summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 17:16:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-27 11:35:24 +0200
commitb83cc2b0108a4ec2087221a6150a66578788e5b4 (patch)
treeb3684057b66602ddf01546dcb8306fddbad69a38 /framework/source
parent86be39afd5b142f7cbdbe0107b394c5924c414cc (diff)
loplugin:stringloop in basic, framework, sax, svtools
Change-Id: I2bad74a8f103e9dc68c8e0d0e6315697068d2f6d Reviewed-on: https://gerrit.libreoffice.org/58135 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/accelerators/storageholder.cxx7
-rw-r--r--framework/source/fwe/xml/menudocumenthandler.cxx8
-rw-r--r--framework/source/fwe/xml/toolboxdocumenthandler.cxx8
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx6
4 files changed, 14 insertions, 15 deletions
diff --git a/framework/source/accelerators/storageholder.cxx b/framework/source/accelerators/storageholder.cxx
index 99c67af297e0..a07883803443 100644
--- a/framework/source/accelerators/storageholder.cxx
+++ b/framework/source/accelerators/storageholder.cxx
@@ -37,6 +37,7 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/io/XSeekable.hpp>
+#include <rtl/ustrbuf.hxx>
#include <algorithm>
@@ -350,14 +351,14 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::getParentStorage(cons
return m_xRoot;
// c)
- OUString sParentPath;
+ OUStringBuffer sParentPath;
sal_Int32 i = 0;
for (i=0; i<c-1; ++i)
{
- sParentPath += lFolders[i] + PATH_SEPARATOR;
+ sParentPath.append(lFolders[i]).append(PATH_SEPARATOR);
}
- TPath2StorageInfo::const_iterator pParent = m_lStorages.find(sParentPath);
+ TPath2StorageInfo::const_iterator pParent = m_lStorages.find(sParentPath.makeStringAndClear());
if (pParent != m_lStorages.end())
return pParent->second.Storage;
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx
index d6bff96e3155..da691e77276a 100644
--- a/framework/source/fwe/xml/menudocumenthandler.cxx
+++ b/framework/source/fwe/xml/menudocumenthandler.cxx
@@ -864,7 +864,7 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons
}
if ( nStyle > 0 )
{
- OUString aValue;
+ OUStringBuffer aValue;
const MenuStyleItem* pStyle = MenuItemStyles;
for ( sal_Int32 nIndex = 0; nIndex < nMenuStyleItemEntries; ++nIndex, ++pStyle )
@@ -872,13 +872,13 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons
if ( nStyle & pStyle->nBit )
{
if ( !aValue.isEmpty() )
- aValue += "+";
- aValue += OUString::createFromAscii( pStyle->attrName );
+ aValue.append("+");
+ aValue.appendAscii( pStyle->attrName );
}
}
pList->AddAttribute( ATTRIBUTE_NS_STYLE,
m_aAttributeType,
- aValue );
+ aValue.makeStringAndClear() );
}
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index f7d04c20708b..f2fbb715a6e6 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -711,7 +711,7 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxItem(
if ( nStyle > 0 )
{
- OUString aValue;
+ OUStringBuffer aValue;
const ToolboxStyleItem* pStyle = Styles;
for ( sal_Int32 nIndex = 0; nIndex < nStyleItemEntries; ++nIndex, ++pStyle )
@@ -719,13 +719,13 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxItem(
if ( nStyle & pStyle->nBit )
{
if ( !aValue.isEmpty() )
- aValue += " ";
- aValue += OUString::createFromAscii( pStyle->attrName );
+ aValue.append(" ");
+ aValue.appendAscii( pStyle->attrName );
}
}
pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_ITEMSTYLE,
m_aAttributeType,
- aValue );
+ aValue.makeStringAndClear() );
}
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index e696f13b5a8c..3f633eaecdf8 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -167,7 +167,6 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
if ( pVCLPopupMenu )
pPopupMenu = static_cast<PopupMenu *>(pVCLPopupMenu->GetMenu());
- OUString aCmd;
OUString aCmd_Dialog;
OUString aCmd_Language;
if( eMode == MODE_SetLanguageSelectionMenu )
@@ -205,8 +204,7 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
!langItem.isEmpty()) // 'no language found' from language guessing
{
pPopupMenu->InsertItem( nItemId, langItem);
- aCmd = aCmd_Language;
- aCmd += langItem;
+ OUString aCmd = aCmd_Language + langItem;
pPopupMenu->SetItemCommand( nItemId, aCmd );
if (langItem == m_aCurLang && eMode == MODE_SetLanguageSelectionMenu )
{
@@ -220,7 +218,7 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
// entry for LANGUAGE_NONE
++nItemId;
pPopupMenu->InsertItem( nItemId, FwkResId(STR_LANGSTATUS_NONE) );
- aCmd = aCmd_Language + "LANGUAGE_NONE";
+ OUString aCmd = aCmd_Language + "LANGUAGE_NONE";
pPopupMenu->SetItemCommand( nItemId, aCmd );
// entry for 'Reset to default language'