]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/cfstring.cpp
Move menu messages handling from wxFrame to wxTLW in wxMSW.
[wxWidgets.git] / src / osx / core / cfstring.cpp
index fa1840f44c6a24d6a8e412ce9211612746471b2e..3aca67c90dfdea7ded4aadbe67f2bf284800a747 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/osx/corefoundation/cfstring.cpp
+// Name:        src/osx/core/cfstring.cpp
 // Purpose:     wxCFStringHolder and other string functions
 // Author:      Stefan Csomor
 // Modified by:
@@ -632,6 +632,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 +699,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
 
 
 //