diff options
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 50bfb7d82f99..c8ffe942e5d8 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -536,19 +536,33 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrmFmt* pFrmFmt, const Size& rS sal_uInt64 cx = 0 ; sal_uInt64 cy = 0 ; const sal_Int64 MAX_INTEGER_VALUE = 2147483647; + + // the 'Size' type uses 'long' for width and height, so on + // platforms where 'long' is 32 bits they can obviously never be + // larger than the max signed 32-bit integer. +#if SAL_TYPES_SIZEOFLONG > 4 if (rSize.Width() > MAX_INTEGER_VALUE) cx = MAX_INTEGER_VALUE ; - else if (0 > rSize.Width()) - cx = 0 ; else - cx = rSize.Width(); +#endif + { + if (0 > rSize.Width()) + cx = 0 ; + else + cx = rSize.Width(); + } +#if SAL_TYPES_SIZEOFLONG > 4 if (rSize.Height() > MAX_INTEGER_VALUE) cy = MAX_INTEGER_VALUE ; - else if (0 > rSize.Height()) - cy = 0 ; else - cy = rSize.Height(); +#endif + { + if (0 > rSize.Height()) + cy = 0 ; + else + cy = rSize.Height(); + } OString aWidth(OString::number(TwipsToEMU(cx))); //we explicitly check the converted EMU value for the range as mentioned in above comment. |