diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-12 16:39:03 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-18 07:37:31 +0000 |
commit | 789055bc2acb4c71483fd60ea258d158bd5aec10 (patch) | |
tree | 7849de841a71f667a30b2a971ad0c3d406110396 /sfx2 | |
parent | 150ac9cf05ed9da6a2af5bc3f820280fd853e519 (diff) |
clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at
identifying leftover intermediate variables from previous
refactorings.
Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657
Reviewed-on: https://gerrit.libreoffice.org/24026
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/appl/macroloader.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/frmhtml.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/control/templatelocalview.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/filtergrouping.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/srchdlg.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/printhelper.cxx | 2 |
11 files changed, 17 insertions, 25 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 9a685a00628a..e2a00eda4538 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -551,7 +551,7 @@ bool lcl_isFilterNativelySupported(const SfxFilter& rFilter) if (rFilter.IsOwnFormat()) return true; - OUString aName = rFilter.GetFilterName(); + const OUString& aName = rFilter.GetFilterName(); if (aName.startsWith("MS Excel")) // We can handle all Excel variants natively. return true; diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 2794ea263d55..d2926c2a0f1d 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -257,16 +257,15 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * pLink, case OBJECT_CLIENT_DDE: { sal_Int32 nTmp = 0; - OUString sCmd( sLNm ); - OUString sServer( sCmd.getToken( 0, cTokenSeparator, nTmp ) ); - OUString sTopic( sCmd.getToken( 0, cTokenSeparator, nTmp ) ); + OUString sServer( sLNm.getToken( 0, cTokenSeparator, nTmp ) ); + OUString sTopic( sLNm.getToken( 0, cTokenSeparator, nTmp ) ); if( pType ) *pType = sServer; if( pFile ) *pFile = sTopic; if( pLinkStr ) - *pLinkStr = nTmp != -1 ? sCmd.copy(nTmp) : OUString(); + *pLinkStr = nTmp != -1 ? sLNm.copy(nTmp) : OUString(); bRet = true; } break; diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx index afddd82160ce..9cf3dade9e30 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -204,7 +204,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, // 'macro:///lib.mod.proc(args)' => macro of App-BASIC // 'macro://[docname|.]/lib.mod.proc(args)' => macro of current or qualified document // 'macro://obj.method(args)' => direct API call, execute it via App-BASIC - OUString aMacro( rURL ); + const OUString& aMacro( rURL ); sal_Int32 nHashPos = aMacro.indexOf( '/', 8 ); sal_Int32 nArgsPos = aMacro.indexOf( '(' ); BasicManager *pAppMgr = SfxApplication::GetBasicManager(); diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx index 779f26ebd922..fe458c7e9605 100644 --- a/sfx2/source/bastyp/frmhtml.cxx +++ b/sfx2/source/bastyp/frmhtml.cxx @@ -100,7 +100,7 @@ void SfxFrameHTMLParser::ParseFrameOptions( break; case HTML_O_FRAMEBORDER: { - OUString aStr = aOption.GetString(); + const OUString& aStr = aOption.GetString(); bool bBorder = true; if ( aStr.equalsIgnoreAsciiCase("NO") || aStr.equalsIgnoreAsciiCase("0") ) @@ -114,7 +114,7 @@ void SfxFrameHTMLParser::ParseFrameOptions( default: if (aOption.GetTokenString().equalsIgnoreAsciiCase(HTML_O_READONLY)) { - OUString aStr = aOption.GetString(); + const OUString& aStr = aOption.GetString(); bool bReadonly = true; if ( aStr.equalsIgnoreAsciiCase("FALSE") ) bReadonly = false; @@ -122,7 +122,7 @@ void SfxFrameHTMLParser::ParseFrameOptions( } else if (aOption.GetTokenString().equalsIgnoreAsciiCase(HTML_O_EDIT)) { - OUString aStr = aOption.GetString(); + const OUString& aStr = aOption.GetString(); bool bEdit = true; if ( aStr.equalsIgnoreAsciiCase("FALSE") ) bEdit = false; diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index 7c82737e2b18..dd5788d48c96 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -262,18 +262,16 @@ sal_uInt16 TemplateLocalView::createRegion(const OUString &rName) if (!mpDocTemplates->InsertDir(rName,nRegionId)) return 0; - OUString aRegionName = rName; - // Insert to the region cache list and to the thumbnail item list TemplateContainerItem* pItem = new TemplateContainerItem( *this, nItemId ); pItem->mnRegionId = nRegionId; - pItem->maTitle = aRegionName; + pItem->maTitle = rName; maRegions.push_back(pItem); pItem = new TemplateContainerItem(*this, nItemId); pItem->mnRegionId = nRegionId; - pItem->maTitle = aRegionName; + pItem->maTitle = rName; AppendItem(pItem); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index a2bf84e0dee5..94f529949829 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1185,7 +1185,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( vcl::Window* pParent, rItemSet.GetItemState( SID_EXPLORER_PROPS_START, false, &pItem ) ) { // File name - OUString aFile( rInfoItem.GetValue() ); + const OUString& aFile( rInfoItem.GetValue() ); INetURLObject aURL; aURL.SetSmartProtocol( INetProtocol::File ); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index dd45218bcc46..a5f9a04340dc 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1038,11 +1038,9 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( makeAny( nTemplateDescription ) ); - OUString sStandardDirTemp = sStandardDir; - aInitArguments[1] <<= NamedValue( OUString( "StandardDir" ), - makeAny( sStandardDirTemp ) + makeAny( sStandardDir ) ); aInitArguments[2] <<= NamedValue( diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index ff86a2d8e6b6..33948a46d0df 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -621,8 +621,6 @@ namespace sfx2 if ( aServiceName != aCurrentServiceName ) { // we reached a new group - OUString sDocServName = aServiceName; - // look for the place in _rAllFilters where this ne group belongs - this is determined // by the order of classes in aGlobalClassNames GroupedFilterList::iterator aGroupPos = _rAllFilters.begin(); @@ -633,7 +631,7 @@ namespace sfx2 StringArray::iterator aGlobalIter = aGlobalClassNames.begin(); while ( ( aGroupPos != _rAllFilters.end() ) && ( aGlobalIter != aGlobalClassNames.end() ) - && ( *aGlobalIter != sDocServName ) + && ( *aGlobalIter != aServiceName ) ) { ++aGlobalIter; diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx index c3aad423cf7f..1c4a139ae0f1 100644 --- a/sfx2/source/dialog/srchdlg.cxx +++ b/sfx2/source/dialog/srchdlg.cxx @@ -84,10 +84,9 @@ void SearchDialog::LoadConfig() { m_sWinState = OUStringToOString(aViewOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US); Any aUserItem = aViewOpt.GetUserItem( "UserItem" ); - OUString aTemp; - if ( aUserItem >>= aTemp ) + OUString sUserData; + if ( aUserItem >>= sUserData ) { - OUString sUserData( aTemp ); DBG_ASSERT( comphelper::string::getTokenCount(sUserData, ';') == 5, "invalid config data" ); sal_Int32 nIdx = 0; OUString sSearchText = sUserData.getToken( 0, ';', nIdx ); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index a48f6dfc58ae..65786cf8997a 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1561,7 +1561,7 @@ void SfxHeaderAttributes_Impl::SetAttributes() void SfxHeaderAttributes_Impl::SetAttribute( const SvKeyValue& rKV ) { - OUString aValue = rKV.GetValue(); + const OUString& aValue = rKV.GetValue(); if( rKV.GetKey().equalsIgnoreAsciiCase("refresh") && !rKV.GetValue().isEmpty() ) { sal_uInt32 nTime = aValue.getToken( 0, ';' ).toInt32() ; diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 8ce5f7824e5b..fa13268c64e0 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -646,7 +646,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& // No ucb or thread will be necessary then. In case it couldnt be // converted its not an URL nor a system path. Then we can't accept // this parameter and have to throw an exception. - OUString sSystemPath(sTemp); + const OUString& sSystemPath(sTemp); OUString sFileURL; if (::osl::FileBase::getFileURLFromSystemPath(sSystemPath,sFileURL)!=::osl::FileBase::E_None) throw css::lang::IllegalArgumentException(); |