From afbf35b977dbc7ecd5a5b3c9c92bc16519e4dfd3 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Sat, 24 Dec 2016 12:00:21 +0300 Subject: tdf#81263 ww8par6: only use valid sal_uInt16 values for ULSpace VerticalOrient position returns a signed SwTwips number, but ULSpace uses unsigned int16, so negative numbers were creating huge margins. fixes commit 3755c87d0426a499d4755e82d8fbc77caa240764 Change-Id: I23daea9a913ef73efc42a65e0adfc393eaf4e775 Reviewed-on: https://gerrit.libreoffice.org/32400 Tested-by: Jenkins Reviewed-by: Justin Luth (cherry picked from commit 604cf7024fce29143150ab77b2f14b59a45e61eb) Reviewed-on: https://gerrit.libreoffice.org/32402 Tested-by: Justin Luth Reviewed-by: Miklos Vajna (cherry picked from commit 70b3dd697cb248fb56830db691269fe9e78c57fb) Reviewed-on: https://gerrit.libreoffice.org/32648 (cherry picked from commit 74ce6ebe51027ecd742b651d095c455417595908) --- sw/source/filter/ww8/ww8par6.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sw') diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 7e638214df8e..21c8606fe5ee 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2360,8 +2360,9 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, if (aFlySet.HasItem(RES_VERT_ORIENT, &pItem)) { const SwFormatVertOrient* pOrient = static_cast(pItem); - if (pOrient->GetPos() != 0) - pULSpaceItem->SetUpper(pOrient->GetPos()); + SwTwips nPos = pOrient->GetPos(); + if( 0 < nPos && nPos <= SAL_MAX_UINT16 ) + pULSpaceItem->SetUpper( sal_uInt16(nPos) ); } } } -- cgit