diff options
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/qa/unit/EPUBExportTest.cxx | 3 | ||||
-rw-r--r-- | writerperfect/source/common/WPXSvInputStream.cxx | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx index edc2da70f59a..f9f821773b18 100644 --- a/writerperfect/qa/unit/EPUBExportTest.cxx +++ b/writerperfect/qa/unit/EPUBExportTest.cxx @@ -18,6 +18,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> #include <comphelper/string.hxx> +#include <o3tl/safeint.hxx> #include <test/bootstrapfixture.hxx> #include <test/xmltesttools.hxx> #include <unotest/macros_test.hxx> @@ -804,7 +805,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testSVG) SvMemoryStream aMemoryStream; aMemoryStream.WriteStream(*pStream); OString aExpected("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<svg"); - CPPUNIT_ASSERT(aMemoryStream.GetSize() > static_cast<sal_uInt64>(aExpected.getLength())); + CPPUNIT_ASSERT(aMemoryStream.GetSize() > o3tl::make_unsigned(aExpected.getLength())); // This failed, there was a '<!DOCTYPE' line between the xml and the svg // one, causing a validation error. diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx index 3f37c89c11c3..8118d7860019 100644 --- a/writerperfect/source/common/WPXSvInputStream.cxx +++ b/writerperfect/source/common/WPXSvInputStream.cxx @@ -14,7 +14,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/seekableinput.hxx> - +#include <o3tl/safeint.hxx> #include <rtl/string.hxx> #include <sal/log.hxx> @@ -848,7 +848,7 @@ const unsigned char* WPXSvInputStream::read(unsigned long numBytes, unsigned lon if ((curpos + numBytes < curpos) /*overflow*/ || (curpos + numBytes - >= static_cast<sal_uInt64>(mpImpl->mnLength))) /*reading more than available*/ + >= o3tl::make_unsigned(mpImpl->mnLength))) /*reading more than available*/ { numBytes = mpImpl->mnLength - curpos; } @@ -909,7 +909,7 @@ int WPXSvInputStream::seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) } if (tmpOffset < mpImpl->tell() - && static_cast<unsigned long>(tmpOffset) + && o3tl::make_unsigned(tmpOffset) >= static_cast<unsigned long>(mpImpl->tell()) - mpImpl->mnReadBufferLength) { mpImpl->mnReadBufferPos = static_cast<unsigned long>( |