From fc0d57b7aff84f4bdca0a1f201527c265d5f0cf5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 6 Nov 2014 17:24:13 +0100 Subject: Revert "use the new OUString::fromUtf8 method" This reverts commit 05050cdb23de586870bf479a9df5ced06828d498, not all places that use e.g. OStringToOUString to convert potential UTF-8 are guaranteed to fulfil the prerequisites necessary to use fromUtf8 (and some places like e.g. in codemaker are happy with the best-effort effect of OStringToOUString's OSTRING_TO_OUSTRING_CVTFLAGS). --- vcl/generic/fontmanager/fontconfig.cxx | 8 ++++---- vcl/generic/fontmanager/helper.cxx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'vcl/generic') diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx index 73fb00e5d44f..1a9dd396fe4c 100644 --- a/vcl/generic/fontmanager/fontconfig.cxx +++ b/vcl/generic/fontmanager/fontconfig.cxx @@ -577,7 +577,7 @@ void PrintFontManager::countFontconfigFonts( boost::unordered_mapgetAtom( ATOM_FAMILYNAME, OUString::fromUtf8( OString( (sal_Char*)family ) ), true ); + int nFamilyName = m_pAtoms->getAtom( ATOM_FAMILYNAME, OStringToOUString( OString( (sal_Char*)family ), RTL_TEXTENCODING_UTF8 ), true ); PrintFont* pUpdate = aFonts.front(); std::list::const_iterator second_font = aFonts.begin(); ++second_font; @@ -630,7 +630,7 @@ void PrintFontManager::countFontconfigFonts( boost::unordered_mapm_eItalic = convertSlant(slant); if( eStyleRes == FcResultMatch ) { - pUpdate->m_aStyleName = OUString::fromUtf8( OString( (sal_Char*)style ) ); + pUpdate->m_aStyleName = OStringToOUString( OString( (sal_Char*)style ), RTL_TEXTENCODING_UTF8 ); } // update font cache @@ -877,7 +877,7 @@ namespace const char* pScriptCode = uscript_getShortName(eScript); if (pScriptCode) aBuf.append('-').append(pScriptCode); - return LanguageTag(OUString::fromUtf8(aBuf.makeStringAndClear())); + return LanguageTag(OStringToOUString(aBuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); } #if defined(ENABLE_DBUS) && defined(ENABLE_PACKAGEKIT) @@ -1056,7 +1056,7 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi rWrapper.m_aFontNameToLocalized.find(sFamily); if (aI != rWrapper.m_aFontNameToLocalized.end()) sFamily = aI->second; - rPattern.maSearchName = OUString::fromUtf8( sFamily ); + rPattern.maSearchName = OStringToOUString( sFamily, RTL_TEXTENCODING_UTF8 ); bRet = true; } } diff --git a/vcl/generic/fontmanager/helper.cxx b/vcl/generic/fontmanager/helper.cxx index da8e2a55a477..3a313190ea80 100644 --- a/vcl/generic/fontmanager/helper.cxx +++ b/vcl/generic/fontmanager/helper.cxx @@ -163,7 +163,7 @@ void psp::getPrinterPathList( std::list< OUString >& rPathList, const char* pSub #ifdef SYSTEM_PPD_DIR if( pSubDir && rtl_str_compare( pSubDir, PRINTER_PPDDIR ) == 0 ) { - rPathList.push_back( OUString::fromUtf8( OString( SYSTEM_PPD_DIR ) ) ); + rPathList.push_back( OStringToOUString( OString( SYSTEM_PPD_DIR ), RTL_TEXTENCODING_UTF8 ) ); } #endif -- cgit