[Mono-dev] RE: [Mono-patches] r48372-trunk/mcs/class/System.Drawing/System.Drawing

Kornél Pál kornelpal at hotmail.com
Mon Aug 15 09:33:10 EDT 2005

I've created a test. Attached as PointCultureTest.cs.

The following are results on .NET Framework 1.1 SP1:

Has to be:                         {X=-2,Y=-8}
en-US:                             {X=-2,Y=-8}
With CultureInfo.InvariantCulture: {X=-2,Y=-8}
With CultureInfo.CurrentCulture:   {X=myNegativeSign2,Y=myNegativeSign8}
MyCultureInfo:                     {X=myNegativeSign2,Y=myNegativeSign8}

This shows that System.Drawing.Point.ToString() is using
CultureInfo.CurrentCulture (the default, when no format provider specified)
and not CultureInfo.InvariantCulture that was assumed by Gert.

I think this patch should be reverted.


----- Original Message -----
From: "Andrew Skiba" <andrews at mainsoft.com>
To: "Gert Driesen <gert.driesen at pandora.be>" <gert at mono-cvs.ximian.com>
Cc: <mono-devel-list at lists.ximian.com>
Sent: Monday, August 15, 2005 2:41 PM
Subject: [Mono-dev] RE: [Mono-patches]

Hi Gert.

I wonder, what is way to write test for such fix? How can one check
whether dotnet Point.cs makes

String.Format ("{{X={0},Y={1}}}", x, y);


string.Format ("{{X={0},Y={1}}}", x.ToString
(CultureInfo.InvariantCulture), y.ToString


Thank you.

> -----Original Message-----
> From: mono-patches-bounces at lists.ximian.com
> [mailto:mono-patches-bounces at lists.ximian.com] On Behalf Of
> Gert Driesen <gert.driesen at pandora.be>
> Sent: Sunday, August 14, 2005 23:11
> To: mono-patches at lists.ximian.com; ximian.monolist at gmail.com
> Subject: [Mono-patches] r48372
> -trunk/mcs/class/System.Drawing/System.Drawing
> Author: gert
> Date: 2005-08-14 16:10:33 -0400 (Sun, 14 Aug 2005) New Revision: 48372
> Modified:
>    trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
>    trunk/mcs/class/System.Drawing/System.Drawing/Point.cs
>    trunk/mcs/class/System.Drawing/System.Drawing/PointF.cs
>    trunk/mcs/class/System.Drawing/System.Drawing/SizeF.cs
> Log:
> * Point.cs: Use invariant culture for converting numbers to string.
> * PointF.cs: same
> * SizeF.cs: same
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PointCultureTest.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050815/7c6c43df/attachment.pl 

More information about the Mono-devel-list mailing list