2008-02-10 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Sun, 10 Feb 2008 20:26:53 +0000 (20:26 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Sun, 10 Feb 2008 20:26:53 +0000 (20:26 -0000)
* gdipFunctions.cs: Seal GdiPlusStreamHelper class. Found using
Gendarme.
* carbonFunctions.cs: Seal Carbon class before 2.0, make it static
from 2.0. Issues reported by Gendarme.
* ColorConverter.cs: Seal internal IComparer class CompareColors.
Found using Gendarme.
* FontConverter.cs: Don't ignore result of String.Trim. Found
using Gendarme.
* Graphics.cs: Document unused FillMode on DrawCloseCurve (part
of the API but unused) and remove unused internal code. Both found
using Gendarme.
* SRDescriptionAttribute.cs: Seal internal attribute. Found using
Gendarme.

svn path=/trunk/mcs/; revision=95403

mcs/class/System.Drawing/System.Drawing/ChangeLog
mcs/class/System.Drawing/System.Drawing/ColorConverter.cs
mcs/class/System.Drawing/System.Drawing/FontConverter.cs
mcs/class/System.Drawing/System.Drawing/Graphics.cs
mcs/class/System.Drawing/System.Drawing/SRDescriptionAttribute.cs
mcs/class/System.Drawing/System.Drawing/carbonFunctions.cs
mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs

index d4a5942535efe056a68a528bb255927bf4dadf1b..787e44b11d8134c37fa76ce480221760859ec3f0 100644 (file)
@@ -1,3 +1,19 @@
+2008-02-10  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * gdipFunctions.cs: Seal GdiPlusStreamHelper class. Found using
+       Gendarme.
+       * carbonFunctions.cs: Seal Carbon class before 2.0, make it static
+       from 2.0. Issues reported by Gendarme.
+       * ColorConverter.cs: Seal internal IComparer class CompareColors. 
+       Found using Gendarme.
+       * FontConverter.cs: Don't ignore result of String.Trim. Found
+       using Gendarme.
+       * Graphics.cs: Document unused FillMode on DrawCloseCurve (part 
+       of the API but unused) and remove unused internal code. Both found
+       using Gendarme.
+       * SRDescriptionAttribute.cs: Seal internal attribute. Found using
+       Gendarme.
+
 2008-02-01  Geoff Norton  <gnorton@novell.com>
 
        * carbonFunction.cs: More clipping fixes.  Include a variable to 
index 10180053792ffafe03109b0aa1fe81e4110749ae..dffdb66b6e2027f941d5b8c20bf0295af6e58837 100644 (file)
@@ -250,8 +250,8 @@ namespace System.Drawing
                        return true;
                }
 
-               class CompareColors : IComparer
-               {
+               sealed class CompareColors : IComparer {
+
                        public int Compare (object x, object y)
                        {
                                return String.Compare (((Color) x).Name, ((Color) y).Name);
index 872f28eb35e5c98b5b170bd8b7f33b1fce52a4ee..22baf05498bca403c427ac40e30c178ab610afdf 100644 (file)
@@ -142,7 +142,7 @@ namespace System.Drawing
                        }
 
                        font = (string)value;
-                       font.Trim();
+                       font = font.Trim ();
 
                        if (font.Length == 0) {
                                return null;
index 0463817564a4c54bbdd89956196191f0bb074b1c..3ef4d66ac31645f2d49ee78d39c1e1f8ebaefa35 100644 (file)
@@ -436,6 +436,8 @@ namespace System.Drawing
                        GDIPlus.CheckStatus (status);
                }
                        
+               // according to MSDN fillmode "is required but ignored" which makes _some_ sense since the unmanaged 
+               // GDI+ call doesn't support it (issue spotted using Gendarme's AvoidUnusedParametersRule)
                public void DrawClosedCurve (Pen pen, Point [] points, float tension, FillMode fillmode)
                {
                        if (pen == null)
@@ -447,7 +449,9 @@ namespace System.Drawing
                        status = GDIPlus.GdipDrawClosedCurve2I (nativeObject, pen.nativeObject, points, points.Length, tension);
                        GDIPlus.CheckStatus (status);
                }
-               
+
+               // according to MSDN fillmode "is required but ignored" which makes _some_ sense since the unmanaged 
+               // GDI+ call doesn't support it (issue spotted using Gendarme's AvoidUnusedParametersRule)
                public void DrawClosedCurve (Pen pen, PointF [] points, float tension, FillMode fillmode)
                {
                        if (pen == null)
@@ -1090,13 +1094,6 @@ namespace System.Drawing
                        GDIPlus.CheckStatus (status);
                }
 
-               internal void DrawRectangle (Pen pen, RectangleF rect)
-               {
-                       if (pen == null)
-                               throw new ArgumentNullException ("pen");
-                       DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
-               }
-
                public void DrawRectangle (Pen pen, Rectangle rect)
                {
                        if (pen == null)
index ec279f7c232801722332535624fa4b48c9565a7b..b3cf9a58bf0b6a5f534b2eea088b8cc7ff4a350a 100644 (file)
@@ -36,8 +36,8 @@ using System.ComponentModel;
 namespace System.Drawing
 {
        [AttributeUsage(AttributeTargets.All)]
-       internal class SRDescriptionAttribute : DescriptionAttribute
-       {
+       internal sealed class SRDescriptionAttribute : DescriptionAttribute {
+
                private bool isReplaced = false;
 
                public SRDescriptionAttribute (string description)
index f1686c268099f06d2d2003040ddf6279e7a3ba53..984feba3e85d046d2d88588f30f0ff099d6f7490 100644 (file)
@@ -35,7 +35,11 @@ using System.Security;
 namespace System.Drawing {
 
        [SuppressUnmanagedCodeSecurity]
-       internal class Carbon {
+#if NET_2_0
+       internal static class Carbon {
+#else
+       internal sealed class Carbon {
+#endif
                internal static Hashtable contextReference = new Hashtable ();
                internal static object lockobj = new object ();
 
index 2f150b27851d6ffb08a5e21601ea94c9a1ba5097..835a1d20a403bab16f8891b679aff3ce87d32da0 100644 (file)
@@ -1703,8 +1703,7 @@ namespace System.Drawing
                public delegate void StreamCloseDelegate ();
                public delegate long StreamSizeDelegate ();
 
-               internal class GdiPlusStreamHelper 
-               {
+               internal sealed class GdiPlusStreamHelper {
                        public Stream stream;
                        
                        private StreamGetHeaderDelegate sghd = null;