diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-03 14:03:54 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-05 08:44:19 +0200 |
commit | 705c48d32eec0aa5180e60ca157daca4b154e4a3 (patch) | |
tree | 97f43496f4b429a2b8d03b1e71cb2a1c33142a15 /comphelper | |
parent | b7d8a58ff2698ffc6e22943f64aa97c5ea253bd9 (diff) |
fdo#38835 strip out OUString globals
they are largely unnecessary these days, since our OUString infrastructure
gained optimised handling for static char constants.
Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/logging.cxx | 26 | ||||
-rw-r--r-- | comphelper/source/misc/numbers.cxx | 3 |
2 files changed, 10 insertions, 19 deletions
diff --git a/comphelper/source/misc/logging.cxx b/comphelper/source/misc/logging.cxx index e59c4079f73e..d34015753e4f 100644 --- a/comphelper/source/misc/logging.cxx +++ b/comphelper/source/misc/logging.cxx @@ -129,14 +129,14 @@ namespace comphelper namespace { - void lcl_replaceParameter( OUString& _inout_Message, const OUString& _rPlaceHolder, const OUString& _rReplacement ) + void lcl_replaceParameter( OUString& _inout_Message, const char* _rPlaceHolder, const OUString& _rReplacement ) { - sal_Int32 nPlaceholderPosition = _inout_Message.indexOf( _rPlaceHolder ); + sal_Int32 nPlaceholderPosition = _inout_Message.indexOfAsciiL( _rPlaceHolder, strlen(_rPlaceHolder) ); OSL_ENSURE( nPlaceholderPosition >= 0, "lcl_replaceParameter: placeholder not found!" ); if ( nPlaceholderPosition < 0 ) return; - _inout_Message = _inout_Message.replaceAt( nPlaceholderPosition, _rPlaceHolder.getLength(), _rReplacement ); + _inout_Message = _inout_Message.replaceAt( nPlaceholderPosition, strlen(_rPlaceHolder), _rReplacement ); } } @@ -147,32 +147,24 @@ namespace comphelper const OptionalString& _rArgument3, const OptionalString& _rArgument4, const OptionalString& _rArgument5, const OptionalString& _rArgument6 ) const { - // (if OUString had an indexOfAscii, we could save those ugly statics ...) - static OUString sPH1( "$1$" ); - static OUString sPH2( "$2$" ); - static OUString sPH3( "$3$" ); - static OUString sPH4( "$4$" ); - static OUString sPH5( "$5$" ); - static OUString sPH6( "$6$" ); - OUString sMessage( _rMessage ); if ( !!_rArgument1 ) - lcl_replaceParameter( sMessage, sPH1, *_rArgument1 ); + lcl_replaceParameter( sMessage, "$1$", *_rArgument1 ); if ( !!_rArgument2 ) - lcl_replaceParameter( sMessage, sPH2, *_rArgument2 ); + lcl_replaceParameter( sMessage, "$2$", *_rArgument2 ); if ( !!_rArgument3 ) - lcl_replaceParameter( sMessage, sPH3, *_rArgument3 ); + lcl_replaceParameter( sMessage, "$3$", *_rArgument3 ); if ( !!_rArgument4 ) - lcl_replaceParameter( sMessage, sPH4, *_rArgument4 ); + lcl_replaceParameter( sMessage, "$4$", *_rArgument4 ); if ( !!_rArgument5 ) - lcl_replaceParameter( sMessage, sPH5, *_rArgument5 ); + lcl_replaceParameter( sMessage, "$5$", *_rArgument5 ); if ( !!_rArgument6 ) - lcl_replaceParameter( sMessage, sPH6, *_rArgument6 ); + lcl_replaceParameter( sMessage, "$6$", *_rArgument6 ); try { diff --git a/comphelper/source/misc/numbers.cxx b/comphelper/source/misc/numbers.cxx index 6df5a155fd1c..29b460641b98 100644 --- a/comphelper/source/misc/numbers.cxx +++ b/comphelper/source/misc/numbers.cxx @@ -67,8 +67,7 @@ css::uno::Any getNumberFormatDecimals(const css::uno::Reference<css::util::XNumb css::uno::Reference<css::beans::XPropertySet> xFormat( xFormats->getByKey(nKey)); if (xFormat.is()) { - static OUString PROPERTY_DECIMALS( "Decimals" ); - return xFormat->getPropertyValue(PROPERTY_DECIMALS); + return xFormat->getPropertyValue( "Decimals" ); } } catch(...) |