diff options
-rw-r--r-- | basic/source/runtime/methods.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxint.cxx | 6 | ||||
-rw-r--r-- | chart2/source/inc/dumpxmltostring.hxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NResultSet.cxx | 2 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_manager.cxx | 2 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 2 | ||||
-rw-r--r-- | framework/source/uielement/spinfieldtoolbarcontroller.cxx | 2 | ||||
-rw-r--r-- | helpcompiler/source/HelpLinker.cxx | 6 | ||||
-rw-r--r-- | jvmfwk/source/fwkbase.cxx | 14 | ||||
-rw-r--r-- | jvmfwk/source/libxmlutil.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/column4.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/dataprovider/csvdataprovider.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/helper.cxx | 2 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 11 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin2.cxx | 5 | ||||
-rw-r--r-- | unoxml/source/dom/characterdata.cxx | 8 |
17 files changed, 33 insertions, 45 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 3e0194f5783f..b6d9383d5b37 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -4168,7 +4168,7 @@ void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool) } } pChar[nSize] = '\0'; - OString aOStr(pChar.get()); + std::string_view aOStr(pChar.get()); // there is no concept about default codepage in unix. so it is incorrectly in unix OUString aOUStr = OStringToOUString(aOStr, encodingVal); diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx index 3e66e83fd7c4..1b57239ddba9 100644 --- a/basic/source/sbx/sbxint.cxx +++ b/basic/source/sbx/sbxint.cxx @@ -485,8 +485,7 @@ start: if( !p->pOUString ) p->pOUString = new OUString; - ::OString aOStr = OString::number( n ); - (*p->pOUString) = ::OStringToOUString( aOStr, RTL_TEXTENCODING_ASCII_US ); + (*p->pOUString) = OUString::number(n); break; } case SbxOBJECT: @@ -742,8 +741,7 @@ start: SbxBase::SetError( ERRCODE_BASIC_CONVERSION ); else { - ::OString aOStr = OString::number( n ); - (*p->pOUString) = ::OStringToOUString( aOStr, RTL_TEXTENCODING_ASCII_US ); + (*p->pOUString) = OUString::number(n); } break; case SbxOBJECT: diff --git a/chart2/source/inc/dumpxmltostring.hxx b/chart2/source/inc/dumpxmltostring.hxx index d03f1cab9d45..b5cfe5a1fab8 100644 --- a/chart2/source/inc/dumpxmltostring.hxx +++ b/chart2/source/inc/dumpxmltostring.hxx @@ -32,9 +32,10 @@ template <typename F> OUString dumpXmlToString(F f) } f(writer); xmlFreeTextWriter(writer); - OString s(reinterpret_cast<char const*>(xmlBufferContent(buf)), xmlBufferLength(buf)); + std::string_view s(reinterpret_cast<char const*>(xmlBufferContent(buf)), xmlBufferLength(buf)); + OUString rv = OStringToOUString(s, RTL_TEXTENCODING_ISO_8859_1); //TODO xmlBufferFree(buf); - return OStringToOUString(s, RTL_TEXTENCODING_ISO_8859_1); //TODO + return rv; } } diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index 965072f70537..2505cbf3dc81 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -88,7 +88,7 @@ static OUString valueToOUString( GValue& _rValue ) { const char *pStr = g_value_get_string( &_rValue ); - OString aStr( pStr ? pStr : "" ); + std::string_view aStr( pStr ? pStr : "" ); OUString sResult( OStringToOUString( aStr, RTL_TEXTENCODING_UTF8 ) ); g_value_unset( &_rValue ); return sResult; diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 570f8be23330..9c4a849e2843 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -251,7 +251,7 @@ void PackageManagerImpl::initActivationLayer( ucbhelper::Content remFileContent( url + "removed", Reference<XCommandEnvironment>(), m_xComponentContext); std::vector<sal_Int8> data = dp_misc::readFile(remFileContent); - OString osData(reinterpret_cast<const char*>(data.data()), + std::string_view osData(reinterpret_cast<const char*>(data.data()), data.size()); OUString sData = OStringToOUString( osData, RTL_TEXTENCODING_UTF8); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 9722be530db2..1a29cdd4ce05 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -348,7 +348,7 @@ static OUString getUString(const char* pString) if (pString == nullptr) return OUString(); - OString sString(pString, strlen(pString)); + std::string_view sString(pString, strlen(pString)); return OStringToOUString(sString, RTL_TEXTENCODING_UTF8); } diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx index fdcac34fd1fe..ce74c9041ef9 100644 --- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx +++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx @@ -441,7 +441,7 @@ OUString SpinfieldToolbarController::FormatOutputString( double fValue ) snprintf( aBuffer, 128, aFormat.getStr(), static_cast<tools::Long>( fValue )); sal_Int32 nSize = strlen( aBuffer ); - OString aTmp( aBuffer, nSize ); + std::string_view aTmp( aBuffer, nSize ); return OStringToOUString( aTmp, osl_getThreadTextEncoding() ); #endif } diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx index e95b9168bf17..708f12a64114 100644 --- a/helpcompiler/source/HelpLinker.cxx +++ b/helpcompiler/source/HelpLinker.cxx @@ -71,7 +71,7 @@ IndexerPreProcessor::~IndexerPreProcessor() static std::string getEncodedPath( const std::string& Path ) { - OString aOStr_Path( Path.c_str() ); + std::string_view aOStr_Path( Path.c_str() ); OUString aOUStr_Path( OStringToOUString ( aOStr_Path, osl_getThreadTextEncoding() ) ); OUString aPathURL; @@ -834,9 +834,9 @@ static void StructuredXMLErrorFunction(SAL_UNUSED_PARAMETER void *, xmlErrorPtr HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpProcessingException& e ) { m_eErrorClass = e.m_eErrorClass; - OString tmpErrorMsg( e.m_aErrorMsg.c_str() ); + std::string_view tmpErrorMsg( e.m_aErrorMsg.c_str() ); m_aErrorMsg = OStringToOUString( tmpErrorMsg, osl_getThreadTextEncoding() ); - OString tmpXMLParsingFile( e.m_aXMLParsingFile.c_str() ); + std::string_view tmpXMLParsingFile( e.m_aXMLParsingFile.c_str() ); m_aXMLParsingFile = OStringToOUString( tmpXMLParsingFile, osl_getThreadTextEncoding() ); m_nXMLParsingLine = e.m_nXMLParsingLine; return *this; diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx index 43820a926dc7..29ba07c3ae84 100644 --- a/jvmfwk/source/fwkbase.cxx +++ b/jvmfwk/source/fwkbase.cxx @@ -160,9 +160,7 @@ VersionInfo VendorSettings::getVersionInformation(std::u16string_view sVendor) c CXmlCharPtr sVersion = xmlNodeListGetString( m_xmlDocVendorSettings, xPathObjectMin->nodesetval->nodeTab[0]->xmlChildrenNode, 1); - OString osVersion(sVersion); - aVersionInfo.sMinVersion = OStringToOUString( - osVersion, RTL_TEXTENCODING_UTF8); + aVersionInfo.sMinVersion = sVersion; } //Get maxVersion @@ -180,9 +178,7 @@ VersionInfo VendorSettings::getVersionInformation(std::u16string_view sVendor) c CXmlCharPtr sVersion = xmlNodeListGetString( m_xmlDocVendorSettings, xPathObjectMax->nodesetval->nodeTab[0]->xmlChildrenNode, 1); - OString osVersion(sVersion); - aVersionInfo.sMaxVersion = OStringToOUString( - osVersion, RTL_TEXTENCODING_UTF8); + aVersionInfo.sMaxVersion = sVersion; } //Get excludeVersions @@ -202,9 +198,7 @@ VersionInfo VendorSettings::getVersionInformation(std::u16string_view sVendor) c { CXmlCharPtr sVersion = xmlNodeListGetString( m_xmlDocVendorSettings, cur->xmlChildrenNode, 1); - OString osVersion(sVersion); - OUString usVersion = OStringToOUString( - osVersion, RTL_TEXTENCODING_UTF8); + OUString usVersion = sVersion; aVersionInfo.vecExcludeVersions.push_back(usVersion); } } @@ -341,7 +335,7 @@ OUString BootParams::getJREHome() UNO_JAVA_JFW_ENV_JREHOME" is set, but the environment variable " "JAVA_HOME is not set."); } - OString osJRE(pJRE); + std::string_view osJRE(pJRE); OUString usJRE = OStringToOUString(osJRE, osl_getThreadTextEncoding()); if (File::getFileURLFromSystemPath(usJRE, sJRE) != File::E_None) throw FrameworkException( diff --git a/jvmfwk/source/libxmlutil.cxx b/jvmfwk/source/libxmlutil.cxx index f83e14143ef4..fa8f6eeee1e0 100644 --- a/jvmfwk/source/libxmlutil.cxx +++ b/jvmfwk/source/libxmlutil.cxx @@ -124,7 +124,7 @@ CXmlCharPtr::operator OUString() OUString ret; if (_object != nullptr) { - OString aOStr(reinterpret_cast<char*>(_object)); + std::string_view aOStr(reinterpret_cast<char*>(_object)); ret = OStringToOUString(aOStr, RTL_TEXTENCODING_UTF8); } return ret; diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index a9b1b91857f8..d4fe7abdbf23 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -2167,7 +2167,7 @@ void ScColumn::RestoreFromCache(SvStream& rStrm) rStrm.ReadInt32(nStrLength); std::unique_ptr<char[]> pStr(new char[nStrLength]); rStrm.ReadBytes(pStr.get(), nStrLength); - OString aOStr(pStr.get(), nStrLength); + std::string_view aOStr(pStr.get(), nStrLength); OUString aStr = OStringToOUString(aOStr, RTL_TEXTENCODING_UTF8); rString = rPool.intern(aStr); } @@ -2189,7 +2189,7 @@ void ScColumn::RestoreFromCache(SvStream& rStrm) rStrm.ReadInt32(nStrLength); std::unique_ptr<char[]> pStr(new char[nStrLength]); rStrm.ReadBytes(pStr.get(), nStrLength); - OString aOStr(pStr.get(), nStrLength); + std::string_view aOStr(pStr.get(), nStrLength); OUString aStr = OStringToOUString(aOStr, RTL_TEXTENCODING_UTF8); for (sal_uInt64 i = 0; i < nFormulaGroupSize; ++i) { diff --git a/sc/source/ui/dataprovider/csvdataprovider.cxx b/sc/source/ui/dataprovider/csvdataprovider.cxx index 99533c9f7a6b..fc8d4ccaf888 100644 --- a/sc/source/ui/dataprovider/csvdataprovider.cxx +++ b/sc/source/ui/dataprovider/csvdataprovider.cxx @@ -53,8 +53,7 @@ public: } else { - OString aStr(s.data(), s.size()); - mpDoc->SetString(mnCol, mnRow, 0, OStringToOUString(aStr, RTL_TEXTENCODING_UTF8)); + mpDoc->SetString(mnCol, mnRow, 0, OStringToOUString(s, RTL_TEXTENCODING_UTF8)); } ++mnCol; diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index adeae7080e1b..7b1cd3a4b6a6 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -1068,7 +1068,7 @@ OUString HtmlExport::DocumentMetadata() const const sal_uInt64 nLen = aStream.GetSize(); OSL_ENSURE(nLen < o3tl::make_unsigned(SAL_MAX_INT32), "Stream can't fit in OString"); - OString aData(static_cast<const char*>(aStream.GetData()), static_cast<sal_Int32>(nLen)); + std::string_view aData(static_cast<const char*>(aStream.GetData()), static_cast<sal_Int32>(nLen)); return OStringToOUString(aData, RTL_TEXTENCODING_UTF8); } diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index 13adfa57387a..272bffcbae66 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -173,7 +173,7 @@ OUString SfxContentHelper::GetActiveHelpString( const OUString& rURL ) sal_Int32 nRead = xStream->readBytes( lData, 1024 ); while ( nRead > 0 ) { - OString sOldString( reinterpret_cast<char const *>(lData.getConstArray()), nRead ); + std::string_view sOldString( reinterpret_cast<char const *>(lData.getConstArray()), nRead ); OUString sString = OStringToOUString( sOldString, RTL_TEXTENCODING_UTF8 ); aRet.append( sString ); diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index b9055a63d2fc..17d6f108c503 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -2426,7 +2426,7 @@ void SvNumberFormatter::ImpAdjustFormatCodeDefault( if (LocaleDataWrapper::areChecksEnabled()) { // check the locale data for correctness - OStringBuffer aMsg; + OUStringBuffer aMsg; sal_Int32 nElem, nShort, nMedium, nLong, nShortDef, nMediumDef, nLongDef; nShort = nMedium = nLong = nShortDef = nMediumDef = nLongDef = -1; for ( nElem = 0; nElem < nCnt; nElem++ ) @@ -2471,10 +2471,8 @@ void SvNumberFormatter::ImpAdjustFormatCodeDefault( aMsg.insert(0, "SvNumberFormatter::ImpAdjustFormatCodeDefault: "); aMsg.append("\nXML locale data FormatElement formatindex: "); aMsg.append(static_cast<sal_Int32>(pFormatArr[nElem].Index)); - OUString aUMsg(OStringToOUString(aMsg, - RTL_TEXTENCODING_ASCII_US)); + LocaleDataWrapper::outputCheckMessage(xLocaleData->appendLocaleInfo(aMsg)); aMsg.setLength(0); - LocaleDataWrapper::outputCheckMessage(xLocaleData->appendLocaleInfo(aUMsg)); } } if ( nShort != -1 && nShortDef == -1 ) @@ -2487,10 +2485,9 @@ void SvNumberFormatter::ImpAdjustFormatCodeDefault( { aMsg.insert(0, "SvNumberFormatter::ImpAdjustFormatCodeDefault: "); aMsg.append("\nXML locale data FormatElement group of: "); - OUString aUMsg(OStringToOUString(aMsg, RTL_TEXTENCODING_ASCII_US)); - aMsg.setLength(0); LocaleDataWrapper::outputCheckMessage( - xLocaleData->appendLocaleInfo(Concat2View(aUMsg + pFormatArr[0].NameID))); + xLocaleData->appendLocaleInfo(Concat2View(aMsg + pFormatArr[0].NameID))); + aMsg.setLength(0); } } // find the default (medium preferred, then long) and reset all other defaults diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 01c668be4586..f6119c8d2d82 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -158,9 +158,8 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) { if(aContentAtPos.aFnd.pAttr) { - sText = OStringToOUString(OString::number( - static_cast<const SwTableBoxValue*>(aContentAtPos.aFnd.pAttr)->GetValue()), - osl_getThreadTextEncoding()); + sText = OUString::number( + static_cast<const SwTableBoxValue*>(aContentAtPos.aFnd.pAttr)->GetValue()); } break; } diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx index d46ff5d7c587..fc58cc1f134f 100644 --- a/unoxml/source/dom/characterdata.cxx +++ b/unoxml/source/dom/characterdata.cxx @@ -88,7 +88,7 @@ namespace DOM // get current data std::shared_ptr<xmlChar const> const pContent( xmlNodeGetContent(m_aNodePtr), xmlFree); - OString aData(reinterpret_cast<char const*>(pContent.get())); + std::string_view aData(reinterpret_cast<char const*>(pContent.get())); OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0 || count < 0) { DOMException e; @@ -158,7 +158,7 @@ namespace DOM // get current data std::shared_ptr<xmlChar const> const pContent( xmlNodeGetContent(m_aNodePtr), xmlFree); - OString aData(reinterpret_cast<char const*>(pContent.get())); + std::string_view aData(reinterpret_cast<char const*>(pContent.get())); OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0) { DOMException e; @@ -193,7 +193,7 @@ namespace DOM // get current data std::shared_ptr<xmlChar const> const pContent( xmlNodeGetContent(m_aNodePtr), xmlFree); - OString aData(reinterpret_cast<char const*>(pContent.get())); + std::string_view aData(reinterpret_cast<char const*>(pContent.get())); OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0 || count < 0){ DOMException e; @@ -246,7 +246,7 @@ namespace DOM // get current data std::shared_ptr<xmlChar const> const pContent( xmlNodeGetContent(m_aNodePtr), xmlFree); - OString aData(reinterpret_cast<char const*>(pContent.get())); + std::string_view aData(reinterpret_cast<char const*>(pContent.get())); OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0 || count < 0) { DOMException e; |