[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 15 10:45:43 UTC 2018


 sw/source/core/layout/pagechg.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 64474264443a83a341c161bbcc6592073a1728f9
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Aug 15 12:40:17 2018 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Aug 15 12:45:20 2018 +0200

    Silence bogus -Werror,-Wsign-compare
    
    ...in some Android builds like <https://tinderbox.libreoffice.org/cgi-bin/
    gunzip.cgi?tree=MASTER&brief-log=1534320601.32504>, where USHRT_MAX is wrongly
    of type unsigned int.  (Cf. similar comits like
    f164c68296b66d534ed2c9de6da4c01e328959d9 "Introduce dedicated
    SwXMLTableContext::MAX_WIDTH, replacing USHRT_MAX".)
    
    So this was the reason for 4a61006255c67bb6f9ac99107093a424a9de441e "Remove <
    USHRT_MAX check that is presumably no longer needed" that now had to be reverted
    again with d9c312d1917bc039bb0354c8c3f5c9dbbb758cf1 "tdf#119252: Revert 'Remove
    < USHRT_MAX check that is presumably no longer".
    
    Change-Id: I7ff4f6ab61adc2490bcab46ec5e5a65d9302141f

diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 5f9bd2c5f01b..6d1bd3e0fa45 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1763,7 +1763,7 @@ void SwRootFrame::ImplCalcBrowseWidth()
             const SwBorderAttrs &rAttrs = *aAccess.Get();
             const SwFormatHoriOrient &rHori = rAttrs.GetAttrSet().GetHoriOrient();
             long nWidth = rAttrs.GetSize().Width();
-            if ( nWidth < USHRT_MAX-2000 && //-2k, because USHRT_MAX gets missing while trying to resize!
+            if ( nWidth < int(USHRT_MAX)-2000 && //-2k, because USHRT_MAX gets missing while trying to resize!  (and cast to int to avoid -Wsign-compare due to broken USHRT_MAX on Android)
                  text::HoriOrientation::FULL != rHori.GetHoriOrient() )
             {
                 const SwHTMLTableLayout *pLayoutInfo =


More information about the Libreoffice-commits mailing list