diff options
Diffstat (limited to 'sw/source/filter/ww8/wrtww8.cxx')
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 5815d7cb72b8..84bf1a645531 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -27,6 +27,7 @@ #include <map> #include <hintids.hxx> #include <string.h> +#include <o3tl/safeint.hxx> #include <osl/endian.h> #include <sal/log.hxx> #include <docsh.hxx> @@ -1205,7 +1206,7 @@ bool WW8_WrFkp::Append( WW8_FC nEndFc, sal_uInt16 nVarLen, const sal_uInt8* pSpr nPos &= 0xFFFE; // Pos for Sprms ( gerade Pos ) } - if( static_cast<sal_uInt16>(nPos) <= ( nIMax + 2U ) * 4U + ( nIMax + 1U ) * nItemSize ) + if( o3tl::make_unsigned(nPos) <= ( nIMax + 2U ) * 4U + ( nIMax + 1U ) * nItemSize ) // does it fits after the CPs and offsets? return false; // no @@ -1418,7 +1419,7 @@ void WW8_WrPct::SetParaBreak() WW8_CP WW8_WrPct::Fc2Cp( sal_uLong nFc ) const { - OSL_ENSURE( nFc >= static_cast<sal_uLong>(nOldFc), "FilePos lies in front of last piece" ); + OSL_ENSURE( nFc >= o3tl::make_unsigned(nOldFc), "FilePos lies in front of last piece" ); OSL_ENSURE( ! m_Pcts.empty(), "Fc2Cp no piece available" ); nFc -= nOldFc; |