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

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 13 21:20:42 UTC 2019


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

New commits:
commit dc326926b0adc35b6ebefa7705ee5a3f133f5c88
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Jun 6 06:22:00 2019 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Thu Jun 13 23:19:36 2019 +0200

    VCL make horizontal scrolling depend on RTL
    
    This is easiest to test in calc. We have two test cases, because
    the document and the GUI can either have different or equal RTL
    settings. This fixes the horizontal border scrolling for me on
    Linux with gen, gtk / gtk3 and qt5 /kde5.
    
    It looks a bit strange that this inverts the delta, if the RTL
    settings are equal, but it seems not all toolkits invert the
    delta in RTL mode, like Qt does.
    
    I also tried to implement this inside ScrollBar::ImplScroll, but
    the Scrollbar has no idea of the wheel event origin, the only one
    which must be inverted.
    
    Change-Id: I239cf6528de95ad581834ec77a13f582aeff5a91
    Reviewed-on: https://gerrit.libreoffice.org/73923
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index a5174bb8e367..c38d0f7cdefc 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -665,10 +665,9 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd,
                             nLines = pData->GetNotchDelta() * nScrollLines;
                         if ( nLines )
                         {
-                            ImplHandleScroll( nullptr,
-                                          0L,
-                                          pData->IsHorz() ? pHScrl : pVScrl,
-                                          nLines );
+                            ImplHandleScroll(nullptr, 0L, pData->IsHorz() ? pHScrl : pVScrl,
+                                pData->IsHorz() && pHScrl && (AllSettings::GetLayoutRTL() == pHScrl->IsRTLEnabled())
+                                    ? -nLines : nLines);
                             bRet = true;
                         }
                     }


More information about the Libreoffice-commits mailing list