diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-06-29 17:14:58 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-06-30 00:24:16 +0200 |
commit | b2aafa91233189a623032894e9259b0f850efe2a (patch) | |
tree | 8e0d4f25effb87052310c7cf9bff2697048b5e5a /sax/qa/cppunit | |
parent | be1a2fb3ad0e5a7a364886a83c9bdc895717cdfd (diff) |
sax: fix overflow in sax::Converter::convertMeasure()
The problem is that -2^31 is negative after negation in 2's
complement.
This causes ODF validation error now in CppunitTest_sd_export_tests
testFdo84043:
Error: attribute "svg:x" has a bad value: ...
svg:x="--2147483.-6-4-7cm"
The validation error only happens in 32-bit builds; 64-bit builds
show a different value svg:x="2139324.72cm", so there must be another
problem somewhere else that isn't fixed here.
Change-Id: If2040cb6ae914c69b7cc651d3ab2d5d232fc71fb
Reviewed-on: https://gerrit.libreoffice.org/56718
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sax/qa/cppunit')
-rw-r--r-- | sax/qa/cppunit/test_converter.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx index d58dd0bfb020..4cf2142c9a60 100644 --- a/sax/qa/cppunit/test_converter.cxx +++ b/sax/qa/cppunit/test_converter.cxx @@ -502,6 +502,7 @@ void ConverterTest::testMeasure() doTestMeasureToString("979.928cm", 555550, MeasureUnit::TWIP, MeasureUnit::CM); doTestMeasureToString("111.1pt", 2222, MeasureUnit::TWIP, MeasureUnit::POINT); doTestMeasureToString("385.7986in", 555550, MeasureUnit::TWIP, MeasureUnit::INCH); + doTestMeasureToString("-2147483.648cm", std::numeric_limits<sal_Int32>::min(), MeasureUnit::MM_100TH, MeasureUnit::CM); } void doTestStringToBool(bool bBool, char const*const pis) |