Alexandre Julliard : gdi32: Mirror the returned rectangle in GetClipBox for RTL layout.

Alexandre Julliard julliard at winehq.org
Wed Sep 8 13:32:10 CDT 2010


Module: wine
Branch: master
Commit: 0766d375bc29874d11a813f82622fc6984240b2d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0766d375bc29874d11a813f82622fc6984240b2d

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Sep  8 13:21:18 2010 +0200

gdi32: Mirror the returned rectangle in GetClipBox for RTL layout.

---

 dlls/gdi32/clipping.c      |    6 ++++++
 dlls/gdi32/tests/mapping.c |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c
index b8d9ed5..7be7650 100644
--- a/dlls/gdi32/clipping.c
+++ b/dlls/gdi32/clipping.c
@@ -400,6 +400,12 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect )
         DeleteObject( hrgn );
     }
     else ret = GetRgnBox( dc->hVisRgn, rect );
+    if (dc->layout & LAYOUT_RTL)
+    {
+        int tmp = rect->left;
+        rect->left = rect->right - 1;
+        rect->right = tmp - 1;
+    }
     DPtoLP( hdc, (LPPOINT)rect, 2 );
     release_dc_ptr( dc );
     return ret;
diff --git a/dlls/gdi32/tests/mapping.c b/dlls/gdi32/tests/mapping.c
index c4a97ac..fba0abf 100644
--- a/dlls/gdi32/tests/mapping.c
+++ b/dlls/gdi32/tests/mapping.c
@@ -313,6 +313,9 @@ static void test_dc_layout(void)
     GetRgnBox( hrgn, &ret_rc );
     ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
         ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
+    GetClipBox( hdc, &ret_rc );
+    ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
+        ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
     SetRectRgn( hrgn, 60, 10, 80, 20 );
     pSetLayout( hdc, LAYOUT_LTR );
     ExtSelectClipRgn( hdc, hrgn, RGN_OR );
@@ -322,6 +325,9 @@ static void test_dc_layout(void)
     GetRgnBox( hrgn, &ret_rc );
     ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
         ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
+    GetClipBox( hdc, &ret_rc );
+    ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
+        ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
 
     /* OffsetClipRgn mirrors too */
     OffsetClipRgn( hdc, 5, 5 );




More information about the wine-cvs mailing list