diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-23 07:47:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-23 14:34:59 +0200 |
commit | 32ca870833a89ec16ed7e08296dcc573dcc64029 (patch) | |
tree | be4eb8d0382db032b7ddfe22df6303fd86ac2c15 /dbaccess | |
parent | 509c017f5a6ee6b7c1bb9b61b36aef58a06afd27 (diff) |
clang-tidy performance-unnecessary-copy-init in dbaccess..drawinglayer
Change-Id: I49a152b2aea93d30b16192260f4f659c7e5fcaee
Reviewed-on: https://gerrit.libreoffice.org/62215
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/filter/hsqldb/createparser.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlExport.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/brwview.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionHelper.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionPage.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/admincontrols.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbwizsetup.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinController.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/TableWindowListBox.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.cxx | 2 |
12 files changed, 17 insertions, 18 deletions
diff --git a/dbaccess/source/filter/hsqldb/createparser.cxx b/dbaccess/source/filter/hsqldb/createparser.cxx index 0588b641a04f..77b1fbec84b2 100644 --- a/dbaccess/source/filter/hsqldb/createparser.cxx +++ b/dbaccess/source/filter/hsqldb/createparser.cxx @@ -49,12 +49,11 @@ sal_Int32 lcl_IndexOfUnicode(const OString& rSource, const sal_Int32 nFrom = 0) } //Convert ascii escaped unicode to utf-8 -OUString lcl_ConvertToUTF8(const OString& rText) +OUString lcl_ConvertToUTF8(const OString& original) { - OString original = rText; - OString sResult = rText; + OString sResult = original; sal_Int32 nIndex = lcl_IndexOfUnicode(sResult); - while (nIndex != -1 && nIndex < rText.getLength()) + while (nIndex != -1 && nIndex < original.getLength()) { const OString sHex = original.copy(nIndex + 2, 4); const sal_Unicode cDec = static_cast<sal_Unicode>(strtol(sHex.getStr(), nullptr, 16)); diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 8f3f5757321e..4a23c3d9f5be 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -288,7 +288,7 @@ void ODBExport::exportDataSource() ::connectivity::DriversConfig aDriverConfig(getComponentContext()); const OUString sURL = ::comphelper::getString(xProp->getPropertyValue(PROPERTY_URL)); - ::comphelper::NamedValueCollection aDriverSupportedProperties( aDriverConfig.getProperties( sURL ) ); + const ::comphelper::NamedValueCollection& aDriverSupportedProperties( aDriverConfig.getProperties( sURL ) ); static OUString s_sTrue(::xmloff::token::GetXMLToken( XML_TRUE )); static OUString s_sFalse(::xmloff::token::GetXMLToken( XML_FALSE )); diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 1f44d6b703cb..bc9cd3b2cae1 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -45,7 +45,7 @@ namespace { bool bGrabFocus = false; SbaGridControl* pVclControl = _pView->getVclControl(); - Reference< css::awt::XControl > xGrid = _pView->getGridControl(); + const Reference< css::awt::XControl >& xGrid = _pView->getGridControl(); if (pVclControl && xGrid.is()) { bGrabFocus = true; diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index fe0ba4585089..79b65147c57a 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -138,7 +138,7 @@ namespace dbaui // forward the values to the controls if ( bValid ) { - OUString sUrl = pUrlItem->GetValue(); + const OUString& sUrl = pUrlItem->GetValue(); setURL( sUrl ); checkTestConnection(); diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index ea87983a665d..3fef20d84ed4 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -233,7 +233,7 @@ namespace dbaui m_pUserName->SetText(pUidItem->GetValue()); m_pPasswordRequired->Check(pAllowEmptyPwd->GetValue()); - OUString sUrl = pUrlItem->GetValue(); + const OUString& sUrl = pUrlItem->GetValue(); setURL( sUrl ); const bool bEnableJDBC = m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC; diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index 452fbed5791a..0891f0925d66 100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -272,7 +272,7 @@ namespace dbaui RadioButton& rSocketPipeRadio = *m_pNamedPipeRadio; const SfxStringItem* pSocketPipeItem = pNamedPipe; #endif - OUString sSocketPipe( pSocketPipeItem->GetValue() ); + const OUString& sSocketPipe( pSocketPipeItem->GetValue() ); if ( !sSocketPipe.isEmpty() ) rSocketPipeRadio.Check(); else diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 78c025be49bf..7937d80e950a 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -152,7 +152,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent ::dbaccess::ODsnTypeCollection::TypeIterator aEnd = m_pCollection->end(); for(PathId i = 1;aIter != aEnd;++aIter,++i) { - const OUString sURLPrefix = aIter.getURLPrefix(); + const OUString& sURLPrefix = aIter.getURLPrefix(); svt::RoadmapWizardTypes::WizardPath aPath; aPath.push_back(PAGE_DBSETUPWIZARD_INTRO); m_pCollection->fillPageIds(sURLPrefix,aPath); diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 0963e3a7bb5a..e324ed3859e4 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -123,7 +123,7 @@ namespace dbaui ++aTypeLoop ) { - const OUString sURLPrefix = aTypeLoop.getURLPrefix(); + const OUString& sURLPrefix = aTypeLoop.getURLPrefix(); if ( !sURLPrefix.isEmpty() ) { // skip mysql connection variations. It is handled in another window. @@ -166,7 +166,7 @@ namespace dbaui ++aTypeLoop ) { - const OUString sURLPrefix = aTypeLoop.getURLPrefix(); + const OUString& sURLPrefix = aTypeLoop.getURLPrefix(); if ( !sURLPrefix.isEmpty() ) { OUString sDisplayName = aTypeLoop.getDisplayName(); diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index f41438313952..e89dace04e84 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -181,7 +181,7 @@ void OJoinController::impl_onModifyChanged() void OJoinController::SaveTabWinPosSize(OTableWindow const * pTabWin, long nOffsetX, long nOffsetY) { // the data for the window - TTableWindowData::value_type pData = pTabWin->GetData(); + const TTableWindowData::value_type& pData = pTabWin->GetData(); OSL_ENSURE(pData != nullptr, "SaveTabWinPosSize : TabWin has no data !"); // set Position & Size of data anew (with current window parameters) diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 37475fb2d01b..0c7e6c1b0d6e 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -950,7 +950,7 @@ bool OSelectionBrowseBox::SaveModified() OUString sTableAlias = aFieldName.getToken(0,'.'); pEntry->SetAlias(sTableAlias); OUString sColumnName = aFieldName.copy(sTableAlias.getLength()+1); - Reference<XConnection> xConnection = rController.getConnection(); + const Reference<XConnection>& xConnection = rController.getConnection(); if ( !xConnection.is() ) return false; bError = fillColumnRef( sColumnName, sTableAlias, xConnection->getMetaData(), pEntry, bListAction ); @@ -1685,7 +1685,7 @@ void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel) const sal_uInt16 nNewLevel = nLevel +1; for (auto const& field : getFields()) { - OTableFieldDescRef pEntry = field; + const OTableFieldDescRef& pEntry = field; OUString sValue = pEntry->GetCriteria(nLevel); if ( !sValue.isEmpty() ) { @@ -1715,7 +1715,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const O bool bAllFieldsSearched = true; for (auto const& field : getFields()) { - OTableFieldDescRef pEntry = field; + const OTableFieldDescRef& pEntry = field; const OUString aField = pEntry->GetField(); const OUString aAlias = pEntry->GetAlias(); diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index cac61db4d7fd..7f126a99d6f5 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -94,7 +94,7 @@ SvTreeListEntry* OTableWindowListBox::GetEntryFromText( const OUString& rEntryTe try { bool bCase = false; - Reference<XConnection> xConnection = rController.getConnection(); + const Reference<XConnection>& xConnection = rController.getConnection(); if(xConnection.is()) { Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 2dc9d91345c0..0a97c99213c9 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -1290,7 +1290,7 @@ bool OTableEditorCtrl::IsPrimaryKeyAllowed( long /*nRow*/ ) // Memo and Image fields cannot be primary keys // or if the column cannot be dropped and the Required flag is not set // or if a css::sdbcx::View is available and the Required flag is not set - TOTypeInfoSP pTypeInfo = pFieldDescr->getTypeInfo(); + const TOTypeInfoSP& pTypeInfo = pFieldDescr->getTypeInfo(); if( pTypeInfo->nSearchType == ColumnSearch::NONE || (pFieldDescr->IsNullable() && pRow->IsReadOnly()) ) |