From 3ee177a14d8b816ef5b62500aeb54524c289e045 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 15 Oct 2019 20:24:10 +0200 Subject: loplugin:stringadd look through a couple more known-good methods Change-Id: Ifbdb3e41eae665f7dcaf5301aaba2b6e4662cf48 Reviewed-on: https://gerrit.libreoffice.org/80855 Tested-by: Jenkins Reviewed-by: Noel Grandin --- framework/source/fwe/xml/statusbardocumenthandler.cxx | 8 ++++---- framework/source/fwe/xml/toolboxdocumenthandler.cxx | 8 ++++---- framework/source/uielement/generictoolbarcontroller.cxx | 12 +++--------- framework/source/uielement/menubarmanager.cxx | 12 +++--------- 4 files changed, 14 insertions(+), 26 deletions(-) (limited to 'framework') diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx index d4fb733c7d2c..b0289933114e 100644 --- a/framework/source/fwe/xml/statusbardocumenthandler.cxx +++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx @@ -156,14 +156,14 @@ OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler( { if ( StatusBarEntries[i].nNamespace == SB_NS_STATUSBAR ) { - OUString temp = XMLNS_STATUSBAR XMLNS_FILTER_SEPARATOR; - temp += OUString::createFromAscii( StatusBarEntries[i].aEntryName ); + OUString temp = XMLNS_STATUSBAR XMLNS_FILTER_SEPARATOR + + OUString::createFromAscii( StatusBarEntries[i].aEntryName ); m_aStatusBarMap.emplace( temp, static_cast(i) ); } else { - OUString temp = XMLNS_XLINK XMLNS_FILTER_SEPARATOR; - temp += OUString::createFromAscii( StatusBarEntries[i].aEntryName ); + OUString temp = XMLNS_XLINK XMLNS_FILTER_SEPARATOR + + OUString::createFromAscii( StatusBarEntries[i].aEntryName ); m_aStatusBarMap.emplace( temp, static_cast(i) ); } } diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx index 50d7246a7a4c..509a7235cd50 100644 --- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx +++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx @@ -134,14 +134,14 @@ OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( const Reference< XInde { if ( ToolBoxEntries[i].nNamespace == TB_NS_TOOLBAR ) { - OUString temp = XMLNS_TOOLBAR XMLNS_FILTER_SEPARATOR; - temp += OUString::createFromAscii( ToolBoxEntries[i].aEntryName ); + OUString temp = XMLNS_TOOLBAR XMLNS_FILTER_SEPARATOR + + OUString::createFromAscii( ToolBoxEntries[i].aEntryName ); m_aToolBoxMap.emplace( temp, static_cast(i) ); } else { - OUString temp = XMLNS_XLINK XMLNS_FILTER_SEPARATOR; - temp += OUString::createFromAscii( ToolBoxEntries[i].aEntryName ); + OUString temp = XMLNS_XLINK XMLNS_FILTER_SEPARATOR + + OUString::createFromAscii( ToolBoxEntries[i].aEntryName ); m_aToolBoxMap.emplace( temp, static_cast(i) ); } } diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index 0049006c9099..31b02118b2c9 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -209,21 +209,15 @@ void GenericToolbarController::statusChanged( const FeatureStateEvent& Event ) // Replacement for place holders if ( aStrValue.startsWith("($1)") ) { - OUString aTmp(FwkResId(STR_UPDATEDOC)); - aTmp += " " + aStrValue.copy( 4 ); - aStrValue = aTmp; + aStrValue = FwkResId(STR_UPDATEDOC) + " " + aStrValue.copy( 4 ); } else if ( aStrValue.startsWith("($2)") ) { - OUString aTmp(FwkResId(STR_CLOSEDOC_ANDRETURN)); - aTmp += aStrValue.copy( 4 ); - aStrValue = aTmp; + aStrValue = FwkResId(STR_CLOSEDOC_ANDRETURN) + aStrValue.copy( 4 ); } else if ( aStrValue.startsWith("($3)") ) { - OUString aTmp(FwkResId(STR_SAVECOPYDOC)); - aTmp += aStrValue.copy( 4 ); - aStrValue = aTmp; + aStrValue = FwkResId(STR_SAVECOPYDOC) + aStrValue.copy( 4 ); } m_pToolbar->SetItemText( m_nID, aStrValue ); m_pToolbar->SetQuickHelpText( m_nID, aStrValue ); diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index ae83e530c00b..41f358d819f9 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -366,21 +366,15 @@ void SAL_CALL MenuBarManager::statusChanged( const FeatureStateEvent& Event ) // Replacement for place holders if ( aItemText.startsWith("($1)") ) { - OUString aTmp(FwkResId(STR_UPDATEDOC)); - aTmp += " " + aItemText.copy( 4 ); - aItemText = aTmp; + aItemText = FwkResId(STR_UPDATEDOC) + " " + aItemText.copy( 4 ); } else if ( aItemText.startsWith("($2)") ) { - OUString aTmp(FwkResId(STR_CLOSEDOC_ANDRETURN)); - aTmp += aItemText.copy( 4 ); - aItemText = aTmp; + aItemText = FwkResId(STR_CLOSEDOC_ANDRETURN) + aItemText.copy( 4 ); } else if ( aItemText.startsWith("($3)") ) { - OUString aTmp(FwkResId(STR_SAVECOPYDOC)); - aTmp += aItemText.copy( 4 ); - aItemText = aTmp; + aItemText = FwkResId(STR_SAVECOPYDOC) + aItemText.copy( 4 ); } m_pVCLMenu->ShowItem( menuItemHandler->nItemId ); -- cgit