diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-12 08:13:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-12 16:53:30 +0100 |
commit | f34ac579fac16fff37bf00fe85d43ad6b938eca7 (patch) | |
tree | 0747c4d86bbf40a5093fb7a3215dd52a8e8586b2 /oox | |
parent | c45753847dfc2b4645dc2f7500a18ec2c5d438df (diff) |
New loplugin:stringviewparam
...to "Find functions that take rtl::O[U]String parameters that can be
generalized to take std::[u16]string_view instead." (Which in turn can avoid
costly O[U]String constructions, see e.g. loplugin:stringview and subView.)
Some of those functions' call sites, passing plain char string literals, needed
to be adapted when converting them.
Change-Id: I644ab546d7a0ce9e470ab9b3196e3e60d1e812bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105622
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/drawingmltypes.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx index 432ce7dc416c..645fe9ec9221 100644 --- a/oox/source/drawingml/drawingmltypes.cxx +++ b/oox/source/drawingml/drawingmltypes.cxx @@ -45,7 +45,7 @@ sal_Int32 GetCoordinate( sal_Int32 nValue ) } /** converts an emu string into 1/100th mmm */ -sal_Int32 GetCoordinate( const OUString& sValue ) +sal_Int32 GetCoordinate( std::u16string_view sValue ) { sal_Int32 nRet = 0; if( !::sax::Converter::convertNumber( nRet, sValue ) ) @@ -60,7 +60,7 @@ sal_Int32 GetPointFromCoordinate( sal_Int32 nValue ) } /** converts a ST_Percentage % string into 1/1000th of % */ -sal_Int32 GetPercent( const OUString& sValue ) +sal_Int32 GetPercent( std::u16string_view sValue ) { sal_Int32 nRet = 0; if( !::sax::Converter::convertNumber( nRet, sValue ) ) @@ -82,7 +82,7 @@ awt::Point GetPointPercent( const Reference< XFastAttributeList >& xAttribs ) } /** converts the ST_TextFontSize to point */ -float GetTextSize( const OUString& sValue ) +float GetTextSize( std::u16string_view sValue ) { float fRet = 0; sal_Int32 nRet; @@ -92,7 +92,7 @@ float GetTextSize( const OUString& sValue ) } /** converts the ST_TextSpacingPoint to 1/100mm */ -sal_Int32 GetTextSpacingPoint( const OUString& sValue ) +sal_Int32 GetTextSpacingPoint( std::u16string_view sValue ) { sal_Int32 nRet; if( ::sax::Converter::convertNumber( nRet, sValue, (SAL_MIN_INT32 + 360) / 254, (SAL_MAX_INT32 - 360) / 254 ) ) |