diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-29 12:24:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-29 18:25:31 +0200 |
commit | 04aafba860f613c20e7078d038cc83eb02de0b54 (patch) | |
tree | 8153152b87089419bde17313d9ac7b9de6fcce32 /sfx2 | |
parent | 76c793d2acf66f46e9edcda43d2f4327e8374841 (diff) |
loplugin:stringadd simplify some *StringBuffer operations
pulled from a larger patch which I created with a more permissive
variant of this plugin
Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 19 | ||||
-rw-r--r-- | sfx2/source/appl/macroloader.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 9 |
3 files changed, 18 insertions, 21 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 3ae22dedd324..91edc7d0ef15 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -727,12 +727,12 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( xContext ); eCurrentApp = vcl::EnumContext::GetApplicationEnum( xModuleManager->identify( xCurrentFrame ) ); - OUStringBuffer aPath("org.openoffice.Office.UI.ToolbarMode/Applications/"); - aPath.append( lcl_getAppName( eCurrentApp ) ); + OUString aPath = "org.openoffice.Office.UI.ToolbarMode/Applications/" + + lcl_getAppName( eCurrentApp ); const utl::OConfigurationTreeRoot aAppNode( xContext, - aPath.makeStringAndClear(), + aPath, true); if ( !aAppNode.isValid() ) { @@ -793,14 +793,14 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) std::vector<OUString> aBackupList; OUString aSidebarMode; - OUStringBuffer aPath( "org.openoffice.Office.UI.ToolbarMode/Applications/" ); - aPath.append( lcl_getAppName( eApp ) ); - aPath.append( "/Modes" ); + OUString aPath = "org.openoffice.Office.UI.ToolbarMode/Applications/" + + lcl_getAppName( eApp ) + + "/Modes"; // Read mode settings const utl::OConfigurationTreeRoot aModesNode( xContext, - aPath.makeStringAndClear(), + aPath, true); if ( !aModesNode.isValid() ) { @@ -965,11 +965,10 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) if ( xLayoutManager.is() ) { - OUStringBuffer aBuf( "private:resource/toolbar/" ); - aBuf.append( pToolbarName->GetValue() ); + OUString aToolbarName = "private:resource/toolbar/" + + pToolbarName->GetValue(); // Evaluate Parameter - OUString aToolbarName( aBuf.makeStringAndClear() ); bool bShow( !xLayoutManager->isElementVisible( aToolbarName )); if ( bShow ) diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx index 95ace6cf665e..f77d557f09f4 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -314,11 +314,12 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, else { // direct API call on a specified object - OUStringBuffer aCall; - aCall.append('[').append(INetURLObject::decode(aMacro.subView(6), - INetURLObject::DecodeMechanism::WithCharset)); - aCall.append(']'); - pAppMgr->GetLib(0)->Execute(aCall.makeStringAndClear()); + OUString aCall = + "[" + + INetURLObject::decode(aMacro.subView(6), + INetURLObject::DecodeMechanism::WithCharset) + + "]"; + pAppMgr->GetLib(0)->Execute(aCall); nErr = SbxBase::GetError(); } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 9b85b791f7a4..b10b17853914 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -709,15 +709,12 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) { uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); - OUStringBuffer aBuffer( 60 ); auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:PrintDefault", vcl::CommandInfoProvider::GetModuleIdentifier(xFrame)); - aBuffer.append(vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); - aBuffer.append( " (" ); - aBuffer.append( aPrinterName ); - aBuffer.append(')'); + OUString val = vcl::CommandInfoProvider::GetLabelForCommand(aProperties) + + " (" + aPrinterName + ")"; - rSet.Put( SfxStringItem( SID_PRINTDOCDIRECT, aBuffer.makeStringAndClear() ) ); + rSet.Put( SfxStringItem( SID_PRINTDOCDIRECT, val ) ); } } break; |