summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-29 16:02:44 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-30 08:29:29 +0100
commitfd7ca0db5c2d5d1580d76c9536828a024543ea53 (patch)
tree9f41035ae777a2552dbfaf9502ba58e76b2db031
parent20e5f64215853bdd32c5f16394ba7f2f36745904 (diff)
Clean up conversion to sal_uInt16
Change-Id: I95ecb0f68e737a25ff90437e82411d1e6eb42675 Reviewed-on: https://gerrit.libreoffice.org/48846 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--sw/source/core/doc/htmltbl.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 05b2cb1d192f..70e025869a74 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <algorithm>
#include <memory>
#include <hintids.hxx>
@@ -365,7 +368,7 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTabFrame(
rTabFrame.CalcFlyOffsets( nUpperDummy, nLeftOffset, nRightOffset );
nWidth -= (nLeftOffset + nRightOffset);
- return nWidth < USHRT_MAX ? static_cast<sal_uInt16>(nWidth) : USHRT_MAX;
+ return static_cast<sal_uInt16>(std::min(nWidth, SwTwips(SAL_MAX_UINT16)));
}
sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTable( const SwDoc& rDoc ) const