summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-05-01 14:15:42 +0900
committerNorbert Thiebaud <nthiebaud@gmail.com>2015-05-04 04:05:23 +0000
commitbe88df0e6ce2ba1dc6931e2a2988ebfdd8ae9ba8 (patch)
treea91be36eea06a7a4802613e2d0f960d341fef9f4 /starmath
parentbcbf45d9f94d177c6841ccede3ff0ba69c4f22b1 (diff)
prefer OUStringBuffer to concatenating OUString in a loop
Change-Id: Ia617e6e3524264ecc62d50bb8b58d1458b8e3303 Reviewed-on: https://gerrit.libreoffice.org/15582 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/document.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 254677f3286a..150e748cf782 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -24,6 +24,7 @@
#include <comphelper/accessibletexthelper.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
+#include <rtl/ustrbuf.hxx>
#include <rtl/ustring.hxx>
#include <unotools/eventcfg.hxx>
#include <sfx2/event.hxx>
@@ -1226,12 +1227,15 @@ void SmDocShell::GetState(SfxItemSet &rSet)
}
if( nCount )
{
- OUString sList;
+ OUStringBuffer aBuf;
for( sal_uInt16 n = 0; n < nCount; ++n )
- sList += (pTmpUndoMgr->*fnGetComment)( n, ::svl::IUndoManager::TopLevel ) + "\n";
+ {
+ aBuf.append((pTmpUndoMgr->*fnGetComment)( n, ::svl::IUndoManager::TopLevel ));
+ aBuf.append('\n');
+ }
SfxStringListItem aItem( nWh );
- aItem.SetString( sList );
+ aItem.SetString( aBuf.makeStringAndClear() );
rSet.Put( aItem );
}
}