Author: spouliot
Date: 2008-02-10 15:26:53 -0500 (Sun, 10 Feb 2008)
New Revision: 95403

Modified:
   trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
   trunk/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs
   trunk/mcs/class/System.Drawing/System.Drawing/FontConverter.cs
   trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs
   trunk/mcs/class/System.Drawing/System.Drawing/SRDescriptionAttribute.cs
   trunk/mcs/class/System.Drawing/System.Drawing/carbonFunctions.cs
   trunk/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
Log:
2008-02-10  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * 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.



Modified: trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2008-02-10 
20:21:47 UTC (rev 95402)
+++ trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2008-02-10 
20:26:53 UTC (rev 95403)
@@ -1,3 +1,19 @@
+2008-02-10  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * 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  <[EMAIL PROTECTED]>
 
        * carbonFunction.cs: More clipping fixes.  Include a variable to 

Modified: trunk/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs     
2008-02-10 20:21:47 UTC (rev 95402)
+++ trunk/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs     
2008-02-10 20:26:53 UTC (rev 95403)
@@ -250,8 +250,8 @@
                        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);

Modified: trunk/mcs/class/System.Drawing/System.Drawing/FontConverter.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/FontConverter.cs      
2008-02-10 20:21:47 UTC (rev 95402)
+++ trunk/mcs/class/System.Drawing/System.Drawing/FontConverter.cs      
2008-02-10 20:26:53 UTC (rev 95403)
@@ -142,7 +142,7 @@
                        }
 
                        font = (string)value;
-                       font.Trim();
+                       font = font.Trim ();
 
                        if (font.Length == 0) {
                                return null;

Modified: trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs   2008-02-10 
20:21:47 UTC (rev 95402)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs   2008-02-10 
20:26:53 UTC (rev 95403)
@@ -436,6 +436,8 @@
                        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 @@
                        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 @@
                        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)

Modified: 
trunk/mcs/class/System.Drawing/System.Drawing/SRDescriptionAttribute.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/SRDescriptionAttribute.cs     
2008-02-10 20:21:47 UTC (rev 95402)
+++ trunk/mcs/class/System.Drawing/System.Drawing/SRDescriptionAttribute.cs     
2008-02-10 20:26:53 UTC (rev 95403)
@@ -36,8 +36,8 @@
 namespace System.Drawing
 {
        [AttributeUsage(AttributeTargets.All)]
-       internal class SRDescriptionAttribute : DescriptionAttribute
-       {
+       internal sealed class SRDescriptionAttribute : DescriptionAttribute {
+
                private bool isReplaced = false;
 
                public SRDescriptionAttribute (string description)

Modified: trunk/mcs/class/System.Drawing/System.Drawing/carbonFunctions.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/carbonFunctions.cs    
2008-02-10 20:21:47 UTC (rev 95402)
+++ trunk/mcs/class/System.Drawing/System.Drawing/carbonFunctions.cs    
2008-02-10 20:26:53 UTC (rev 95403)
@@ -35,7 +35,11 @@
 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 ();
 

Modified: trunk/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs      
2008-02-10 20:21:47 UTC (rev 95402)
+++ trunk/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs      
2008-02-10 20:26:53 UTC (rev 95403)
@@ -1703,8 +1703,7 @@
                public delegate void StreamCloseDelegate ();
                public delegate long StreamSizeDelegate ();
 
-               internal class GdiPlusStreamHelper 
-               {
+               internal sealed class GdiPlusStreamHelper {
                        public Stream stream;
                        
                        private StreamGetHeaderDelegate sghd = null;

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

Reply via email to