[try 5][Gdiplus 3/6] Implement GdipSetEmpty

Adam Petaccia adam at tpetaccia.com
Thu Jul 24 18:01:37 CDT 2008


Changelog:
(try4):
    Update to new naming scheme.
    region->node is no longer a pointer
(try2):
    Don't delete the region, but just the element, and call InitRegion instead.
---
 dlls/gdiplus/region.c       |   13 +++++++++----
 dlls/gdiplus/tests/region.c |    3 +++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c
index 0e96550..900d470 100644
--- a/dlls/gdiplus/region.c
+++ b/dlls/gdiplus/region.c
@@ -304,12 +304,17 @@ GpStatus WINGDIPAPI GdipIsInfiniteRegion(GpRegion *region, GpGraphics *graphics,
 
 GpStatus WINGDIPAPI GdipSetEmpty(GpRegion *region)
 {
-    static int calls;
+    GpStatus stat;
 
-    if(!(calls++))
-        FIXME("not implemented\n");
+    TRACE("%p\n", region);
 
-    return NotImplemented;
+    if (!region)
+        return InvalidParameter;
+
+    delete_element(&region->node);
+    stat = init_region(region, RegionDataEmptyRect);
+
+    return stat;
 }
 
 GpStatus WINGDIPAPI GdipSetInfinite(GpRegion *region)
diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c
index a5064d1..41359d8 100644
--- a/dlls/gdiplus/tests/region.c
+++ b/dlls/gdiplus/tests/region.c
@@ -82,7 +82,10 @@ todo_wine
     expect_dword(buf + 4, RGNDATA_INFINITE_RECT);
 
     status = GdipSetEmpty(region);
+}
     ok(status == Ok, "status %08x\n", status);
+todo_wine
+{
     status = GdipGetRegionDataSize(region, &needed);
     ok(status == Ok, "status %08x\n", status);
     expect(20, needed);
-- 
1.5.4.3




More information about the wine-patches mailing list