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>
This commit is contained in:
parent
bcbf45d9f9
commit
be88df0e6c
@ -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 );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user