https://bugzilla.novell.com/show_bug.cgi?id=473758


           Summary: Calling methods on Graphic after passing unicode text
                    to MeasureString fires errors
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: i686
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Drawing.
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---


It seems passing some specific unicode chars to Graphics.MeasureString causes
the next operations to fail. As expected, .net does not fire any error.

Try using this test case:

using System;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

public class Test
{
        static Control c;

        static void Main ()
        {
                c = new Control ();

                Graphics g = c.CreateGraphics ();
                DoPaint (g);
                g.Dispose ();
        }

        static void DoPaint (Graphics g)
        {
                byte[] data = new byte[] {0xD8, 0xD9};
                string text = Encoding.Unicode.GetString (data);

                g.MeasureString (text, c.Font);
                g.FillRectangle (SystemBrushes.ControlDark, new Rectangle (1,
1, 2, 2));
        }
}

An error appears calling FillRectangle - but if you pass a text such "hello" to
MeasureString instead, FillRectangle doesn't fire any error.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to