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

Ivan Timofeev timofeev.i.s at gmail.com
Fri Jun 28 11:36:22 PDT 2013


 vcl/source/control/scrbar.cxx            |    4 ++--
 vcl/source/gdi/salgdilayout.cxx          |    4 ++--
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |    8 +-------
 3 files changed, 5 insertions(+), 11 deletions(-)

New commits:
commit a08f579e3704fbd97590f9b050d250ae445725a7
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Fri Jun 28 21:54:15 2013 +0400

    fdo#63254: correct re-mirroring formula
    
    This patch fixes horizontal scrollbar in Calc when a sheet is RTL and UI is LTR.
    
    When a particular window (horizontal scrollbar in this case) is RTL and a whole
    UI is LTR this code used for mirroring and re-mirroring back coordinates. AFAICS
    mirroring is correct, but re-mirroring is not.
    
    The used formula comes from commit 69b684b12e42bf1396bdffca88ca880ac3c2e00b, and
    the same formula appears in the other variant of overloaded function "mirror":
     mirror(sal_uInt32, const SalPoint*, SalPoint*, const OutputDevice*, bool),
    but it does not affect the bug.
    
    Change-Id: Iec9c53edce9d33be6b676d1094bed8bf92f2e435

diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 9d54573..3d34a5f 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -119,7 +119,7 @@ void SalGraphics::mirror( long& x, const OutputDevice *pOutDev, bool bBack ) con
             {
                 long devX = pOutDevRef->GetOutOffXPixel();   // re-mirrored mnOutOffX
                 if( bBack )
-                    x = x - pOutDevRef->GetOutputWidthPixel() + devX - pOutDevRef->GetOutOffXPixel() + 1;
+                    x = devX + (pOutDevRef->GetOutputWidthPixel() + devX) - (x + 1);
                 else
                     x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - 1;
             }
@@ -155,7 +155,7 @@ void SalGraphics::mirror( long& x, long& nWidth, const OutputDevice *pOutDev, bo
             {
                 long devX = pOutDevRef->GetOutOffXPixel();   // re-mirrored mnOutOffX
                 if( bBack )
-                    x = x - pOutDevRef->GetOutputWidthPixel() + devX - pOutDevRef->GetOutOffXPixel() + nWidth;
+                    x = devX + (pOutDevRef->GetOutputWidthPixel() + devX) - (x + nWidth);
                 else
                     x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - nWidth;
             }
commit e3a801e2454eed2e61202bbacca01fe3fcc20c1d
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Fri Jun 28 21:52:17 2013 +0400

    fdo#44582: fix scrollbars in RTL UI
    
    Change-Id: I518e9bcf673ffd1f17ecb51c2c4f962a2f722446

diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index b326915..d283daf 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -317,9 +317,9 @@ void ScrollBar::ImplCalc( sal_Bool bUpdate )
 
         if ( GetStyle() & WB_HORZ )
         {
-            if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_LEFT,
+            if ( GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT,
                         aControlRegion, 0, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) &&
-                 GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_RIGHT,
+                 GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT,
                         aControlRegion, 0, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) )
             {
                 maBtn1Rect = aBtn1Region;
commit 48e1d9c7afe5c2a39d9a08d7a38f7c8ff39d8c84
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Mon Jun 24 22:55:55 2013 +0400

    fdo#66335: gtk: Revert hacks for RTL scrollbars
    
    returning false here in getNativeControlRegion results in a fallback to
    square buttons in vcl scrollbar code. But there is no problem in gtk+ backend
    in this case, let's fix the problem differently.
    
    This reverts commits 898a3e84807bccbb876e3f5583728f6d24e05e9a and
    e8e82bd2109b82ddd535cdac30303249c6b62942.
    
    Change-Id: I66fcdd1f27d471321852445e5881cee03baef7b1

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 176486e..c88bc6f 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1048,13 +1048,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
             rNativeContentRegion.Right() = rNativeContentRegion.Left() + 1;
         if (!rNativeContentRegion.GetHeight())
             rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1;
-        //fdo#63254 horizontal scrool bar isn't displayed in RTL tab
-        // with LTR UI in calc
-        returnVal =Application::GetSettings().GetLayoutRTL();
-
-        //See fdo#44582, Horizontal scrollbar in navigator window is broken
-        if ((nPart==PART_BUTTON_LEFT || nPart==PART_BUTTON_RIGHT) && Application::GetSettings().GetLayoutRTL())
-            returnVal = false;
+        returnVal = sal_True;
     }
     if( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL) )
     {


More information about the Libreoffice-commits mailing list