diff options
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/defaultoptions.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx index c338a741e24c..0a74a321825a 100644 --- a/unotools/source/config/defaultoptions.cxx +++ b/unotools/source/config/defaultoptions.cxx @@ -32,6 +32,7 @@ #include <osl/mutex.hxx> #include <rtl/instance.hxx> +#include <rtl/ustrbuf.hxx> #include "itemholder1.hxx" @@ -234,7 +235,8 @@ SvtDefaultOptions_Impl::SvtDefaultOptions_Impl() : ConfigItem( "Office.Common/Pa if ( aValues.getLength() == aNames.getLength() ) { SvtPathOptions aPathOpt; - OUString aTempStr, aFullPath; + OUString aTempStr; + OUStringBuffer aFullPathBuf; for ( int nProp = 0; nProp < aNames.getLength(); nProp++ ) { @@ -246,7 +248,7 @@ SvtDefaultOptions_Impl::SvtDefaultOptions_Impl() : ConfigItem( "Office.Common/Pa { // multi paths if ( pValues[nProp] >>= aTempStr ) - aFullPath = aPathOpt.SubstituteVariable( aTempStr ); + aFullPathBuf = aPathOpt.SubstituteVariable( aTempStr ); else { SAL_WARN( "unotools.config", "any operator >>= failed" ); @@ -257,17 +259,16 @@ SvtDefaultOptions_Impl::SvtDefaultOptions_Impl() : ConfigItem( "Office.Common/Pa case css::uno::TypeClass_SEQUENCE : { // single paths - aFullPath.clear(); + aFullPathBuf.setLength(0); Sequence < OUString > aList; if ( pValues[nProp] >>= aList ) { sal_Int32 nCount = aList.getLength(); for ( sal_Int32 nPosition = 0; nPosition < nCount; ++nPosition ) { - aTempStr = aPathOpt.SubstituteVariable( aList[ nPosition ] ); - aFullPath += aTempStr; + aFullPathBuf.append(aPathOpt.SubstituteVariable( aList[ nPosition ] )); if ( nPosition < nCount-1 ) - aFullPath += ";"; + aFullPathBuf.append(";"); } } else @@ -283,6 +284,7 @@ SvtDefaultOptions_Impl::SvtDefaultOptions_Impl() : ConfigItem( "Office.Common/Pa } } + auto aFullPath = aFullPathBuf.makeStringAndClear(); switch ( nProp ) { case DEFAULTPATH_ADDIN: m_aAddinPath = aFullPath; break; |