diff options
154 files changed, 444 insertions, 345 deletions
diff --git a/avmedia/source/opengl/oglplayer.cxx b/avmedia/source/opengl/oglplayer.cxx index 74f38211e4d0..36f5e6874fa0 100644 --- a/avmedia/source/opengl/oglplayer.cxx +++ b/avmedia/source/opengl/oglplayer.cxx @@ -87,7 +87,7 @@ bool OGLPlayer::create( const OUString& rURL ) if( !rFile.filename.empty() ) { const OUString sFilesURL = - INetURLObject::GetAbsURL(m_sURL, OUString::fromUtf8(OString(rFile.filename.c_str()))); + INetURLObject::GetAbsURL(m_sURL,OStringToOUString(OString(rFile.filename.c_str()),RTL_TEXTENCODING_UTF8)); if( rFile.type == GLTF_IMAGE ) { // Load images as bitmaps diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 639c3a79f04b..f1381b7ff79c 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -555,7 +555,9 @@ IMPL_LINK( OrganizeDialog, ActivatePageHdl, TabControl *, pTabCtrl ) ObjectPage::ObjectPage(vcl::Window *pParent, const OString &rName, sal_uInt16 nMode) - : TabPage(pParent, rName, "modules/BasicIDE/ui/" + OUString::fromUtf8(rName).toAsciiLowerCase() + ".ui") + : TabPage(pParent, rName, OUString("modules/BasicIDE/ui/") + + OStringToOUString(rName, RTL_TEXTENCODING_UTF8).toAsciiLowerCase() + + OUString(".ui")) { get(m_pBasicBox, "library"); Size aSize(m_pBasicBox->LogicToPixel(Size(130, 117), MAP_APPFONT)); diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx index 24c1c85ba4e9..aa484bc2668c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx @@ -182,8 +182,8 @@ void call( } catch (std::exception & e) { throw css::uno::RuntimeException( "C++ code threw " - + OUString::fromUtf8(typeid(e).name()) - + ": " + OUString::fromUtf8(e.what())); + + OStringToOUString(typeid(e).name(), RTL_TEXTENCODING_UTF8) + + ": " + OStringToOUString(e.what(), RTL_TEXTENCODING_UTF8)); } catch (...) { throw css::uno::RuntimeException( "C++ code threw unknown exception"); diff --git a/canvas/workben/canvasdemo.cxx b/canvas/workben/canvasdemo.cxx index f114e267c343..b8ca6b4675c3 100644 --- a/canvas/workben/canvasdemo.cxx +++ b/canvas/workben/canvasdemo.cxx @@ -166,7 +166,7 @@ class DemoRenderer void drawStringAt( OString aString, double x, double y ) { rendering::StringContext aText; - aText.Text = OUString::fromUtf8( aString ); + aText.Text = OStringToOUString( aString, RTL_TEXTENCODING_UTF8 ); aText.StartPosition = 0; aText.Length = aString.getLength(); rendering::RenderState aRenderState( maRenderState ); diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 25bc3859ac55..5887635e9841 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -3370,7 +3370,7 @@ static OUString failsToSupply(const OUString& name_, const OString& baseName) return OUString( "\n" "#if OSL_DEBUG_LEVEL > 0\n" - " ::rtl::OUString(\"component context fails to supply service '" + name_ + "' of type '" + OUString::fromUtf8(baseName) + "'\")\n" + " ::rtl::OUString(\"component context fails to supply service '" + name_ + "' of type '" + OStringToOUString(baseName, RTL_TEXTENCODING_UTF8) + "'\")\n" "#else\n" " ::rtl::OUString(\"service not supplied\")\n" "#endif\n"); diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 86a2dc6c7919..47d3472ca7a6 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1946,7 +1946,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow, cons aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$columnname$", aColName)); aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$precision$", OUString::number(nLen))); aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$scale$", OUString::number(nScale))); - aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$value$", OUString::fromUtf8(aDefaultValue))); + aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$value$", OStringToOUString(aDefaultValue,RTL_TEXTENCODING_UTF8))); const OUString sError( getConnection()->getResources().getResourceStringWithSubstitution( STR_INVALID_COLUMN_DECIMAL_VALUE diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx index 4bc4f316fe0a..c53523b5d479 100644 --- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx @@ -214,7 +214,8 @@ namespace connectivity if( pSpec ) { - aName = OUString::fromUtf8( g_param_spec_get_name( ( GParamSpec * )pSpec ) ); + aName = OStringToOUString( g_param_spec_get_name( ( GParamSpec * )pSpec ), + RTL_TEXTENCODING_UTF8 ); aName = aName.replace( '-', '_' ); } return aName; @@ -1154,10 +1155,12 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables( ODatabaseMetaDataResultSet::ORow aRow(3); aRow.reserve(6); - OUString aHumanName = OUString::fromUtf8( e_source_get_display_name( pSource ) ); + OUString aHumanName = OStringToOUString( e_source_get_display_name( pSource ), + RTL_TEXTENCODING_UTF8 ); aRow.push_back(new ORowSetValueDecorator(aHumanName)); //tablename aRow.push_back(new ORowSetValueDecorator(aTable)); - OUString aUID = OUString::fromUtf8( e_source_get_uid( pSource ) ); + OUString aUID = OStringToOUString( e_source_get_uid( pSource ), + RTL_TEXTENCODING_UTF8 ); aRow.push_back(new ORowSetValueDecorator(aUID)); //comment //I'd prefer to swap the comment and the human name and //just use e_source_registry_ref_source(get_e_source_registry(), aUID); @@ -1204,7 +1207,8 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables( { ESource *pSource = E_SOURCE (s->data); - OUString aName = OUString::fromUtf8( e_source_peek_name( pSource ) ); + OUString aName = OStringToOUString( e_source_peek_name( pSource ), + RTL_TEXTENCODING_UTF8 ); ODatabaseMetaDataResultSet::ORow aRow(3); aRow.reserve(6); diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index 59c9cf67db5c..bbf643c78a7e 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -98,7 +98,7 @@ valueToOUString( GValue& _rValue ) { const char *pStr = g_value_get_string( &_rValue ); OString aStr( pStr ? pStr : "" ); - OUString sResult( OUString::fromUtf8( aStr ) ); + OUString sResult( OStringToOUString( aStr, RTL_TEXTENCODING_UTF8 ) ); g_value_unset( &_rValue ); return sResult; } diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx index 084cefd35083..8e6a0746383c 100644 --- a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx @@ -110,7 +110,8 @@ OUString SAL_CALL OEvoabResultSetMetaData::getColumnLabel( sal_Int32 nColumnNum OUString aLabel; if( pSpec ) - aLabel = OUString::fromUtf8( g_param_spec_get_nick( (GParamSpec *) pSpec ) ); + aLabel = OStringToOUString( g_param_spec_get_nick( (GParamSpec *) pSpec ), + RTL_TEXTENCODING_UTF8 ); return aLabel; } diff --git a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx index 136734306be7..c4a239ade780 100644 --- a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx +++ b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx @@ -60,7 +60,7 @@ bool MDatabaseMetaDataHelper::getTableStrings( OConnection* _pCon, std::set<std::string> lists; _pCon->getMorkParser("AddressBook")->retrieveLists(lists); for (::std::set<std::string>::iterator iter = lists.begin(); iter != lists.end(); ++iter) { - OUString groupTableName = OUString::fromUtf8((*iter).c_str()); + OUString groupTableName = OStringToOUString((*iter).c_str(), RTL_TEXTENCODING_UTF8); SAL_INFO("connectivity.mork", "add Table " << groupTableName); _rStrings.push_back(groupTableName); diff --git a/connectivity/source/drivers/mork/MNSINIParser.cxx b/connectivity/source/drivers/mork/MNSINIParser.cxx index ff8f932ff12b..b33baa1e82df 100644 --- a/connectivity/source/drivers/mork/MNSINIParser.cxx +++ b/connectivity/source/drivers/mork/MNSINIParser.cxx @@ -60,7 +60,8 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce struct ini_NameValue nameValue; nameValue.sName = OStringToOUString( line.copy(0,nIndex).trim(), RTL_TEXTENCODING_ASCII_US ); - nameValue.sValue = OUString::fromUtf8( line.copy(nIndex+1).trim() ); + nameValue.sValue = OStringToOUString( + line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 ); aSection->lList.push_back(nameValue); diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx index 1fff2cc8b510..686af4e09148 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.cxx +++ b/connectivity/source/drivers/mork/MQueryHelper.cxx @@ -243,7 +243,7 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection, MQueryExpression std::string value = xMork->getValue(CellsIter->second); OString key(column.c_str(), static_cast<sal_Int32>(column.size())); OString valueOString(value.c_str(), static_cast<sal_Int32>(value.size())); - OUString valueOUString = OUString::fromUtf8( valueOString ); + OUString valueOUString = OStringToOUString( valueOString, RTL_TEXTENCODING_UTF8 ); entry->setValue(key, valueOUString); } ::std::vector< sal_Bool > vector = entryMatchedByExpression(this, &expr, entry); diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx index 9450a8a2b722..9b36e68f2fd0 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx @@ -67,7 +67,8 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce struct ini_NameValue nameValue; nameValue.sName = OStringToOUString( line.copy(0,nIndex).trim(), RTL_TEXTENCODING_ASCII_US ); - nameValue.sValue = OUString::fromUtf8( line.copy(nIndex+1).trim() ); + nameValue.sValue = OStringToOUString( + line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 ); aSection->lList.push_back(nameValue); diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index e077f8420109..17428fd96fe2 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -125,7 +125,7 @@ void bufferEscapeConstant( OUStringBuffer & buf, const OUString & value, Connect strbuf.setLength( len ); // Previously here RTL_TEXTENCODING_ASCII_US; as we set the PostgreSQL client_encoding to UTF8, // we get UTF8 here, too. I'm not sure why it worked well before... - buf.append( OUString::fromUtf8( strbuf.makeStringAndClear() ) ); + buf.append( OStringToOUString( strbuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ) ); } static inline void ibufferQuoteConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings ) @@ -168,7 +168,7 @@ static inline void ibufferQuoteIdentifier( OUStringBuffer & buf, const OUString -1, Any()); } - buf.append( OUString::fromUtf8( cstr ) ); + buf.append( OStringToOUString( cstr, RTL_TEXTENCODING_UTF8 ) ); PQfreemem( cstr ); } @@ -553,11 +553,11 @@ void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUSt { case 1: *first = OUString(); - *second = OUString::fromUtf8( vec[0] ); + *second = OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 ); break; case 3: - *first = OUString::fromUtf8( vec[0] ); - *second = OUString::fromUtf8( vec[2] ); + *first = OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 ); + *second = OStringToOUString( vec[2], RTL_TEXTENCODING_UTF8 ); break; default: SAL_WARN("connectivity.postgresql", @@ -706,12 +706,15 @@ com::sun::star::uno::Sequence< sal_Int32 > parseIntArray( const OUString & str ) { sal_Int32 start = 0; IntVector vec; +// printf( ">%s<\n" , OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() ); for( sal_Int32 i = str.indexOf( ' ' ) ; i != -1 ; i = str.indexOf( ' ', start) ) { vec.push_back( (sal_Int32)rtl_ustr_toInt32( &str.pData->buffer[start], 10 ) ); +// printf( "found %d\n" , rtl_ustr_toInt32( &str.pData->buffer[start], 10 )); start = i + 1; } vec.push_back( (sal_Int32)rtl_ustr_toInt32( &str.pData->buffer[start], 10 ) ); +// printf( "found %d\n" , rtl_ustr_toInt32( &str.pData->buffer[start], 10 )); return sequence_of_vector(vec); } diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l index ae8a1b2db351..330a853c9d75 100644 --- a/connectivity/source/parse/sqlflex.l +++ b/connectivity/source/parse/sqlflex.l @@ -523,13 +523,13 @@ sal_Int32 gatherString(int delim, sal_Int32 nTyp) switch(nTyp) { case 0: - SQL_NEW_NODE(::rtl::OUString::fromUtf8(sBuffer.makeStringAndClear()), SQL_NODE_NAME); + SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME); return SQL_TOKEN_NAME; case 1: - SQL_NEW_NODE(::rtl::OUString::fromUtf8(sBuffer.makeStringAndClear()), SQL_NODE_STRING); + SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_STRING); return SQL_TOKEN_STRING; case 2: - SQL_NEW_NODE(::rtl::OUString::fromUtf8(sBuffer.makeStringAndClear()), SQL_NODE_ACCESS_DATE); + SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE); return SQL_TOKEN_ACCESS_DATE; } } diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index c767867cf47e..eb2abedff3d2 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1603,7 +1603,7 @@ OSQLParseNode::OSQLParseNode(const OString &_rNewValue, SQLNodeType eNewNodeType, sal_uInt32 nNewNodeID) :m_pParent(NULL) - ,m_aNodeValue(OUString::fromUtf8(_rNewValue)) + ,m_aNodeValue(OStringToOUString(_rNewValue,RTL_TEXTENCODING_UTF8)) ,m_eNodeType(eNewNodeType) ,m_nNodeID(nNewNodeID) { @@ -2301,7 +2301,7 @@ void OSQLParseNode::showParseTree( OUStringBuffer& _inout_rBuffer, sal_uInt32 nL case SQL_NODE_KEYWORD: _inout_rBuffer.appendAscii( "SQL_KEYWORD: " ); - _inout_rBuffer.append( OUString::fromUtf8( OSQLParser::TokenIDToStr( getTokenID() ) ) ); + _inout_rBuffer.append( OStringToOUString( OSQLParser::TokenIDToStr( getTokenID() ), RTL_TEXTENCODING_UTF8 ) ); _inout_rBuffer.append( '\n' ); break; @@ -2442,7 +2442,7 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, const SQLParseNodeParamet rString.appendAscii(" "); const OString sT = OSQLParser::TokenIDToStr(m_nNodeID, rParam.bInternational ? &rParam.m_rContext : NULL); - rString.append(OUString::fromUtf8(sT)); + rString.append(OStringToOUString(sT,RTL_TEXTENCODING_UTF8)); } break; case SQL_NODE_STRING: if (!rString.isEmpty()) diff --git a/connectivity/workben/iniParser/main.cxx b/connectivity/workben/iniParser/main.cxx index f19719d84bfd..e029b4acc900 100644 --- a/connectivity/workben/iniParser/main.cxx +++ b/connectivity/workben/iniParser/main.cxx @@ -102,7 +102,8 @@ public: struct ini_NameValue nameValue; nameValue.sName = OStringToOUString( line.copy(0,nIndex).trim(), RTL_TEXTENCODING_ASCII_US ); - nameValue.sValue = OUString::fromUtf8(line.copy(nIndex+1).trim()); + nameValue.sValue = OStringToOUString( + line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 ); aSection->lList.push_back(nameValue); diff --git a/cppcanvas/qa/extras/emfplus/emfplus.cxx b/cppcanvas/qa/extras/emfplus/emfplus.cxx index ac4a6f2f549d..70ee82795c9f 100644 --- a/cppcanvas/qa/extras/emfplus/emfplus.cxx +++ b/cppcanvas/qa/extras/emfplus/emfplus.cxx @@ -60,7 +60,7 @@ public: char* pEnv = getenv("CPPCANVAS_DEBUG_EMFPLUS_DUMP_TO"); if (pEnv) { - SvFileStream aStream(OUString::fromUtf8(pEnv), STREAM_WRITE); + SvFileStream aStream(OStringToOUString(pEnv, RTL_TEXTENCODING_UTF8), STREAM_WRITE); vcl::PNGWriter aWriter(aResultBitmap); CPPUNIT_ASSERT(aWriter.Write(aStream)); } diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 1a9b02e3b1c5..5399dab23768 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -381,7 +381,7 @@ void SvxPersonalizationTabPage::LoadDefaultImages() { OString aLine; aStream.ReadLine( aLine ); - OUString aPersonaSetting( OUString::fromUtf8( aLine ) ); + OUString aPersonaSetting( OStringToOUString( aLine, RTL_TEXTENCODING_UTF8 ) ); OUString aPreviewFile; sal_Int32 nNewIndex = aPersonaSetting.indexOf( ';', 0 ); if( nNewIndex < 0 ) diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 6e9774c72acc..c192947b4880 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1142,7 +1142,7 @@ namespace { ::com::sun::star::util::URL aURL; aURL.Complete = "vnd.sun.star.help://" + - _sModuleName + "/" + OUString::fromUtf8(sHelpId); + _sModuleName + "/" + OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8); OUString sAnchor; OUString sTempURL = aURL.Complete; diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 19abbe0e82bd..5bb7a8d7c443 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -3421,7 +3421,7 @@ void OQueryDesignView::fillFunctionInfo( const ::connectivity::OSQLParseNode* p OUString sFunctionName = pFunctionName->getTokenValue(); if ( sFunctionName.isEmpty() ) - sFunctionName = OUString::fromUtf8(OSQLParser::TokenIDToStr(pFunctionName->getTokenID())); + sFunctionName = OStringToOUString(OSQLParser::TokenIDToStr(pFunctionName->getTokenID()),RTL_TEXTENCODING_UTF8); nDataType = OSQLParser::getFunctionReturnType( sFunctionName diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 0c097fdea1ba..1f4c2eaae461 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -191,7 +191,8 @@ void OSelectionBrowseBox::initialize() for (size_t i = 0; i < sizeof (eFunctions) / sizeof (eFunctions[0]); ++i) { m_aFunctionStrings += ";"; - m_aFunctionStrings += OUString::fromUtf8(rContext.getIntlKeywordAscii(eFunctions[i])); + m_aFunctionStrings += OStringToOUString(rContext.getIntlKeywordAscii(eFunctions[i]), + RTL_TEXTENCODING_UTF8); } m_aFunctionStrings += ";"; m_aFunctionStrings += sGroup; diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 693406b0d711..3d78dee5f153 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -170,7 +170,7 @@ namespace dbaui { rString += "SQL_KEYWORD:"; OString sT = OSQLParser::TokenIDToStr(_pNode->getTokenID()); - rString += OUString::fromUtf8(sT); + rString += OStringToOUString(sT, RTL_TEXTENCODING_UTF8); break;} case SQL_NODE_COMPARISON: diff --git a/desktop/source/deployment/manager/dp_activepackages.cxx b/desktop/source/deployment/manager/dp_activepackages.cxx index 9768a2a5a358..42f6b4122bc7 100644 --- a/desktop/source/deployment/manager/dp_activepackages.cxx +++ b/desktop/source/deployment/manager/dp_activepackages.cxx @@ -176,7 +176,8 @@ ActivePackages::Entries ActivePackages::getEntries() const { RTL_TEXTENCODING_UTF8), decodeNewData(i->second))); } else { - OUString fn(OUString::fromUtf8(i->first)); + OUString fn( + OStringToOUString(i->first, RTL_TEXTENCODING_UTF8)); es.push_back( ::std::make_pair( ::dp_misc::generateLegacyIdentifier(fn), diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index e60f36b8311a..1529fb407ae5 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -253,7 +253,8 @@ void PackageManagerImpl::initActivationLayer( ::rtl::ByteSequence data = dp_misc::readFile(remFileContent); OString osData(reinterpret_cast<const sal_Char*>(data.getConstArray()), data.getLength()); - OUString sData = OUString::fromUtf8(osData); + OUString sData = OStringToOUString( + osData, RTL_TEXTENCODING_UTF8); if (!sData.equals(aUserName)) continue; } diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index e5fed36980d0..4af0fe373d02 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -755,7 +755,7 @@ void BackendImpl::PackageImpl::processPackage_( //we just add all other xcu/xcs files to the configmgr.ini instead of //rebuilding the directory structure. OUString url2( - OUString::fromUtf8(i->first)); + OStringToOUString(i->first, RTL_TEXTENCODING_UTF8)); if (url2 != url) { bool schema = i->second.equalsIgnoreAsciiCase( "vnd.sun.star.configuration-schema"); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d23adc16ae64..60c53fb16bf6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -158,7 +158,8 @@ static OUString getUString(const char* pString) if (pString == NULL) return OUString(); - return OUString::fromUtf8(OString(pString, strlen(pString))); + OString sString(pString, strlen(pString)); + return OStringToOUString(sString, RTL_TEXTENCODING_UTF8); } // Try to convert a relative URL to an absolute one diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index c64ba81b7565..c0d1979a42c4 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1957,7 +1957,7 @@ OUString XShapeDumper::dump(uno::Reference<drawing::XShapes> xPageShapes, bool b xmlTextWriterEndDocument( xmlWriter ); xmlFreeTextWriter( xmlWriter ); - return OUString::fromUtf8(aString.makeStringAndClear()); + return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); } OUString XShapeDumper::dump(uno::Reference<drawing::XShape> xPageShapes, bool bDumpInteropProperties) @@ -1981,7 +1981,7 @@ OUString XShapeDumper::dump(uno::Reference<drawing::XShape> xPageShapes, bool bD xmlTextWriterEndDocument( xmlWriter ); xmlFreeTextWriter( xmlWriter ); - return OUString::fromUtf8(aString.makeStringAndClear()); + return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/qa/lookuptree/lookuptree_test.cxx b/editeng/qa/lookuptree/lookuptree_test.cxx index ff47330be2b6..e1a35f41d0ef 100644 --- a/editeng/qa/lookuptree/lookuptree_test.cxx +++ b/editeng/qa/lookuptree/lookuptree_test.cxx @@ -98,12 +98,12 @@ void LookupTreeTest::testTrie() CPPUNIT_ASSERT_EQUAL( OUString("H31l0"), suggestions[0] ); suggestions.clear(); - trie.insert( OUString::fromUtf8( "H\xC3\xA4llo" ) ); + trie.insert( OStringToOUString( "H\xC3\xA4llo", RTL_TEXTENCODING_UTF8 ) ); trie.findSuggestions( OUString("H"), suggestions ); CPPUNIT_ASSERT_EQUAL( (size_t) 3, suggestions.size() ); CPPUNIT_ASSERT_EQUAL( OUString("H31l0"), suggestions[0] ); CPPUNIT_ASSERT_EQUAL( OUString("H1"), suggestions[1] ); - CPPUNIT_ASSERT_EQUAL( OUString::fromUtf8( "H\xC3\xA4llo" ), suggestions[2] ); + CPPUNIT_ASSERT_EQUAL( OStringToOUString( "H\xC3\xA4llo", RTL_TEXTENCODING_UTF8 ), suggestions[2] ); suggestions.clear(); trie.findSuggestions( OUString("H3"), suggestions ); @@ -111,9 +111,9 @@ void LookupTreeTest::testTrie() CPPUNIT_ASSERT_EQUAL( OUString("H31l0"), suggestions[0] ); suggestions.clear(); - trie.findSuggestions( OUString::fromUtf8("H\xC3\xA4"), suggestions ); + trie.findSuggestions( OStringToOUString("H\xC3\xA4", RTL_TEXTENCODING_UTF8), suggestions ); CPPUNIT_ASSERT_EQUAL( (size_t) 1, suggestions.size() ); - CPPUNIT_ASSERT_EQUAL( OUString::fromUtf8("H\xC3\xA4llo"), suggestions[0] ); + CPPUNIT_ASSERT_EQUAL( OStringToOUString("H\xC3\xA4llo", RTL_TEXTENCODING_UTF8), suggestions[0] ); suggestions.clear(); trie.findSuggestions( OUString(""), suggestions); diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index cbb952a78e9e..26a2512774e2 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -448,8 +448,8 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( if(xPropInfo->hasPropertyByName(uProp)) { OUString sId = OUString::createFromAscii( INET_HID_SCHEME ); - DBG_ASSERT( INetURLObject( OUString::fromUtf8( sHelpId ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); - sId += OUString::fromUtf8( sHelpId ); + DBG_ASSERT( INetURLObject( OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); + sId += OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ); xPropSet->setPropertyValue( uProp, makeAny( sId ) ); } diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx index 333a8bcd4c62..2acd02731973 100644 --- a/extensions/source/config/ldap/ldapaccess.cxx +++ b/extensions/source/config/ldap/ldapaccess.cxx @@ -228,7 +228,7 @@ void LdapConnection::initConnection() data->insert( LdapData::value_type( OStringToOUString(attr, RTL_TEXTENCODING_ASCII_US), - OUString::fromUtf8(*values))); + OStringToOUString(*values, RTL_TEXTENCODING_UTF8))); ldap_value_free(values); } attr = ldap_next_attribute(mConnection, result.msg, ptr); @@ -284,7 +284,7 @@ void LdapConnection::initConnection() #else sal_Char *charsDn = ldap_get_dn(mConnection, entry) ; - userDn = OUString::fromUtf8( charsDn ); + userDn = OStringToOUString( charsDn, RTL_TEXTENCODING_UTF8 ); ldap_memfree(charsDn) ; #endif } diff --git a/extensions/source/plugin/aqua/macmgr.mm b/extensions/source/plugin/aqua/macmgr.mm index c92f4fef92b4..878571a9377e 100644 --- a/extensions/source/plugin/aqua/macmgr.mm +++ b/extensions/source/plugin/aqua/macmgr.mm @@ -283,7 +283,7 @@ static rtl::OUString GetNextPluginStringFromHandle(Handle h, short *index) rtl::OStringBuffer aBuf( nLen ); aBuf.append( pPascalBytes+1, nLen ); *index += nLen + 1; - return rtl::OUString::fromUtf8( aBuf.makeStringAndClear() ); + return rtl::OStringToOUString( aBuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); } static int parseMimeResource( CFBundleRef i_xBundle, diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index fa6f4b0f2ace..34a2dd02f286 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -809,7 +809,7 @@ namespace pcr const EventDescription& rEvent = impl_getEventForName_throw( _rPropertyName ); aDescriptor.DisplayName = rEvent.sDisplayName; aDescriptor.HelpURL = HelpIdUrl::getHelpURL( rEvent.sHelpId ); - aDescriptor.PrimaryButtonId = OUString::fromUtf8(rEvent.sUniqueBrowseId); + aDescriptor.PrimaryButtonId = OStringToOUString(rEvent.sUniqueBrowseId, RTL_TEXTENCODING_UTF8); aDescriptor.HasPrimaryButton = sal_True; aDescriptor.Category = "Events"; return aDescriptor; diff --git a/extensions/source/propctrlr/pcrcommon.cxx b/extensions/source/propctrlr/pcrcommon.cxx index 0cd148e722ca..9292a029a4e8 100644 --- a/extensions/source/propctrlr/pcrcommon.cxx +++ b/extensions/source/propctrlr/pcrcommon.cxx @@ -49,7 +49,7 @@ namespace pcr OUString HelpIdUrl::getHelpURL( const OString& sHelpId ) { OUStringBuffer aBuffer; - OUString aTmp( OUString::fromUtf8(sHelpId) ); + OUString aTmp( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8) ); INetURLObject aHID( aTmp ); if ( aHID.GetProtocol() == INET_PROT_NOT_VALID ) aBuffer.appendAscii( INET_HID_SCHEME ); diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx index 647709e84ce0..ac0c4b7688e1 100644 --- a/extensions/source/update/check/download.cxx +++ b/extensions/source/update/check/download.cxx @@ -77,7 +77,7 @@ static void openFile( OutData& out ) sal_Int32 nIndex = aURL.lastIndexOf('/'); if( nIndex > 0 ) { - out.File = out.DestinationDir + OUString::fromUtf8(aURL.copy(nIndex)); + out.File = out.DestinationDir + OStringToOUString(aURL.copy(nIndex), RTL_TEXTENCODING_UTF8); oslFileError rc; @@ -329,7 +329,7 @@ bool curl_run(const OUString& rURL, OutData& out, const OString& aProxyHost, sal } } if ( !ret ) - out.Handler->downloadStalled( OUString::fromUtf8(aMessage) ); + out.Handler->downloadStalled( OStringToOUString(aMessage, RTL_TEXTENCODING_UTF8) ); } curl_easy_cleanup(pCURL); diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index b01880ea704f..6d2efbad1713 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2684,7 +2684,8 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, OString sComment = pA->GetComment(); if (!sComment.isEmpty()) { - sType.append(OUString::fromUtf8(sComment)); + sType.append(OStringToOUString( + sComment, RTL_TEXTENCODING_UTF8)); } if (sComment.equalsIgnoreAsciiCase("FIELD_SEQ_BEGIN")) { diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx index 691036f16967..a6f0089790e5 100644 --- a/filter/source/xmlfilterdetect/filterdetect.cxx +++ b/filter/source/xmlfilterdetect/filterdetect.cxx @@ -115,7 +115,7 @@ OUString SAL_CALL FilterDetect::detect( com::sun::star::uno::Sequence< com::sun: } if ( nUniPos == 3 || ( nUniPos == 0 && !bTryUtf16 ) ) // UTF-8 or non-Unicode - resultString = OUString::fromUtf8( read_uInt8s_ToOString( *pInStream, nSize ) ); + resultString = OStringToOUString( read_uInt8s_ToOString( *pInStream, nSize ), RTL_TEXTENCODING_UTF8 ); else if ( nUniPos == 2 || bTryUtf16 ) // UTF-16 resultString = read_uInt16s_ToOUString( *pInStream, nSize ); diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx index 0a2b5a0d733c..3c497e5e86ff 100644 --- a/forms/source/xforms/submission/submission_get.cxx +++ b/forms/source/xforms/submission/submission_get.cxx @@ -85,7 +85,7 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const css::uno::Reference< aUTF8QueryURL.append('?'); aUTF8QueryURL.append(aQueryString.makeStringAndClear()); } - OUString aQueryURL = OUString::fromUtf8(aUTF8QueryURL.makeStringAndClear()); + OUString aQueryURL = OStringToOUString(aUTF8QueryURL.makeStringAndClear(), RTL_TEXTENCODING_UTF8); ucbhelper::Content aContent(aQueryURL, aEnvironment, m_xContext); css::uno::Reference< XOutputStream > aPipe( css::io::Pipe::create(m_xContext), UNO_QUERY_THROW ); aContent.openStream(aPipe); diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index c45f3c947fd6..486200822d9f 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -203,7 +203,7 @@ namespace svt aHelpId = static_cast< SvtFileView* >( _pControl )->GetHelpId( ); OUString sHelpURL; - OUString aTmp( OUString::fromUtf8( aHelpId ) ); + OUString aTmp( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ) ); INetURLObject aHID( aTmp ); if ( aHID.GetProtocol() == INET_PROT_NOT_VALID ) sHelpURL = OUString::createFromAscii( INET_HID_SCHEME ); diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx index f88c620aede1..1599447eef8c 100644 --- a/framework/source/helper/persistentwindowstate.cxx +++ b/framework/source/helper/persistentwindowstate.cxx @@ -239,8 +239,9 @@ OUString PersistentWindowState::implst_getWindowStateFromWindow(const css::uno:: { sal_uLong nMask = WINDOWSTATE_MASK_ALL; nMask &= ~(WINDOWSTATE_MASK_MINIMIZED); - sWindowState = OUString::fromUtf8( - static_cast<SystemWindow*>(pWindow)->GetWindowState(nMask)); + sWindowState = OStringToOUString( + static_cast<SystemWindow*>(pWindow)->GetWindowState(nMask), + RTL_TEXTENCODING_UTF8); } // <- SOLAR SAFE ------------------------ } diff --git a/framework/source/inc/pattern/window.hxx b/framework/source/inc/pattern/window.hxx index bb5e73581a83..7ff8d45dfaa7 100644 --- a/framework/source/inc/pattern/window.hxx +++ b/framework/source/inc/pattern/window.hxx @@ -62,7 +62,7 @@ static OUString getWindowState(const css::uno::Reference< css::awt::XWindow >& x } // <- SOLAR SAFE ---------------------------- - return OUString::fromUtf8(sWindowState); + return OStringToOUString(sWindowState,RTL_TEXTENCODING_UTF8); } static void setWindowState(const css::uno::Reference< css::awt::XWindow >& xWindow , diff --git a/framework/source/layoutmanager/helpers.cxx b/framework/source/layoutmanager/helpers.cxx index 55e0dcfa408b..ca623fff4730 100644 --- a/framework/source/layoutmanager/helpers.cxx +++ b/framework/source/layoutmanager/helpers.cxx @@ -88,7 +88,7 @@ OUString retrieveToolbarNameFromHelpURL( vcl::Window* pWindow ) ToolBox* pToolBox = dynamic_cast<ToolBox *>( pWindow ); if ( pToolBox ) { - aToolbarName = OUString::fromUtf8( pToolBox->GetHelpId() ); + aToolbarName = OStringToOUString( pToolBox->GetHelpId(), RTL_TEXTENCODING_UTF8 ); sal_Int32 i = aToolbarName.lastIndexOf( ':' ); if ( !aToolbarName.isEmpty() && ( i > 0 ) && (( i + 1 ) < aToolbarName.getLength() )) aToolbarName = aToolbarName.copy( i+1 ); // Remove ".HelpId:" protocol from toolbar name diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index de9294df51fc..37e1893c52cd 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -1493,7 +1493,7 @@ void LanguageTag::convertFromRtlLocale() myLtError aError; theDataRef::get().incRef(); mpImplLangtag = lt_tag_convert_from_locale( aStr.getStr(), &aError.p); - maBcp47 = OUString::fromUtf8( lt_tag_get_string( mpImplLangtag)); + maBcp47 = OStringToOUString( lt_tag_get_string( mpImplLangtag), RTL_TEXTENCODING_UTF8); mbInitializedBcp47 = true; #else mnLangID = MsLangId::convertUnxByteStringToLanguage( aStr); diff --git a/idlc/source/astconstant.cxx b/idlc/source/astconstant.cxx index 7b9797981e61..b37ff90e6b73 100644 --- a/idlc/source/astconstant.cxx +++ b/idlc/source/astconstant.cxx @@ -109,13 +109,13 @@ bool AstConstant::dumpBlob( OUString type; if ( getNodeType() != NT_enum_val ) { - type = OUString::fromUtf8(exprTypeToString(getConstValueType())); + type = OStringToOUString(exprTypeToString(getConstValueType()), RTL_TEXTENCODING_UTF8); } rBlob.setFieldData( index, getDocumentation(), OUString(), RT_ACCESS_CONST | (published ? RT_ACCESS_PUBLISHED : 0), - OUString::fromUtf8(name), type, aConst); + OStringToOUString(name, RTL_TEXTENCODING_UTF8), type, aConst); return true; } diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index 01ca504aaefd..c9a2c473f3fa 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -41,7 +41,7 @@ bool AstModule::dump(RegistryKey& rKey) localKey = rKey; }else { - if (rKey.createKey( OUString::fromUtf8(getFullName()), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -62,7 +62,7 @@ bool AstModule::dump(RegistryKey& rKey) m_bPublished ? TYPEREG_VERSION_1 : TYPEREG_VERSION_0, getDocumentation(), emptyStr, typeClass, m_bPublished, - OUString::fromUtf8(getRelativName()), 0, + OStringToOUString(getRelativName(), RTL_TEXTENCODING_UTF8), 0, nConst, 0, 0); DeclList::const_iterator iter = getIteratorBegin(); @@ -102,7 +102,7 @@ bool AstModule::dump(RegistryKey& rKey) typereg::Writer aBlob( m_bPublished ? TYPEREG_VERSION_1 : TYPEREG_VERSION_0, getDocumentation(), emptyStr, typeClass, m_bPublished, - OUString::fromUtf8(getRelativName()), 0, 0, 0, + OStringToOUString(getRelativName(), RTL_TEXTENCODING_UTF8), 0, 0, 0, 0); sal_uInt32 aBlobSize; @@ -131,7 +131,7 @@ bool AstTypeDef::dump(RegistryKey& rKey) { OUString emptyStr; RegistryKey localKey; - if (rKey.createKey( OUString::fromUtf8(getFullName()), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -142,10 +142,11 @@ bool AstTypeDef::dump(RegistryKey& rKey) typereg::Writer aBlob( m_bPublished ? TYPEREG_VERSION_1 : TYPEREG_VERSION_0, getDocumentation(), emptyStr, RT_TYPE_TYPEDEF, m_bPublished, - OUString::fromUtf8(getRelativName()), 1, 0, 0, 0); + OStringToOUString(getRelativName(), RTL_TEXTENCODING_UTF8), 1, 0, 0, 0); aBlob.setSuperTypeName( 0, - OUString::fromUtf8(getBaseType()->getRelativName())); + OStringToOUString( + getBaseType()->getRelativName(), RTL_TEXTENCODING_UTF8)); sal_uInt32 aBlobSize; void const * pBlob = aBlob.getBlob(&aBlobSize); @@ -216,7 +217,7 @@ bool AstService::dump(RegistryKey& rKey) } RegistryKey localKey; if (rKey.createKey( - OUString::fromUtf8(getFullName()), + OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8), localKey)) { fprintf( stderr, "%s: warning, could not create key '%s' in '%s'\n", @@ -230,12 +231,12 @@ bool AstService::dump(RegistryKey& rKey) version, getDocumentation(), emptyStr, getNodeType() == NT_singleton ? RT_TYPE_SINGLETON : RT_TYPE_SERVICE, m_bPublished, - OUString::fromUtf8(getRelativName()), + OStringToOUString(getRelativName(), RTL_TEXTENCODING_UTF8), superName.isEmpty() ? 0 : 1, properties, constructors, references); if (!superName.isEmpty()) { writer.setSuperTypeName( - 0, OUString::fromUtf8(superName)); + 0, OStringToOUString(superName, RTL_TEXTENCODING_UTF8)); } sal_uInt16 constructorIndex = 0; sal_uInt16 propertyIndex = 0; @@ -257,7 +258,8 @@ bool AstService::dump(RegistryKey& rKey) writer.setReferenceData( referenceIndex++, decl->getDocumentation(), RT_REF_SUPPORTS, (decl->isOptional() ? RT_ACCESS_OPTIONAL : RT_ACCESS_INVALID), - OUString::fromUtf8( decl->getRealInterface()->getRelativName() )); + OStringToOUString( decl->getRealInterface()->getRelativName(), + RTL_TEXTENCODING_UTF8)); break; } @@ -267,7 +269,8 @@ bool AstService::dump(RegistryKey& rKey) AstServiceMember * decl = static_cast<AstServiceMember *>(*i); writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RT_REF_EXPORTS, (decl->isOptional() ? RT_ACCESS_OPTIONAL : RT_ACCESS_INVALID), - OUString::fromUtf8(decl->getRealService()->getRelativName())); + OStringToOUString(decl->getRealService()->getRelativName(), + RTL_TEXTENCODING_UTF8)); } break; @@ -276,7 +279,8 @@ bool AstService::dump(RegistryKey& rKey) AstObserves * decl = static_cast<AstObserves *>(*i); writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RT_REF_OBSERVES, RT_ACCESS_INVALID, - OUString::fromUtf8( decl->getRealInterface()->getRelativName())); + OStringToOUString( decl->getRealInterface()->getRelativName(), + RTL_TEXTENCODING_UTF8)); break; } @@ -285,7 +289,8 @@ bool AstService::dump(RegistryKey& rKey) AstNeeds * decl = static_cast<AstNeeds *>(*i); writer.setReferenceData( referenceIndex++, decl->getDocumentation(), RT_REF_NEEDS, RT_ACCESS_INVALID, - OUString::fromUtf8( decl->getRealService()->getRelativName())); + OStringToOUString( decl->getRealService()->getRelativName(), + RTL_TEXTENCODING_UTF8)); break; } @@ -362,10 +367,10 @@ bool AstAttribute::dumpBlob( accessMode |= RT_ACCESS_REMOVABLE; } - OUString name(OUString::fromUtf8(getLocalName())); + OUString name(OStringToOUString(getLocalName(), RTL_TEXTENCODING_UTF8)); rBlob.setFieldData( index, getDocumentation(), OUString(), accessMode, name, - OUString::fromUtf8(getType()->getRelativName()), + OStringToOUString(getType()->getRelativName(), RTL_TEXTENCODING_UTF8), RTConstValue()); dumpExceptions( rBlob, m_getDocumentation, m_getExceptions, RT_MODE_ATTRIBUTE_GET, @@ -388,7 +393,7 @@ void AstAttribute::dumpExceptions( // AstInterface::dump: writer.setMethodData( idx, documentation, flags, - OUString::fromUtf8(getLocalName()), + OStringToOUString(getLocalName(), RTL_TEXTENCODING_UTF8), OUString("void"), 0, static_cast< sal_uInt16 >(exceptions.size())); sal_uInt16 exceptionIndex = 0; @@ -397,7 +402,8 @@ void AstAttribute::dumpExceptions( { writer.setMethodExceptionTypeName( idx, exceptionIndex++, - OUString::fromUtf8((*i)->getRelativName())); + OStringToOUString( + (*i)->getRelativName(), RTL_TEXTENCODING_UTF8)); } } } diff --git a/idlc/source/astenum.cxx b/idlc/source/astenum.cxx index 7332f1c76d32..1f330b18f780 100644 --- a/idlc/source/astenum.cxx +++ b/idlc/source/astenum.cxx @@ -60,7 +60,7 @@ AstConstant* AstEnum::checkValue(AstExpression* pExpr) bool AstEnum::dump(RegistryKey& rKey) { RegistryKey localKey; - if (rKey.createKey( OUString::fromUtf8(getFullName()), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -75,7 +75,7 @@ bool AstEnum::dump(RegistryKey& rKey) typereg::Writer aBlob( m_bPublished ? TYPEREG_VERSION_1 : TYPEREG_VERSION_0, getDocumentation(), emptyStr, RT_TYPE_ENUM, m_bPublished, - OUString::fromUtf8(getRelativName()), 0, + OStringToOUString(getRelativName(), RTL_TEXTENCODING_UTF8), 0, nConst, 0, 0); DeclList::const_iterator iter = getIteratorBegin(); diff --git a/idlc/source/astinterface.cxx b/idlc/source/astinterface.cxx index 4f5affb721af..8bd8fb7cbfd9 100644 --- a/idlc/source/astinterface.cxx +++ b/idlc/source/astinterface.cxx @@ -103,7 +103,7 @@ bool AstInterface::dump(RegistryKey& rKey) return true; RegistryKey localKey; - if (rKey.createKey( OUString::fromUtf8(getFullName()), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -194,7 +194,7 @@ bool AstInterface::dump(RegistryKey& rKey) OUString emptyStr; typereg::Writer aBlob( version, getDocumentation(), emptyStr, RT_TYPE_INTERFACE, m_bPublished, - OUString::fromUtf8(getRelativName()), nBaseTypes, + OStringToOUString(getRelativName(), RTL_TEXTENCODING_UTF8), nBaseTypes, nAttributes, nMethods, nReferences); sal_uInt16 superTypeIndex = 0; @@ -206,11 +206,15 @@ bool AstInterface::dump(RegistryKey& rKey) aBlob.setReferenceData( referenceIndex++, i->getDocumentation(), RT_REF_SUPPORTS, RT_ACCESS_OPTIONAL, - OUString::fromUtf8(i->getInterface()->getRelativName())); + OStringToOUString( + i->getInterface()->getRelativName(), + RTL_TEXTENCODING_UTF8)); } else { aBlob.setSuperTypeName( superTypeIndex++, - OUString::fromUtf8(i->getInterface()->getRelativName())); + OStringToOUString( + i->getInterface()->getRelativName(), + RTL_TEXTENCODING_UTF8)); } } diff --git a/idlc/source/astoperation.cxx b/idlc/source/astoperation.cxx index bcc23ec14907..5a38c8acbc20 100644 --- a/idlc/source/astoperation.cxx +++ b/idlc/source/astoperation.cxx @@ -48,11 +48,12 @@ bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) if (m_pReturnType == 0) { returnTypeName = "void"; } else { - returnTypeName = OUString::fromUtf8(m_pReturnType->getRelativName()); + returnTypeName = OStringToOUString( + m_pReturnType->getRelativName(), RTL_TEXTENCODING_UTF8); } rBlob.setMethodData( index, getDocumentation(), methodMode, - OUString::fromUtf8(getLocalName()), + OStringToOUString(getLocalName(), RTL_TEXTENCODING_UTF8), returnTypeName, nParam, nExcep); if ( nParam ) @@ -90,8 +91,11 @@ bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) rBlob.setMethodParameterData( index, paramIndex++, paramMode, - OUString::fromUtf8(pDecl->getLocalName()), - OUString::fromUtf8(pParam->getType()->getRelativName())); + OStringToOUString( + pDecl->getLocalName(), RTL_TEXTENCODING_UTF8), + OStringToOUString( + pParam->getType()->getRelativName(), + RTL_TEXTENCODING_UTF8)); } ++iter; } @@ -106,7 +110,8 @@ bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) { rBlob.setMethodExceptionTypeName( index, exceptIndex++, - OUString::fromUtf8((*iter)->getRelativName())); + OStringToOUString( + (*iter)->getRelativName(), RTL_TEXTENCODING_UTF8)); ++iter; } } diff --git a/idlc/source/aststruct.cxx b/idlc/source/aststruct.cxx index b8f0a2e3a264..482ee73dadfa 100644 --- a/idlc/source/aststruct.cxx +++ b/idlc/source/aststruct.cxx @@ -78,7 +78,7 @@ bool AstStruct::isType() const { bool AstStruct::dump(RegistryKey& rKey) { RegistryKey localKey; - if (rKey.createKey( OUString::fromUtf8(getFullName()), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -107,13 +107,14 @@ bool AstStruct::dump(RegistryKey& rKey) (m_typeParameters.empty() && !m_bPublished ? TYPEREG_VERSION_0 : TYPEREG_VERSION_1), getDocumentation(), emptyStr, typeClass, m_bPublished, - OUString::fromUtf8(getRelativName()), + OStringToOUString(getRelativName(), RTL_TEXTENCODING_UTF8), m_pBaseType == 0 ? 0 : 1, nMember, 0, static_cast< sal_uInt16 >(m_typeParameters.size())); if (m_pBaseType != 0) { aBlob.setSuperTypeName( 0, - OUString::fromUtf8(m_pBaseType->getRelativName())); + OStringToOUString( + m_pBaseType->getRelativName(), RTL_TEXTENCODING_UTF8)); } if ( nMember > 0 ) @@ -139,8 +140,9 @@ bool AstStruct::dump(RegistryKey& rKey) } aBlob.setFieldData( index++, pMember->getDocumentation(), emptyStr, flags, - OUString::fromUtf8(pMember->getLocalName()), - OUString::fromUtf8(typeName), + OStringToOUString( + pMember->getLocalName(), RTL_TEXTENCODING_UTF8), + OStringToOUString(typeName, RTL_TEXTENCODING_UTF8), RTConstValue()); } ++iter; @@ -153,7 +155,8 @@ bool AstStruct::dump(RegistryKey& rKey) { aBlob.setReferenceData( index++, emptyStr, RT_REF_TYPE_PARAMETER, RT_ACCESS_INVALID, - OUString::fromUtf8((*i)->getLocalName())); + OStringToOUString( + (*i)->getLocalName(), RTL_TEXTENCODING_UTF8)); } sal_uInt32 aBlobSize; diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx index b5ed727b9e5a..75a71dfa6a6b 100644 --- a/idlc/source/idlc.cxx +++ b/idlc/source/idlc.cxx @@ -272,7 +272,7 @@ OUString Idlc::processDocumentation() if (m_bIsDocValid) { OString raw(getDocumentation()); if (m_bGenerateDoc) { - doc = OUString::fromUtf8(raw); + doc = OStringToOUString(raw, RTL_TEXTENCODING_UTF8); } else if (raw.indexOf("@deprecated") != -1) { //TODO: this check is somewhat crude doc = "@deprecated"; diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx index 53fd802fc5f6..695db41d2097 100644 --- a/idlc/source/idlccompile.cxx +++ b/idlc/source/idlccompile.cxx @@ -258,8 +258,9 @@ sal_Int32 compileFile(const OString * pathname) { cppArgs.append("-I"); cppArgs.append(filePath); - lCppArgs.push_back(OUString::fromUtf8( - cppArgs.makeStringAndClear().replace('\\', '/'))); + lCppArgs.push_back(OStringToOUString( + cppArgs.makeStringAndClear().replace('\\', '/'), + RTL_TEXTENCODING_UTF8)); } } @@ -271,7 +272,7 @@ sal_Int32 compileFile(const OString * pathname) { token = dOpt.getToken( 0, ' ', nIndex ); if (token.getLength()) - lCppArgs.push_back(OUString::fromUtf8("-D" + token)); + lCppArgs.push_back(OStringToOUString("-D" + token, RTL_TEXTENCODING_UTF8)); } while( nIndex != -1 ); } @@ -283,17 +284,17 @@ sal_Int32 compileFile(const OString * pathname) { token = incOpt.getToken( 0, ' ', nIndex ); if (token.getLength()) - lCppArgs.push_back(OUString::fromUtf8("-I" + token)); + lCppArgs.push_back(OStringToOUString("-I" + token, RTL_TEXTENCODING_UTF8)); } while( nIndex != -1 ); } lCppArgs.push_back(OUString("-o")); cppArgs.append(preprocFile); - lCppArgs.push_back(OUString::fromUtf8(cppArgs.makeStringAndClear())); + lCppArgs.push_back(OStringToOUString(cppArgs.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); cppArgs.append(tmpFile); - lCppArgs.push_back(OUString::fromUtf8(cppArgs.makeStringAndClear())); + lCppArgs.push_back(OStringToOUString(cppArgs.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); OUString cpp; OUString startDir; diff --git a/idlc/source/idlcproduce.cxx b/idlc/source/idlcproduce.cxx index d7dd9f1c7946..35a3a20a5517 100644 --- a/idlc/source/idlcproduce.cxx +++ b/idlc/source/idlcproduce.cxx @@ -119,7 +119,7 @@ static bool cleanPath() void removeIfExists(const OString& pathname) { - osl::File::remove(OUString::fromUtf8(pathname)); + osl::File::remove(OStringToOUString(pathname, RTL_TEXTENCODING_UTF8)); } sal_Int32 SAL_CALL @@ -154,7 +154,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile) OString urlRegTmpName = convertToFileUrl(regTmpName); Registry regFile; - if ( regFile.create(OUString::fromUtf8(urlRegTmpName)) != REG_NO_ERROR ) + if ( regFile.create(OStringToOUString(urlRegTmpName, RTL_TEXTENCODING_UTF8)) != REG_NO_ERROR ) { fprintf(stderr, "%s: could not create registry file '%s'\n", pOptions->getProgramName().getStr(), regTmpName.getStr()); @@ -184,7 +184,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile) fprintf(stderr, "%s: could not close registry file '%s'\n", pOptions->getProgramName().getStr(), regFileName.getStr()); } - regFile.destroy(OUString::fromUtf8(regFileName)); + regFile.destroy(OStringToOUString(regFileName, RTL_TEXTENCODING_UTF8)); removeIfExists(regFileName); cleanPath(); return 1; diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx index cf6e46de9150..dfdb9bd291a9 100644 --- a/idlc/source/options.cxx +++ b/idlc/source/options.cxx @@ -197,7 +197,7 @@ bool Options::setOption(char const * option, std::string const & rArg) with error. */ OString convertIncPathtoShortWindowsPath(const OString& incPath) { - OUString path = OUString::fromUtf8(incPath); + OUString path = OStringToOUString(incPath, RTL_TEXTENCODING_UTF8); std::vector<sal_Unicode> vec(path.getLength() + 1); //GetShortPathNameW only works if the file can be found! diff --git a/idlc/source/parser.y b/idlc/source/parser.y index a9267ac17ad5..400778026c9c 100644 --- a/idlc/source/parser.y +++ b/idlc/source/parser.y @@ -61,6 +61,7 @@ using ::rtl::OUString; using ::rtl::OString; +using ::rtl::OStringToOUString; using ::rtl::OStringBuffer; extern int yylex(void); @@ -896,7 +897,8 @@ attribute_get_raises: IDL_GET raises ';' { $$.documentation = new rtl::OUString( - rtl::OUString::fromUtf8(idlc()->getDocumentation())); + rtl::OStringToOUString( + idlc()->getDocumentation(), RTL_TEXTENCODING_UTF8)); $$.exceptions = $2; } ; @@ -918,7 +920,8 @@ attribute_set_raises: raises ';' { $$.documentation = new rtl::OUString( - rtl::OUString::fromUtf8(idlc()->getDocumentation())); + rtl::OStringToOUString( + idlc()->getDocumentation(), RTL_TEXTENCODING_UTF8)); $$.exceptions = $3; } ; @@ -1200,7 +1203,8 @@ interface_inheritance_decl: } else { addInheritedInterface( ifc, *$4, $1, - rtl::OUString::fromUtf8(idlc()->getDocumentation())); + rtl::OStringToOUString( + idlc()->getDocumentation(), RTL_TEXTENCODING_UTF8)); } delete $4; } diff --git a/include/codemaker/typemanager.hxx b/include/codemaker/typemanager.hxx index be67e1ab17bc..d9bb4d83d5af 100644 --- a/include/codemaker/typemanager.hxx +++ b/include/codemaker/typemanager.hxx @@ -68,7 +68,7 @@ inline OString u2b(OUString const & s) { } inline OUString b2u(OString const & s) { - return OUString::fromUtf8(s); + return OStringToOUString(s, RTL_TEXTENCODING_UTF8); } #endif diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx index 48143b3fe100..84dcbb5d0eca 100644 --- a/jvmfwk/source/fwkbase.cxx +++ b/jvmfwk/source/fwkbase.cxx @@ -142,7 +142,9 @@ VersionInfo VendorSettings::getVersionInformation(const OUString & sVendor) sVersion = xmlNodeListGetString( m_xmlDocVendorSettings, xPathObjectMin->nodesetval->nodeTab[0]->xmlChildrenNode, 1); - aVersionInfo.sMinVersion = OUString::fromUtf8(OString((sal_Char*)(xmlChar*) sVersion)); + OString osVersion((sal_Char*)(xmlChar*) sVersion); + aVersionInfo.sMinVersion = OStringToOUString( + osVersion, RTL_TEXTENCODING_UTF8); } //Get maxVersion @@ -162,7 +164,9 @@ VersionInfo VendorSettings::getVersionInformation(const OUString & sVendor) sVersion = xmlNodeListGetString( m_xmlDocVendorSettings, xPathObjectMax->nodesetval->nodeTab[0]->xmlChildrenNode, 1); - aVersionInfo.sMaxVersion = OUString::fromUtf8(OString((sal_Char*) (xmlChar*) sVersion)); + OString osVersion((sal_Char*) (xmlChar*) sVersion); + aVersionInfo.sMaxVersion = OStringToOUString( + osVersion, RTL_TEXTENCODING_UTF8); } //Get excludeVersions @@ -184,7 +188,9 @@ VersionInfo VendorSettings::getVersionInformation(const OUString & sVendor) CXmlCharPtr sVersion; sVersion = xmlNodeListGetString( m_xmlDocVendorSettings, cur->xmlChildrenNode, 1); - OUString usVersion = OUString::fromUtf8(OString((sal_Char*)(xmlChar*) sVersion)); + OString osVersion((sal_Char*)(xmlChar*) sVersion); + OUString usVersion = OStringToOUString( + osVersion, RTL_TEXTENCODING_UTF8); aVersionInfo.addExcludeVersion(usVersion); } } diff --git a/jvmfwk/source/libxmlutil.cxx b/jvmfwk/source/libxmlutil.cxx index c7ac695a041e..838c73590102 100644 --- a/jvmfwk/source/libxmlutil.cxx +++ b/jvmfwk/source/libxmlutil.cxx @@ -130,7 +130,7 @@ CXmlCharPtr::operator OUString() if (_object != NULL) { OString aOStr((sal_Char*)_object); - ret = OUString::fromUtf8(aOStr); + ret = OStringToOUString(aOStr, RTL_TEXTENCODING_UTF8); } return ret; } diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 5c3f134904ab..5546e9eb5984 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -126,7 +126,8 @@ void InitPoFile( //Create directory for po file { OUString outDir = - OUString::fromUtf8(rPotDir.copy(0,rPotDir.lastIndexOf('/'))); + OStringToOUString( + rPotDir.copy(0,rPotDir.lastIndexOf('/')), RTL_TEXTENCODING_UTF8); OUString outDirUrl; if (osl::FileBase::getFileURLFromSystemPath(outDir, outDirUrl) != osl::FileBase::E_None) @@ -406,7 +407,8 @@ void handleDirectory( //Remove empty pot directory OUString sPoPath = - OUString::fromUtf8(rPotDir.copy(0,rPotDir.lastIndexOf('/'))); + OStringToOUString( + rPotDir.copy(0,rPotDir.lastIndexOf('/')), RTL_TEXTENCODING_UTF8); OUString sPoUrl; if (osl::FileBase::getFileURLFromSystemPath(sPoPath, sPoUrl) != osl::FileBase::E_None) diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx index e75581d34d6d..a1836caf0a7b 100644 --- a/l10ntools/source/pocheck.cxx +++ b/l10ntools/source/pocheck.cxx @@ -121,7 +121,7 @@ static void checkStyleNames(const OString& aLanguage) aPoInput.close(); aPoOutput.close(); OUString aPoPathURL; - osl::FileBase::getFileURLFromSystemPath(OUString::fromUtf8(aPoPath), aPoPathURL); + osl::FileBase::getFileURLFromSystemPath(OStringToOUString(aPoPath, RTL_TEXTENCODING_UTF8), aPoPathURL); if( bAnyError ) osl::File::move(aPoPathURL + ".new", aPoPathURL); else @@ -343,7 +343,7 @@ static void checkFunctionNames(const OString& aLanguage) } aPoInput.close(); aPoOutput.close(); - osl::FileBase::getFileURLFromSystemPath(OUString::fromUtf8(aPoPaths[i]), aPoPathURL); + osl::FileBase::getFileURLFromSystemPath(OStringToOUString(aPoPaths[i], RTL_TEXTENCODING_UTF8), aPoPathURL); if( bAnyError ) osl::File::move(aPoPathURL + ".new", aPoPathURL); else @@ -395,7 +395,7 @@ static void checkVerticalBar(const OString& aLanguage) aPoInput.close(); aPoOutput.close(); OUString aPoPathURL; - osl::FileBase::getFileURLFromSystemPath(OUString::fromUtf8(aPoPath), aPoPathURL); + osl::FileBase::getFileURLFromSystemPath(OStringToOUString(aPoPath, RTL_TEXTENCODING_UTF8), aPoPathURL); if( bError ) osl::File::move(aPoPathURL + ".new", aPoPathURL); else @@ -444,7 +444,7 @@ static void checkMathSymbolNames(const OString& aLanguage) aPoInput.close(); aPoOutput.close(); OUString aPoPathURL; - osl::FileBase::getFileURLFromSystemPath(OUString::fromUtf8(aPoPath), aPoPathURL); + osl::FileBase::getFileURLFromSystemPath(OStringToOUString(aPoPath, RTL_TEXTENCODING_UTF8), aPoPathURL); if( bError ) osl::File::move(aPoPathURL + ".new", aPoPathURL); else diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx index 25a7b15d6465..a41cd154d4c3 100644 --- a/l10ntools/source/propmerge.cxx +++ b/l10ntools/source/propmerge.cxx @@ -61,7 +61,8 @@ namespace //Escape unicode characters static void lcl_PrintJavaStyle( const OString& rText, std::ofstream &rOfstream ) { - const OUString sTemp = OUString::fromUtf8( rText ); + const OUString sTemp = + OStringToOUString( rText, RTL_TEXTENCODING_UTF8 ); for ( sal_Int32 nIndex = 0; nIndex < sTemp.getLength(); ++nIndex ) { sal_Unicode cUniCode = sTemp[nIndex]; diff --git a/l10ntools/source/uimerge.cxx b/l10ntools/source/uimerge.cxx index 34612bffdb29..5954ab17c8d3 100644 --- a/l10ntools/source/uimerge.cxx +++ b/l10ntools/source/uimerge.cxx @@ -135,7 +135,7 @@ bool Merge( { bool bDestinationIsDir(false); - const OUString aDestDir(OUString::fromUtf8(rDestinationDir)); + const OUString aDestDir(OStringToOUString(rDestinationDir, RTL_TEXTENCODING_UTF8)); OUString aDestDirUrl; if (osl::FileBase::E_None == osl::FileBase::getFileURLFromSystemPath(aDestDir, aDestDirUrl)) { diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index d82d4f30ca42..2c376cf8c675 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -799,7 +799,7 @@ namespace static OUString lcl_pathnameToAbsoluteUrl(const OString& rPathname) { - OUString sPath = OUString::fromUtf8(rPathname); + OUString sPath = OStringToOUString(rPathname, RTL_TEXTENCODING_UTF8 ); OUString sUrl; if (osl::FileBase::getFileURLFromSystemPath(sPath, sUrl) != osl::FileBase::E_None) @@ -1139,7 +1139,7 @@ OString XMLUtil::QuotHTML( const OString &rString ) reinterpret_cast<const UChar*>(sPattern.getStr()), sPattern.getLength() ); - const OUString sOUSource = OUString::fromUtf8(rString); + const OUString sOUSource = OStringToOUString(rString, RTL_TEXTENCODING_UTF8); icu::UnicodeString sSource( reinterpret_cast<const UChar*>( sOUSource.getStr()), sOUSource.getLength() ); diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index a035314fc70b..6cd87c239993 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -339,7 +339,7 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL) { if (aLine[0] == '#') // skip comments continue; - OUString aText = OUString::fromUtf8(aLine); + OUString aText = OStringToOUString(aLine, RTL_TEXTENCODING_UTF8); uno::Reference< XDictionaryEntry > xEntry = new DicEntry( aText, eDicType == DictionaryType_NEGATIVE ); addEntry_Impl( xEntry, true ); //! don't launch events here diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx index 2edc40c6be99..0eadef15cbbc 100644 --- a/oox/source/drawingml/customshapepresetdata.cxx +++ b/oox/source/drawingml/customshapepresetdata.cxx @@ -34,7 +34,7 @@ void lcl_parseAdjustmentValue(comphelper::SequenceAsVector<drawing::EnhancedCust if (aToken.startsWith(aNamePrefix)) { OString aName = aToken.copy(aNamePrefix.getLength(), aToken.getLength() - aNamePrefix.getLength() - strlen("\"")); - aAdjustmentValue.Name = OUString::fromUtf8(aName); + aAdjustmentValue.Name = OStringToOUString(aName, RTL_TEXTENCODING_UTF8); } else if (aToken.startsWith(aValuePrefix)) { @@ -414,7 +414,7 @@ void lcl_parseEquations(comphelper::SequenceAsVector<OUString>& rEquations, cons else if (rValue[i] == '"' && bInString) { bInString = false; - rEquations.push_back(OUString::fromUtf8(rValue.copy(nStart + strlen("\""), i - nStart - strlen("\"")))); + rEquations.push_back(OStringToOUString(rValue.copy(nStart + strlen("\""), i - nStart - strlen("\"")), RTL_TEXTENCODING_UTF8)); } } } @@ -734,7 +734,7 @@ void CustomShapeProperties::initializePresetDataMap() bFirst = false; else maPresetDataMap[StaticTokenMap::get().getTokenFromUnicode(aName)] = aPropertyMap; - aName = OUString::fromUtf8(aLine.copy(aCommentPrefix.getLength(), aLine.getLength() - aCommentPrefix.getLength() - strlen(" */"))); + aName = OStringToOUString(aLine.copy(aCommentPrefix.getLength(), aLine.getLength() - aCommentPrefix.getLength() - strlen(" */")), RTL_TEXTENCODING_UTF8); } else { diff --git a/reportdesign/source/ui/dlg/dlgpage.cxx b/reportdesign/source/ui/dlg/dlgpage.cxx index 2069cea03ba1..821648d6b542 100644 --- a/reportdesign/source/ui/dlg/dlgpage.cxx +++ b/reportdesign/source/ui/dlg/dlgpage.cxx @@ -38,9 +38,9 @@ namespace rptui \************************************************************************/ ORptPageDialog::ORptPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const OString &rDialog) - : SfxTabDialog (pParent, rDialog, - "modules/dbreport/ui/" + OUString::fromUtf8(rDialog).toAsciiLowerCase() + ".ui", - pAttr) + : SfxTabDialog (pParent, rDialog, OUString("modules/dbreport/ui/") + + OStringToOUString(rDialog, RTL_TEXTENCODING_UTF8).toAsciiLowerCase() + + OUString(".ui"), pAttr) , rOutAttrs(*pAttr) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx index a2cea932bb51..792b64c21c6e 100644 --- a/reportdesign/source/ui/inspection/DefaultInspection.cxx +++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx @@ -36,7 +36,7 @@ namespace rptui OUString HelpIdUrl::getHelpURL( const OString& sHelpId ) { OUStringBuffer aBuffer; - OUString aTmp( OUString::fromUtf8(sHelpId) ); + OUString aTmp( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8) ); DBG_ASSERT( INetURLObject( aTmp ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); aBuffer.appendAscii( INET_HID_SCHEME ); aBuffer.append( aTmp.getStr() ); diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 0ec25cd4a0e6..b9df2babf467 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -145,7 +145,7 @@ ODesignView::~ODesignView() } if ( m_pReportExplorer ) { - SvtViewOptions aDlgOpt(E_WINDOW, OUString::fromUtf8(m_pReportExplorer->GetHelpId())); + SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pReportExplorer->GetHelpId(), RTL_TEXTENCODING_UTF8)); aDlgOpt.SetWindowState(OStringToOUString(m_pReportExplorer->GetWindowState(WINDOWSTATE_MASK_ALL), RTL_TEXTENCODING_ASCII_US)); notifySystemWindow(this,m_pReportExplorer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); ::std::unique_ptr<vcl::Window> aTemp2(m_pReportExplorer); @@ -488,7 +488,7 @@ void ODesignView::toggleReportExplorer() { OReportController& rReportController = getController(); m_pReportExplorer = new ONavigator(this,rReportController); - SvtViewOptions aDlgOpt(E_WINDOW, OUString::fromUtf8(m_pReportExplorer->GetHelpId())); + SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pReportExplorer->GetHelpId(), RTL_TEXTENCODING_UTF8)); if ( aDlgOpt.Exists() ) m_pReportExplorer->SetWindowState(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US)); m_pReportExplorer->AddEventListener(LINK(&rReportController,OReportController,EventLstHdl)); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index f8755f4ec8fc..2fa10d6fec22 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -337,7 +337,7 @@ void OReportController::disposing() } if ( m_pGroupsFloater ) { - SvtViewOptions aDlgOpt(E_WINDOW, OUString::fromUtf8(m_pGroupsFloater->GetHelpId())); + SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pGroupsFloater->GetHelpId(), RTL_TEXTENCODING_UTF8)); aDlgOpt.SetWindowState(OStringToOUString(m_pGroupsFloater->GetWindowState(WINDOWSTATE_MASK_ALL), RTL_TEXTENCODING_ASCII_US)); ::std::unique_ptr<FloatingWindow> aTemp(m_pGroupsFloater); m_pGroupsFloater = NULL; @@ -2595,7 +2595,7 @@ void OReportController::openSortingAndGroupingDialog() if ( !m_pGroupsFloater ) { m_pGroupsFloater = new OGroupsSortingDialog(getView(),!isEditable(),this); - SvtViewOptions aDlgOpt(E_WINDOW, OUString::fromUtf8(m_pGroupsFloater->GetHelpId())); + SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pGroupsFloater->GetHelpId(), RTL_TEXTENCODING_UTF8)); if ( aDlgOpt.Exists() ) m_pGroupsFloater->SetWindowState(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US)); m_pGroupsFloater->AddEventListener(LINK(this,OReportController,EventLstHdl)); diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index ddb11f93bffa..fdf44a098dd7 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -43,6 +43,7 @@ using namespace osl; using ::rtl::OUString; using ::rtl::OUStringToOString; using ::rtl::OString; +using ::rtl::OStringToOUString; // helper functions @@ -473,7 +474,7 @@ namespace osl_FileBase void getAbsoluteFileURL::check_getAbsoluteFileURL( rtl::OUString const& _suBaseURL, rtl::OString const& _sRelativeURL, ::osl::FileBase::RC _nAssumeError, rtl::OUString const& _suAssumeResultStr ) { - rtl::OUString suRelativeURL = rtl::OUString::fromUtf8(_sRelativeURL); + rtl::OUString suRelativeURL = rtl::OStringToOUString(_sRelativeURL, RTL_TEXTENCODING_UTF8); rtl::OString sBaseURL = rtl::OUStringToOString(_suBaseURL, RTL_TEXTENCODING_UTF8); rtl::OUString suResultURL; osl::FileBase::RC nError = FileBase::getAbsoluteFileURL( _suBaseURL, suRelativeURL, suResultURL ); @@ -673,21 +674,25 @@ namespace osl_FileBase // PRE: URL as String rtl::OUString suSource; rtl::OUString suStr; - suSource = rtl::OUString::fromUtf8(_sSource); - ::osl::FileBase::RC nError; - if ( bDirection ) - nError = osl::FileBase::getSystemPathFromFileURL( suSource, suStr ); - else - nError = osl::FileBase::getFileURLFromSystemPath( suSource, suStr ); + suSource = rtl::OStringToOUString(_sSource, RTL_TEXTENCODING_UTF8); + ::osl::FileBase::RC nError; + if ( bDirection ) + nError = osl::FileBase::getSystemPathFromFileURL( suSource, suStr ); + else + nError = osl::FileBase::getFileURLFromSystemPath( suSource, suStr ); // if the given string is gt length 0, // we check also this string rtl::OString sStr = rtl::OUStringToOString(suStr, RTL_TEXTENCODING_UTF8); rtl::OString sError = errorToString(nError); - if ( bDirection ) - printf("getSystemPathFromFileURL('%s') deliver system path: '%s', error '%s'\n", _sSource.getStr(), sStr.getStr(), sError.getStr() ); - else - printf("getFileURLFromSystemPath('%s') deliver File URL: '%s', error '%s'\n", _sSource.getStr(), sStr.getStr(), sError.getStr() ); + if ( bDirection ) + printf("getSystemPathFromFileURL('%s') deliver system path: '%s', error '%s'\n", _sSource.getStr(), sStr.getStr(), sError.getStr() ); + else + printf("getFileURLFromSystemPath('%s') deliver File URL: '%s', error '%s'\n", _sSource.getStr(), sStr.getStr(), sError.getStr() ); + + // rtl::OUString suStrEncode = rtl::Uri::encode(suStr, rtl_UriCharClassUnoParamValue, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8); + // sStr = rtl::OUStringToOString(suStr, RTL_TEXTENCODING_UTF8); + // printf("UTF8: %s\n", sStr.getStr() ); if (!_sAssumeResultStr.isEmpty()) { @@ -4852,7 +4857,7 @@ namespace osl_Directory #endif tmp_x += rtl::OString(TEST_PATH_POSTFIX); - rc = FileBase::getFileURLFromSystemPath(rtl::OUString::fromUtf8(tmp_x), test_path); + rc = FileBase::getFileURLFromSystemPath(rtl::OStringToOUString(tmp_x, RTL_TEXTENCODING_UTF8), test_path); CPPUNIT_ASSERT_MESSAGE ( diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index b2ca0a97bcd6..5719ae4301ec 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -377,7 +377,8 @@ Bootstrap_Impl::Bootstrap_Impl( OUString const & rIniName ) struct rtl_bootstrap_NameValue nameValue; nameValue.sName = OStringToOUString( line.copy(0,nIndex).trim(), RTL_TEXTENCODING_ASCII_US ); - nameValue.sValue = OUString::fromUtf8(line.copy(nIndex+1).trim()); + nameValue.sValue = OStringToOUString( + line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 ); #if OSL_DEBUG_LEVEL > 1 OString name_tmp = OUStringToOString(nameValue.sName, RTL_TEXTENCODING_ASCII_US); @@ -986,13 +987,14 @@ rtl::OUString expandMacros( // replacement text (and if it did, it would fail to // detect cycles that pass through here): buf.append( - rtl::OUString::fromUtf8( + rtl::OStringToOUString( osl::Profile(seg[0]).readString( rtl::OUStringToOString( seg[1], RTL_TEXTENCODING_UTF8), rtl::OUStringToOString( seg[2], RTL_TEXTENCODING_UTF8), - rtl::OString()))); + rtl::OString()), + RTL_TEXTENCODING_UTF8)); } } } else { diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx index e54e2e30873a..e2cbcc677238 100644 --- a/sax/source/tools/fastattribs.cxx +++ b/sax/source/tools/fastattribs.cxx @@ -46,9 +46,9 @@ void UnknownAttribute::FillAttribute( Attribute* pAttrib ) const { if( pAttrib ) { - pAttrib->Name = OUString::fromUtf8( maName ); + pAttrib->Name = OStringToOUString( maName, RTL_TEXTENCODING_UTF8 ); pAttrib->NamespaceURL = maNamespaceURL; - pAttrib->Value = OUString::fromUtf8( maValue ); + pAttrib->Value = OStringToOUString( maValue, RTL_TEXTENCODING_UTF8 ); } } diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index 7e54cfcf605f..23db69e7740e 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -154,7 +154,7 @@ std::vector<boost::shared_ptr<osl::File> > OpenCLDevice::binaryGenerated( const if ( mpArryDevsID[i] != 0 ) { OString fileName = createFileName(gpuEnv.mpArryDevsID[i], clFileName); - osl::File* pNewFile = new osl::File(rtl::OUString::fromUtf8(fileName)); + osl::File* pNewFile = new osl::File(rtl::OStringToOUString(fileName, RTL_TEXTENCODING_UTF8)); if(pNewFile->open(osl_File_OpenFlag_Read) == osl::FileBase::E_None) { aGeneratedFiles.push_back(boost::shared_ptr<osl::File>(pNewFile)); @@ -174,7 +174,7 @@ std::vector<boost::shared_ptr<osl::File> > OpenCLDevice::binaryGenerated( const bool OpenCLDevice::writeBinaryToFile( const OString& rFileName, const char* binary, size_t numBytes ) { - osl::File file(rtl::OUString::fromUtf8(rFileName)); + osl::File file(rtl::OStringToOUString(rFileName, RTL_TEXTENCODING_UTF8)); osl::FileBase::RC status = file.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); @@ -345,7 +345,7 @@ bool buildProgram(const char* buildOption, GPUEnv* gpuInfo, int idx) } OString aBuildLogFileURL = OpenCLDevice::maCacheFolder + "kernel-build.log"; - osl::File aBuildLogFile(rtl::OUString::fromUtf8(aBuildLogFileURL)); + osl::File aBuildLogFile(rtl::OStringToOUString(aBuildLogFileURL, RTL_TEXTENCODING_UTF8)); osl::FileBase::RC status = aBuildLogFile.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 23c384532034..8fa70fb230e2 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -3043,7 +3043,7 @@ void ScInterpreter::ScBahtText() if( bMinus ) aText.insert( 0, OString( UTF8_TH_MINUS ) ); - PushString( OUString::fromUtf8(aText.makeStringAndClear()) ); + PushString( OStringToOUString(aText.makeStringAndClear(), RTL_TEXTENCODING_UTF8) ); } } diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx index 66ffd19f80e0..8131a5465d52 100644 --- a/sc/source/core/tool/interpr7.cxx +++ b/sc/source/core/tool/interpr7.cxx @@ -93,13 +93,13 @@ void ScInterpreter::ScFilterXML() xmlNsPtr ns = (xmlNsPtr)pNodeSet->nodeTab[0]; xmlNodePtr cur = (xmlNodePtr)ns->next; boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree); - aResult = OUString::fromUtf8(OString((char*)pChar2.get())); + aResult = OStringToOUString(OString((char*)pChar2.get()), RTL_TEXTENCODING_UTF8); } else { xmlNodePtr cur = pNodeSet->nodeTab[0]; boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree); - aResult = OUString::fromUtf8(OString((char*)pChar2.get())); + aResult = OStringToOUString(OString((char*)pChar2.get()), RTL_TEXTENCODING_UTF8); } } else @@ -198,7 +198,7 @@ void ScInterpreter::ScWebservice() xStream->closeInput(); - OUString aContent = OUString::fromUtf8( aBuffer.makeStringAndClear() ); + OUString aContent = OStringToOUString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); PushString( aContent ); } } diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx index 288e9d3ad42f..d0d3c37d3106 100644 --- a/sc/source/filter/oox/numberformatsbuffer.cxx +++ b/sc/source/filter/oox/numberformatsbuffer.cxx @@ -1891,7 +1891,7 @@ void NumberFormat::setFormatCode( const OUString& rFmtCode ) void NumberFormat::setFormatCode( const Locale& rLocale, const sal_Char* pcFmtCode ) { maModel.maLocale = rLocale; - maModel.maFmtCode = OUString::fromUtf8( OString( pcFmtCode ) ); + maModel.maFmtCode = OStringToOUString( OString( pcFmtCode ), RTL_TEXTENCODING_UTF8 ); maModel.mnPredefId = -1; } diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index e688a0f293fb..3735f28c82b2 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -432,7 +432,7 @@ void ScOrcusSharedStrings::append_segment(const char* s, size_t n) size_t ScOrcusSharedStrings::commit_segments() { OString aStr = maCurSegment.makeStringAndClear(); - return mrFactory.addString(OUString::fromUtf8(aStr)); + return mrFactory.addString(OStringToOUString(aStr, RTL_TEXTENCODING_UTF8)); } void ScOrcusStyles::set_font_count(size_t /*n*/) diff --git a/sc/source/ui/miscdlgs/mtrindlg.cxx b/sc/source/ui/miscdlgs/mtrindlg.cxx index 23cb845e5fcc..c6782d1a25a2 100644 --- a/sc/source/ui/miscdlgs/mtrindlg.cxx +++ b/sc/source/ui/miscdlgs/mtrindlg.cxx @@ -35,7 +35,8 @@ ScMetricInputDlg::ScMetricInputDlg( vcl::Window* pParent, long nLast ) : ModalDialog(pParent, sDialogName, - OUString::fromUtf8("modules/scalc/ui/" + sDialogName.toAsciiLowerCase() + ".ui")) + OStringToOUString("modules/scalc/ui/" + + sDialogName.toAsciiLowerCase() + ".ui", RTL_TEXTENCODING_UTF8)) { get(m_pEdValue, "value"); get(m_pBtnDefVal, "default"); diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index d5d355276f0f..897f26851024 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -1084,7 +1084,7 @@ OUString HtmlExport::DocumentMetadata() const OString aData(reinterpret_cast<const char*>(aStream.GetData()), aStream.GetSize()); - return OUString::fromUtf8(aData); + return OStringToOUString(aData, RTL_TEXTENCODING_UTF8); } bool HtmlExport::CreateHtmlTextForPresPages() diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 506af5bb0c16..0429ecfbe769 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -443,7 +443,7 @@ bool ImplSdPPTImport::Import() { // second pass, searching for a SlideName for ( nToken = 0; nToken < nTokenCount; nToken++ ) { - OUString aToken(OUString::fromUtf8(aStringAry[nToken])); + OUString aToken(OStringToOUString(aStringAry[nToken], RTL_TEXTENCODING_UTF8)); std::vector<OUString>::const_iterator pIter = std::find(maSlideNameList.begin(),maSlideNameList.end(),aToken); diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx index 46e0d4a369a2..6a68229968fc 100644 --- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx @@ -627,7 +627,7 @@ vcl::Window * lcl_GetTopmostParent( vcl::Window * pWindow ) void CustomAnimationCreateDialog::setPosition() { - SvtViewOptions aDlgOpt(E_TABDIALOG, OUString::fromUtf8(GetHelpId())); + SvtViewOptions aDlgOpt(E_TABDIALOG, OStringToOUString(GetHelpId(), RTL_TEXTENCODING_UTF8)); if ( aDlgOpt.Exists() ) { SetWindowState( OUStringToOString(aDlgOpt.GetWindowState(), @@ -654,7 +654,7 @@ void CustomAnimationCreateDialog::setPosition() void CustomAnimationCreateDialog::storePosition() { // save settings (screen position and current page) - SvtViewOptions aDlgOpt(E_TABDIALOG, OUString::fromUtf8(GetHelpId())); + SvtViewOptions aDlgOpt(E_TABDIALOG, OStringToOUString(GetHelpId(), RTL_TEXTENCODING_UTF8)); aDlgOpt.SetWindowState(OStringToOUString( GetWindowState(WINDOWSTATE_MASK_POS), RTL_TEXTENCODING_ASCII_US)); } diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index e3c336f5f6a1..d5bf9663a97c 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -492,7 +492,7 @@ sal_Int32 OSXBluetoothWrapper::readLine( OString& aLine ) mBuffer.erase( mBuffer.begin(), aIt + 1 ); // Also delete the empty line // yeps - SAL_INFO( "sdremote.bluetooth", " returning, got \"" << OUString::fromUtf8( aLine ) << "\"" ); + SAL_INFO( "sdremote.bluetooth", " returning, got \"" << OStringToOUString( aLine, RTL_TEXTENCODING_UTF8 ) << "\"" ); return aLine.getLength() + 1; } diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index 07321bad6e94..7404bbddcfbf 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -131,8 +131,9 @@ void RemoteServer::execute() MutexGuard aGuard( sDataMutex ); ::boost::shared_ptr< ClientInfoInternal > pClient( new ClientInfoInternal( - OUString::fromUtf8( aName ), - aAddress, false, pSocket, OUString::fromUtf8( aPin ) ) ); + OStringToOUString( aName, RTL_TEXTENCODING_UTF8 ), + aAddress, false, pSocket, OStringToOUString( aPin, + RTL_TEXTENCODING_UTF8 ) ) ); mAvailableClients.push_back( pClient ); // Read off any additional non-empty lines diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index 5fef51293c14..7607058ddd9a 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -185,7 +185,7 @@ OUString PDFName::getFilteredName() const else aFilter.append( pStr[i] ); } - return OUString::fromUtf8( aFilter.makeStringAndClear() ); + return OStringToOUString( aFilter.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); } PDFString::~PDFString() diff --git a/sdext/source/pdfimport/sax/emitcontext.cxx b/sdext/source/pdfimport/sax/emitcontext.cxx index c4b91a83a88b..0a856ea29de1 100644 --- a/sdext/source/pdfimport/sax/emitcontext.cxx +++ b/sdext/source/pdfimport/sax/emitcontext.cxx @@ -52,7 +52,7 @@ SaxEmitter::SaxEmitter( const uno::Reference< xml::sax::XDocumentHandler >& xDoc static const char* pDir = getenv( "DBG_PDFIMPORT_DIR" ); if( pDir ) { - OUString aStr( OUString::fromUtf8( pDir ) ); + OUString aStr( OStringToOUString( pDir, RTL_TEXTENCODING_UTF8 ) ); OUString aFileURL; osl_getFileURLFromSystemPath( aStr.pData, &aFileURL.pData ); OUStringBuffer aBuf( 256 ); diff --git a/sdext/source/pdfimport/tree/style.cxx b/sdext/source/pdfimport/tree/style.cxx index e5fdf4501c2d..4e91dcf26a8c 100644 --- a/sdext/source/pdfimport/tree/style.cxx +++ b/sdext/source/pdfimport/tree/style.cxx @@ -76,7 +76,7 @@ sal_Int32 StyleContainer::impl_getStyleId( const Style& rStyle, bool bSubStyle ) sal_Int32 StyleContainer::getStandardStyleId( const OString& rName ) { PropertyMap aProps; - aProps[ "style:family" ] = OUString::fromUtf8( rName ); + aProps[ "style:family" ] = OStringToOUString( rName, RTL_TEXTENCODING_UTF8 ); aProps[ "style:name" ] = "standard"; Style aStyle( "style:style", aProps ); diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index c6e09609f6ee..79d64fdf1bbf 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -382,7 +382,7 @@ void Parser::readChar() // chars gobble up rest of line m_nCharIndex = -1; - m_pSink->drawGlyphs(OUString::fromUtf8(aChars), + m_pSink->drawGlyphs(OStringToOUString(aChars, RTL_TEXTENCODING_UTF8), aRect, aUnoMatrix, fontSize); } @@ -600,7 +600,8 @@ void Parser::readFont() } // yet unknown font - get info and add to map - FontAttributes aResult( OUString::fromUtf8( aFontName ), + FontAttributes aResult( OStringToOUString( aFontName, + RTL_TEXTENCODING_UTF8 ), nIsBold != 0, nIsItalic != 0, nIsUnderline != 0, @@ -782,8 +783,9 @@ void Parser::readLink() readDouble(aBounds.Y2); m_pSink->hyperLink( aBounds, - OUString::fromUtf8( lcl_unescapeLineFeeds( - m_aLine.copy(m_nCharIndex) ) ) ); + OStringToOUString( lcl_unescapeLineFeeds( + m_aLine.copy(m_nCharIndex) ), + RTL_TEXTENCODING_UTF8 ) ); // name gobbles up rest of line m_nCharIndex = -1; } diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index ba98e80d29a5..e2cb96804f0d 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -292,7 +292,7 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo) if (!rInfo.aModule.isEmpty()) sName = rInfo.aModule + "/" + sName; SvtViewOptions aWinOpt(E_WINDOW, sName); - aWinOpt.SetWindowState(OUString::fromUtf8(rInfo.aWinState)); + aWinOpt.SetWindowState(OStringToOUString(rInfo.aWinState, RTL_TEXTENCODING_UTF8)); ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1); aSeq[0].Name = "Data"; diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 612f98531782..e9cab42faad7 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -455,7 +455,7 @@ OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const vcl::Window* p while ( pParent ) { aNewHelpId = pParent->GetHelpId(); - sHelpText = SfxHelp_Impl::GetHelpText( OUString::fromUtf8(aNewHelpId), sModuleName ); + sHelpText = SfxHelp_Impl::GetHelpText( OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8), sModuleName ); if (!sHelpText.isEmpty()) pParent = NULL; else @@ -476,7 +476,7 @@ OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const vcl::Window* p if ( !aNewHelpId.isEmpty() ) { sHelpText += " - "; - sHelpText += OUString::fromUtf8(aNewHelpId); + sHelpText += OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8); } } @@ -568,7 +568,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const while ( pParent ) { OString aHelpId = pParent->GetHelpId(); - aHelpURL = CreateHelpURL( OUString::fromUtf8(aHelpId), aHelpModuleName ); + aHelpURL = CreateHelpURL( OStringToOUString(aHelpId, RTL_TEXTENCODING_UTF8), aHelpModuleName ); if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) { break; diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index ab4736b8ef45..f8f0e2a42ab1 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -730,7 +730,8 @@ static OUString getAutostartDir( bool bCreate = false ) OUString aShortcut; const char *pConfigHome; if( (pConfigHome = getenv("XDG_CONFIG_HOME") ) ) - aShortcut = OUString::fromUtf8( OString( pConfigHome ) ); + aShortcut = OStringToOUString( OString( pConfigHome ), + RTL_TEXTENCODING_UTF8 ); else { OUString aHomeURL; diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx index a5da0de290a1..b716f56d8724 100644 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ b/sfx2/source/appl/shutdowniconunx.cxx @@ -164,7 +164,8 @@ static void add_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, OUString *pOverrideLabel, sal_uInt16 nResId, GCallback pFnCallback ) { - OUString *pURL = new OUString (OUString::fromUtf8( pAsciiURL )); + OUString *pURL = new OUString (OStringToOUString( pAsciiURL, + RTL_TEXTENCODING_UTF8 )); OString aLabel; if (pOverrideLabel) aLabel = OUStringToOString (*pOverrideLabel, RTL_TEXTENCODING_UTF8); diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index de879ad93d73..e00e6cb266d5 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -207,7 +207,7 @@ OUString SfxContentHelper::GetActiveHelpString( const OUString& rURL ) while ( nRead > 0 ) { OString sOldString( (sal_Char*)lData.getConstArray(), nRead ); - OUString sString = OUString::fromUtf8( sOldString ); + OUString sString = OStringToOUString( sOldString, RTL_TEXTENCODING_UTF8 ); aRet.append( sString ); nRead = xStream->readBytes( lData, 1024 ); diff --git a/sfx2/source/bastyp/mieclip.cxx b/sfx2/source/bastyp/mieclip.cxx index 18b94389a9fb..8fcc660e7618 100644 --- a/sfx2/source/bastyp/mieclip.cxx +++ b/sfx2/source/bastyp/mieclip.cxx @@ -60,7 +60,7 @@ SvStream* MSE40HTMLClipFormatObj::IsValid( SvStream& rStream ) else if (sTmp == "EndFragment") nFragEnd = sLine.copy(nIndex).toInt32(); else if (sTmp == "SourceURL") - sBaseURL = OUString::fromUtf8( sLine.copy(nIndex) ); + sBaseURL = OStringToOUString( sLine.copy(nIndex), RTL_TEXTENCODING_UTF8 ); if (nEnd >= 0 && nStt >= 0 && (!sBaseURL.isEmpty() || rStream.Tell() >= static_cast<sal_Size>(nStt))) diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 1503ed1c3f32..8549e9b7c64a 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -254,7 +254,7 @@ bool SfxHTMLParser::FinishFileDownload( OUString& rStr ) sal_Size nLen = aStream.Tell(); aStream.Seek( 0 ); OString sBuffer = read_uInt8s_ToOString(aStream, nLen); - rStr = OUString::fromUtf8( sBuffer ); + rStr = OStringToOUString( sBuffer, RTL_TEXTENCODING_UTF8 ); } delete pDLMedium; diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx index de7c107160f5..4fc4cbf18e93 100644 --- a/sfx2/source/control/msg.cxx +++ b/sfx2/source/control/msg.cxx @@ -59,7 +59,7 @@ OString SfxSlot::GetCommand() const OUString SfxSlot::GetCommandString() const { - return OUString::fromUtf8(GetCommand()); + return OStringToOUString(GetCommand(), RTL_TEXTENCODING_UTF8); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 75845925c128..b8a3a7419596 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -101,7 +101,7 @@ void SfxModalDialog::SetDialogData_Impl() // save settings (position and user data) OUString sConfigId; if (isLayoutEnabled()) - sConfigId = OUString::fromUtf8(GetHelpId()); + sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8); else { SAL_WARN("sfx.config", "Dialog needs to be converted to .ui format"); @@ -128,7 +128,7 @@ void SfxModalDialog::GetDialogData_Impl() { OUString sConfigId; if (isLayoutEnabled()) - sConfigId = OUString::fromUtf8(GetHelpId()); + sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8); else { SAL_WARN("sfx.config", "Dialog needs to be converted to .ui format"); @@ -654,7 +654,8 @@ IMPL_LINK_NOARG(SfxSingleTabDialog, OKHdl_Impl) pImpl->m_pSfxPage->FillUserData(); OUString sData( pImpl->m_pSfxPage->GetUserData() ); - OUString sConfigId = OUString::fromUtf8(pImpl->m_pSfxPage->GetConfigId()); + OUString sConfigId = OStringToOUString(pImpl->m_pSfxPage->GetConfigId(), + RTL_TEXTENCODING_UTF8); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); @@ -723,7 +724,8 @@ void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage, if ( pImpl->m_pSfxPage ) { // First obtain the user data, only then Reset() - OUString sConfigId = OUString::fromUtf8(pImpl->m_pSfxPage->GetConfigId()); + OUString sConfigId = OStringToOUString(pImpl->m_pSfxPage->GetConfigId(), + RTL_TEXTENCODING_UTF8); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 25d91ae3d4b1..18da893e5823 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -271,7 +271,7 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve OUString aHelpText; Help* pHelp = Application::GetHelp(); if ( pHelp ) - aHelpText = pHelp->GetHelpText( OUString::fromUtf8(sHelpId), NULL ); + aHelpText = pHelp->GetHelpText( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), NULL ); return aHelpText; } @@ -1143,7 +1143,7 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con { while ( *_pControlId ) { - DBG_ASSERT( INetURLObject( OUString::fromUtf8( *_pHelpId ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); + DBG_ASSERT( INetURLObject( OStringToOUString( *_pHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); OUString sId( sHelpIdPrefix ); sId += OUString( *_pHelpId, strlen( *_pHelpId ), RTL_TEXTENCODING_UTF8 ); xControlAccess->setValue( *_pControlId, ControlActions::SET_HELP_URL, makeAny( sId ) ); diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index d71f62d466ba..34338673e9ba 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -377,7 +377,8 @@ SfxTabDialog::~SfxTabDialog() if ( !aPageData.isEmpty() ) { // save settings of all pages (user data) - OUString sConfigId = OUString::fromUtf8(pDataObject->pTabPage->GetConfigId()); + OUString sConfigId = OStringToOUString(pDataObject->pTabPage->GetConfigId(), + RTL_TEXTENCODING_UTF8); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); @@ -554,7 +555,7 @@ void SfxTabDialog::Start_Impl() sal_uInt16 nActPage = m_pTabCtrl->GetPageId( 0 ); // load old settings, when exists - SvtViewOptions aDlgOpt(E_TABDIALOG, OUString::fromUtf8(GetHelpId())); + SvtViewOptions aDlgOpt(E_TABDIALOG, OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8)); if ( aDlgOpt.Exists() ) { SetWindowState(OUStringToOString(aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US)); @@ -673,7 +674,8 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId ) if ( !aPageData.isEmpty() ) { // save settings of this page (user data) - OUString sConfigId = OUString::fromUtf8(pDataObject->pTabPage->GetConfigId()); + OUString sConfigId = OStringToOUString(pDataObject->pTabPage->GetConfigId(), + RTL_TEXTENCODING_UTF8); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); @@ -756,7 +758,7 @@ SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const void SfxTabDialog::SavePosAndId() { // save settings (screen position and current page) - SvtViewOptions aDlgOpt(E_TABDIALOG, OUString::fromUtf8(GetHelpId())); + SvtViewOptions aDlgOpt(E_TABDIALOG, OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8)); aDlgOpt.SetWindowState(OStringToOUString(GetWindowState(WINDOWSTATE_MASK_POS),RTL_TEXTENCODING_ASCII_US)); // to-do replace with name of page when all pages are converted to .ui aDlgOpt.SetPageID( m_pTabCtrl->GetCurPageId() ); @@ -1125,7 +1127,7 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) DBG_ASSERT( NULL == pDataObject->pTabPage, "create TabPage more than once" ); pDataObject->pTabPage = pTabPage; - OUString sConfigId = OUString::fromUtf8(pTabPage->GetConfigId()); + OUString sConfigId = OStringToOUString(pTabPage->GetConfigId(), RTL_TEXTENCODING_UTF8); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); diff --git a/shell/source/backends/gconfbe/gconfaccess.cxx b/shell/source/backends/gconfbe/gconfaccess.cxx index d3e3b0b977b0..371b76603043 100644 --- a/shell/source/backends/gconfbe/gconfaccess.cxx +++ b/shell/source/backends/gconfbe/gconfaccess.cxx @@ -204,8 +204,8 @@ uno::Any makeAnyOfGconfValue( GConfValue *pGconfValue ) return uno::makeAny( (sal_Int32) gconf_value_get_int( pGconfValue ) ); case GCONF_VALUE_STRING: - return uno::makeAny( OUString::fromUtf8( OString( - gconf_value_get_string(pGconfValue) ) ) ); + return uno::makeAny( OStringToOUString( OString( + gconf_value_get_string(pGconfValue) ), RTL_TEXTENCODING_UTF8 ) ); default: fprintf( stderr, "makeAnyOfGconfValue: Type not handled.\n" ); @@ -230,7 +230,7 @@ static void splitFontName( GConfValue *pGconfValue, OUString &rName, sal_Int16 & rHeight = static_cast<sal_Int16>( aSize.toInt32() ); } - rName = OUString::fromUtf8( aFont.copy( 0, nIdx ) ); + rName = OStringToOUString( aFont.copy( 0, nIdx ), RTL_TEXTENCODING_UTF8 ); } @@ -265,7 +265,7 @@ uno::Any translateToOOo( const ConfigurationValue &rValue, GConfValue *pGconfVal } // Remove trailing ";" aBuffer.setLength(aBuffer.getLength()-1); - return uno::makeAny(OUString::fromUtf8(aBuffer.makeStringAndClear())); + return uno::makeAny(OStringToOUString(aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); } else g_warning( "unexpected type for ignore_hosts" ); diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx index 538bec8747bb..bb08e4d68ceb 100644 --- a/shell/source/tools/lngconvex/lngconvex.cxx +++ b/shell/source/tools/lngconvex/lngconvex.cxx @@ -306,7 +306,8 @@ void add_group_entries( key_value_utf8 = comphelper::string::strip(key_value_utf8, '\"'); - OUString key_value_utf16 = OUString::fromUtf8(key_value_utf8); + OUString key_value_utf16 = + OStringToOUString(key_value_utf8, RTL_TEXTENCODING_UTF8); Substitutor.add_substitution( GroupName.getStr(), make_winrc_unicode_string(key_value_utf16)); diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 21119b34ac8d..6f66c25b7621 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -3167,7 +3167,7 @@ OUString UCBStorage::GetLinkedFile( SvStream &rStream ) OString aTmp = read_uInt16_lenPrefixed_uInt8s_ToOString(rStream); if (aTmp.match("ContentURL=")) { - aString = OUString::fromUtf8(aTmp.copy(11)); + aString = OStringToOUString(aTmp.copy(11), RTL_TEXTENCODING_UTF8); } } diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx index 6ae8ec14c3de..ea0a5965649f 100644 --- a/svl/source/misc/lockfilecommon.cxx +++ b/svl/source/misc/lockfilecommon.cxx @@ -165,7 +165,7 @@ OUString LockFileCommon::ParseName( const uno::Sequence< sal_Int8 >& aBuffer, sa } } - return OUString::fromUtf8( aResult.makeStringAndClear() ); + return OStringToOUString( aResult.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); } diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 509fea1fe4c8..974ac7a20079 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -279,7 +279,7 @@ public: inline NameTranslationEntry::NameTranslationEntry( const OString& rOrg, const OString& rTrans ) : HashedEntry(OStringToOUString(rOrg, RTL_TEXTENCODING_ASCII_US)) - , maTranslatedName(OUString::fromUtf8(rTrans)) + , maTranslatedName(OStringToOUString(rTrans, RTL_TEXTENCODING_UTF8)) { } diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 191d06c943e0..c83db0b4a1d5 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1018,7 +1018,8 @@ void FontNameBox::LoadMRUEntries( const OUString& aFontMRUEntriesFile, sal_Unico OString aLine; aStream.ReadLine( aLine ); - OUString aEntries = OUString::fromUtf8(aLine); + OUString aEntries = OStringToOUString(aLine, + RTL_TEXTENCODING_UTF8); SetMRUEntries( aEntries, cSep ); } diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index 139b8f81f9ff..490ad89bcbf0 100644 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -1145,7 +1145,7 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt ) } else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { - OUString aHelpId( OUString::fromUtf8( GetHelpId( nItemId ) ) ); + OUString aHelpId( OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) ); if ( !aHelpId.isEmpty() ) { // display it if help is available @@ -1473,7 +1473,7 @@ OUString HeaderBar::GetHelpText( sal_uInt16 nItemId ) const { Help* pHelp = Application::GetHelp(); if ( pHelp ) - pItem->maHelpText = pHelp->GetHelpText( OUString::fromUtf8( pItem->maHelpId ), this ); + pItem->maHelpText = pHelp->GetHelpText( OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this ); } return pItem->maHelpText; diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 15740f92df69..2e8fa764f6b8 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -1509,7 +1509,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) } else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { - OUString aHelpId( OUString::fromUtf8( GetHelpId( nItemId ) ) ); + OUString aHelpId( OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) ); if ( !aHelpId.isEmpty() ) { // trigger Help if available @@ -2429,7 +2429,7 @@ OUString TabBar::GetHelpText( sal_uInt16 nPageId ) const { Help* pHelp = Application::GetHelp(); if ( pHelp ) - pItem->maHelpText = pHelp->GetHelpText( OUString::fromUtf8( pItem->maHelpId ), this ); + pItem->maHelpText = pHelp->GetHelpText( OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this ); } return pItem->maHelpText; diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index add32b0ece53..7bf8f637dfba 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -2119,7 +2119,7 @@ bool TransferableDataHelper::GetFileList( while( xStm->ReadLine( aDiskString ) ) if( !aDiskString.isEmpty() && aDiskString[0] != '#' ) - rFileList.AppendFile( OUString::fromUtf8(aDiskString) ); + rFileList.AppendFile( OStringToOUString(aDiskString, RTL_TEXTENCODING_UTF8) ); bRet = true; } diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index c37a71774abd..c36ccbc33cf3 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -258,7 +258,8 @@ namespace { static OUString lcl_getHelpURL( const OString& sHelpId ) { OUStringBuffer aBuffer; - OUString aTmp( OUString::fromUtf8( sHelpId ) ); + OUString aTmp( + OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) ); INetURLObject aHID( aTmp ); if ( aHID.GetProtocol() == INET_PROT_NOT_VALID ) aBuffer.appendAscii( INET_HID_SCHEME ); diff --git a/svx/source/gallery2/galini.cxx b/svx/source/gallery2/galini.cxx index 5c5de4d58b65..b4c53388cf1c 100644 --- a/svx/source/gallery2/galini.cxx +++ b/svx/source/gallery2/galini.cxx @@ -57,7 +57,8 @@ OUString GalleryThemeEntry::ReadStrFromIni(const OUString &aKeyName ) { aKey = OStringToOUString( aLine.copy( 0, n ).trim(), RTL_TEXTENCODING_ASCII_US ); - aValue = OUString::fromUtf8( aLine.copy( n + 1 ).trim() ); + aValue = OStringToOUString( + aLine.copy( n + 1 ).trim(), RTL_TEXTENCODING_UTF8 ); if( ( n = aKey.indexOf( '[' ) ) >= 1 ) { diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 8caa580b7acf..cf644489752f 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -711,7 +711,7 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, bo sal_uInt32 nThemeId = 0; OString aTmpStr = read_uInt16_lenPrefixed_uInt8s_ToOString(*pIStm); - aThemeName = OUString::fromUtf8(aTmpStr); + aThemeName = OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); // execute a charakter conversion if( nVersion >= 0x0004 ) diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.cxx b/svx/source/sidebar/insert/InsertPropertyPanel.cxx index f0cb73507218..7f4925b22e51 100644 --- a/svx/source/sidebar/insert/InsertPropertyPanel.cxx +++ b/svx/source/sidebar/insert/InsertPropertyPanel.cxx @@ -106,7 +106,7 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent) return 1; // Extract name of (sub)toolbar from help id. - OUString sToolbarName (rtl::OUString::fromUtf8(pToolBox->GetHelpId())); + OUString sToolbarName (rtl::OStringToOUString(pToolBox->GetHelpId(), RTL_TEXTENCODING_UTF8)); if (sToolbarName.getLength() == 0) return 1; const util::URL aURL (sfx2::sidebar::Tools::GetURL(sToolbarName)); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index ba45f4cba5e9..2c508672f1f5 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2252,7 +2252,7 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge std::vector<OString>& rNames = it->second; if (rNames.size() > nIndex) // We know the bookmark name for this sequence and this index, do the replacement. - sMark = OUString::fromUtf8(rNames[nIndex]); + sMark = OStringToOUString(rNames[nIndex], RTL_TEXTENCODING_UTF8); } } } diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index 2ddf80f64201..fe0a1ea81f2e 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -175,7 +175,7 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor RTL_TEXTENCODING_UTF8).getStr(), 0, returnValue); OString aContentString = loadFile(aOutput.GetURL()); - OUString aContentOUString = OUString::fromUtf8(aContentString); + OUString aContentOUString = OStringToOUString(aContentString, RTL_TEXTENCODING_UTF8); if( eFormat == test::OOXML && !aContentOUString.isEmpty() ) { diff --git a/testtools/source/bridgetest/multi.cxx b/testtools/source/bridgetest/multi.cxx index 256247433bc6..0c20128345a0 100644 --- a/testtools/source/bridgetest/multi.cxx +++ b/testtools/source/bridgetest/multi.cxx @@ -46,7 +46,9 @@ template< typename T > void checkEqual(T const & value, T const & argument) { if (argument != value) { std::ostringstream s; s << value << " != " << argument; - throw CheckFailed( OUString::fromUtf8(OString(s.str().c_str())) ); + throw CheckFailed( + OStringToOUString( + OString(s.str().c_str()), RTL_TEXTENCODING_UTF8)); } } diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 476c1fa7f1c5..f7d7b419154b 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -1993,7 +1993,7 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const ::com::sun::st break; case BASEPROPERTY_HELPURL: { - OUString aHelpId( OUString::fromUtf8( GetWindow()->GetHelpId() ) ); + OUString aHelpId( OStringToOUString( GetWindow()->GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); aProp <<= OUString( aHelpId ); } break; diff --git a/tubes/source/contacts.cxx b/tubes/source/contacts.cxx index 867a9c95d3cb..df9900565dd8 100644 --- a/tubes/source/contacts.cxx +++ b/tubes/source/contacts.cxx @@ -128,7 +128,8 @@ public: static OUString fromUTF8( const char *pStr ) { - return OUString::fromUtf8( OString( pStr, strlen( pStr ) ) ); + return OStringToOUString( OString( pStr, strlen( pStr ) ), + RTL_TEXTENCODING_UTF8 ); } void Populate() diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.cxx b/ucb/source/ucp/webdav-neon/DAVProperties.cxx index 09960488ac89..5d5634936dca 100644 --- a/ucb/source/ucp/webdav-neon/DAVProperties.cxx +++ b/ucb/source/ucp/webdav-neon/DAVProperties.cxx @@ -108,8 +108,10 @@ void DAVProperties::createUCBPropName( const char * nspace, const char * name, OUString & rFullName ) { - OUString aNameSpace = OUString::fromUtf8( nspace ); - OUString aName = OUString::fromUtf8( name ); + OUString aNameSpace + = OStringToOUString( nspace, RTL_TEXTENCODING_UTF8 ); + OUString aName + = OStringToOUString( name, RTL_TEXTENCODING_UTF8 ); if ( aNameSpace.isEmpty() ) { diff --git a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx index f4a58ccb5def..73b6c7c5df32 100644 --- a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx +++ b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx @@ -175,7 +175,7 @@ extern "C" int NPFR_propfind_iter( void* userdata, else { thePropertyValue.Value - <<= OUString::fromUtf8( value ); + <<= OStringToOUString( value, RTL_TEXTENCODING_UTF8 ); } } @@ -192,7 +192,8 @@ extern "C" void NPFR_propfind_results( void* userdata, { // @@@ href is not the uri! DAVResource ctor wants uri! - DAVResource theResource( OUString::fromUtf8( uri->path ) ); + DAVResource theResource( + OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); ne_propset_iterate( set, NPFR_propfind_iter, &theResource ); @@ -223,7 +224,8 @@ extern "C" void NPFR_propnames_results( void* userdata, { // @@@ href is not the uri! DAVResourceInfo ctor wants uri! // Create entry for the resource. - DAVResourceInfo theResource( OUString::fromUtf8( uri->path ) ); + DAVResourceInfo theResource( + OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); // Fill entry. ne_propset_iterate( results, NPFR_propnames_iter, &theResource ); diff --git a/ucb/source/ucp/webdav-neon/NeonUri.cxx b/ucb/source/ucp/webdav-neon/NeonUri.cxx index bec91bcb8759..d378cfb46ddf 100644 --- a/ucb/source/ucp/webdav-neon/NeonUri.cxx +++ b/ucb/source/ucp/webdav-neon/NeonUri.cxx @@ -124,24 +124,28 @@ void NeonUri::init( const OString & rUri, const ne_uri * pUri ) &g_sUriDefaultsHTTPS : &g_sUriDefaultsHTTP; - mScheme = OUString::fromUtf8( - pUri->scheme ? pUri->scheme : pUriDefs->scheme); - mUserInfo = OUString::fromUtf8( - pUri->userinfo ? pUri->userinfo : pUriDefs->userinfo); - mHostName = OUString::fromUtf8( - pUri->host ? pUri->host : pUriDefs->host); + mScheme = OStringToOUString( + pUri->scheme ? pUri->scheme : pUriDefs->scheme, + RTL_TEXTENCODING_UTF8 ); + mUserInfo = OStringToOUString( + pUri->userinfo ? pUri->userinfo : pUriDefs->userinfo, + RTL_TEXTENCODING_UTF8 ); + mHostName = OStringToOUString( + pUri->host ? pUri->host : pUriDefs->host, + RTL_TEXTENCODING_UTF8 ); mPort = pUri->port > 0 ? pUri->port : pUriDefs->port; - mPath = OUString::fromUtf8( - pUri->path ? pUri->path : pUriDefs->path); + mPath = OStringToOUString( + pUri->path ? pUri->path : pUriDefs->path, + RTL_TEXTENCODING_UTF8 ); if ( pUri->query ) { - mPath += "?" + OUString::fromUtf8( pUri->query ); + mPath += "?" + OStringToOUString( pUri->query, RTL_TEXTENCODING_UTF8 ); } if ( pUri->fragment ) { - mPath += "#" + OUString::fromUtf8( pUri->fragment ); + mPath += "#" + OStringToOUString( pUri->fragment, RTL_TEXTENCODING_UTF8 ); } } diff --git a/ucb/source/ucp/webdav/DAVProperties.cxx b/ucb/source/ucp/webdav/DAVProperties.cxx index 4162f4f6db09..34537d29e663 100644 --- a/ucb/source/ucp/webdav/DAVProperties.cxx +++ b/ucb/source/ucp/webdav/DAVProperties.cxx @@ -113,8 +113,10 @@ void DAVProperties::createUCBPropName( const char * nspace, const char * name, OUString & rFullName ) { - OUString aNameSpace = OUString::fromUtf8( nspace ); - OUString aName = OUString::fromUtf8( name ); + OUString aNameSpace + = OStringToOUString( nspace, RTL_TEXTENCODING_UTF8 ); + OUString aName + = OStringToOUString( name, RTL_TEXTENCODING_UTF8 ); if ( !aNameSpace.getLength() ) { diff --git a/ucb/source/ucp/webdav/SerfUri.cxx b/ucb/source/ucp/webdav/SerfUri.cxx index 5c44cca7f200..df299338667e 100644 --- a/ucb/source/ucp/webdav/SerfUri.cxx +++ b/ucb/source/ucp/webdav/SerfUri.cxx @@ -93,22 +93,22 @@ SerfUri::SerfUri( const OUString & inUri ) void SerfUri::init( const apr_uri_t * pUri ) { - mScheme = OUString::fromUtf8( pUri->scheme ); - mUserInfo = OUString::fromUtf8( pUri->user ); - mHostName = OUString::fromUtf8( pUri->hostname ); + mScheme = OStringToOUString( pUri->scheme, RTL_TEXTENCODING_UTF8 ); + mUserInfo = OStringToOUString( pUri->user, RTL_TEXTENCODING_UTF8 ); + mHostName = OStringToOUString( pUri->hostname, RTL_TEXTENCODING_UTF8 ); mPort = pUri->port; - mPath = OUString::fromUtf8( pUri->path ); + mPath = OStringToOUString( pUri->path, RTL_TEXTENCODING_UTF8 ); if ( pUri->query ) { mPath += "?"; - mPath += OUString::fromUtf8( pUri->query ); + mPath += OStringToOUString( pUri->query, RTL_TEXTENCODING_UTF8 ); } if ( pUri->fragment ) { mPath += "#"; - mPath += OUString::fromUtf8( pUri->fragment ); + mPath += OStringToOUString( pUri->fragment, RTL_TEXTENCODING_UTF8 ); } } diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx index f835e6dab6de..68c5c82a4e6b 100644 --- a/unoxml/source/dom/attr.cxx +++ b/unoxml/source/dom/attr.cxx @@ -238,7 +238,8 @@ namespace DOM if (m_pNamespace.get()) { OSL_ASSERT(!m_aNodePtr->parent); - OUString const ret(OUString::fromUtf8(m_pNamespace->second)); + OUString const ret(OStringToOUString( + m_pNamespace->second, RTL_TEXTENCODING_UTF8)); return ret; } else { return CNode::getPrefix(); @@ -254,7 +255,8 @@ namespace DOM if (m_pNamespace.get()) { OSL_ASSERT(!m_aNodePtr->parent); - OUString const ret(OUString::fromUtf8(m_pNamespace->first)); + OUString const ret(OStringToOUString( + m_pNamespace->first, RTL_TEXTENCODING_UTF8)); return ret; } else { return CNode::getNamespaceURI(); diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx index 9f5888dba942..1033a7c9aabf 100644 --- a/unoxml/source/dom/characterdata.cxx +++ b/unoxml/source/dom/characterdata.cxx @@ -88,7 +88,7 @@ namespace DOM ::boost::shared_ptr<xmlChar const> const pContent( xmlNodeGetContent(m_aNodePtr), xmlFree); OString aData(reinterpret_cast<sal_Char const*>(pContent.get())); - OUString tmp(OUString::fromUtf8(aData)); + OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0 || count < 0) { DOMException e; e.Code = DOMExceptionType_INDEX_SIZE_ERR; @@ -159,7 +159,7 @@ namespace DOM ::boost::shared_ptr<xmlChar const> const pContent( xmlNodeGetContent(m_aNodePtr), xmlFree); OString aData(reinterpret_cast<sal_Char const*>(pContent.get())); - OUString tmp(OUString::fromUtf8(aData)); + OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0) { DOMException e; e.Code = DOMExceptionType_INDEX_SIZE_ERR; @@ -194,7 +194,7 @@ namespace DOM ::boost::shared_ptr<xmlChar const> const pContent( xmlNodeGetContent(m_aNodePtr), xmlFree); OString aData(reinterpret_cast<sal_Char const*>(pContent.get())); - OUString tmp(OUString::fromUtf8(aData)); + OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0 || count < 0){ DOMException e; e.Code = DOMExceptionType_INDEX_SIZE_ERR; @@ -249,7 +249,7 @@ namespace DOM ::boost::shared_ptr<xmlChar const> const pContent( xmlNodeGetContent(m_aNodePtr), xmlFree); OString aData(reinterpret_cast<sal_Char const*>(pContent.get())); - OUString tmp(OUString::fromUtf8(aData)); + OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0 || count < 0) { DOMException e; e.Code = DOMExceptionType_INDEX_SIZE_ERR; diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 0013f400b98d..1bec82992295 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -2319,7 +2319,9 @@ librdf_TypeConverter::convertToXURI(librdf_uri* i_pURI) const "librdf_TypeConverter::convertToXURI: " "librdf_uri_as_string failed", m_rRep); } - OUString uriU( OUString::fromUtf8( OString(reinterpret_cast<const sal_Char*>(uri))) ); + OUString uriU( OStringToOUString( + OString(reinterpret_cast<const sal_Char*>(uri)), + RTL_TEXTENCODING_UTF8) ); try { return rdf::URI::create(m_xContext, uriU); } catch (const lang::IllegalArgumentException & iae) { @@ -2358,7 +2360,9 @@ librdf_TypeConverter::convertToXResource(librdf_node* i_pNode) const "librdf_TypeConverter::convertToXResource: " "blank node has no label", m_rRep); } - OUString labelU( OUString::fromUtf8( OString(reinterpret_cast<const sal_Char*>(label))) ); + OUString labelU( OStringToOUString( + OString(reinterpret_cast<const sal_Char*>(label)), + RTL_TEXTENCODING_UTF8) ); try { return uno::Reference<rdf::XResource>( rdf::BlankNode::create(m_xContext, labelU), uno::UNO_QUERY); @@ -2391,9 +2395,13 @@ librdf_TypeConverter::convertToXNode(librdf_node* i_pNode) const librdf_uri* pType( librdf_node_get_literal_value_datatype_uri(i_pNode) ); OSL_ENSURE(!lang || !pType, "convertToXNode: invalid literal"); - const OUString valueU( OUString::fromUtf8(OString(reinterpret_cast<const sal_Char*>(value))) ); + const OUString valueU( OStringToOUString( + OString(reinterpret_cast<const sal_Char*>(value)), + RTL_TEXTENCODING_UTF8) ); if (lang) { - const OUString langU( OUString::fromUtf8( OString(reinterpret_cast<const sal_Char*>(lang))) ); + const OUString langU( OStringToOUString( + OString(reinterpret_cast<const sal_Char*>(lang)), + RTL_TEXTENCODING_UTF8) ); return uno::Reference<rdf::XNode>( rdf::Literal::createWithLanguage(m_xContext, valueU, langU), uno::UNO_QUERY); 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_map<OString, int, continue; } - int nFamilyName = m_pAtoms->getAtom( 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<PrintFont*>::const_iterator second_font = aFonts.begin(); ++second_font; @@ -630,7 +630,7 @@ void PrintFontManager::countFontconfigFonts( boost::unordered_map<OString, int, pUpdate->m_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 diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index cfc2ca735d90..ffe94bfd11c2 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -231,7 +231,7 @@ bool Edit::set_property(const OString &rKey, const OString &rValue) SetStyle(nBits); } else if (rKey == "placeholder-text") - SetPlaceholderText(OUString::fromUtf8(rValue)); + SetPlaceholderText(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else return Control::set_property(rKey, rValue); return true; diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index d86356e056ff..a0d3da11eccd 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -1049,7 +1049,7 @@ Image FixedImage::loadThemeImage(const OString &rFileName) static ImplImageTreeSingletonRef aImageTree; OUString sIconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme(); - const OUString sFileName(OUString::fromUtf8(rFileName)); + const OUString sFileName(OStringToOUString(rFileName, RTL_TEXTENCODING_UTF8)); BitmapEx aBitmap; bool bSuccess = aImageTree->loadImage(sFileName, sIconTheme, aBitmap, true); SAL_WARN_IF(!bSuccess, "vcl.layout", "Unable to load " << sFileName diff --git a/vcl/source/control/fixedhyper.cxx b/vcl/source/control/fixedhyper.cxx index 701c529985cf..6926a0c843c6 100644 --- a/vcl/source/control/fixedhyper.cxx +++ b/vcl/source/control/fixedhyper.cxx @@ -134,7 +134,7 @@ void FixedHyperlink::SetText(const OUString& rNewDescription) bool FixedHyperlink::set_property(const OString &rKey, const OString &rValue) { if (rKey == "uri") - SetURL(OUString::fromUtf8(rValue)); + SetURL(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else return FixedText::set_property(rKey, rValue); return true; diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 11d2b9f2e156..8c58442ba063 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1366,7 +1366,7 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt ) } else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { - OUString aHelpId( OUString::fromUtf8( GetHelpId( nItemId ) ) ); + OUString aHelpId( OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) ); if ( !aHelpId.isEmpty() ) { // call Help if existing @@ -1962,7 +1962,7 @@ const OUString& TabControl::GetHelpText( sal_uInt16 nPageId ) const { Help* pHelp = Application::GetHelp(); if ( pHelp ) - pItem->maHelpText = pHelp->GetHelpText( OUString::fromUtf8( pItem->maHelpId ), this ); + pItem->maHelpText = pHelp->GetHelpText( OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this ); } return pItem->maHelpText; } diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 243668edbcf0..b7d046686b5d 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -2199,14 +2199,14 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData ) if( GRAPHIC_NONE == pData->maGraphic.GetType() || pData->maGraphic.GetContext() ) // Import { // Import - nFormat = GetImportFormatNumberForShortName( OUString::fromUtf8( aShortName) ); + nFormat = GetImportFormatNumberForShortName( OStringToOUString( aShortName, RTL_TEXTENCODING_UTF8) ); nRet = ImportGraphic( pData->maGraphic, OUString(), pData->mrStm, nFormat ) == 0; } #ifndef DISABLE_EXPORT else if( !aShortName.isEmpty() ) { // Export - nFormat = GetExportFormatNumberForShortName( OUString::fromUtf8(aShortName) ); + nFormat = GetExportFormatNumberForShortName( OStringToOUString(aShortName, RTL_TEXTENCODING_UTF8) ); nRet = ExportGraphic( pData->maGraphic, OUString(), pData->mrStm, nFormat ) == 0; } #endif diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx index e803b00d54da..e81bafe54269 100644 --- a/vcl/source/gdi/impimagetree.cxx +++ b/vcl/source/gdi/impimagetree.cxx @@ -326,8 +326,8 @@ void ImplImageTree::parseLinkFile(boost::shared_ptr< SvStream > pStream) continue; sal_Int32 nIndex = 0; - aLink = OUString::fromUtf8( aLine.getToken(0, ' ', nIndex) ); - aOriginal = OUString::fromUtf8( aLine.getToken(0, ' ', nIndex) ); + aLink = OStringToOUString( aLine.getToken(0, ' ', nIndex), RTL_TEXTENCODING_UTF8 ); + aOriginal = OStringToOUString( aLine.getToken(0, ' ', nIndex), RTL_TEXTENCODING_UTF8 ); // skip comments, or incomplete entries if (aLink.isEmpty() || aLink[0] == '#' || aOriginal.isEmpty()) diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 71531495ac00..9431819075b7 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -833,7 +833,7 @@ namespace if (!rFrame.is()) return; - OUString aCommand(OUString::fromUtf8(extractActionName(rMap))); + OUString aCommand(OStringToOUString(extractActionName(rMap), RTL_TEXTENCODING_UTF8)); if (aCommand.isEmpty()) return; @@ -1393,7 +1393,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c MetricField *pField = new MetricField(pParent, nBits); pField->SetUnit(eUnit); if (eUnit == FUNIT_CUSTOM) - pField->SetCustomUnitText(OUString::fromUtf8(sUnit)); + pField->SetCustomUnitText(OStringToOUString(sUnit, RTL_TEXTENCODING_UTF8)); pWindow = pField; } } @@ -1427,7 +1427,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c pBox->SetUnit(eUnit); pBox->SetDecimalDigits(extractDecimalDigits(sPattern)); if (eUnit == FUNIT_CUSTOM) - pBox->SetCustomUnitText(OUString::fromUtf8(sUnit)); + pBox->SetCustomUnitText(OStringToOUString(sUnit, RTL_TEXTENCODING_UTF8)); pWindow = pBox; } else if (extractEntry(rMap)) @@ -1438,7 +1438,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c { sal_uInt16 nActiveId = extractActive(rMap); for (std::vector<OString>::const_iterator aI = rItems.begin(), aEnd = rItems.end(); aI != aEnd; ++aI) - pComboBox->InsertEntry(OUString::fromUtf8(*aI)); + pComboBox->InsertEntry(OStringToOUString(*aI, RTL_TEXTENCODING_UTF8)); if (nActiveId < rItems.size()) pComboBox->SelectEntryPos(nActiveId); } @@ -1452,7 +1452,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c { sal_uInt16 nActiveId = extractActive(rMap); for (std::vector<OString>::const_iterator aI = rItems.begin(), aEnd = rItems.end(); aI != aEnd; ++aI) - pListBox->InsertEntry(OUString::fromUtf8(*aI)); + pListBox->InsertEntry(OStringToOUString(*aI, RTL_TEXTENCODING_UTF8)); if (nActiveId < rItems.size()) pListBox->SelectEntryPos(nActiveId); } @@ -1483,7 +1483,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c pBox->SetUnit(eUnit); pBox->SetDecimalDigits(extractDecimalDigits(sPattern)); if (eUnit == FUNIT_CUSTOM) - pBox->SetCustomUnitText(OUString::fromUtf8(sUnit)); + pBox->SetCustomUnitText(OStringToOUString(sUnit, RTL_TEXTENCODING_UTF8)); pWindow = pBox; } else @@ -1617,7 +1617,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c ToolBox *pToolBox = dynamic_cast<ToolBox*>(pParent); if (pToolBox) { - OUString aCommand(OUString::fromUtf8(extractActionName(rMap))); + OUString aCommand(OStringToOUString(extractActionName(rMap), RTL_TEXTENCODING_UTF8)); sal_uInt16 nItemId = 0; ToolBoxItemBits nBits = ToolBoxItemBits::NONE; @@ -1634,14 +1634,14 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c const sal_uInt16 COMMAND_ITEMID_START = 30000; nItemId = COMMAND_ITEMID_START + pToolBox->GetItemCount(); pToolBox->InsertItem(nItemId, - OUString::fromUtf8(extractLabel(rMap)), nBits); + OStringToOUString(extractLabel(rMap), RTL_TEXTENCODING_UTF8), nBits); pToolBox->SetItemCommand(nItemId, aCommand); pToolBox->SetHelpId(nItemId, m_sHelpRoot + id); } OString sTooltip(extractTooltipText(rMap)); if (!sTooltip.isEmpty()) - pToolBox->SetQuickHelpText(nItemId, OUString::fromUtf8(sTooltip)); + pToolBox->SetQuickHelpText(nItemId, OStringToOUString(sTooltip, RTL_TEXTENCODING_UTF8)); OString sIconName(extractIconName(rMap)); if (!sIconName.isEmpty()) @@ -1679,10 +1679,10 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c #ifdef SAL_DLLPREFIX sModuleBuf.append(SAL_DLLPREFIX); #endif - sModuleBuf.append(OUString::fromUtf8(name.copy(0, nDelim))); + sModuleBuf.append(OStringToOUString(name.copy(0, nDelim), RTL_TEXTENCODING_UTF8)); sModuleBuf.append(SAL_DLLEXTENSION); #endif - OUString sFunction(OUString::fromUtf8(OString("make") + name.copy(nDelim+1))); + OUString sFunction(OStringToOUString(OString("make") + name.copy(nDelim+1), RTL_TEXTENCODING_UTF8)); #ifndef DISABLE_DYNLOADING OUString sModule = sModuleBuf.makeStringAndClear(); ModuleMap::iterator aI = m_aModuleMap.find(sModule); @@ -1886,7 +1886,8 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read if (aFind != aProperties.end()) { sal_uInt16 nPageId = pTabControl->GetCurPageId(); - pTabControl->SetPageText(nPageId, OUString::fromUtf8(aFind->second)); + pTabControl->SetPageText(nPageId, + OStringToOUString(aFind->second, RTL_TEXTENCODING_UTF8)); pTabControl->SetPageName(nPageId, sID); } else @@ -2446,7 +2447,7 @@ std::vector<OString> VclBuilder::handleItems(xmlreader::XmlReader &reader, const if (m_pStringReplace) { - OUString sTmp = (*m_pStringReplace)(OUString::fromUtf8(sValue)); + OUString sTmp = (*m_pStringReplace)(OStringToOUString(sValue, RTL_TEXTENCODING_UTF8)); sValue = OUStringToOString(sTmp, RTL_TEXTENCODING_UTF8); } @@ -2710,7 +2711,7 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, const OString &rClass, con if (rClass == "GtkMenuItem") { - OUString sLabel(OUString::fromUtf8(convertMnemonicMarkup(extractLabel(rProps)))); + OUString sLabel(OStringToOUString(convertMnemonicMarkup(extractLabel(rProps)), RTL_TEXTENCODING_UTF8)); pParent->InsertItem(nNewId, sLabel, MenuItemBits::TEXT, rID); } else if (rClass == "GtkSeparatorMenuItem") @@ -2730,9 +2731,9 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, const OString &rClass, con const OString &rValue = aI->second; if (rKey == "tooltip-markup") - pParent->SetTipHelpText(nNewId, OUString::fromUtf8(rValue)); + pParent->SetTipHelpText(nNewId, OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else if (rKey == "tooltip-text") - pParent->SetTipHelpText(nNewId, OUString::fromUtf8(rValue)); + pParent->SetTipHelpText(nNewId, OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else if (rKey == "visible") pParent->ShowItem(nNewId, toBool(rValue)); else if (rKey == "has-default" && toBool(rValue)) @@ -3062,7 +3063,7 @@ void VclBuilder::collectProperty(xmlreader::XmlReader &reader, const OString &rI sProperty = sProperty.replace('_', '-'); if (m_pStringReplace) { - OUString sTmp = (*m_pStringReplace)(OUString::fromUtf8(sValue)); + OUString sTmp = (*m_pStringReplace)(OStringToOUString(sValue, RTL_TEXTENCODING_UTF8)); rMap[sProperty] = OUStringToOString(sTmp, RTL_TEXTENCODING_UTF8); } else @@ -3290,7 +3291,7 @@ void VclBuilder::mungeModel(ListBox &rTarget, const ListStore &rStore, sal_uInt1 aI != aEnd; ++aI) { const ListStore::row &rRow = *aI; - sal_uInt16 nEntry = rTarget.InsertEntry(OUString::fromUtf8(rRow[0])); + sal_uInt16 nEntry = rTarget.InsertEntry(OStringToOUString(rRow[0], RTL_TEXTENCODING_UTF8)); if (rRow.size() > 1) { sal_IntPtr nValue = rRow[1].toInt32(); @@ -3433,7 +3434,7 @@ void VclBuilder::mungeTextBuffer(VclMultiLineEdit &rTarget, const TextBuffer &rT const OString &rValue = aI->second; if (rKey == "text") - rTarget.SetText(OUString::fromUtf8(rValue)); + rTarget.SetText(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else { SAL_INFO("vcl.layout", "unhandled property :" << rKey.getStr()); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 2a56ca99c00a..590525fe3b4d 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2220,9 +2220,9 @@ OUString MessageDialog::get_secondary_text() const bool MessageDialog::set_property(const OString &rKey, const OString &rValue) { if (rKey == "text") - set_primary_text(OUString::fromUtf8(rValue)); + set_primary_text(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else if (rKey == "secondary-text") - set_secondary_text(OUString::fromUtf8(rValue)); + set_secondary_text(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else if (rKey == "message-type") { VclMessageType eMode = VCL_MESSAGE_INFO; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 03ca36f214d6..546725aed72b 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1182,7 +1182,7 @@ OUString Menu::ImplGetHelpText( sal_uInt16 nItemId ) const if (!pData->aCommandStr.isEmpty()) pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL ); if (pData->aHelpText.isEmpty() && !pData->aHelpId.isEmpty()) - pData->aHelpText = pHelp->GetHelpText( OUString::fromUtf8( pData->aHelpId ), NULL ); + pData->aHelpText = pHelp->GetHelpText( OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL ); } } diff --git a/vcl/source/window/menuwindow.cxx b/vcl/source/window/menuwindow.cxx index 88b0e8ab159c..ddfe6bffbc97 100644 --- a/vcl/source/window/menuwindow.cxx +++ b/vcl/source/window/menuwindow.cxx @@ -151,7 +151,7 @@ bool MenuWindow::ImplHandleHelpEvent(vcl::Window* pMenuWindow, Menu* pMenu, sal_ if ( !aCommand.isEmpty() ) pHelp->Start( aCommand, NULL ); else - pHelp->Start( OUString::fromUtf8( aHelpId ), NULL ); + pHelp->Start( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL ); } bDone = true; } diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 4acd97de0e8a..715e75e2909d 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -775,7 +775,7 @@ void PrintDialog::storeToSettings() mpTabCtrl->GetPageText( mpTabCtrl->GetCurPageId() ) ); pItem->setValue( OUString( "PrintDialog" ), OUString( "WindowState" ), - OUString::fromUtf8( GetWindowState() ) + OStringToOUString( GetWindowState(), RTL_TEXTENCODING_UTF8 ) ); pItem->Commit(); } diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index ad9e04dacc8b..c4ccf055f433 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -800,7 +800,7 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt ) if ( !aCommand.isEmpty() ) pHelp->Start( aCommand, this ); else if ( !aHelpId.isEmpty() ) - pHelp->Start( OUString::fromUtf8( aHelpId ), this ); + pHelp->Start( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this ); } return; } @@ -1263,7 +1263,7 @@ const OUString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const if ( !pItem->maCommand.isEmpty() ) pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this ); if ( pItem->maHelpText.isEmpty() && !pItem->maHelpId.isEmpty() ) - pItem->maHelpText = pHelp->GetHelpText( OUString::fromUtf8( pItem->maHelpId ), this ); + pItem->maHelpText = pHelp->GetHelpText( OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this ); } } diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 33402393a4ac..4fc17254545b 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -4182,7 +4182,7 @@ const OUString& ToolBox::ImplGetHelpText( sal_uInt16 nItemId ) const if ( pItem->maCommandStr.getLength() ) pItem->maHelpText = pHelp->GetHelpText( pItem->maCommandStr, this ); if ( pItem->maHelpText.isEmpty() && !pItem->maHelpId.isEmpty() ) - pItem->maHelpText = pHelp->GetHelpText( OUString::fromUtf8( pItem->maHelpId ), this ); + pItem->maHelpText = pHelp->GetHelpText( OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this ); } } @@ -4254,7 +4254,7 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt ) if ( !aCommand.isEmpty() ) pHelp->Start( aCommand, this ); else if ( !aHelpId.isEmpty() ) - pHelp->Start( OUString::fromUtf8( aHelpId ), this ); + pHelp->Start( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this ); } return; } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index adfde5afb448..b4468848ef20 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -273,7 +273,8 @@ Window::~Window() aTempStr.append(aErrorStr.toString()); OSL_FAIL(aTempStr.getStr()); // abort in debug builds, must be fixed! - Application::Abort(OUString::fromUtf8(aTempStr.makeStringAndClear())); + Application::Abort(OStringToOUString( + aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); } } @@ -295,7 +296,7 @@ Window::~Window() aTempStr.append(") with live SystemWindows destroyed: "); aTempStr.append(aErrorStr.toString()); OSL_FAIL( aTempStr.getStr() ); - Application::Abort(OUString::fromUtf8(aTempStr.makeStringAndClear())); // abort in debug builds, this must be fixed! + Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed! } if ( mpWindowImpl->mpFirstChild ) @@ -310,7 +311,7 @@ Window::~Window() pTempWin = pTempWin->mpWindowImpl->mpNext; } OSL_FAIL( aTempStr.getStr() ); - Application::Abort(OUString::fromUtf8(aTempStr.makeStringAndClear())); // abort in debug builds, this must be fixed! + Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed! } if ( mpWindowImpl->mpFirstOverlap ) @@ -325,7 +326,7 @@ Window::~Window() pTempWin = pTempWin->mpWindowImpl->mpNext; } OSL_FAIL( aTempStr.getStr() ); - Application::Abort(OUString::fromUtf8(aTempStr.makeStringAndClear())); // abort in debug builds, this must be fixed! + Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed! } vcl::Window* pMyParent = GetParent(); @@ -345,7 +346,7 @@ Window::~Window() aTempStr.append(OUStringToOString(GetText(), RTL_TEXTENCODING_UTF8)); aTempStr.append(") still in TaskPanelList!"); OSL_FAIL( aTempStr.getStr() ); - Application::Abort(OUString::fromUtf8(aTempStr.makeStringAndClear())); // abort in debug builds, this must be fixed! + Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed! } } #endif @@ -416,7 +417,7 @@ Window::~Window() RTL_TEXTENCODING_UTF8)). append(") with focussed child window destroyed ! THIS WILL LEAD TO CRASHES AND MUST BE FIXED !"); OSL_FAIL( aTempStr.getStr() ); - Application::Abort(OUString::fromUtf8(aTempStr.makeStringAndClear())); // abort in debug build version, this must be fixed! + Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8 )); // abort in debug build version, this must be fixed! #endif } @@ -1945,7 +1946,7 @@ void Window::RequestHelp( const HelpEvent& rHEvt ) } else { - OUString aStrHelpId( OUString::fromUtf8( GetHelpId() ) ); + OUString aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); if ( aStrHelpId.isEmpty() && ImplGetParent() ) ImplGetParent()->RequestHelp( rHEvt ); else @@ -3208,7 +3209,7 @@ const Wallpaper& Window::GetDisplayBackground() const const OUString& Window::GetHelpText() const { - OUString aStrHelpId( OUString::fromUtf8( GetHelpId() ) ); + OUString aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); bool bStrHelpId = !aStrHelpId.isEmpty(); if ( !mpWindowImpl->maHelpText.getLength() && bStrHelpId ) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 8db9d7f81b98..5f6c8a66e32b 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1539,7 +1539,7 @@ bool Window::set_property(const OString &rKey, const OString &rValue) { if ((rKey == "label") || (rKey == "title") || (rKey == "text") ) { - SetText(OUString::fromUtf8(VclBuilder::convertMnemonicMarkup(rValue))); + SetText(OStringToOUString(VclBuilder::convertMnemonicMarkup(rValue), RTL_TEXTENCODING_UTF8)); } else if (rKey == "visible") Show(toBool(rValue)); @@ -1618,9 +1618,9 @@ bool Window::set_property(const OString &rKey, const OString &rValue) else if (rKey == "valign") set_valign(toAlign(rValue)); else if (rKey == "tooltip-markup") - SetQuickHelpText(OUString::fromUtf8(rValue)); + SetQuickHelpText(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else if (rKey == "tooltip-text") - SetQuickHelpText(OUString::fromUtf8(rValue)); + SetQuickHelpText(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else if (rKey == "border-width") set_border_width(rValue.toInt32()); else if (rKey == "margin-left") @@ -1653,11 +1653,11 @@ bool Window::set_property(const OString &rKey, const OString &rValue) } else if (rKey == "accessible-name") { - SetAccessibleName(OUString::fromUtf8(rValue)); + SetAccessibleName(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); } else if (rKey == "accessible-description") { - SetAccessibleDescription(OUString::fromUtf8(rValue)); + SetAccessibleDescription(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); } else if (rKey == "use-markup") { diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx index 5732ac20571c..015f226ed8fb 100644 --- a/vcl/unx/generic/app/i18n_cb.cxx +++ b/vcl/unx/generic/app/i18n_cb.cxx @@ -523,7 +523,7 @@ void SwitchIMCallback (XIC, XPointer, XPointer call_data) { XIMSwitchIMNotifyCallbackStruct* pCallData = (XIMSwitchIMNotifyCallbackStruct*)call_data; - ::vcl::I18NStatus::get().changeIM( OUString::fromUtf8(pCallData->to->name) ); + ::vcl::I18NStatus::get().changeIM( OStringToOUString(pCallData->to->name, RTL_TEXTENCODING_UTF8) ); } // vii. destroy callbacks: internally disable all IC/IM calls diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx index ea7bb0de3735..389f74dc8be8 100644 --- a/vcl/unx/generic/printer/jobdata.cxx +++ b/vcl/unx/generic/printer/jobdata.cxx @@ -219,7 +219,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa else if (aLine.startsWith(printerEquals)) { bPrinter = true; - rJobData.m_aPrinterName = OUString::fromUtf8(aLine.copy(RTL_CONSTASCII_LENGTH(printerEquals))); + rJobData.m_aPrinterName = OStringToOUString(aLine.copy(RTL_CONSTASCII_LENGTH(printerEquals)), RTL_TEXTENCODING_UTF8); } else if (aLine.startsWith(orientatationEquals)) { diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 97c3668f1542..fecc6ada9054 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -128,8 +128,9 @@ PrinterInfoManager::~PrinterInfoManager() void PrinterInfoManager::initSystemDefaultPaper() { - m_aSystemDefaultPaper = OUString::fromUtf8( - PaperInfo::toPSName(PaperInfo::getSystemDefaultPaper().getPaper())); + m_aSystemDefaultPaper = OStringToOUString( + PaperInfo::toPSName(PaperInfo::getSystemDefaultPaper().getPaper()), + RTL_TEXTENCODING_UTF8); } bool PrinterInfoManager::checkPrintersChanged( bool bWait ) @@ -329,9 +330,10 @@ void PrinterInfoManager::initialize() // initialize to global defaults aPrinter.m_aInfo = m_aGlobalDefaults; - aPrinterName = OUString::fromUtf8(aValue.copy(nNamePos+1)); + aPrinterName = OStringToOUString(aValue.copy(nNamePos+1), + RTL_TEXTENCODING_UTF8); aPrinter.m_aInfo.m_aPrinterName = aPrinterName; - aPrinter.m_aInfo.m_aDriverName = OUString::fromUtf8(aValue.copy(0, nNamePos)); + aPrinter.m_aInfo.m_aDriverName = OStringToOUString(aValue.copy(0, nNamePos), RTL_TEXTENCODING_UTF8); // set parser, merge settings // don't do this for CUPS printers as this is done @@ -385,14 +387,14 @@ void PrinterInfoManager::initialize() aValue = "lpr"; #endif } - aPrinter.m_aInfo.m_aCommand = OUString::fromUtf8(aValue); + aPrinter.m_aInfo.m_aCommand = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); } aValue = aConfig.ReadKey( "QuickCommand" ); - aPrinter.m_aInfo.m_aQuickCommand = OUString::fromUtf8(aValue); + aPrinter.m_aInfo.m_aQuickCommand = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); aValue = aConfig.ReadKey( "Features" ); - aPrinter.m_aInfo.m_aFeatures = OUString::fromUtf8(aValue); + aPrinter.m_aInfo.m_aFeatures = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); // override the settings in m_aGlobalDefaults if keys exist aValue = aConfig.ReadKey( "DefaultPrinter" ); @@ -400,10 +402,10 @@ void PrinterInfoManager::initialize() aDefaultPrinter = aPrinterName; aValue = aConfig.ReadKey( "Location" ); - aPrinter.m_aInfo.m_aLocation = OUString::fromUtf8(aValue); + aPrinter.m_aInfo.m_aLocation = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); aValue = aConfig.ReadKey( "Comment" ); - aPrinter.m_aInfo.m_aComment = OUString::fromUtf8(aValue); + aPrinter.m_aInfo.m_aComment = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); aValue = aConfig.ReadKey( "Copies" ); if (!aValue.isEmpty()) diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx index 081542e5af45..fe2f0d5e2f52 100644 --- a/vcl/unx/gtk/a11y/atktextattributes.cxx +++ b/vcl/unx/gtk/a11y/atktextattributes.cxx @@ -542,7 +542,7 @@ SetString( uno::Any& rAny, const gchar * value ) if( !aFontName.isEmpty() ) { - rAny = uno::makeAny( OUString::fromUtf8( aFontName ) ); + rAny = uno::makeAny( OStringToOUString( aFontName, RTL_TEXTENCODING_UTF8 ) ); return true; } diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 405c4719f10f..4eeafb1aeff7 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -938,7 +938,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException, std gchar *gFileName = g_filename_from_uri ( sFileName.getStr(), NULL, NULL ); if( g_file_test( gFileName, G_FILE_TEST_IS_REGULAR ) ) { - INetURLObject aFileObj( OUString::fromUtf8(sFileName) ); + INetURLObject aFileObj( OStringToOUString(sFileName, RTL_TEXTENCODING_UTF8) ); OString baseName( OUStringToOString( @@ -1382,7 +1382,7 @@ OUString SAL_CALL SalGtkFilePicker::getLabel( sal_Int16 nControlId ) else OSL_TRACE("Can't get label on list"); - return OUString::fromUtf8( aTxt ); + return OStringToOUString( aTxt, RTL_TEXTENCODING_UTF8 ); } // XFilePreview functions diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 6d669e88fcd7..bab4f5c6f888 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -3898,7 +3898,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) psp::FastPrintFontInfo aInfo; // set family name - aInfo.m_aFamilyName = OUString::fromUtf8( aFamily ); + aInfo.m_aFamilyName = OStringToOUString( aFamily, RTL_TEXTENCODING_UTF8 ); // set italic switch( eStyle ) { diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 96b73c7c218d..66d0dddba5d7 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1283,7 +1283,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) psp::FastPrintFontInfo aInfo; // set family name - aInfo.m_aFamilyName = OUString::fromUtf8( aFamily ); + aInfo.m_aFamilyName = OStringToOUString( aFamily, RTL_TEXTENCODING_UTF8 ); // set italic switch( eStyle ) { diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx index 2604b7a5417c..036b52d72e2a 100644 --- a/writerfilter/source/dmapper/BorderHandler.cxx +++ b/writerfilter/source/dmapper/BorderHandler.cxx @@ -67,7 +67,7 @@ void BorderHandler::lcl_attribute(Id rName, Value & rVal) break; case NS_ooxml::LN_CT_Border_color: m_nLineColor = nIntValue; - appendGrabBag("color", OUString::fromUtf8(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true))); + appendGrabBag("color", OStringToOUString(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true), RTL_TEXTENCODING_UTF8)); break; case NS_ooxml::LN_CT_Border_space: // border distance in points m_nLineDistance = ConversionHelper::convertTwipToMM100( nIntValue * 20 ); diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx index 795c97177ff2..4b6657c6ea2f 100644 --- a/writerfilter/source/dmapper/CellColorHandler.cxx +++ b/writerfilter/source/dmapper/CellColorHandler.cxx @@ -106,13 +106,13 @@ void CellColorHandler::lcl_attribute(Id rName, Value & rVal) } break; case NS_ooxml::LN_CT_Shd_fill: - createGrabBag("fill", uno::makeAny(OUString::fromUtf8(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true)))); + createGrabBag("fill", uno::makeAny(OStringToOUString(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true), RTL_TEXTENCODING_UTF8))); if( nIntValue == OOXML_COLOR_AUTO ) nIntValue = 0xffffff; //fill color auto means white m_nFillColor = nIntValue; break; case NS_ooxml::LN_CT_Shd_color: - createGrabBag("color", uno::makeAny(OUString::fromUtf8(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true)))); + createGrabBag("color", uno::makeAny(OStringToOUString(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true), RTL_TEXTENCODING_UTF8))); if( nIntValue == OOXML_COLOR_AUTO ) nIntValue = 0; //shading color auto means black //color of the shading @@ -272,8 +272,8 @@ TablePropertyMapPtr CellColorHandler::getProperties() : m_OutputFormat == Paragraph ? PROP_PARA_BACK_COLOR : PROP_CHAR_BACK_COLOR, uno::makeAny( nApplyColor )); - createGrabBag("originalColor", uno::makeAny( OUString::fromUtf8( - msfilter::util::ConvertColor( nApplyColor, true ) ))); + createGrabBag("originalColor", uno::makeAny( OStringToOUString( + msfilter::util::ConvertColor( nApplyColor, true ), RTL_TEXTENCODING_UTF8 ))); return pPropertyMap; } diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index d4e0c7bd1746..1c7b19d00db6 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -277,7 +277,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_Color_val: if (m_pImpl->GetTopContext()) m_pImpl->GetTopContext()->Insert(PROP_CHAR_COLOR, uno::makeAny( nIntValue ) ); - m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "val", OUString::fromUtf8(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true))); + m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "val", OStringToOUString(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true), RTL_TEXTENCODING_UTF8)); break; case NS_ooxml::LN_CT_Underline_color: if (m_pImpl->GetTopContext()) diff --git a/writerfilter/source/dmapper/TDefTableHandler.cxx b/writerfilter/source/dmapper/TDefTableHandler.cxx index ad23035ed677..e2c32ec6813b 100644 --- a/writerfilter/source/dmapper/TDefTableHandler.cxx +++ b/writerfilter/source/dmapper/TDefTableHandler.cxx @@ -292,7 +292,7 @@ void TDefTableHandler::lcl_attribute(Id rName, Value & rVal) appendGrabBag("val", TDefTableHandler::getBorderTypeString(nIntValue)); break; case NS_ooxml::LN_CT_Border_color: - appendGrabBag("color", OUString::fromUtf8(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true))); + appendGrabBag("color", OStringToOUString(msfilter::util::ConvertColor(nIntValue, /*bAutoColor=*/true), RTL_TEXTENCODING_UTF8)); m_nLineColor = nIntValue; break; case NS_ooxml::LN_CT_Border_space: diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx index 91722703b94e..baf7049ec0c7 100644 --- a/writerfilter/source/filter/RtfFilter.cxx +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -85,7 +85,7 @@ sal_Bool RtfFilter::filter(const uno::Sequence< beans::PropertyValue >& aDescrip // If this is set, write to this file, instead of the real document during paste. char* pEnv = getenv("SW_DEBUG_RTF_PASTE_TO"); OUString aOutStr; - if (!bIsNewDoc && pEnv && utl::LocalFileHelper::ConvertPhysicalNameToURL(OUString::fromUtf8(pEnv), aOutStr)) + if (!bIsNewDoc && pEnv && utl::LocalFileHelper::ConvertPhysicalNameToURL(OStringToOUString(pEnv, RTL_TEXTENCODING_UTF8), aOutStr)) { SvStream* pOut = utl::UcbStreamHelper::CreateStream(aOutStr, STREAM_WRITE); SvStream* pIn = utl::UcbStreamHelper::CreateStream(xInputStream); @@ -99,7 +99,7 @@ sal_Bool RtfFilter::filter(const uno::Sequence< beans::PropertyValue >& aDescrip if (!bIsNewDoc && pEnv) { OUString aInStr; - utl::LocalFileHelper::ConvertPhysicalNameToURL(OUString::fromUtf8(pEnv), aInStr); + utl::LocalFileHelper::ConvertPhysicalNameToURL(OStringToOUString(pEnv, RTL_TEXTENCODING_UTF8), aInStr); SvStream* pStream = utl::UcbStreamHelper::CreateStream(aInStr, STREAM_READ); uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStream)); xInputStream.set(xStream, uno::UNO_QUERY); diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index a123a3a2f89c..bd981f3a6ba0 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -357,11 +357,11 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap xPropertySet->setPropertyValue("FillColor", aAny); // fillType will decide, possible it'll be the start color of a gradient. - aFillModel.moColor.set(OUString("#") + OUString::fromUtf8(msfilter::util::ConvertColor(aAny.get<sal_Int32>()))); + aFillModel.moColor.set(OUString("#") + OStringToOUString(msfilter::util::ConvertColor(aAny.get<sal_Int32>()), RTL_TEXTENCODING_UTF8)); } else if (i->first == "fillBackColor") // fillType will decide, possible it'll be the end color of a gradient. - aFillModel.moColor2.set(OUString("#") + OUString::fromUtf8(msfilter::util::ConvertColor(msfilter::util::BGRToRGB(i->second.toInt32())))); + aFillModel.moColor2.set(OUString("#") + OStringToOUString(msfilter::util::ConvertColor(msfilter::util::BGRToRGB(i->second.toInt32())), RTL_TEXTENCODING_UTF8)); else if (i->first == "lineColor") aLineColor <<= msfilter::util::BGRToRGB(i->second.toInt32()); else if (i->first == "lineBackColor") @@ -564,7 +564,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap aShadowModel.mbHasShadow = true; } else if (i->first == "shadowColor") - aShadowModel.moColor.set(OUString("#") + OUString::fromUtf8(msfilter::util::ConvertColor(msfilter::util::BGRToRGB(i->second.toInt32())))); + aShadowModel.moColor.set(OUString("#") + OStringToOUString(msfilter::util::ConvertColor(msfilter::util::BGRToRGB(i->second.toInt32())), RTL_TEXTENCODING_UTF8)); else if (i->first == "shadowOffsetX") // EMUs to points aShadowModel.moOffset.set(OUString::number(i->second.toDouble() / 12700) + "pt"); diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx index 30779d14b652..3c22f9d3b341 100644 --- a/writerperfect/source/common/WPXSvInputStream.cxx +++ b/writerperfect/source/common/WPXSvInputStream.cxx @@ -206,7 +206,7 @@ SotStorageStreamRef OLEStorageImpl::getStream(const rtl::OUString &rPath) SotStorageStreamRef OLEStorageImpl::getStream(const std::size_t nId) { if (!maStreams[nId].stream.ref.Is()) - maStreams[nId].stream.ref = createStream(rtl::OUString::fromUtf8(maStreams[nId].name)); + maStreams[nId].stream.ref = createStream(rtl::OStringToOUString(maStreams[nId].name, RTL_TEXTENCODING_UTF8)); return maStreams[nId].stream.ref; } @@ -352,7 +352,7 @@ Reference<XInputStream> ZipStorageImpl::getStream(const rtl::OUString &rPath) Reference<XInputStream> ZipStorageImpl::getStream(const std::size_t nId) { if (!maStreams[nId].xStream.is()) - maStreams[nId].xStream = createStream(rtl::OUString::fromUtf8(maStreams[nId].aName)); + maStreams[nId].xStream = createStream(rtl::OStringToOUString(maStreams[nId].aName, RTL_TEXTENCODING_UTF8)); return maStreams[nId].xStream; } @@ -625,7 +625,7 @@ bool WPXSvInputStreamImpl::existsSubStream(const char *const name) PositionHolder pos(mxSeekable); mxSeekable->seek(0); - const rtl::OUString aName(rtl::OUString::fromUtf8(rtl::OString(name))); + const rtl::OUString aName(rtl::OStringToOUString(rtl::OString(name), RTL_TEXTENCODING_UTF8)); if (isOLE()) { @@ -655,7 +655,7 @@ librevenge::RVNGInputStream *WPXSvInputStreamImpl::getSubStreamByName(const char PositionHolder pos(mxSeekable); mxSeekable->seek(0); - const rtl::OUString aName(rtl::OUString::fromUtf8(rtl::OString(name))); + const rtl::OUString aName(rtl::OStringToOUString(rtl::OString(name), RTL_TEXTENCODING_UTF8)); if (isOLE()) { |