summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-26 13:27:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-26 19:37:20 +0200
commit5fe702f1b69a02a274621a01db68256a94edfd36 (patch)
tree8b07b80a9046040ba7da685e4063f5f21e1f0eaa /oox
parentcf2dc247ff5f726238856e9b46a4926a30430e14 (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 'oox')
-rw-r--r--oox/source/helper/attributelist.cxx4
-rw-r--r--oox/source/ppt/comments.cxx8
-rw-r--r--oox/source/vml/vmlformatting.cxx8
-rw-r--r--oox/source/vml/vmlshape.cxx2
4 files changed, 11 insertions, 11 deletions
diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx
index 6afab21c33d8..e0bea17c22e6 100644
--- a/oox/source/helper/attributelist.cxx
+++ b/oox/source/helper/attributelist.cxx
@@ -120,11 +120,11 @@ sal_Int64 AttributeConversion::decodeHyper( std::u16string_view rValue )
return o3tl::toInt64(rValue);
}
-sal_Int32 AttributeConversion::decodeIntegerHex( const OUString& rValue )
+sal_Int32 AttributeConversion::decodeIntegerHex( std::u16string_view rValue )
{
// It looks like all Office Open XML attributes containing hexadecimal
// values are based on xsd:hexBinary and so use an unsigned representation:
- return static_cast< sal_Int32 >(rValue.toUInt32( 16 ));
+ return static_cast< sal_Int32 >(o3tl::toUInt32(rValue, 16));
//TODO: Change this function to return sal_uInt32 and get rid of the
// cast, but that will have a ripple effect
}
diff --git a/oox/source/ppt/comments.cxx b/oox/source/ppt/comments.cxx
index a255dd010950..73b78c34459a 100644
--- a/oox/source/ppt/comments.cxx
+++ b/oox/source/ppt/comments.cxx
@@ -35,10 +35,10 @@ void Comment::setDateTime(const OUString& sDateTime)
{
sal_Int32 nIdx{ 0 };
aDateTime.Year = o3tl::toInt32(o3tl::getToken(sDateTime, 0, '-', nIdx));
- aDateTime.Month = sDateTime.getToken(0, '-', nIdx).toUInt32();
- aDateTime.Day = sDateTime.getToken(0, 'T', nIdx).toUInt32();
- aDateTime.Hours = sDateTime.getToken(0, ':', nIdx).toUInt32();
- aDateTime.Minutes = sDateTime.getToken(0, ':', nIdx).toUInt32();
+ aDateTime.Month = o3tl::toUInt32(o3tl::getToken(sDateTime, 0, '-', nIdx));
+ aDateTime.Day = o3tl::toUInt32(o3tl::getToken(sDateTime, 0, 'T', nIdx));
+ aDateTime.Hours = o3tl::toUInt32(o3tl::getToken(sDateTime, 0, ':', nIdx));
+ aDateTime.Minutes = o3tl::toUInt32(o3tl::getToken(sDateTime, 0, ':', nIdx));
double seconds = rtl_math_uStringToDouble(sDateTime.getStr() + nIdx,
sDateTime.getStr() + sDateTime.getLength(), '.', 0,
nullptr, nullptr);
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index e195a1e94183..f3b29150b1b6 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -246,16 +246,16 @@ Color ConversionHelper::decodeColor( const GraphicHelper& rGraphicHelper,
// RGB colors in the format '#RRGGBB'
if( (aColorName.getLength() == 7) && (aColorName[ 0 ] == '#') )
{
- aDmlColor.setSrgbClr( aColorName.copy( 1 ).toUInt32( 16 ) );
+ aDmlColor.setSrgbClr( o3tl::toUInt32(aColorName.subView( 1 ), 16) );
return aDmlColor;
}
// RGB colors in the format '#RGB'
if( (aColorName.getLength() == 4) && (aColorName[ 0 ] == '#') )
{
- sal_Int32 nR = aColorName.copy( 1, 1 ).toUInt32( 16 ) * 0x11;
- sal_Int32 nG = aColorName.copy( 2, 1 ).toUInt32( 16 ) * 0x11;
- sal_Int32 nB = aColorName.copy( 3, 1 ).toUInt32( 16 ) * 0x11;
+ sal_Int32 nR = o3tl::toUInt32(aColorName.subView( 1, 1 ), 16 ) * 0x11;
+ sal_Int32 nG = o3tl::toUInt32(aColorName.subView( 2, 1 ), 16 ) * 0x11;
+ sal_Int32 nB = o3tl::toUInt32(aColorName.subView( 3, 1 ), 16 ) * 0x11;
aDmlColor.setSrgbClr( (nR << 16) | (nG << 8) | nB );
return aDmlColor;
}
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 188e3303449c..4e2e6e2d224e 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -119,7 +119,7 @@ sal_Int32 lclConvertCrop(const OUString& rCrop, sal_uInt32 nSize)
if (rCrop.endsWith("f"))
{
// Numeric value is specified in 1/65536-ths.
- sal_uInt32 nCrop = rCrop.copy(0, rCrop.getLength() - 1).toUInt32();
+ sal_uInt32 nCrop = o3tl::toUInt32(rCrop.subView(0, rCrop.getLength() - 1));
return (nCrop * nSize) / 65536;
}