gdi: fix ModifyWorldTransform
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Fri Oct 28 06:19:08 CDT 2005
Huw Davies <huw at codeweavers.com>
xform can be NULL when setting the identity.
--
Huw Davies
huw at codeweavers.com
Index: dlls/gdi/dc.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/dc.c,v
retrieving revision 1.11
diff -u -p -r1.11 dc.c
--- dlls/gdi/dc.c 27 Oct 2005 18:28:43 -0000 1.11
+++ dlls/gdi/dc.c 28 Oct 2005 11:14:17 -0000
@@ -1217,7 +1217,7 @@ BOOL WINAPI ModifyWorldTransform( HDC hd
/* Check for illegal parameters */
if (!dc) return FALSE;
- if (!xform) goto done;
+ if (!xform && iMode != MWT_IDENTITY) goto done;
/* Check that graphics mode is GM_ADVANCED */
if (dc->GraphicsMode!=GM_ADVANCED) goto done;
Index: dlls/gdi/tests/.cvsignore
===================================================================
RCS file: /home/wine/wine/dlls/gdi/tests/.cvsignore,v
retrieving revision 1.8
diff -u -p -r1.8 .cvsignore
--- dlls/gdi/tests/.cvsignore 10 Oct 2005 19:53:22 -0000 1.8
+++ dlls/gdi/tests/.cvsignore 28 Oct 2005 11:14:17 -0000
@@ -4,6 +4,7 @@ brush.ok
clipping.ok
gdiobj.ok
generated.ok
+mapping.ok
metafile.ok
palette.ok
testlist.c
Index: dlls/gdi/tests/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/gdi/tests/Makefile.in,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile.in
--- dlls/gdi/tests/Makefile.in 10 Oct 2005 19:53:22 -0000 1.8
+++ dlls/gdi/tests/Makefile.in 28 Oct 2005 11:14:17 -0000
@@ -11,6 +11,7 @@ CTESTS = \
clipping.c \
gdiobj.c \
generated.c \
+ mapping.c \
metafile.c \
palette.c
--- /dev/null 2004-02-23 21:02:56.000000000 +0000
+++ dlls/gdi/tests/mapping.c 2005-10-28 12:08:19.357340390 +0100
@@ -0,0 +1,56 @@
+/*
+ * Unit tests for mapping functions
+ *
+ * Copyright (c) 2005 Huw Davies
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <math.h>
+
+#include "wine/test.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winerror.h"
+
+
+void test_modify_world_transform(void)
+{
+ HDC hdc = GetDC(0);
+ int ret;
+
+ ret = SetGraphicsMode(hdc, GM_ADVANCED);
+ if(!ret) /* running in win9x so quit */
+ return;
+
+ ret = ModifyWorldTransform(hdc, NULL, MWT_IDENTITY);
+ ok(ret, "ret = %d\n", ret);
+
+ ret = ModifyWorldTransform(hdc, NULL, MWT_LEFTMULTIPLY);
+ ok(!ret, "ret = %d\n", ret);
+
+ ret = ModifyWorldTransform(hdc, NULL, MWT_RIGHTMULTIPLY);
+ ok(!ret, "ret = %d\n", ret);
+
+ ReleaseDC(0, hdc);
+}
+
+START_TEST(mapping)
+{
+ test_modify_world_transform();
+}
More information about the wine-patches
mailing list