Author: atsushi
Date: 2006-05-15 16:30:00 -0400 (Mon, 15 May 2006)
New Revision: 60723

Modified:
   trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
   trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs
   trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
   trunk/mcs/class/System.Drawing/Test/System.Drawing/TestGraphics.cs
Log:
2006-05-15  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * Graphics.cs : (FillRectangles/FillRectanglesI): when argument
          array is empty, don't invoke GDI+. Fixed bug #78408.

        * TestGraphics.cs : added test for bug #78408 (FillRectangles).




Modified: trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2006-05-15 
20:29:04 UTC (rev 60722)
+++ trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2006-05-15 
20:30:00 UTC (rev 60723)
@@ -1,3 +1,8 @@
+2006-05-15  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * Graphics.cs : (FillRectangles/FillRectanglesI): when argument
+         array is empty, don't invoke GDI+. Fixed bug #78408.
+
 2006-05-12  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * gdipFunctions.c: Fix misnamed GdipAdd*Path*String[I] API (#78383)

Modified: trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs   2006-05-15 
20:29:04 UTC (rev 60722)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs   2006-05-15 
20:30:00 UTC (rev 60723)
@@ -1611,7 +1611,9 @@
                {
                        if (brush == null)
                                throw new ArgumentNullException ("brush");
-                       
+                       if (rects.Length == 0)
+                               return;
+
                        Status status = GDIPlus.GdipFillRectanglesI 
(nativeObject, brush.nativeObject, rects, rects.Length);
                        GDIPlus.CheckStatus (status);
                }
@@ -1620,6 +1622,8 @@
                {
                        if (brush == null)
                                throw new ArgumentNullException ("brush");
+                       if (rects.Length == 0)
+                               return;
                        
                        Status status = GDIPlus.GdipFillRectangles 
(nativeObject, brush.nativeObject, rects, rects.Length);
                        GDIPlus.CheckStatus (status);

Modified: trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog        
2006-05-15 20:29:04 UTC (rev 60722)
+++ trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog        
2006-05-15 20:30:00 UTC (rev 60723)
@@ -1,3 +1,7 @@
+2006-05-15  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * TestGraphics.cs : added test for bug #78408 (FillRectangles).
+
 2006-05-12  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * TestRegion.cs: Added a new test case for unioning a rectangle with 

Modified: trunk/mcs/class/System.Drawing/Test/System.Drawing/TestGraphics.cs
===================================================================
--- trunk/mcs/class/System.Drawing/Test/System.Drawing/TestGraphics.cs  
2006-05-15 20:29:04 UTC (rev 60722)
+++ trunk/mcs/class/System.Drawing/Test/System.Drawing/TestGraphics.cs  
2006-05-15 20:30:00 UTC (rev 60723)
@@ -1227,5 +1227,16 @@
                        Graphics g = Graphics.FromImage (bitmap);
                        g.Restore (null);
                }
+
+               [Test]
+               public void FillRectanglesZeroRects ()
+               {
+                       using (Bitmap bitmap = new Bitmap (20, 20)) {
+                               Graphics g = Graphics.FromImage (bitmap);
+                               Brush brush = new SolidBrush (Color.Red);
+                               g.FillRectangles (brush, new Rectangle [0]);
+                               g.FillRectangles (brush, new RectangleF [0]);
+                       }
+               }
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to