diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-26 13:27:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-26 19:37:20 +0200 |
commit | 5fe702f1b69a02a274621a01db68256a94edfd36 (patch) | |
tree | 8b07b80a9046040ba7da685e4063f5f21e1f0eaa /sc/source/filter/oox | |
parent | cf2dc247ff5f726238856e9b46a4926a30430e14 (diff) |
add o3tl::toUInt32
Change-Id: I07f11bf12fbe1d1c2d812fa0965d6e632e1e1aba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133437
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/oox')
-rw-r--r-- | sc/source/filter/oox/drawingfragment.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index 033720a1bf1e..adf499d996f3 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -45,6 +45,7 @@ #include <oox/vml/vmlshape.hxx> #include <oox/vml/vmlshapecontainer.hxx> #include <osl/diagnose.h> +#include <o3tl/string_view.hxx> #include <formulaparser.hxx> #include <stylesbuffer.hxx> #include <themebuffer.hxx> @@ -703,14 +704,14 @@ sal_uInt32 VmlDrawing::convertControlTextColor( const OUString& rTextColor ) con { // RGB colors in the format '#RRGGBB' if( rTextColor.getLength() == 7 ) - return OleHelper::encodeOleColor( rTextColor.copy( 1 ).toUInt32( 16 ) ); + return OleHelper::encodeOleColor( o3tl::toUInt32(rTextColor.subView( 1 ), 16) ); // RGB colors in the format '#RGB' if( rTextColor.getLength() == 4 ) { - sal_Int32 nR = rTextColor.copy( 1, 1 ).toUInt32( 16 ) * 0x11; - sal_Int32 nG = rTextColor.copy( 2, 1 ).toUInt32( 16 ) * 0x11; - sal_Int32 nB = rTextColor.copy( 3, 1 ).toUInt32( 16 ) * 0x11; + sal_Int32 nR = o3tl::toUInt32(rTextColor.subView( 1, 1 ), 16) * 0x11; + sal_Int32 nG = o3tl::toUInt32(rTextColor.subView( 2, 1 ), 16) * 0x11; + sal_Int32 nB = o3tl::toUInt32(rTextColor.subView( 3, 1 ), 16) * 0x11; return OleHelper::encodeOleColor( (nR << 16) | (nG << 8) | nB ); } |