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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sun Jan 26 18:39:21 UTC 2020


 sw/source/uibase/ribbar/inputwin.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 04404a2edd1121f518ff28bebdd74b45df228280
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sun Jan 26 15:07:40 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sun Jan 26 19:38:47 2020 +0100

    Avoid explicit cast to smaller sal_uInt16 from larger long
    
    ...in what might be an attempt to avoid warnings about signed vs. unsigned
    comparisons.
    
    Change-Id: I19be3cc0510b8628e961d840f51b0c9480aee746
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87450
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index cc1bc1705050..47e551f69c8e 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -21,6 +21,7 @@
 #include <sal/log.hxx>
 
 #include <comphelper/string.hxx>
+#include <o3tl/safeint.hxx>
 #include <officecfg/Office/Common.hxx>
 #include <tools/gen.hxx>
 #include <sfx2/objface.hxx>
@@ -527,7 +528,7 @@ void InputEdit::UpdateRange(const OUString& rBoxes,
                 ++nEndPos;
             }
             // Only if the current position lies in the range or right behind.
-            if( bFound && !( nStartPos < static_cast<sal_uInt16>(aSelection.Max()) &&
+            if( bFound && !( nStartPos < o3tl::make_unsigned(aSelection.Max()) &&
                              static_cast<sal_uInt16>(aSelection.Max()) <= nEndPos + 1 ))
                 bFound = false;
         }


More information about the Libreoffice-commits mailing list