diff options
48 files changed, 92 insertions, 102 deletions
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 87daa849f74f..f821c15aece6 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -218,7 +218,7 @@ void SbiCodeGen::Save() { aIfaceProcName.append(aPropPrefix); } - aIfaceProcName.append(std::u16string_view(aPureProcName).substr(rIfaceName.getLength() + 1) ); + aIfaceProcName.append(aPureProcName.subView(rIfaceName.getLength() + 1) ); aIfaceName = rIfaceName; nPassCount = 2; break; diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 87cef46cffbe..bacd02a2c0e2 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -2091,7 +2091,7 @@ void SbiRuntime::StepRSET() } else { - aNewStr.append(std::u16string_view(aRefValString).substr(0, nVarStrLen)); + aNewStr.append(aRefValString.subView(0, nVarStrLen)); } refVar->PutString(aNewStr.makeStringAndClear()); diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index ba84ff032b66..8ab965406fcb 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -449,7 +449,7 @@ OUString removeAny(OUString const& rIn, { if (i > 0) { - buf.append(std::u16string_view(rIn).substr(0, i)); + buf.append(rIn.subView(0, i)); } isFound = true; } diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 01cdcc03aa76..ecc2f4f8f221 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -135,7 +135,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const } else { - aSql.append(std::u16string_view(sTypeName).substr(0, ++nParenPos)); + aSql.append(sTypeName.subView(0, ++nParenPos)); } if ( nPrecision > 0 && nDataType != DataType::TIMESTAMP ) @@ -152,7 +152,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const else { nParenPos = sTypeName.indexOf(')',nParenPos); - aSql.append(std::u16string_view(sTypeName).substr(nParenPos)); + aSql.append(sTypeName.subView(nParenPos)); } } else diff --git a/connectivity/source/drivers/firebird/Clob.cxx b/connectivity/source/drivers/firebird/Clob.cxx index 2038dfc11350..64c231230884 100644 --- a/connectivity/source/drivers/firebird/Clob.cxx +++ b/connectivity/source/drivers/firebird/Clob.cxx @@ -101,7 +101,7 @@ OUString SAL_CALL Clob::getSubString(sal_Int64 nPosition, if( nCharsToCopy > nLength ) nCharsToCopy = nLength; // append relevant part of first segment - sSegmentBuffer.append( std::u16string_view(sSegment).substr(0, nCharsToCopy) ); + sSegmentBuffer.append( sSegment.subView(0, nCharsToCopy) ); nActLen += sSegmentBuffer.getLength(); } } @@ -117,7 +117,7 @@ OUString SAL_CALL Clob::getSubString(sal_Int64 nPosition, RTL_TEXTENCODING_UTF8 ); sal_Int32 nStrLen = sSegment.getLength(); if( nActLen + nStrLen > nLength ) - sSegmentBuffer.append(std::u16string_view(sSegment).substr(0, nLength - nActLen)); + sSegmentBuffer.append(sSegment.subView(0, nLength - nActLen)); else sSegmentBuffer.append(sSegment); nActLen += nStrLen; diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index e4510b758055..56fa1827bdad 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -374,9 +374,9 @@ sal_Int64 toNumericWithoutDecimalPlace(const OUString& sSource) OUStringBuffer sBuffer(15); if(nDotIndex > 0) { - sBuffer.append(std::u16string_view(sNumber).substr(0, nDotIndex)); + sBuffer.append(sNumber.subView(0, nDotIndex)); } - sBuffer.append(std::u16string_view(sNumber).substr(nDotIndex + 1)); + sBuffer.append(sNumber.subView(nDotIndex + 1)); return sBuffer.makeStringAndClear().toInt64(); } } diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index 81785e536a40..aafa45e239e0 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -252,7 +252,7 @@ OUString makeURL( OUString const & baseURL, OUString const & relPath_ ) { OUStringBuffer buf(128); if (baseURL.getLength() > 1 && baseURL[ baseURL.getLength() - 1 ] == '/') - buf.append( std::u16string_view(baseURL).substr(0, baseURL.getLength() - 1) ); + buf.append( baseURL.subView(0, baseURL.getLength() - 1) ); else buf.append( baseURL ); OUString relPath(relPath_); diff --git a/desktop/source/deployment/misc/dp_ucb.cxx b/desktop/source/deployment/misc/dp_ucb.cxx index 71e7d18a1c9c..3da815f15fa4 100644 --- a/desktop/source/deployment/misc/dp_ucb.cxx +++ b/desktop/source/deployment/misc/dp_ucb.cxx @@ -218,18 +218,18 @@ bool readLine( OUString * res, OUString const & startingWith, { pos = file.indexOf( LF, pos ); if (pos < 0) { // EOF - buf.append( std::u16string_view(file).substr(start) ); + buf.append( file.subView(start) ); } else { if (pos > 0 && file[ pos - 1 ] == CR) { // consume extra CR - buf.append( std::u16string_view(file).substr(start, pos - start - 1) ); + buf.append( file.subView(start, pos - start - 1) ); ++pos; } else - buf.append( std::u16string_view(file).substr(start, pos - start) ); + buf.append( file.subView(start, pos - start) ); ++pos; // consume LF // check next line: if (pos < file.getLength() && @@ -273,16 +273,16 @@ bool readProperties( std::vector< std::pair< OUString, OUString> > & out_result, bool bEOF = false; pos = file.indexOf( LF, pos ); if (pos < 0) { // EOF - buf.append( std::u16string_view(file).substr(start) ); + buf.append( file.subView(start) ); bEOF = true; } else { if (pos > 0 && file[ pos - 1 ] == CR) // consume extra CR - buf.append( std::u16string_view(file).substr(start, pos - start - 1) ); + buf.append( file.subView(start, pos - start - 1) ); else - buf.append( std::u16string_view(file).substr(start, pos - start) ); + buf.append( file.subView(start, pos - start) ); pos++; } OUString aLine = buf.makeStringAndClear(); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index e1a9c91e3ee5..19f4362a8ff8 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1643,7 +1643,7 @@ OUString ContentNode::GetExpandedText(sal_Int32 nStartPos, sal_Int32 nEndPos) co DBG_ASSERT( nEnd >= nIndex, "End in front of the index?" ); //!! beware of sub string length of -1 if (nEnd > nIndex) - aStr.append( std::u16string_view(GetString()).substr(nIndex, nEnd - nIndex) ); + aStr.append( GetString().subView(nIndex, nEnd - nIndex) ); if ( pNextFeature ) { diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 0f048114462b..a551188a4c66 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -3029,12 +3029,12 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p nTmp++; if (nTmp < nSttWdPos) break; // word delimiter found - buf.append(std::u16string_view(rTxt).substr(nFndPos, nSttWdPos - nFndPos)).append(pFnd->GetLong()); + buf.append(rTxt.subView(nFndPos, nSttWdPos - nFndPos)).append(pFnd->GetLong()); nFndPos = nSttWdPos + sTmp.getLength(); } } while (nSttWdPos != -1); if (nEndPos - nFndPos > extra_repl) - buf.append(std::u16string_view(rTxt).substr(nFndPos, nEndPos - nFndPos)); + buf.append(rTxt.subView(nFndPos, nEndPos - nFndPos)); aLong = buf.makeStringAndClear(); } if ( const SvxAutocorrWord* pNew = Insert( SvxAutocorrWord(aShort, aLong) ) ) diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index 191173f276e4..141e011ad792 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -306,7 +306,7 @@ namespace frm // To fix this, we would probably have to revert here to always return "1" or "0" as normalized // filter, and change our client code to properly translate this (which could be some effort). if ( nMarkerPos == 0 ) - aText.append( std::u16string_view(sText).substr(sExpressionMarker.getLength()) ); + aText.append( sText.subView(sExpressionMarker.getLength()) ); else { // fallback diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 8f08976528cf..4187bd4a8ee7 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -414,7 +414,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > co sal_Int32 n = aSortedTbs[i].aCommand.lastIndexOf( '/' ); if (( n > 0 ) && (( n+1 ) < aSortedTbs[i].aCommand.getLength() )) - aStrBuf.append( std::u16string_view(aSortedTbs[i].aCommand).substr(n+1) ); + aStrBuf.append( aSortedTbs[i].aCommand.subView(n+1) ); OUString aCmd( aStrBuf.makeStringAndClear() ); @@ -671,11 +671,9 @@ void SAL_CALL ToolbarsMenuController::itemSelected( const css::awt::MenuEvent& r sal_Int32 nIndex = aCmd.indexOf( '=' ); if (( nIndex > 0 ) && (( nIndex+1 ) < aCmd.getLength() )) { - OUStringBuffer aBuf( "private:resource/toolbar/" ); - aBuf.append( std::u16string_view(aCmd).substr(nIndex+1) ); + OUString aToolBarResName = OUString::Concat("private:resource/toolbar/") + aCmd.subView(nIndex+1); bool bShow( !pVCLPopupMenu->IsItemChecked( rEvent.MenuId )); - OUString aToolBarResName( aBuf.makeStringAndClear() ); if ( bShow ) { xLayoutManager->createElement( aToolBarResName ); diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index 05ac79ce624c..5b7fb25fe47d 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -906,13 +906,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 { if ( cLast == '\\' ) { // escaped - aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 2)); + aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 2)); aSymbol.append(OUString(¤t, 1)); } else { eState = ssStop; - aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 1)); + aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 1)); } postSymbolIndex = nextCharIndex; } @@ -931,13 +931,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 { if ( cLast == '\\' ) { // escaped - aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 2)); + aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 2)); aSymbol.append(OUString(¤t, 1)); } else if (current == nextChar && !(nContTypes & KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING) ) { // "" => literal " escaped - aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex)); + aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex)); nextCharIndex = index; if (index < rText.getLength()) { ++nCodePoints; } nextChar = (index < rText.getLength()) ? rText.iterateCodePoints(&index) : 0; @@ -945,7 +945,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 else { eState = ssStop; - aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 1)); + aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 1)); } postSymbolIndex = nextCharIndex; } @@ -1054,7 +1054,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 { if (postSymbolIndex < nextCharIndex) { //! open quote - aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 1)); + aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 1)); r.TokenType |= KParseType::MISSING_QUOTE; } r.DequotedNameOrString = aSymbol.toString(); diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx index 66a5655deed7..b437edcd198e 100644 --- a/i18npool/source/nativenumber/nativenumbersupplier.cxx +++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx @@ -1086,7 +1086,7 @@ OUString getHebrewNativeNumberString(const OUString& aNumberString, bool useGere makeHebrewNumber(value, output, true, useGeresh); if (i < len) - output.append(std::u16string_view(aNumberString).substr(i)); + output.append(aNumberString.subView(i)); return output.makeStringAndClear(); } @@ -1212,7 +1212,7 @@ OUString getCyrillicNativeNumberString(const OUString& aNumberString) makeCyrillicNumber(value, output, true); if (i < len) - output.append(std::u16string_view(aNumberString).substr(i)); + output.append(aNumberString.subView(i)); return output.makeStringAndClear(); } diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index a60512e5a587..06d277855c76 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -496,7 +496,7 @@ void StringHelper::appendEncString( OUStringBuffer& rStr, const OUString& rData, if( (nBeg == 0) && (nIdx == nEnd) ) rStr.append( rData ); else - rStr.append( std::u16string_view(rData).substr(nBeg, nIdx - nBeg) ); + rStr.append( rData.subView(nBeg, nIdx - nBeg) ); } // append characters to be encoded while( (nIdx < nEnd) && (rData[ nIdx ] < 0x20) ) @@ -562,7 +562,7 @@ OUString lclTrimQuotedStringList( const OUString& rStr ) { // seek to next quote character and add text portion to token buffer sal_Int32 nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_QUOTE, nPos ); - aToken.append( std::u16string_view(rStr).substr(nPos, nEnd - nPos) ); + aToken.append( rStr.subView(nPos, nEnd - nPos) ); // process literal quotes while( (nEnd + 1 < nLen) && (rStr[ nEnd ] == OOX_DUMP_CFG_QUOTE) && (rStr[ nEnd + 1 ] == OOX_DUMP_CFG_QUOTE) ) { @@ -585,7 +585,7 @@ OUString lclTrimQuotedStringList( const OUString& rStr ) { // find list separator, add token text to buffer sal_Int32 nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_LISTSEP, nPos ); - aBuffer.append( std::u16string_view(rStr).substr(nPos, nEnd - nPos) ); + aBuffer.append( rStr.subView(nPos, nEnd - nPos) ); if( nEnd < nLen ) aBuffer.append( OOX_DUMP_LF ); // set current position behind list separator diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx index 46f1ef90a576..4403c1d98e1a 100644 --- a/opencl/source/openclconfig.cxx +++ b/opencl/source/openclconfig.cxx @@ -80,7 +80,7 @@ OUString getToken(const OUString& string, sal_Int32& index) while ((p = token.indexOf('%', i)) >= 0) { if (p > i) - result.append(std::u16string_view(token).substr(i, p - i)); + result.append(token.subView(i, p - i)); if (p < token.getLength() - 2) { result.append(sal_Unicode(token.copy(p+1, 2).toInt32(16))); @@ -91,7 +91,7 @@ OUString getToken(const OUString& string, sal_Int32& index) i = token.getLength(); } } - result.append(std::u16string_view(token).substr(i)); + result.append(token.subView(i)); return result.makeStringAndClear(); } diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index 087e5855e6e1..fff60d6e2449 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -967,7 +967,7 @@ OUString ORegKey::getFullPath(OUString const & path) const { b.append(m_name); if (!b.isEmpty() && b[b.getLength() - 1] == '/') { if (path[0] == '/') { - b.append(std::u16string_view(path).substr(1)); + b.append(path.subView(1)); } else { b.append(path); } diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index 5e99d5306cdc..54ec0c02ac46 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -286,7 +286,7 @@ template<typename T> oslFileError getSystemPathFromFileUrl( return osl_File_E_INVAL; if constexpr (std::is_same_v<T, rtl::OString>) { - if (!decodeFromUtf8(std::u16string_view(url).substr(i), path)) { + if (!decodeFromUtf8(url.subView(i), path)) { return osl_File_E_INVAL; } } else if constexpr (std::is_same_v<T, rtl::OUString>) { diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 57cbceaaca7c..4f7c686a1aba 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -911,7 +911,7 @@ void Converter::convertDuration(OUStringBuffer& rBuffer, if ( aNS.getLength() > 2 ) { rBuffer.append( '.'); - rBuffer.append( std::u16string_view(aNS).substr(2) ); // strip "0." + rBuffer.append( aNS.subView(2) ); // strip "0." } } rBuffer.append( 'S'); diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index f3ab5f917f9d..b8dd4c1440b6 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -2173,7 +2173,7 @@ static void lcl_ScRange_Format_XL_Header( OUStringBuffer& rString, const ScRange { if (!aDocName.isEmpty()) { - rString.append("'[").append(aDocName).append("]").append(std::u16string_view(aTabName).substr(1)); + rString.append("'[" + aDocName + "]" + aTabName.subView(1)); } else { diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 279e9c7eaee0..3c3b2834e0db 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -932,7 +932,7 @@ OUString lclEncodeDosUrl( // Excel seems confused by this token). aBuf.append(EXC_URL_PARENTDIR); else - aBuf.append(std::u16string_view(aOldUrl).substr(0,nPos)).append(EXC_URL_SUBDIR); + aBuf.append(aOldUrl.subView(0,nPos)).append(EXC_URL_SUBDIR); aOldUrl = aOldUrl.copy(nPos + 1); } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index cea27bd9109e..81c434a7055f 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1160,9 +1160,9 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText ) if (nStartPosition > 0) { OUStringBuffer aBuf; - aBuf.append(std::u16string_view(aNew).substr(0, nStartPosition)); + aBuf.append(aNew.subView(0, nStartPosition)); aBuf.append(u'\x25BA'); - aBuf.append(std::u16string_view(aNew).substr(nStartPosition)); + aBuf.append(aNew.subView(nStartPosition)); nArgs = ppFDesc->getParameterCount(); sal_Int16 nVarArgsSet = 0; if ( nArgs >= PAIRED_VAR_ARGS ) diff --git a/sdext/source/pdfimport/tree/style.cxx b/sdext/source/pdfimport/tree/style.cxx index 68f36379e172..73a9bd936663 100644 --- a/sdext/source/pdfimport/tree/style.cxx +++ b/sdext/source/pdfimport/tree/style.cxx @@ -167,7 +167,7 @@ OUString StyleContainer::getStyleName( sal_Int32 nStyle ) const else aStyleName = OStringToOUString( rStyle.Name, RTL_TEXTENCODING_ASCII_US ); sal_Int32 nIndex = aStyleName.lastIndexOf( ':' ); - aRet.append( std::u16string_view(aStyleName).substr(nIndex+1) ); + aRet.append( aStyleName.subView(nIndex+1) ); aRet.append( nStyle ); } } diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index 6d414d5f66ca..050109ff7182 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -375,13 +375,13 @@ void PresenterController::UpdatePaneTitles() if (nStartIndex < 0) { // Add the remaining part of the string. - sResult.append(std::u16string_view(sTemplate).substr(nIndex)); + sResult.append(sTemplate.subView(nIndex)); break; } else { // Add the part preceding the next %. - sResult.append(std::u16string_view(sTemplate).substr(nIndex, nStartIndex-nIndex)); + sResult.append(sTemplate.subView(nIndex, nStartIndex-nIndex)); // Get the placeholder ++nStartIndex; diff --git a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx index 9e21c5aef79f..1d93202f9c48 100644 --- a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx +++ b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx @@ -93,7 +93,7 @@ OUString Translator::translateToInternal( } sal_Int32 i = RTL_CONSTASCII_LENGTH("file:"); OUStringBuffer buf(128); - buf.append(std::u16string_view(externalUriReference).substr(0, i)); + buf.append(externalUriReference.subView(0, i)); // Some environments (e.g., Java) produce illegal file URLs without an // authority part; treat them as having an empty authority part: if (!externalUriReference.match("//", i)) @@ -141,7 +141,7 @@ OUString Translator::translateToExternal( } sal_Int32 i = RTL_CONSTASCII_LENGTH("file://"); OUStringBuffer buf(128); - buf.append(std::u16string_view(internalUriReference).substr(0, i)); + buf.append(internalUriReference.subView(0, i)); rtl_TextEncoding encoding = osl_getThreadTextEncoding(); for (bool path = true;;) { sal_Int32 j = i; diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx index 958e728d76cf..d5cfb2347863 100644 --- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx +++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx @@ -282,9 +282,7 @@ void SAL_CALL UrlReference::setName(OUString const & name) sal_Int32 i = 0; parsePart(m_base.m_path, true, &i); - auto tmp = std::u16string_view(m_base.m_path).substr(i); - m_base.m_path = encodeNameOrParamFragment(name) + - std::u16string_view(tmp.data(), tmp.length()); + m_base.m_path = encodeNameOrParamFragment(name) + m_base.m_path.subView(i); } sal_Bool UrlReference::hasParameter(OUString const & key) @@ -314,7 +312,7 @@ void UrlReference::setParameter(OUString const & key, OUString const & value) } OUStringBuffer newPath(128); - newPath.append(std::u16string_view(m_base.m_path).substr(0, i)); + newPath.append(m_base.m_path.subView(0, i)); if (!bExistent) { newPath.append( m_base.m_path.indexOf('?') < 0 ? '?' : '&' ); newPath.append(encodeNameOrParamFragment(key)); @@ -324,7 +322,7 @@ void UrlReference::setParameter(OUString const & key, OUString const & value) if (bExistent) { /*oldValue = */ parsePart(m_base.m_path, false, &i); // skip key - newPath.append(std::u16string_view(m_base.m_path).substr(i)); + newPath.append(m_base.m_path.subView(i)); } m_base.m_path = newPath.makeStringAndClear(); diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 04d168c4d976..43a4cd500e1b 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -786,11 +786,11 @@ OUString URIHelper::resolveIdnaHost(OUString const & url) { return url; } OUStringBuffer buf(uri->getScheme()); - buf.append("://").append(std::u16string_view(auth).substr(0, hostStart)); + buf.append("://").append(auth.subView(0, hostStart)); buf.append( reinterpret_cast<sal_Unicode const *>(ascii.getBuffer()), ascii.length()); - buf.append(std::u16string_view(auth).substr(hostEnd)).append(uri->getPath()); + buf.append(auth.subView(hostEnd)).append(uri->getPath()); if (uri->hasQuery()) { buf.append('?').append(uri->getQuery()); } diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 85a34f28e842..c452c25001fa 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -1733,7 +1733,7 @@ short SvNumberformat::ImpNextSymbol(OUStringBuffer& rString, 0 <= nNatNumNum && nNatNumNum <= 19 ) { sBuffSymbol.stripStart('['); - sBuffSymbol.append( std::u16string_view(aBufStr).substr(--nPos, aNatNum.getLength()+1) ); + sBuffSymbol.append( aBufStr.subView(--nPos, aNatNum.getLength()+1) ); nPos += aNatNum.getLength()+1; //! SymbolType is negative eSymbolType = static_cast<short>(BRACKET_SYMBOLTYPE_NATNUM0 - nNatNumNum); @@ -1743,7 +1743,7 @@ short SvNumberformat::ImpNextSymbol(OUStringBuffer& rString, 1 <= nDBNum && nDBNum <= 9 ) { sBuffSymbol.stripStart('['); - sBuffSymbol.append( std::u16string_view(aBufStr).substr(--nPos, aDBNum.getLength()+1) ); + sBuffSymbol.append( aBufStr.subView(--nPos, aDBNum.getLength()+1) ); nPos += aDBNum.getLength()+1; //! SymbolType is negative eSymbolType = sal::static_int_cast< short >( BRACKET_SYMBOLTYPE_DBNUM1 - (nDBNum - 1) ); @@ -1971,7 +1971,7 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr ) } else { - aTmp.append(std::u16string_view(rStr).substr(nStartPos, nPos - nStartPos) ); + aTmp.append(rStr.subView(nStartPos, nPos - nStartPos) ); nStartPos = nPos + 2; sal_Int32 nDash; nEnd = nStartPos - 1; @@ -2004,13 +2004,13 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr ) { nPos = nDash; } - aTmp.append(std::u16string_view(rStr).substr(nStartPos, nPos - nStartPos) ); + aTmp.append(rStr.subView(nStartPos, nPos - nStartPos) ); nStartPos = nClose + 1; } } if ( nLen > nStartPos ) { - aTmp.append(std::u16string_view(rStr).substr(nStartPos, nLen - nStartPos) ); + aTmp.append(rStr.subView(nStartPos, nLen - nStartPos) ); } return aTmp.makeStringAndClear(); } diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 6b2f57682316..9310a290a184 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -113,7 +113,7 @@ void SwAccessiblePortionData::Text(TextFrameIndex const nLength, m_aPortionAttrs.push_back( nAttr ); // update buffer + nViewPosition - m_aBuffer.append(std::u16string_view(m_pTextFrame->GetText()).substr(sal_Int32(m_nViewPosition), sal_Int32(nLength))); + m_aBuffer.append(m_pTextFrame->GetText().subView(sal_Int32(m_nViewPosition), sal_Int32(nLength))); m_nViewPosition += nLength; } diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 41bf202a9ea4..f22dda20ff50 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -783,7 +783,7 @@ SwCalcOper SwCalc::GetToken() // ignore the ] if ('\\' == m_sCommand[nFndPos-1]) { - m_aVarName.append(std::u16string_view(m_sCommand).substr(nSttPos, + m_aVarName.append(m_sCommand.subView(nSttPos, nFndPos - nSttPos - 1) ); nSttPos = ++nFndPos; } @@ -795,7 +795,7 @@ SwCalcOper SwCalc::GetToken() if( nFndPos != -1 ) { if( nSttPos != nFndPos ) - m_aVarName.append(std::u16string_view(m_sCommand).substr(nSttPos, + m_aVarName.append(m_sCommand.subView(nSttPos, nFndPos - nSttPos) ); aRes.EndPos = nFndPos + 1; m_eCurrOper = CALC_NAME; diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 88622208be36..1b9b73e2faf8 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -1106,7 +1106,7 @@ OUString SwPaM::GetText() const ? End()->nContent.GetIndex() : aTmpStr.getLength(); - aResult.append(std::u16string_view(aTmpStr).substr(nStart, nEnd-nStart)); + aResult.append(aTmpStr.subView(nStart, nEnd-nStart)); } else { diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 6f7c7789a848..cdff7c6fe588 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -673,12 +673,12 @@ OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTa if (nStt<0 || nEnd<0 ) { // set the rest and finish - aStr.append(std::u16string_view(m_sFormula).substr(nFormula)); + aStr.append(m_sFormula.subView(nFormula)); break; } // write beginning - aStr.append(std::u16string_view(m_sFormula).substr(nFormula, nStt - nFormula)); + aStr.append(m_sFormula.subView(nFormula, nStt - nFormula)); if (fnFormula) { diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index b6cbb86bbeb3..65834cf27077 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -229,7 +229,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, if (pStart->nContent != nLastEnd) // not 0 so we eliminate adjacent deletes { extents.emplace_back(pNode, nLastEnd, pStart->nContent.GetIndex()); - mergedText.append(std::u16string_view(pNode->GetText()).substr(nLastEnd, pStart->nContent.GetIndex() - nLastEnd)); + mergedText.append(pNode->GetText().subView(nLastEnd, pStart->nContent.GetIndex() - nLastEnd)); } if (&pEnd->nNode.GetNode() != pNode) { @@ -350,7 +350,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, if (nLastEnd != pNode->Len()) { extents.emplace_back(pNode, nLastEnd, pNode->Len()); - mergedText.append(std::u16string_view(pNode->GetText()).substr(nLastEnd, pNode->Len() - nLastEnd)); + mergedText.append(pNode->GetText().subView(nLastEnd, pNode->Len() - nLastEnd)); } if (extents.empty()) // there was no text anywhere { diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index dc1706333efa..c883f4f5528a 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -365,7 +365,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( if( aBuffer.isEmpty() ) { aBuffer.append( '\'' ); - aBuffer.append( std::u16string_view(sRange).substr(0, i) ); + aBuffer.append( sRange.subView(0, i) ); } if( '\'' == c || '\\' == c ) aBuffer.append( '\\' ); diff --git a/toolkit/source/awt/animatedimagespeer.cxx b/toolkit/source/awt/animatedimagespeer.cxx index b14a3efafaa5..9eeddc1715dc 100644 --- a/toolkit/source/awt/animatedimagespeer.cxx +++ b/toolkit/source/awt/animatedimagespeer.cxx @@ -119,11 +119,9 @@ namespace toolkit const sal_Int32 separatorPos = i_imageURL.indexOf( '/' ); ENSURE_OR_RETURN( separatorPos != -1, "lcl_getHighContrastURL: unsupported URL scheme - cannot automatically determine HC version!", i_imageURL ); - OUStringBuffer composer; - composer.append( std::u16string_view(i_imageURL).substr(0, separatorPos) ); - composer.append( "/sifr" ); - composer.append( std::u16string_view(i_imageURL).substr(separatorPos) ); - return composer.makeStringAndClear(); + OUString composer = OUString::Concat(i_imageURL.subView(0, separatorPos)) + "/sifr" + + i_imageURL.subView(separatorPos); + return composer; } diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 04cd62ee9fba..4ecc6583dfa8 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -1720,7 +1720,7 @@ Content::queryChildContent( const OUString & rRelativeChildUri ) if ( !rRelativeChildUri.startsWith("/") ) aBuf.append( rRelativeChildUri ); else - aBuf.append( std::u16string_view(rRelativeChildUri).substr(1) ); + aBuf.append( rRelativeChildUri.subView(1) ); uno::Reference< ucb::XContentIdentifier > xChildId = new ::ucbhelper::ContentIdentifier( aBuf.makeStringAndClear() ); diff --git a/unotools/source/config/configpaths.cxx b/unotools/source/config/configpaths.cxx index 81d8cb828c6e..8c206d03a3cd 100644 --- a/unotools/source/config/configpaths.cxx +++ b/unotools/source/config/configpaths.cxx @@ -53,7 +53,7 @@ void lcl_resolveCharEntities(OUString & aLocalString) OSL_ENSURE(ch,"Configuration path contains '&' that is not part of a valid character escape"); if (ch) { - aResult.append(std::u16string_view(aLocalString).substr(nStart,nEscapePos-nStart)).append(ch); + aResult.append(aLocalString.subView(nStart,nEscapePos-nStart)).append(ch); sal_Int32 nEscapeEnd=aLocalString.indexOf(';',nEscapePos); nStart = nEscapeEnd+1; @@ -66,7 +66,7 @@ void lcl_resolveCharEntities(OUString & aLocalString) } while ( nEscapePos > 0); - aResult.append(std::u16string_view(aLocalString).substr(nStart)); + aResult.append(aLocalString.subView(nStart)); aLocalString = aResult.makeStringAndClear(); } diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index d61a3c3dd0dd..6d2c08676a29 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -218,10 +218,10 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css } else { - aBuffer.append( std::u16string_view(sLabel).substr(0, index) ); + aBuffer.append( sLabel.subView(0, index) ); if( bMenu ) aBuffer.append( '&' ); - aBuffer.append( std::u16string_view(sLabel).substr(index + 1) ); + aBuffer.append( sLabel.subView(index + 1) ); } OUString sNewLabel = aBuffer.makeStringAndClear(); SAL_INFO("vbahelper", "VbaCommandBarHelper::findControlByName, control name: " << sNewLabel); diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 65bd69bb528e..fa9cf9760a78 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -187,23 +187,23 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& rValue, // If in "a b/c" format. if(nFracNumPos != -1 ) { - aStr1.append(std::u16string_view(aStr).substr(0, nFracNumPos)); - aStrNum.append(std::u16string_view(aStr).substr(nFracNumPos+1, nFracDivPos-nFracNumPos-1)); - aStrDenom.append(std::u16string_view(aStr).substr(nFracDivPos+1)); + aStr1.append(aStr.subView(0, nFracNumPos)); + aStrNum.append(aStr.subView(nFracNumPos+1, nFracDivPos-nFracNumPos-1)); + aStrDenom.append(aStr.subView(nFracDivPos+1)); } // "a/b" format, or not a fraction at all else { - aStrNum.append(std::u16string_view(aStr).substr(0, nFracDivPos)); - aStrDenom.append(std::u16string_view(aStr).substr(nFracDivPos+1)); + aStrNum.append(aStr.subView(0, nFracDivPos)); + aStrDenom.append(aStr.subView(nFracDivPos+1)); } } // parse decimal strings else if ( nDecPos >= 0) { - aStr1.append(std::u16string_view(aStr).substr(0, nDecPos)); - aStr2.append(std::u16string_view(aStr).substr(nDecPos+1)); + aStr1.append(aStr.subView(0, nDecPos)); + aStr2.append(aStr.subView(nDecPos+1)); } else aStr1 = aStr; diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 7bf0afd853e8..e303c18e74af 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -744,7 +744,7 @@ static bool ImplPatternProcessKeyInput( IEditImplementation& rEdit, const KeyEve { // possibly extend string until cursor position if ( aStr.getLength() < nNewPos ) - aStr.append( std::u16string_view(rLiteralMask).substr(aStr.getLength(), nNewPos-aStr.getLength()) ); + aStr.append( rLiteralMask.subView(aStr.getLength(), nNewPos-aStr.getLength()) ); if ( nNewPos < aStr.getLength() ) aStr.insert( cChar, nNewPos ); else if ( nNewPos < rEditMask.getLength() ) diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index e141ce610741..8750ef96f191 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -120,7 +120,7 @@ bool ImplCurrencyGetValue( const OUString& rStr, BigInt& rValue, if ( nDecPos != -1 ) { aStr1 = aStr.subView( 0, nDecPos ); - aStr2.append(std::u16string_view(aStr).substr(nDecPos+1)); + aStr2.append(aStr.subView(nDecPos+1)); } else aStr1 = aStr; diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index a61c67b0c69d..1959151ffee1 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -269,7 +269,7 @@ OUString TextEngine::GetTextLines( LineEnd aSeparator ) const for ( size_t nL = 0; nL < nLines; ++nL ) { TextLine& rLine = pTEParaPortion->GetLines()[nL]; - aText.append( std::u16string_view(pTEParaPortion->GetNode()->GetText()).substr(rLine.GetStart(), rLine.GetEnd() - rLine.GetStart()) ); + aText.append( pTEParaPortion->GetNode()->GetText().subView(rLine.GetStart(), rLine.GetEnd() - rLine.GetStart()) ); if ( pSep && ( ( (nP+1) < nParas ) || ( (nL+1) < nLines ) ) ) aText.append(pSep); } @@ -406,7 +406,7 @@ OUString TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) co if ( nNode == nEndPara ) // may also be == nStart! nEndPos = aSel.GetEnd().GetIndex(); - aText.append(std::u16string_view(pNode->GetText()).substr(nStartPos, nEndPos-nStartPos)); + aText.append(pNode->GetText().subView(nStartPos, nEndPos-nStartPos)); if ( nNode < nEndPara ) aText.append(pSep); } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 825616b3d0aa..3cffab6e3b20 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1668,11 +1668,8 @@ static OUString getShortenedString( const OUString& i_rLong, vcl::RenderContext { if (nPos < aNonMnem.getLength() && i_rLong[nPos+1] == aNonMnem[nPos]) { - OUStringBuffer aBuf( i_rLong.getLength() ); - aBuf.append( std::u16string_view(aNonMnem).substr(0, nPos) ); - aBuf.append( '~' ); - aBuf.append( std::u16string_view(aNonMnem).substr(nPos) ); - aNonMnem = aBuf.makeStringAndClear(); + OUString aTmp = OUString::Concat(aNonMnem.subView(0, nPos)) + "~" + aNonMnem.subView(nPos); + aNonMnem = aTmp; } } return aNonMnem; diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index 6cda57185a3b..23f3d7017ccd 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -449,7 +449,7 @@ void SvXMLUnitConverter::convertDateTime( OUStringBuffer& rBuffer, // Truncate nFractionDecimals+1 digit if it was not rounded to zero. const sal_Int32 nCount = nLen - 2 - static_cast<int>(nLen > nFractionDecimals + 2); rBuffer.append( '.'); - rBuffer.append( std::u16string_view(aFraction).substr(2, nCount)); // strip 0. + rBuffer.append( aFraction.subView(2, nCount)); // strip 0. } } diff --git a/xmloff/source/draw/propimp0.cxx b/xmloff/source/draw/propimp0.cxx index 991b3cb7a271..961aa406d868 100644 --- a/xmloff/source/draw/propimp0.cxx +++ b/xmloff/source/draw/propimp0.cxx @@ -185,7 +185,7 @@ bool XMLTextAnimationStepPropertyHdl::importXML( sal_Int32 nPos = rStrImpValue.indexOf( "px" ); if( nPos != -1 ) { - if (::sax::Converter::convertNumber(nValue, std::u16string_view(rStrImpValue).substr(0, nPos))) + if (::sax::Converter::convertNumber(nValue, rStrImpValue.subView(0, nPos))) { rValue <<= sal_Int16( -nValue ); bRet = true; diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx index 6e2a485ca828..cf61dba8fab7 100644 --- a/xmloff/source/meta/xmlmetai.cxx +++ b/xmloff/source/meta/xmlmetai.cxx @@ -251,8 +251,7 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno: if ( nBegin != -1 ) { sBuffer.append( '$' ); - sBuffer.append( std::u16string_view(i_rBuildId).substr( - nBegin + sBuildCompare.getLength()) ); + sBuffer.append( i_rBuildId.subView(nBegin + sBuildCompare.getLength()) ); sBuildId = sBuffer.makeStringAndClear(); } } diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx index 128dfa15289c..144de999cb78 100644 --- a/xmloff/source/style/fonthdl.cxx +++ b/xmloff/source/style/fonthdl.cxx @@ -97,7 +97,7 @@ bool XMLFontFamilyNamePropHdl::importXML( const OUString& rStrImpValue, uno::Any if( !sValue.isEmpty() ) sValue.append(';'); - sValue.append(std::u16string_view(rStrImpValue).substr(nFirst, nLast-nFirst+1)); + sValue.append(rStrImpValue.subView(nFirst, nLast-nFirst+1)); } if( -1 != nPos ) diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 0e35f8b1948b..291c2ee36041 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -1005,7 +1005,7 @@ void SvXMLExportPropertyMapper::_exportXML( sPrefix = pNamespaceMap->GetPrefixByKey( nKey ); } // In any case, the attribute name has to be adapted. - sNameBuffer.append(sPrefix).append(":").append(std::u16string_view(rAttribName).substr(nColonPos+1) ); + sNameBuffer.append(sPrefix).append(":").append(rAttribName.subView(nColonPos+1)); sAttribName = sNameBuffer.makeStringAndClear(); } |