Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDick Porter <dick@acm.org>2003-12-04 18:01:04 +0300
committerDick Porter <dick@acm.org>2003-12-04 18:01:04 +0300
commit190b0a5060831aafe544d79ea3e5f55d920fbe6f (patch)
treebfe1ffb295fc8ced9827a69c04c2c7f44baea22b /mcs/class/corlib/System.Globalization
parent0ca733a0359277dee8ea74e089a895a0ae27640c (diff)
2003-12-04 Dick Porter <dick@ximian.com>
* CompareInfo.cs: Implement the deserialization callback * CultureInfo.cs: Allow CompareInfo to see the CultureMap so that it can construct the ICU collator itself svn path=/trunk/mcs/; revision=20776
Diffstat (limited to 'mcs/class/corlib/System.Globalization')
-rw-r--r--mcs/class/corlib/System.Globalization/ChangeLog7
-rw-r--r--mcs/class/corlib/System.Globalization/CompareInfo.cs16
-rw-r--r--mcs/class/corlib/System.Globalization/CultureInfo.cs7
3 files changed, 21 insertions, 9 deletions
diff --git a/mcs/class/corlib/System.Globalization/ChangeLog b/mcs/class/corlib/System.Globalization/ChangeLog
index 4a6d7a5095e..85db7aaf4db 100644
--- a/mcs/class/corlib/System.Globalization/ChangeLog
+++ b/mcs/class/corlib/System.Globalization/ChangeLog
@@ -1,3 +1,10 @@
+2003-12-04 Dick Porter <dick@ximian.com>
+
+ * CompareInfo.cs: Implement the deserialization callback
+
+ * CultureInfo.cs: Allow CompareInfo to see the CultureMap so that
+ it can construct the ICU collator itself
+
2003-12-02 Dick Porter <dick@ximian.com>
* NumberFormatInfo.cs: Helper called by runtime locale
diff --git a/mcs/class/corlib/System.Globalization/CompareInfo.cs b/mcs/class/corlib/System.Globalization/CompareInfo.cs
index 2b4a4f77e69..d5354173760 100644
--- a/mcs/class/corlib/System.Globalization/CompareInfo.cs
+++ b/mcs/class/corlib/System.Globalization/CompareInfo.cs
@@ -22,10 +22,14 @@ namespace System.Globalization
/* Hide the .ctor() */
CompareInfo() {}
-
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ private extern void construct_compareinfo (string locale);
+
internal CompareInfo (int lcid)
{
this.lcid=lcid;
+ this.construct_compareinfo (CultureInfo.CultureMap.lcid_to_icuname (lcid));
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
@@ -445,10 +449,16 @@ namespace System.Globalization
return("CompareInfo - "+lcid);
}
- [MonoTODO]
void IDeserializationCallback.OnDeserialization(object sender)
{
- throw new NotImplementedException ();
+ /* This will build the ICU collator, and store
+ * the pointer in ICU_collator
+ */
+ try {
+ this.construct_compareinfo (CultureInfo.CultureMap.lcid_to_icuname (lcid));
+ } catch {
+ ICU_collator=IntPtr.Zero;
+ }
}
/* LAMESPEC: not mentioned in the spec, but corcompare
diff --git a/mcs/class/corlib/System.Globalization/CultureInfo.cs b/mcs/class/corlib/System.Globalization/CultureInfo.cs
index caeda7ea2f1..e3045731192 100644
--- a/mcs/class/corlib/System.Globalization/CultureInfo.cs
+++ b/mcs/class/corlib/System.Globalization/CultureInfo.cs
@@ -36,7 +36,7 @@ namespace System.Globalization
private static readonly string MSG_READONLY = "This instance is read only";
- private sealed class CultureMap : IEnumerable
+ internal sealed class CultureMap : IEnumerable
{
private static Hashtable CultureID;
private static Hashtable CultureNames;
@@ -1257,10 +1257,6 @@ namespace System.Globalization
return(name);
}
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static void construct_compareinfo (object compareinfo, string locale);
-
public virtual CompareInfo CompareInfo
{
get {
@@ -1268,7 +1264,6 @@ namespace System.Globalization
lock (this) {
if(compareinfo==null) {
compareinfo=new CompareInfo (lcid);
- construct_compareinfo (compareinfo, icu_name);
}
}
}