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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sat Aug 10 12:44:14 UTC 2019


 vcl/source/window/window2.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 98617d958da903fa1bc849dce50ffba6e2c035ff
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Aug 10 13:07:21 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Aug 10 14:43:34 2019 +0200

    Silence -Werror,-Wimplicit-int-float-conversion
    
    > vcl/source/window/window2.cxx:588:20: error: implicit conversion from 'long' to 'double' changes value from -9223372036854775807 to -9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
    >         if ( nN == -LONG_MAX )
    >                 ~~ ^~~~~~~~~
    
    etc. with Clang 10
    
    Change-Id: I272e8fc373a91630f1c48a2b0ad7a265c5370bcf
    Reviewed-on: https://gerrit.libreoffice.org/77241
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index a9d7c042a21a..636eb14b3854 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -585,9 +585,9 @@ static void lcl_HandleScrollHelper( ScrollBar* pScrl, double nN, bool isMultiply
     {
         long nNewPos = pScrl->GetThumbPos();
 
-        if ( nN == -LONG_MAX )
+        if ( nN == double(-LONG_MAX) )
             nNewPos += pScrl->GetPageSize();
-        else if ( nN == LONG_MAX )
+        else if ( nN == double(LONG_MAX) )
             nNewPos -= pScrl->GetPageSize();
         else
         {
@@ -657,9 +657,9 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd,
                         if ( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
                         {
                             if ( pData->GetDelta() < 0 )
-                                nLines = -LONG_MAX;
+                                nLines = double(-LONG_MAX);
                             else
-                                nLines = LONG_MAX;
+                                nLines = double(LONG_MAX);
                         }
                         else
                             nLines = pData->GetNotchDelta() * nScrollLines;


More information about the Libreoffice-commits mailing list