[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 16 10:06:50 UTC 2018


 sw/source/core/layout/pagechg.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit ab8b8fdbb32ad4da5af521b1b982189786bcdcb4
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Aug 14 17:21:01 2018 +0200
Commit:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Thu Aug 16 12:06:25 2018 +0200

    tdf#119252: Revert "Remove < USHRT_MAX check that is presumably no longer
    
    ...needed"
    
    This reverts commit 4a61006255c67bb6f9ac99107093a424a9de441e, as it turns out
    to actually break things.  I'm not quite sure how I came across that code and
    the attempted fix back then, but at least ASan+UBSan `make check` still works
    after the revert (and UBSan seems the most likely reason I came across this).
    
    I know too little about that Writer table layout code to know whether the
    original code is actually good, or would need some other fixing, so lets just
    revert for now.
    
    Change-Id: I1e88372a3b688a5fdd4c1bf88033b51287195799
    Reviewed-on: https://gerrit.libreoffice.org/59002
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit d9c312d1917bc039bb0354c8c3f5c9dbbb758cf1)
    Reviewed-on: https://gerrit.libreoffice.org/59039
    Tested-by: Xisco FaulĂ­ <xiscofauli at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 036e3371e97c..ac6c74f4fc57 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1764,10 +1764,10 @@ void SwRootFrame::ImplCalcBrowseWidth()
             SwBorderAttrAccess aAccess( SwFrame::GetCache(), pFrame );
             const SwBorderAttrs &rAttrs = *aAccess.Get();
             const SwFormatHoriOrient &rHori = rAttrs.GetAttrSet().GetHoriOrient();
-            if ( text::HoriOrientation::FULL != rHori.GetHoriOrient() )
+            long nWidth = rAttrs.GetSize().Width();
+            if ( nWidth < USHRT_MAX-2000 && //-2k, because USHRT_MAX gets missing while trying to resize!
+                 text::HoriOrientation::FULL != rHori.GetHoriOrient() )
             {
-                long nWidth = rAttrs.GetSize().Width();
-
                 const SwHTMLTableLayout *pLayoutInfo =
                     static_cast<const SwTabFrame *>(pFrame)->GetTable()
                                             ->GetHTMLTableLayout();


More information about the Libreoffice-commits mailing list