diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-22 14:08:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-23 14:00:08 +0100 |
commit | ec1c4c49301758c54394f9943252e192ad54638b (patch) | |
tree | b53af3cb9154a388495b1af35c3f8ff41d6ebe1f /vcl | |
parent | db0f2c29bf3a6ad5a08f8524ea0e65aa90792bb2 (diff) |
O[U]String::replaceAt overloads that take string_view
which results in lots of nice string_view improvements picked up by the
plugins
Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/osx/salmenu.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/textdoc.cxx | 4 | ||||
-rw-r--r-- | vcl/source/filter/FilterConfigCache.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/image/ImplImage.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 6 | ||||
-rw-r--r-- | vcl/source/treelist/transfer.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/mnemonic.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx | 4 |
12 files changed, 24 insertions, 24 deletions
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index aeda577a2615..3164ba873bae 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -601,7 +601,7 @@ void AquaSalMenu::SetItemText( unsigned /*i_nPos*/, SalMenuItem* i_pSalMenuItem, { sal_Int32 nPos2 = aText.indexOf( ')' ); if( nPos2 != -1 ) - aText = aText.replaceAt( nPos, nPos2-nPos+1, "" ); + aText = aText.replaceAt( nPos, nPos2-nPos+1, u"" ); } } diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index de3de3d6e1f7..1f728ce03ab4 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -376,7 +376,7 @@ IMPL_LINK_NOARG(ComboBox::Impl, ImplSelectHdl, LinkParamNone*, void) sal_Int32 nP = m_pImplLB->GetEntryList().FindEntry( aToken ); if ((nP != LISTBOX_ENTRY_NOTFOUND) && (!m_pImplLB->GetEntryList().IsEntryPosSelected(nP))) { - aText = aText.replaceAt( nPrevIndex, nTokenLen, "" ); + aText = aText.replaceAt( nPrevIndex, nTokenLen, u"" ); nIndex = nIndex - nTokenLen; sal_Int32 nSepCount=0; if ((nPrevIndex+nSepCount < aText.getLength()) && (aText[nPrevIndex+nSepCount] == m_cMultiSep)) @@ -384,7 +384,7 @@ IMPL_LINK_NOARG(ComboBox::Impl, ImplSelectHdl, LinkParamNone*, void) nIndex--; ++nSepCount; } - aText = aText.replaceAt( nPrevIndex, nSepCount, "" ); + aText = aText.replaceAt( nPrevIndex, nSepCount, u"" ); } aText = comphelper::string::strip(aText, ' '); } diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index a3e2264d3f8c..9e39516887c4 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -264,7 +264,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, tools::Long nMaxWidth ) do { if (pItem->maFormatText.getLength() > aAppendStr.getLength()) - pItem->maFormatText = pItem->maFormatText.replaceAt( pItem->maFormatText.getLength()-aAppendStr.getLength()-1, 1, "" ); + pItem->maFormatText = pItem->maFormatText.replaceAt( pItem->maFormatText.getLength()-aAppendStr.getLength()-1, 1, u"" ); aSize.setWidth( GetOutDev()->GetCtrlTextWidth( pItem->maFormatText ) ); aSize.AdjustWidth(aImageSize.Width() ); aSize.AdjustWidth(TAB_TABOFFSET_X*2 ); diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx index 2be8c372c273..9e0c80b96815 100644 --- a/vcl/source/edit/textdoc.cxx +++ b/vcl/source/edit/textdoc.cxx @@ -271,13 +271,13 @@ void TextNode::InsertText( sal_Int32 nPos, const OUString& rText ) void TextNode::InsertText( sal_Int32 nPos, sal_Unicode c ) { - maText = maText.replaceAt( nPos, 0, OUString(c) ); + maText = maText.replaceAt( nPos, 0, rtl::OUStringChar(c) ); ExpandAttribs( nPos, 1 ); } void TextNode::RemoveText( sal_Int32 nPos, sal_Int32 nChars ) { - maText = maText.replaceAt( nPos, nChars, "" ); + maText = maText.replaceAt( nPos, nChars, u"" ); CollapseAttribs( nPos, nChars ); } diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx index 64e4e6929dea..a314a6ca1660 100644 --- a/vcl/source/filter/FilterConfigCache.cxx +++ b/vcl/source/filter/FilterConfigCache.cxx @@ -69,7 +69,7 @@ OUString FilterConfigCache::FilterConfigCacheEntry::GetShortName() { aShortName = lExtensionList[ 0 ]; if ( aShortName.startsWith( "*." ) ) - aShortName = aShortName.replaceAt( 0, 2, "" ); + aShortName = aShortName.replaceAt( 0, 2, u"" ); } return aShortName; } @@ -375,7 +375,7 @@ OUString FilterConfigCache::GetImportWildcard(sal_uInt16 nFormat, sal_Int32 nEnt { OUString aWildcard( GetImportFormatExtension( nFormat, nEntry ) ); if ( !aWildcard.isEmpty() ) - aWildcard = aWildcard.replaceAt( 0, 0, "*." ); + aWildcard = aWildcard.replaceAt( 0, 0, u"*." ); return aWildcard; } @@ -473,7 +473,7 @@ OUString FilterConfigCache::GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEn { OUString aWildcard( GetExportFormatExtension( nFormat, nEntry ) ); if ( !aWildcard.isEmpty() ) - aWildcard = aWildcard.replaceAt( 0, 0, "*." ); + aWildcard = aWildcard.replaceAt( 0, 0, u"*." ); return aWildcard; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 48dda1916a0f..3db1ca90f235 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -7054,7 +7054,7 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, tools::Long nWidth, Fo // do not get broader than nWidth modulo 1 character while( GetTextWidth( aStrikeout ) >= nWidth ) - aStrikeout = aStrikeout.replaceAt( 0, 1, "" ); + aStrikeout = aStrikeout.replaceAt( 0, 1, u"" ); aStrikeout += aStrikeoutChar; bool bShadow = m_aCurrentPDFState.m_aFont.IsShadow(); if ( bShadow ) diff --git a/vcl/source/image/ImplImage.cxx b/vcl/source/image/ImplImage.cxx index 6df732c09d97..a5637c3bb452 100644 --- a/vcl/source/image/ImplImage.cxx +++ b/vcl/source/image/ImplImage.cxx @@ -66,7 +66,7 @@ bool ImplImage::loadStockAtScale(double fScale, BitmapEx &rBitmapEx) sal_Int32 nStart = maStockName.indexOf("%3f"); sal_Int32 nEnd = maStockName.lastIndexOf("."); - OUString aFileName = maStockName.replaceAt(nStart, nEnd - nStart, ""); + OUString aFileName = maStockName.replaceAt(nStart, nEnd - nStart, u""); if (!ImageTree::get().loadImage(aFileName, aIconTheme, aBitmapEx, true, nScalePercentage, eScalingFlags)) { diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index bdeee4fbc428..8fb3a2c87118 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -2023,7 +2023,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, { if ( (nIndex > 1) || (nIndex == aStr.getLength()) ) nIndex--; - aStr = aStr.replaceAt( nIndex, 1, ""); + aStr = aStr.replaceAt( nIndex, 1, u""); } } @@ -2295,12 +2295,12 @@ OUString OutputDevice::GetNonMnemonicString( const OUString& rStr, sal_Int32& rM { if ( rMnemonicPos == -1 ) rMnemonicPos = i; - aStr = aStr.replaceAt( i, 1, "" ); + aStr = aStr.replaceAt( i, 1, u"" ); nLen--; } else { - aStr = aStr.replaceAt( i, 1, "" ); + aStr = aStr.replaceAt( i, 1, u"" ); nLen--; i++; } diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index 35422acc2273..f86501cc8def 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -1875,7 +1875,7 @@ bool TransferableDataHelper::GetINetBookmark( const css::datatransfer::DataFlavo } aURL = aString.copy( nStart + 1, nLen ); - aString = aString.replaceAt( 0, nStart + 1 + nLen, "" ); + aString = aString.replaceAt( 0, nStart + 1 + nLen, u"" ); nStart = aString.indexOf( '@' ); nLen = aString.toInt32(); diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx index 4dd12668b48d..d412b2ad4071 100644 --- a/vcl/source/window/mnemonic.cxx +++ b/vcl/source/window/mnemonic.cxx @@ -195,7 +195,7 @@ OUString MnemonicGenerator::CreateMnemonic( const OUString& _rKey ) if ( maMnemonics[nMnemonicIndex] ) { maMnemonics[nMnemonicIndex] = 0; - rKey = rKey.replaceAt( nIndex, 0, OUString(m_cMnemonic) ); + rKey = rKey.replaceAt( nIndex, 0, rtl::OUStringChar(m_cMnemonic) ); bChanged = true; break; } @@ -247,7 +247,7 @@ OUString MnemonicGenerator::CreateMnemonic( const OUString& _rKey ) if ( nBestCount != 0xFFFF ) { maMnemonics[nBestMnemonicIndex] = 0; - rKey = rKey.replaceAt( nBestIndex, 0, OUString(m_cMnemonic) ); + rKey = rKey.replaceAt( nBestIndex, 0, rtl::OUStringChar(m_cMnemonic) ); bChanged = true; } } @@ -327,7 +327,7 @@ OUString MnemonicGenerator::EraseAllMnemonicChars( const OUString& rStr ) aStr[ i+2 ] == ')' && c >= MNEMONIC_RANGE_2_START && c <= MNEMONIC_RANGE_2_END ) { - aStr = aStr.replaceAt( i-1, 4, "" ); + aStr = aStr.replaceAt( i-1, 4, u"" ); nLen -= 4; i--; continue; @@ -335,7 +335,7 @@ OUString MnemonicGenerator::EraseAllMnemonicChars( const OUString& rStr ) } // remove standard mnemonics - aStr = aStr.replaceAt( i, 1, "" ); + aStr = aStr.replaceAt( i, 1, u"" ); nLen--; } else diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 8ea34f144054..f9309413825e 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -1320,7 +1320,7 @@ void PPDParser::parseOrderDependency(const OString& rLine) OUString aKey(OStringToOUString(GetCommandLineToken(2, aLine), RTL_TEXTENCODING_MS_1252)); if( aKey[ 0 ] != '*' ) return; // invalid order dependency - aKey = aKey.replaceAt( 0, 1, "" ); + aKey = aKey.replaceAt( 0, 1, u"" ); PPDKey* pKey; PPDParser::hash_type::const_iterator keyit = m_aKeys.find( aKey ); @@ -1354,7 +1354,7 @@ void PPDParser::parseConstraint( const OString& rLine ) OUString aLine(OStringToOUString(rLine, RTL_TEXTENCODING_MS_1252)); sal_Int32 nIdx = rLine.indexOf(':'); if (nIdx != -1) - aLine = aLine.replaceAt(0, nIdx + 1, ""); + aLine = aLine.replaceAt(0, nIdx + 1, u""); PPDConstraint aConstraint; int nTokens = GetCommandLineTokenCount( aLine ); for( int i = 0; i < nTokens; i++ ) @@ -1362,7 +1362,7 @@ void PPDParser::parseConstraint( const OString& rLine ) OUString aToken = GetCommandLineToken( i, aLine ); if( !aToken.isEmpty() && aToken[ 0 ] == '*' ) { - aToken = aToken.replaceAt( 0, 1, "" ); + aToken = aToken.replaceAt( 0, 1, u"" ); if( aConstraint.m_pKey1 ) aConstraint.m_pKey2 = getKey( aToken ); else diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx index 8c0e638d024b..3c52b7ca3981 100644 --- a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx @@ -439,11 +439,11 @@ shrinkFilterName( const OUString &rFilterName, bool bAllowNoStar = false ) if( nBracketEnd <= 0 ) continue; if( isFilterString( rFilterName.copy( i + 1, nBracketLen - 1 ), "*." ) ) - aRealName = aRealName.replaceAt( i, nBracketLen + 1, OUString() ); + aRealName = aRealName.replaceAt( i, nBracketLen + 1, u"" ); else if (bAllowNoStar) { if( isFilterString( rFilterName.copy( i + 1, nBracketLen - 1 ), ".") ) - aRealName = aRealName.replaceAt( i, nBracketLen + 1, OUString() ); + aRealName = aRealName.replaceAt( i, nBracketLen + 1, u"" ); } } } |