diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-06-12 15:58:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-06-13 17:08:36 +0200 |
commit | 3af0114a295d2a6c600117adb5bcd6689c0c787e (patch) | |
tree | 262f32143b99a8754e517be454681267cadaa85f /sc | |
parent | 4edbfa892bfe6ca81c88363b2249e0b7d5eef31f (diff) |
Introduce O[U]String::toUInt32
...which has become necessary since bd60d41176da540b01d7583cfe00637431967f39
"Handle oveflow in O(U)String::toInt() functions" reduces values in the range
(SAL_MAX_INT32 .. SAL_MAX_UINT32] to zero, but some calls of toInt32(16) relied
on getting a correct (unsigned) value for the whole input range ["0" ..
"FFFFFFFF"] (see libreoffice-4-1 commit 9bf6c83367cedb7be81bf67f30d2147d26c7a8c3
"Revert overflow checks in O[U]String::toInt{32,64} again").
Audited all uses of toInt32/64 with non-decimal radix. (There is still a TODO
comment in oox/source/helper/attributelist.cxx, and
stoc/source/typeconv/convert.cxx will still need some love and test code.)
Change-Id: Iadaca1c0e41dab553687d0ce41c20c10cd657a95
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/drawingfragment.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/oox/pagesettings.cxx | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 584aaeffc5b8..6d93c4e94099 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -2191,7 +2191,7 @@ OUString decodeNumberFormat(const OUString& rFmt) // Hex-encoded character found. Decode it back into its // original character. An example of number format with // hex-encoded chars: "\0022$\0022\#\,\#\#0\.00" - sal_Int32 nVal = OUString(p1, nDigitCount).toInt32(16); + sal_uInt32 nVal = OUString(p1, nDigitCount).toUInt32(16); aBuf.append(static_cast<sal_Unicode>(nVal)); } } diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index dc047d43d298..c8338a961189 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -678,14 +678,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 ).toInt32( 16 ) ); + return OleHelper::encodeOleColor( rTextColor.copy( 1 ).toUInt32( 16 ) ); // RGB colors in the format '#RGB' if( rTextColor.getLength() == 4 ) { - sal_Int32 nR = rTextColor.copy( 1, 1 ).toInt32( 16 ) * 0x11; - sal_Int32 nG = rTextColor.copy( 2, 1 ).toInt32( 16 ) * 0x11; - sal_Int32 nB = rTextColor.copy( 3, 1 ).toInt32( 16 ) * 0x11; + 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; return OleHelper::encodeOleColor( (nR << 16) | (nG << 8) | nB ); } diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx index 28553dc97a34..fd90cc52477f 100644 --- a/sc/source/filter/oox/pagesettings.cxx +++ b/sc/source/filter/oox/pagesettings.cxx @@ -872,7 +872,7 @@ void HeaderFooterParser::convertFontColor( const OUString& rColor ) static_cast< double >( rColor.copy( 2 ).toInt32() ) / 100.0 ); else // RGB color: RRGGBB - maFontModel.maColor.setRgb( rColor.toInt32( 16 ) ); + maFontModel.maColor.setRgb( rColor.toUInt32( 16 ) ); } void HeaderFooterParser::finalizePortion() |