]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/cfstring.cpp
adapting to new event version
[wxWidgets.git] / src / osx / core / cfstring.cpp
index c3bfcce19bd815258effb9a86fc6b816b2c7054a..384bf88e720ba25b284c719cd9e3c3c8896725a7 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     2004-10-29 (from code in src/osx/carbon/utils.cpp)
-// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 // Usage:       Darwin (base library)
@@ -632,6 +631,18 @@ wxCFStringRef::wxCFStringRef( const wxString &st , wxFontEncoding WXUNUSED_IN_UN
     }
 }
 
+wxString wxCFStringRef::AsStringWithNormalizationFormC( CFStringRef ref, wxFontEncoding encoding )
+{
+    if ( !ref )
+        return wxEmptyString ;
+
+    CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, ref);
+    CFStringNormalize(cfMutableString,kCFStringNormalizationFormC);
+    wxString str = wxCFStringRef::AsString(ref,encoding);
+    CFRelease(cfMutableString);
+    return str;
+}
+
 wxString wxCFStringRef::AsString( CFStringRef ref, wxFontEncoding WXUNUSED_IN_UNICODE(encoding) )
 {
     if ( !ref )
@@ -687,7 +698,12 @@ wxString wxCFStringRef::AsString( NSString* ref, wxFontEncoding encoding )
 {
     return AsString( (CFStringRef) ref, encoding );
 }
-#endif
+
+wxString wxCFStringRef::AsStringWithNormalizationFormC( NSString* ref, wxFontEncoding encoding )
+{
+    return AsStringWithNormalizationFormC( (CFStringRef) ref, encoding );
+}
+#endif // wxOSX_USE_COCOA_OR_IPHONE
 
 
 //