X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8d462eb74a32a522427e658441d1bc5e67b2d8a5..01c226691aabe0eb4bfe86c04b4b9a59d7af367a:/src/osx/core/strconv_cf.cpp diff --git a/src/osx/core/strconv_cf.cpp b/src/osx/core/strconv_cf.cpp index 78f6429c2c..aba2402411 100644 --- a/src/osx/core/strconv_cf.cpp +++ b/src/osx/core/strconv_cf.cpp @@ -33,6 +33,7 @@ * assume ABI compatibility even within a given wxWidgets release. */ +#if wxUSE_FONTMAP WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf( const char* name) { wxMBConv_cf *result = new wxMBConv_cf(name); @@ -44,6 +45,7 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf( const char* name) else return result; } +#endif // wxUSE_FONTMAP WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding) { @@ -130,11 +132,11 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding) else { // NOTE: Includes NULL iff source did - /* NOTE: This is an approximation. The eventual UTF-32 will + /* NOTE: This is an approximation. The eventual UTF-32 will * possibly have less elements but certainly not more. */ size_t returnSize = CFStringGetLength(theString); - + if (dstSize == 0 || dst == NULL) { return returnSize; @@ -144,13 +146,13 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding) // for an undersized UTF-32 destination buffer. CFRange fullStringRange = CFRangeMake(0, CFStringGetLength(theString)); UniChar *szUniCharBuffer = new UniChar[fullStringRange.length]; - + CFStringGetCharacters(theString, fullStringRange, szUniCharBuffer); - + wxMBConvUTF16 converter; returnSize = converter.ToWChar( dst, dstSize, (const char*)szUniCharBuffer, fullStringRange.length ); delete [] szUniCharBuffer; - + return returnSize; } // NOTREACHED @@ -205,7 +207,7 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding) CFIndex usedBufLen; CFIndex charsConverted = CFStringGetBytes( - theString, + theString, CFRangeMake(0, CFStringGetLength(theString)), m_encoding, 0, // FAIL on unconvertible characters