vcl/win/source/gdi/salnativewidgets-luna.cxx |   18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

New commits:
commit a4cc4d3ec982ac61100b337125983afa0bb6fbc3
Author: Ivan Timofeev <timofeev....@gmail.com>
Date:   Wed Apr 11 21:34:06 2012 +0400

    vcl: win: fix RTL menu separator and gutter, checkmarks are still misplaced

diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx 
b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 2bc2f4b..bcf80cd 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -984,8 +984,16 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, 
RECT rc,
             if( nPart == PART_ENTIRE_CONTROL )
             {
                 RECT aGutterRC = rc;
-                aGutterRC.left += aValue.getNumericVal();
-                aGutterRC.right = aGutterRC.left+3;
+                if( Application::GetSettings().GetLayoutRTL() )
+                {
+                    aGutterRC.right -= aValue.getNumericVal();
+                    aGutterRC.left = aGutterRC.right-3;
+                }
+                else
+                {
+                    aGutterRC.left += aValue.getNumericVal();
+                    aGutterRC.right = aGutterRC.left+3;
+                }
                 return
                 ImplDrawTheme( hTheme, hDC, MENU_POPUPBACKGROUND, 0, rc, 
aCaption ) &&
                 ImplDrawTheme( hTheme, hDC, MENU_POPUPGUTTER, 0, aGutterRC, 
aCaption )
@@ -1028,7 +1036,11 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, 
RECT rc,
             }
             else if( nPart == PART_MENU_SEPARATOR )
             {
-                rc.left += aValue.getNumericVal(); // adjust for gutter 
position
+                // adjust for gutter position
+                if( Application::GetSettings().GetLayoutRTL() )
+                    rc.right -= aValue.getNumericVal();
+                else
+                    rc.left += aValue.getNumericVal();
                 Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
                     MENU_POPUPSEPARATOR, 0, Rectangle( rc.left, rc.top, 
rc.right, rc.bottom ) ) );
                 // center the separator inside the passed rectangle
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to