summaryrefslogtreecommitdiffstats
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-13 08:20:48 +0200
committerMichael Meeks <michael.meeks@collabora.com>2019-08-05 21:06:38 -0400
commit59f1c7977103f6e49027d178719549ee30bd6354 (patch)
treeb8af33cac650b3ee93e5f42c86c3e116da862689 /dbaccess
parentlok: add missing parameter to PostExtTextInputEvent function (diff)
downloadcore-59f1c7977103f6e49027d178719549ee30bd6354.tar.gz
core-59f1c7977103f6e49027d178719549ee30bd6354.zip
loplugin:sequentialassign in dbaccess..desktop
Change-Id: I3f3108daf208fa8c6be90b28da5503846c27732e Reviewed-on: https://gerrit.libreoffice.org/70698 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx3
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx3
-rw-r--r--dbaccess/source/ext/macromigration/migrationlog.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlExport.cxx3
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx9
-rw-r--r--dbaccess/source/ui/app/AppDetailView.cxx6
-rw-r--r--dbaccess/source/ui/app/AppSwapWindow.cxx3
-rw-r--r--dbaccess/source/ui/app/AppTitleWindow.cxx6
-rw-r--r--dbaccess/source/ui/app/AppView.cxx6
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx6
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx9
-rw-r--r--dbaccess/source/ui/dlg/directsql.cxx3
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx4
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnectionData.cxx3
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx6
15 files changed, 24 insertions, 49 deletions
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 4f360bfc1ee9..bbf82b903c61 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -762,8 +762,7 @@ Reference< XStorage > const & ODatabaseModelImpl::getOrCreateRootStorage()
if ( !m_xDocumentStorage.is() )
{
Reference< XSingleServiceFactory> xStorageFactory = StorageFactory::create( m_aContext );
- Any aSource;
- aSource = m_aMediaDescriptor.get( "Stream" );
+ Any aSource = m_aMediaDescriptor.get( "Stream" );
if ( !aSource.hasValue() )
aSource = m_aMediaDescriptor.get( "InputStream" );
if ( !aSource.hasValue() && !m_sDocFileLocation.isEmpty() )
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index e84af4dfe653..c79c303e508a 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1719,10 +1719,9 @@ Reference< XUIConfigurationManager2 > const & ODatabaseDocument::getUIConfigurat
m_xUIConfigurationManager = UIConfigurationManager::create( m_pImpl->m_aContext );
OUString aUIConfigFolderName( "Configurations2" );
- Reference< XStorage > xConfigStorage;
// First try to open with READWRITE and then READ
- xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, ElementModes::READWRITE );
+ Reference< XStorage > xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, ElementModes::READWRITE );
if ( xConfigStorage.is() )
{
OUString aMediaType;
diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx b/dbaccess/source/ext/macromigration/migrationlog.cxx
index 13953894bf8b..a6e1a254ff6d 100644
--- a/dbaccess/source/ext/macromigration/migrationlog.cxx
+++ b/dbaccess/source/ext/macromigration/migrationlog.cxx
@@ -409,8 +409,7 @@ namespace dbmm
for (auto const& elem : rDoc.aMovedLibraries)
{
- OUString sMovedLib( sMovedLibTemplate );
- sMovedLib = sMovedLib.replaceAll( "$type$", getScriptTypeDisplayName( elem.eType ) );
+ OUString sMovedLib = sMovedLibTemplate.replaceAll( "$type$", getScriptTypeDisplayName( elem.eType ) );
sMovedLib = sMovedLib.replaceAll( "$old$", elem.sOldName );
sMovedLib = sMovedLib.replaceAll( "$new$", elem.sNewName );
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index 4a23c3d9f5be..f1de2eff1b56 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -989,8 +989,7 @@ void ODBExport::exportColumns(const Reference<XColumnsSupplier>& _xColSup)
OUString sValue;
xProp->getPropertyValue(PROPERTY_HELPTEXT) >>= sValue;
- Any aColumnDefault;
- aColumnDefault = xProp->getPropertyValue(PROPERTY_CONTROLDEFAULT);
+ Any aColumnDefault = xProp->getPropertyValue(PROPERTY_CONTROLDEFAULT);
if ( bHidden || !sValue.isEmpty() || aColumnDefault.hasValue() || pAtt->getLength() )
{
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 5c5868f886e7..9bb9ba0aa53a 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -167,8 +167,7 @@ namespace
{
//FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont(*this, aFont);
@@ -1213,8 +1212,7 @@ void OAppDetailPageHelper::ImplInitSettings()
{
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont(*this, aFont);
m_aTBPreview->SetPointFont(*m_aTBPreview, aFont);
@@ -1304,8 +1302,7 @@ void OPreviewWindow::ImplInitSettings()
{
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont(*this, aFont);
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index 81d7a32ed47b..d34d12c78265 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -391,8 +391,7 @@ void OTasksWindow::ImplInitSettings()
{
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont(*this, aFont);
@@ -571,8 +570,7 @@ void OApplicationDetailView::ImplInitSettings()
{
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont(*this, aFont);
diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx
index 0150dc69bc12..8b1b3a53bbfb 100644
--- a/dbaccess/source/ui/app/AppSwapWindow.cxx
+++ b/dbaccess/source/ui/app/AppSwapWindow.cxx
@@ -76,8 +76,7 @@ void OApplicationSwapWindow::ImplInitSettings()
{
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont(*this, aFont);
diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx
index 9f18829c2c67..2dceaa7d7c04 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -147,8 +147,7 @@ void OTitleWindow::ImplInitSettings()
SetSettings(aAllSettings);
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont(*this, aFont);
@@ -168,8 +167,7 @@ void OTitleWindow::ApplySettings(vcl::RenderContext& rRenderContext)
rRenderContext.SetSettings(aAllSettings);
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor(rStyleSettings.GetWindowTextColor());
SetPointFont(*this, aFont);
diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx
index 9ece79f6830a..bc4b86d109d2 100644
--- a/dbaccess/source/ui/app/AppView.cxx
+++ b/dbaccess/source/ui/app/AppView.cxx
@@ -144,8 +144,7 @@ void OAppBorderWindow::ImplInitSettings()
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont(*this, aFont);
@@ -527,8 +526,7 @@ void OApplicationView::ImplInitSettings()
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont(*this, aFont);
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 581a655cd9d2..0b9167c1980a 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -2613,10 +2613,8 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry )
Reference<XParametersSupplier> xParSup(xAnalyzer,UNO_QUERY);
if ( xParSup->getParameters()->getCount() > 0 )
{
- OUString sFilter = " WHERE ";
- sFilter = sFilter + xAnalyzer->getFilter();
- OUString sReplace(sSql);
- sReplace = sReplace.replaceFirst(sFilter, "");
+ OUString sFilter = " WHERE " + xAnalyzer->getFilter();
+ OUString sReplace = sSql.replaceFirst(sFilter, "");
xAnalyzer->setQuery(sReplace);
Reference<XSingleSelectQueryComposer> xComposer(xAnalyzer,UNO_QUERY);
xComposer->setFilter("0=1");
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 1288ff708241..79310b33e85b 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -426,8 +426,7 @@ namespace dbaui
if ( m_pCollection->isFileSystemBased( m_eType ) )
{
// get the two parts: prefix and file URL
- OUString sFileURLDecoded;
- sFileURLDecoded = sURL;
+ OUString sFileURLDecoded = sURL;
sURL = OUString();
if ( !sFileURLDecoded.isEmpty() )
@@ -660,10 +659,8 @@ namespace dbaui
bool OConnectionHelper::commitURL()
{
- OUString sURL;
- OUString sOldPath;
- sOldPath = m_xConnectionURL->GetSavedValueNoPrefix();
- sURL = m_xConnectionURL->GetTextNoPrefix();
+ OUString sOldPath = m_xConnectionURL->GetSavedValueNoPrefix();
+ OUString sURL = m_xConnectionURL->GetTextNoPrefix();
if ( m_pCollection->isFileSystemBased(m_eType) )
{
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index 87f4d956ae63..6b050b044478 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -150,8 +150,7 @@ namespace dbaui
m_aStatementHistory.push_back(_rStatement);
// normalize the statement, and remember the normalized form, too
- OUString sNormalized(_rStatement);
- sNormalized = sNormalized.replaceAll("\n", " ");
+ OUString sNormalized = _rStatement.replaceAll("\n", " ");
m_aNormalizedHistory.push_back(sNormalized);
// add the normalized version to the list box
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 795e7e6a7eab..5be7f68fd37c 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -170,9 +170,7 @@ void ObjectCopySource::copyFilterAndSortingTo( const Reference< XConnection >& _
if ( !sFilter.isEmpty() )
{
sStatement.append(aPropertie.second);
- OUString sReplace = sFilter;
- sReplace = sReplace.replaceFirst(sSourceName,sTargetNameTemp);
- sFilter = sReplace;
+ sFilter = sFilter.replaceFirst(sSourceName,sTargetNameTemp);
_rxObject->setPropertyValue( aPropertie.first, makeAny(sFilter) );
sStatement.append(sFilter);
}
diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
index 6934ed27fe78..c02cbfcd3d24 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
@@ -284,8 +284,7 @@ bool ORelationTableConnectionData::Update()
{
if(!(elem->GetSourceFieldName().isEmpty() || elem->GetDestFieldName().isEmpty()))
{
- Reference<XPropertySet> xColumn;
- xColumn = xColumnFactory->createDataDescriptor();
+ Reference<XPropertySet> xColumn = xColumnFactory->createDataDescriptor();
if ( xColumn.is() )
{
xColumn->setPropertyValue(PROPERTY_NAME,makeAny(elem->GetSourceFieldName()));
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 51898df9ff0b..456d9bd78d80 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -1036,8 +1036,7 @@ void OTableController::alterColumns()
bAutoIncrement != pField->IsAutoIncrement())&&
xColumnFactory.is())
{
- Reference<XPropertySet> xNewColumn;
- xNewColumn = xColumnFactory->createDataDescriptor();
+ Reference<XPropertySet> xNewColumn = xColumnFactory->createDataDescriptor();
::dbaui::setColumnProperties(xNewColumn,pField);
// first try to alter the column
bool bNotOk = false;
@@ -1088,8 +1087,7 @@ void OTableController::alterColumns()
{ // we can't find the column so we could try it with the index before we drop and append a new column
try
{
- Reference<XPropertySet> xNewColumn;
- xNewColumn = xColumnFactory->createDataDescriptor();
+ Reference<XPropertySet> xNewColumn = xColumnFactory->createDataDescriptor();
::dbaui::setColumnProperties(xNewColumn,pField);
xAlter->alterColumnByIndex(nPos,xNewColumn);
if(xColumns->hasByName(pField->GetName()))