Author: tkreuzer
Date: Mon Aug 23 01:41:56 2010
New Revision: 48605
URL:
http://svn.reactos.org/svn/reactos?rev=48605&view=rev
Log:
[WIN32K]
Seperate DC_vSetLayout from NtGdiSetLayout and save the old value before setting the new
one.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/coord.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] Mon Aug 23 01:41:56
2010
@@ -886,6 +886,46 @@
return;
}
+VOID
+NTAPI
+DC_vSetLayout(
+ IN PDC pdc,
+ IN LONG wox,
+ IN DWORD dwLayout)
+{
+ PDC_ATTR pdcattr = pdc->pdcattr;
+
+ pdcattr->dwLayout = dwLayout;
+
+ if (!(dwLayout & LAYOUT_ORIENTATIONMASK)) return;
+
+ if (dwLayout & LAYOUT_RTL)
+ {
+ pdcattr->iMapMode = MM_ANISOTROPIC;
+ }
+
+ pdcattr->szlWindowExt.cy = -pdcattr->szlWindowExt.cy;
+ pdcattr->ptlWindowOrg.x = -pdcattr->ptlWindowOrg.x;
+
+ if (wox == -1)
+ IntMirrorWindowOrg(pdc);
+ else
+ pdcattr->ptlWindowOrg.x = wox - pdcattr->ptlWindowOrg.x;
+
+ if (!(pdcattr->flTextAlign & TA_CENTER)) pdcattr->flTextAlign |= TA_RIGHT;
+
+ if (pdc->dclevel.flPath & DCPATH_CLOCKWISE)
+ pdc->dclevel.flPath &= ~DCPATH_CLOCKWISE;
+ else
+ pdc->dclevel.flPath |= DCPATH_CLOCKWISE;
+
+ pdcattr->flXform |= (PAGE_EXTENTS_CHANGED |
+ INVALIDATE_ATTRIBUTES |
+ DEVICE_TO_WORLD_INVALID);
+
+// DC_UpdateXforms(pdc);
+}
+
// NtGdiSetLayout
//
// The default is left to right. This function changes it to right to left, which
@@ -901,53 +941,22 @@
IN LONG wox,
IN DWORD dwLayout)
{
- PDC dc;
+ PDC pdc;
PDC_ATTR pdcattr;
DWORD oLayout;
- dc = DC_LockDc(hdc);
- if (!dc)
+ pdc = DC_LockDc(hdc);
+ if (!pdc)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return GDI_ERROR;
}
- pdcattr = dc->pdcattr;
-
- pdcattr->dwLayout = dwLayout;
+ pdcattr = pdc->pdcattr;
+
oLayout = pdcattr->dwLayout;
-
- if (!(dwLayout & LAYOUT_ORIENTATIONMASK))
- {
- DC_UnlockDc(dc);
- return oLayout;
- }
-
- if (dwLayout & LAYOUT_RTL)
- {
- pdcattr->iMapMode = MM_ANISOTROPIC;
- }
-
- pdcattr->szlWindowExt.cy = -pdcattr->szlWindowExt.cy;
- pdcattr->ptlWindowOrg.x = -pdcattr->ptlWindowOrg.x;
-
- if (wox == -1)
- IntMirrorWindowOrg(dc);
- else
- pdcattr->ptlWindowOrg.x = wox - pdcattr->ptlWindowOrg.x;
-
- if (!(pdcattr->flTextAlign & TA_CENTER)) pdcattr->flTextAlign |= TA_RIGHT;
-
- if (dc->dclevel.flPath & DCPATH_CLOCKWISE)
- dc->dclevel.flPath &= ~DCPATH_CLOCKWISE;
- else
- dc->dclevel.flPath |= DCPATH_CLOCKWISE;
-
- pdcattr->flXform |= (PAGE_EXTENTS_CHANGED |
- INVALIDATE_ATTRIBUTES |
- DEVICE_TO_WORLD_INVALID);
-
-// DC_UpdateXforms(dc);
- DC_UnlockDc(dc);
+ DC_vSetLayout(pdc, wox, dwLayout);
+
+ DC_UnlockDc(pdc);
return oLayout;
}