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 #include #include +#include #include #include #include @@ -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 ); } }