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)
|
: m_cfs(NULL) , m_release(false)
|
||||||
{
|
{
|
||||||
Assign( str , encoding ) ;
|
Assign( str , encoding ) ;
|
||||||
@@ -75,7 +76,8 @@ public:
|
|||||||
m_cfs = NULL ;
|
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; }
|
operator CFStringRef () const { return m_cfs; }
|
||||||
wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
|
wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
|
||||||
|
@@ -884,13 +884,13 @@ wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathCompon
|
|||||||
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, cfString);
|
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, cfString);
|
||||||
CFRelease( cfString );
|
CFRelease( cfString );
|
||||||
CFStringNormalize(cfMutableString,kCFStringNormalizationFormC);
|
CFStringNormalize(cfMutableString,kCFStringNormalizationFormC);
|
||||||
return wxMacCFStringHolder(cfMutableString).AsString(wxLocale::GetSystemEncoding());
|
return wxMacCFStringHolder(cfMutableString).AsString();
|
||||||
}
|
}
|
||||||
|
|
||||||
OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef )
|
OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef )
|
||||||
{
|
{
|
||||||
OSStatus err = noErr ;
|
OSStatus err = noErr ;
|
||||||
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, wxMacCFStringHolder(path ,wxLocale::GetSystemEncoding() ) ) ;
|
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, wxMacCFStringHolder(path));
|
||||||
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
|
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
|
||||||
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kDefaultPathStyle, false);
|
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kDefaultPathStyle, false);
|
||||||
CFRelease( cfMutableString );
|
CFRelease( cfMutableString );
|
||||||
|
@@ -105,9 +105,10 @@ wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding)
|
|||||||
#if wxUSE_GUI
|
#if wxUSE_GUI
|
||||||
encoding = wxFont::GetDefaultEncoding() ;
|
encoding = wxFont::GetDefaultEncoding() ;
|
||||||
#else
|
#else
|
||||||
encoding = wxLocale::GetSystemEncoding() ;
|
encoding = wxFONTENCODING_SYSTEM; // to be set below
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( encoding == wxFONTENCODING_SYSTEM )
|
if ( encoding == wxFONTENCODING_SYSTEM )
|
||||||
{
|
{
|
||||||
enc = CFStringGetSystemEncoding();
|
enc = CFStringGetSystemEncoding();
|
||||||
|
@@ -90,8 +90,7 @@ long wxMacExecute(wxChar **argv,
|
|||||||
CFURLRef cfurlApp =
|
CFURLRef cfurlApp =
|
||||||
CFURLCreateWithFileSystemPath(
|
CFURLCreateWithFileSystemPath(
|
||||||
kCFAllocatorDefault,
|
kCFAllocatorDefault,
|
||||||
wxMacCFStringHolder(path,
|
wxMacCFStringHolder(path),
|
||||||
wxLocale::GetSystemEncoding()),
|
|
||||||
kDefaultPathStyle,
|
kDefaultPathStyle,
|
||||||
true); //false == not a directory
|
true); //false == not a directory
|
||||||
|
|
||||||
@@ -159,8 +158,7 @@ long wxMacExecute(wxChar **argv,
|
|||||||
// First, try creating as a directory
|
// First, try creating as a directory
|
||||||
cfurlCurrentFile = CFURLCreateWithFileSystemPath(
|
cfurlCurrentFile = CFURLCreateWithFileSystemPath(
|
||||||
kCFAllocatorDefault,
|
kCFAllocatorDefault,
|
||||||
wxMacCFStringHolder(*argv,
|
wxMacCFStringHolder(*argv),
|
||||||
wxLocale::GetSystemEncoding()),
|
|
||||||
kDefaultPathStyle,
|
kDefaultPathStyle,
|
||||||
true); //true == directory
|
true); //true == directory
|
||||||
}
|
}
|
||||||
@@ -170,8 +168,7 @@ long wxMacExecute(wxChar **argv,
|
|||||||
// as a regular file
|
// as a regular file
|
||||||
cfurlCurrentFile = CFURLCreateWithFileSystemPath(
|
cfurlCurrentFile = CFURLCreateWithFileSystemPath(
|
||||||
kCFAllocatorDefault,
|
kCFAllocatorDefault,
|
||||||
wxMacCFStringHolder(*argv,
|
wxMacCFStringHolder(*argv),
|
||||||
wxLocale::GetSystemEncoding()),
|
|
||||||
kDefaultPathStyle,
|
kDefaultPathStyle,
|
||||||
false); //false == regular file
|
false); //false == regular file
|
||||||
}
|
}
|
||||||
@@ -182,7 +179,7 @@ long wxMacExecute(wxChar **argv,
|
|||||||
// so try creating it through CFURLCreateWithString
|
// so try creating it through CFURLCreateWithString
|
||||||
cfurlCurrentFile = CFURLCreateWithString(
|
cfurlCurrentFile = CFURLCreateWithString(
|
||||||
kCFAllocatorDefault,
|
kCFAllocatorDefault,
|
||||||
wxMacCFStringHolder(*argv, wxLocale::GetSystemEncoding()),
|
wxMacCFStringHolder(*argv),
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user