add default value for the encoding parameter of wxMacCFStringHolder() instead of passing wxLocale::GetSystemEncoding() which doesn't work when wxUSE_INTL == 0 to it in many places (replaces 2nd part of patch 1501724)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40283 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -44,7 +44,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
wxMacCFStringHolder(const wxString &str , wxFontEncoding encoding )
|
||||
wxMacCFStringHolder(const wxString &str,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||
: m_cfs(NULL) , m_release(false)
|
||||
{
|
||||
Assign( str , encoding ) ;
|
||||
@@ -75,7 +76,8 @@ public:
|
||||
m_cfs = NULL ;
|
||||
}
|
||||
|
||||
void Assign( const wxString &str , wxFontEncoding encoding ) ;
|
||||
void Assign(const wxString &str,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||
|
||||
operator CFStringRef () const { return m_cfs; }
|
||||
wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
|
||||
|
@@ -884,13 +884,13 @@ wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathCompon
|
||||
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, cfString);
|
||||
CFRelease( cfString );
|
||||
CFStringNormalize(cfMutableString,kCFStringNormalizationFormC);
|
||||
return wxMacCFStringHolder(cfMutableString).AsString(wxLocale::GetSystemEncoding());
|
||||
return wxMacCFStringHolder(cfMutableString).AsString();
|
||||
}
|
||||
|
||||
OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef )
|
||||
{
|
||||
OSStatus err = noErr ;
|
||||
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, wxMacCFStringHolder(path ,wxLocale::GetSystemEncoding() ) ) ;
|
||||
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, wxMacCFStringHolder(path));
|
||||
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
|
||||
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kDefaultPathStyle, false);
|
||||
CFRelease( cfMutableString );
|
||||
|
@@ -105,9 +105,10 @@ wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding)
|
||||
#if wxUSE_GUI
|
||||
encoding = wxFont::GetDefaultEncoding() ;
|
||||
#else
|
||||
encoding = wxLocale::GetSystemEncoding() ;
|
||||
encoding = wxFONTENCODING_SYSTEM; // to be set below
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( encoding == wxFONTENCODING_SYSTEM )
|
||||
{
|
||||
enc = CFStringGetSystemEncoding();
|
||||
|
@@ -90,8 +90,7 @@ long wxMacExecute(wxChar **argv,
|
||||
CFURLRef cfurlApp =
|
||||
CFURLCreateWithFileSystemPath(
|
||||
kCFAllocatorDefault,
|
||||
wxMacCFStringHolder(path,
|
||||
wxLocale::GetSystemEncoding()),
|
||||
wxMacCFStringHolder(path),
|
||||
kDefaultPathStyle,
|
||||
true); //false == not a directory
|
||||
|
||||
@@ -159,8 +158,7 @@ long wxMacExecute(wxChar **argv,
|
||||
// First, try creating as a directory
|
||||
cfurlCurrentFile = CFURLCreateWithFileSystemPath(
|
||||
kCFAllocatorDefault,
|
||||
wxMacCFStringHolder(*argv,
|
||||
wxLocale::GetSystemEncoding()),
|
||||
wxMacCFStringHolder(*argv),
|
||||
kDefaultPathStyle,
|
||||
true); //true == directory
|
||||
}
|
||||
@@ -170,8 +168,7 @@ long wxMacExecute(wxChar **argv,
|
||||
// as a regular file
|
||||
cfurlCurrentFile = CFURLCreateWithFileSystemPath(
|
||||
kCFAllocatorDefault,
|
||||
wxMacCFStringHolder(*argv,
|
||||
wxLocale::GetSystemEncoding()),
|
||||
wxMacCFStringHolder(*argv),
|
||||
kDefaultPathStyle,
|
||||
false); //false == regular file
|
||||
}
|
||||
@@ -182,7 +179,7 @@ long wxMacExecute(wxChar **argv,
|
||||
// so try creating it through CFURLCreateWithString
|
||||
cfurlCurrentFile = CFURLCreateWithString(
|
||||
kCFAllocatorDefault,
|
||||
wxMacCFStringHolder(*argv, wxLocale::GetSystemEncoding()),
|
||||
wxMacCFStringHolder(*argv),
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user