diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-01 13:20:11 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-07-04 06:49:52 +0000 |
commit | 7855ea48309ee2ba06ee5f3d5dac27ecfc4ca4a6 (patch) | |
tree | 359d2a334303f6e32582981efef6e6e0d6b69e01 | |
parent | cd71034b26a404c8f9b763865ef6ebdd0adeebb7 (diff) |
remove comphelper::string::remove
and replace it with OUString/OString::replaceAll
Change-Id: I37b1c3b51251dfd9d749d6f1060c75b3a93d7f1a
Reviewed-on: https://gerrit.libreoffice.org/26850
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
53 files changed, 64 insertions, 124 deletions
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx index 70998759e04f..0d18ac03a73b 100644 --- a/comphelper/qa/string/test_string.cxx +++ b/comphelper/qa/string/test_string.cxx @@ -34,7 +34,6 @@ class TestString: public CppUnit::TestFixture { public: void testNatural(); - void testRemove(); void testStripStart(); void testStripEnd(); void testStrip(); @@ -47,7 +46,6 @@ public: CPPUNIT_TEST_SUITE(TestString); CPPUNIT_TEST(testNatural); - CPPUNIT_TEST(testRemove); CPPUNIT_TEST(testStripStart); CPPUNIT_TEST(testStripEnd); CPPUNIT_TEST(testStrip); @@ -278,20 +276,6 @@ void TestString::testNatural() ); } -void TestString::testRemove() -{ - OString aIn("abc"); - OString aOut; - - aOut = ::comphelper::string::remove(aIn, 'b'); - CPPUNIT_ASSERT(aOut == "ac"); - - aIn = "aaa"; - - aOut = ::comphelper::string::remove(aIn, 'a'); - CPPUNIT_ASSERT(aOut.isEmpty()); -} - void TestString::testStripStart() { OString aIn("abc"); diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 2f85d9325bef..ac0ca35dc410 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -680,7 +680,7 @@ bool OFlatTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool else { if ( cThousandDelimiter ) - aStrConverted = comphelper::string::remove(aStr, cThousandDelimiter); + aStrConverted = aStr.replaceAll(OUString(cThousandDelimiter), ""); else aStrConverted = aStr; } diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index 9d91faeca8d8..ef7ad42fa3f6 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -73,7 +73,7 @@ static OUString getNormDicEntry_Impl(const OUString &rText) } aTmp = aTmp2.makeStringAndClear(); } - return comphelper::string::remove(aTmp, '='); + return aTmp.replaceAll("=", ""); } // Compare Dictionary Entry result diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx index 61949b640c1b..1a374ab96173 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.cxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx @@ -93,7 +93,7 @@ bool OQueryTableWindow::Init() sAliasName += "_" + OUString::number(m_nAliasNum); } - sAliasName = comphelper::string::remove(sAliasName, '"'); + sAliasName = sAliasName.replaceAll("\"", ""); SetAliasName(sAliasName); // SetAliasName passes it as WinName, hence it uses the base class // reset the title diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 1174677eaf19..ae2f189948bf 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -606,7 +606,7 @@ bool FormulaDlg_Impl::CalcStruct( const OUString& rStrExp, bool bForceRecalcStru aString = aString.copy(0, nLength-1); } - aString = comphelper::string::remove(aString, '\n'); + aString = aString.replaceAll("\n", ""); OUString aStrResult; if ( CalcValue(aString, aStrResult ) ) diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx index f1d253f30401..ea8762850fdd 100644 --- a/include/comphelper/string.hxx +++ b/include/comphelper/string.hxx @@ -50,34 +50,6 @@ inline bool equals(const OUString& rIn, sal_Unicode c) /** Removes all occurrences of a character from within the source string - @deprecated Use OString::replaceAll(OString(c), OString()) - instead. - - @param rIn The input OString - @param c The character to be removed - - @return The resulting OString - */ -inline OString remove(const OString &rIn, - sal_Char c) -{ return rIn.replaceAll(OString(c), OString()); } - -/** Removes all occurrences of a character from within the source string - - @deprecated Use - OUString::replaceAll(OUString(c), OUString()) instead. - - @param rIn The input OUString - @param c The character to be removed - - @return The resulting OUString - */ -inline OUString remove(const OUString &rIn, - sal_Unicode c) -{ return rIn.replaceAll(OUString(c), ""); } - -/** Removes all occurrences of a character from within the source string - @param rIn The input OUStringBuffer @param c The character to be removed diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index 34027d95eb2c..7b97f500d9de 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -96,7 +96,7 @@ void SearchSimilarText( const OUString &rText, sal_Int16 nLanguage, if (pEntries[k].is()) { // remove characters used to determine hyphenation positions - aEntryTxt = comphelper::string::remove(pEntries[k]->getDictionaryWord(), '='); + aEntryTxt = pEntries[k]->getDictionaryWord().replaceAll("=", ""); } if (!aEntryTxt.isEmpty() && aEntryTxt.getLength() > 1 && LevDistance( rText, aEntryTxt ) <= 2) rDicListProps.push_back( aEntryTxt ); diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx index 2cc3f46921bf..56d3ffc7810a 100644 --- a/linguistic/workben/sspellimp.cxx +++ b/linguistic/workben/sspellimp.cxx @@ -229,8 +229,7 @@ Reference< XSpellAlternatives > aAlt2( aTmp ); aAlt1.SearchAndReplaceAll( (sal_Unicode) 'x', (sal_Unicode) 'u'); aAlt1.SearchAndReplaceAll( (sal_Unicode) 'X', (sal_Unicode) 'U'); - aAlt2 = comphelper::string::remove(aAlt2, 'x'); - aAlt2 = comphelper::string::remove(aAlt2, 'X'); + aAlt2 = aAlt2.replaceAll("x", "").replaceAll("X", ""); pStr[0] = aAlt1; pStr[1] = aAlt2; diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index 3c6eb9c8b1d6..962616780452 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -894,7 +894,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile, aLine = comphelper::string::stripStart(aLine, ' '); aLine = comphelper::string::stripStart(aLine, '\t'); - aLine = comphelper::string::remove(aLine, ';'); + aLine = aLine.replaceAll(";", ""); if (comphelper::string::isdigitAsciiString(aLine)) { diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 4b2836d7871d..9eae3d44271f 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -63,7 +63,7 @@ ScEditUtil::ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ, OUString ScEditUtil::ModifyDelimiters( const OUString& rOld ) { // underscore is used in function argument names - OUString aRet = comphelper::string::remove(rOld, '_') + + OUString aRet = rOld.replaceAll("_", "") + "=()+-*/^&<>" + ScCompiler::GetNativeSymbol(ocSep); // argument separator is localized. return aRet; diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 7fa8dc5cd18b..caea9fd9fa87 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -510,7 +510,7 @@ void lcl_GetColumnTypes( if ( nToken > 1 ) { aFieldName = aString.getToken( 0, ',' ); - aString = comphelper::string::remove(aString, ' '); + aString = aString.replaceAll(" ", ""); switch ( aString.getToken( 1, ',' )[0] ) { case 'L' : diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 3121b36ee381..ade5249347ee 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -304,7 +304,7 @@ bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction) ScChangeActionType eType=pScChangeAction->GetType(); OUString aDesc; - OUString aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n'); + OUString aComment = pScChangeAction->GetComment().replaceAll("\n", ""); if(eType==SC_CAT_CONTENT) { @@ -429,7 +429,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeAction( bIsGenerated = true; } - OUString aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n'); + OUString aComment = pScChangeAction->GetComment().replaceAll("\n", ""); if (!aDesc.isEmpty()) { @@ -600,7 +600,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction( aString += "\t"; } - OUString aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n'); + OUString aComment = pScChangeAction->GetComment().replaceAll("\n", ""); if (!aDesc.isEmpty()) { @@ -715,7 +715,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionC aString += "\t"; } - OUString aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n'); + OUString aComment = pScChangeAction->GetComment().replaceAll("\n", ""); if(!aDesc.isEmpty()) { diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index d3ad69fd784b..acdd72ec061b 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1328,8 +1328,7 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterfac if (pFilter) { sExtension = pFilter->GetDefaultExtension (); - sExtension = comphelper::string::remove(sExtension, '*'); - sExtension = comphelper::string::remove(sExtension, '.'); + sExtension = sExtension.replaceAll("*", "").replaceAll(".", ""); } // a) the new way (optional!) diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index 33948a46d0df..374ece4a8274 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -1165,7 +1165,7 @@ namespace sfx2 if ( !_bForOpen ) { // show '*' in extensions only when opening a document - sExt = comphelper::string::remove(sExt, '*'); + sExt = sExt.replaceAll("*", ""); } sRet += sOpenBracket; sRet += sExt; diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 1522234ef25f..c7995c9f2a08 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -914,15 +914,12 @@ bool CreateFromAddress_Impl( OUString& rFrom ) } rFrom += comphelper::string::strip(aName, ' '); // remove illegal characters - rFrom = comphelper::string::remove(rFrom, '<'); - rFrom = comphelper::string::remove(rFrom, '>'); - rFrom = comphelper::string::remove(rFrom, '@'); + rFrom = rFrom.replaceAll("<", "").replaceAll(">", "").replaceAll("@", ""); } OUString aEmailName = aUserCFG.GetEmail(); // remove illegal characters - aEmailName = comphelper::string::remove(aEmailName, '<'); - aEmailName = comphelper::string::remove(aEmailName, '>'); + aEmailName = aEmailName.replaceAll("<", "").replaceAll(">", ""); if ( !aEmailName.isEmpty() ) { diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index db3d03edb36f..0a016939b78a 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -53,7 +53,7 @@ IMPL_LINK_NOARG_TYPED( SfxNewStyleDlg, OKHdl, ComboBox&, void ) IMPL_LINK_TYPED( SfxNewStyleDlg, ModifyHdl, Edit&, rBox, void ) { - m_pOKBtn->Enable( !comphelper::string::remove(rBox.GetText(), ' ').isEmpty() ); + m_pOKBtn->Enable( !rBox.GetText().replaceAll(" ", "").isEmpty() ); } SfxNewStyleDlg::SfxNewStyleDlg( vcl::Window* pParent, SfxStyleSheetBasePool& rInPool ) diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index dc996183252b..8f7a814bdce6 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -970,7 +970,7 @@ OUString SfxObjectShell::GetServiceNameFromFactory( const OUString& rFact ) aFact = aFact.copy( 0, nPos ); aParam = aParam.copy(1); } - aFact = comphelper::string::remove(aFact, '4'); + aFact = aFact.replaceAll("4", ""); aFact = aFact.toAsciiLowerCase(); // HACK: sometimes a real document service name is given here instead of diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index ccccfeaf8409..6be8a2676449 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2216,7 +2216,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, assert((&rComboBox == pOldSymbols || &rComboBox == pSymbols) && "Sm : wrong ComboBox"); // trim SymbolName (no blanks) - OUString aNormName(comphelper::string::remove(rSymbolName, ' ')); + OUString aNormName = rSymbolName.replaceAll(" ", ""); // and remove possible deviations within the input rComboBox.SetText(aNormName); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index eba45ac01734..dd8bcb2d13f9 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -970,7 +970,7 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const OUString& rText, long do { OUString aLine = rText.getToken(0, '\n', nPos); - aLine = comphelper::string::remove(aLine, '\r'); + aLine = aLine.replaceAll("\r", ""); aSize = GetTextLineSize(rDevice, aLine); @@ -1054,7 +1054,7 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const do { OUString aLine = rText.getToken(0, '\n', nPos); - aLine = comphelper::string::remove(aLine, '\r'); + aLine = aLine.replaceAll("\r", ""); aSize = GetTextLineSize(rDevice, aLine); if (aSize.Width() > MaxWidth) { diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx index 769d7832f5f8..019cbb556c65 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -38,8 +38,8 @@ namespace linguistic bool RemoveHyphens(OUString &rTxt) { sal_Int32 n = rTxt.getLength(); - rTxt = comphelper::string::remove(rTxt, SVT_SOFT_HYPHEN); - rTxt = comphelper::string::remove(rTxt, SVT_HARD_HYPHEN); + rTxt = rTxt.replaceAll(OUString(SVT_SOFT_HYPHEN), ""); + rTxt = rTxt.replaceAll(OUString(SVT_HARD_HYPHEN), ""); return n != rTxt.getLength(); } diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index e446d73bcb24..6154e2a9bb78 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -2915,7 +2915,7 @@ bool ImpSvNumberInputScan::ScanStringNumFor( const OUString& rString, // S !bFirst && (nSign < 0) && pFormat->IsSecondSubformatRealNegative() ) { // simply negated twice? --1 - aString = comphelper::string::remove(aString, ' '); + aString = aString.replaceAll(" ", ""); if ( (aString.getLength() == 1) && (aString[0] == '-') ) { bFound = true; diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index 43040c93ae6b..723986ca042b 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -125,8 +125,7 @@ HDDEDATA CALLBACK DdeInternal::SvrCallback( while( -1 != n ) { OUString s( sTopics.getToken( 0, '\t', n )); - s = comphelper::string::remove(s, '\n'); - s = comphelper::string::remove(s, '\r'); + s = s.replaceAll("\n", "").replaceAll("\r", ""); if( !hText1 || s == reinterpret_cast<const sal_Unicode*>(chTopicBuf) ) { DdeString aDStr( pInst->hDdeInstSvr, s ); diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx index 7702add7dc35..a196e0a3ad8d 100644 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -441,8 +441,7 @@ OUString FontList::GetStyleName(const FontMetric& rInfo) const else { // Translate StyleName to localized name - OUString aCompareStyleName = aStyleName.toAsciiLowerCase(); - aCompareStyleName = comphelper::string::remove(aCompareStyleName, ' '); + OUString aCompareStyleName = aStyleName.toAsciiLowerCase().replaceAll(" ", ""); if (aCompareStyleName == "bold") aStyleName = maBold; else if (aCompareStyleName == "bolditalic") diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 01e534cf7507..b031d4c85cc7 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -248,7 +248,7 @@ void ImageMap::ImpReadCERNLine( const OString& rLine, const OUString& rBaseURL { OString aStr = comphelper::string::stripStart(rLine, ' '); aStr = comphelper::string::stripStart(aStr, '\t'); - aStr = comphelper::string::remove(aStr, ';'); + aStr = aStr.replaceAll(";", ""); aStr = aStr.toAsciiLowerCase(); const char* pStr = aStr.getStr(); @@ -389,7 +389,7 @@ void ImageMap::ImpReadNCSALine( const OString& rLine, const OUString& rBaseURL ) { OString aStr = comphelper::string::stripStart(rLine, ' '); aStr = comphelper::string::stripStart(aStr, '\t'); - aStr = comphelper::string::remove(aStr, ';'); + aStr = aStr.replaceAll(";", ""); aStr = aStr.toAsciiLowerCase(); const char* pStr = aStr.getStr(); diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 931890b2da48..a47b4e4a5cd6 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -1934,8 +1934,7 @@ bool HTMLParser::ParseMetaOptionsImpl( if ( bHTTPEquiv || HTML_META_DESCRIPTION != nAction ) { // if it is not a Description, remove CRs and LFs from CONTENT - aContent = comphelper::string::remove(aContent, '\r'); - aContent = comphelper::string::remove(aContent, '\n'); + aContent = aContent.replaceAll("\r", "").replaceAll("\n", ""); } else { diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index dd81069eb8f9..18a139893aa2 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -628,7 +628,7 @@ void ColumnsWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) if (nCol) aText = OUString::number(nCol); else - aText = comphelper::string::remove(Button::GetStandardText(StandardButtonType::Cancel), '~'); + aText = Button::GetStandardText(StandardButtonType::Cancel).replaceAll("~", ""); Size aTextSize(rRenderContext.GetTextWidth(aText), rRenderContext.GetTextHeight()); rRenderContext.DrawText(Point((aSize.Width() - aTextSize.Width()) / 2, aSize.Height() - nTextHeight + 2), aText); diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index bebb41ba67b1..5ade3ec3cf5d 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -2222,7 +2222,7 @@ bool SwCursorShell::SelectNxtPrvHyperlink( bool bNext ) OUString sText( pTextNd->GetExpandText( rAttr.GetStart(), *rAttr.GetEnd() - rAttr.GetStart() ) ); - sText = comphelper::string::remove(sText, 0x0a); + sText = sText.replaceAll(OUStringLiteral1<0x0a>(), ""); sText = comphelper::string::strip(sText, ' '); if( !sText.isEmpty() ) diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 634d587b3574..c07b8b0417a8 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -244,9 +244,8 @@ bool SwAutoCompleteWord::InsertWord( const OUString& rWord, SwDoc& rDoc ) return false; } - OUString aNewWord(rWord); - aNewWord = comphelper::string::remove(aNewWord, CH_TXTATR_INWORD); - aNewWord = comphelper::string::remove(aNewWord, CH_TXTATR_BREAKWORD); + OUString aNewWord = rWord.replaceAll(OUString(CH_TXTATR_INWORD), "") + .replaceAll(OUStringLiteral1<CH_TXTATR_BREAKWORD>(), ""); pImpl->AddDocument(rDoc); bool bRet = false; diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index ea8089295b9b..d4b951adc1a8 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -627,7 +627,7 @@ static void lcl_FormatPostIt( aStr = pField->GetPar2(); #if defined(_WIN32) // Throw out all CR in Windows - aStr = comphelper::string::remove(aStr, '\r'); + aStr = aStr.replaceAll("\r", ""); #endif pIDCO->InsertString( aPam, aStr ); } diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 43aa82fab6e2..83cc9dfd9793 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -673,7 +673,7 @@ void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) OUString sText( pTextNd->GetExpandText( rAttr.GetStart(), *rAttr.GetEnd() - rAttr.GetStart() ) ); - sText = comphelper::string::remove(sText, 0x0a); + sText = sText.replaceAll(OUStringLiteral1<0x0a>(), ""); sText = comphelper::string::strip(sText, ' '); if( !sText.isEmpty() ) diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index b517487a6c51..17a2b29b4b40 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -861,9 +861,8 @@ uno::Reference< XSpellAlternatives > if( pWrong->InWrongWord(nBegin,nLen) && !pNode->IsSymbol(nBegin) ) { const OUString aText(pNode->GetText().copy(nBegin, nLen)); - OUString aWord( aText ); - aWord = comphelper::string::remove(aWord, CH_TXTATR_BREAKWORD); - aWord = comphelper::string::remove(aWord, CH_TXTATR_INWORD); + OUString aWord = aText.replaceAll(OUStringLiteral1<CH_TXTATR_BREAKWORD>(), "") + .replaceAll(OUString(CH_TXTATR_INWORD), ""); uno::Reference< XSpellChecker1 > xSpell( ::GetSpellChecker() ); if( xSpell.is() ) diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx index 6c356ae47be7..5543f05ceac9 100644 --- a/sw/source/core/fields/ddetbl.cxx +++ b/sw/source/core/fields/ddetbl.cxx @@ -108,7 +108,7 @@ void SwDDETable::ChangeContent() // access to DDEFieldType SwDDEFieldType* pDDEType = static_cast<SwDDEFieldType*>(aDepend.GetRegisteredIn()); - OUString aExpand = comphelper::string::remove(pDDEType->GetExpansion(), '\r'); + OUString aExpand = pDDEType->GetExpansion().replaceAll("\r", ""); sal_Int32 nExpandTokenPos = 0; for( size_t n = 0; n < m_aLines.size(); ++n ) diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index a993a073642c..118d7c17bd1e 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -398,7 +398,7 @@ void SwGetRefField::UpdateField( const SwTextField* pFieldTextAttr ) // remove all special characters (replace them with blanks) if( !sText.isEmpty() ) { - sText = comphelper::string::remove(sText, 0xad); + sText = sText.replaceAll(OUString(sal_Unicode(0xad)), ""); OUStringBuffer aBuf(sText); const sal_Int32 l = aBuf.getLength(); for (sal_Int32 i=0; i<l; ++i) diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 8fa82a85d96f..7afdedad12f3 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -204,7 +204,7 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode ) { OUString aOutStr( aStr.copy( nStrPos, nNextAttr - nStrPos ) ); if ( !bExportSoftHyphens ) - aOutStr = comphelper::string::remove(aOutStr, CHAR_SOFTHYPHEN); + aOutStr = aOutStr.replaceAll(OUString(CHAR_SOFTHYPHEN), ""); rWrt.Strm().WriteUnicodeOrByteText( aOutStr ); } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index b2e95fa773b9..642816a16d2c 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1969,8 +1969,7 @@ void SwHTMLWriter::AddLinkTarget( const OUString& rURL ) OUString aURL( rURL.copy( 1 ) ); // nPos-1+1/3 (-1 wg. Erase) - OUString sCmp(comphelper::string::remove(aURL.copy(bEncoded ? nPos+2 : nPos), - ' ')); + OUString sCmp = aURL.copy(bEncoded ? nPos+2 : nPos).replaceAll(" ",""); if( sCmp.isEmpty() ) return; diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index aeb520d418f6..894cfdf718ea 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1607,8 +1607,7 @@ void SwHTMLParser::InsertInput() // geloescht werden. if( !bKeepCRLFInValue ) { - sText = comphelper::string::remove(sText, '\r'); - sText = comphelper::string::remove(sText, '\n'); + sText = sText.replaceAll("\r", "").replaceAll("\n", ""); } const uno::Reference< XMultiServiceFactory > & rServiceFactory = diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index c83eafe5d36c..2d6d590508dc 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -1162,7 +1162,7 @@ ANCHOR_SETEVENT: sal_Int32 nPos = sDecoded.lastIndexOf( cMarkSeparator ); if( nPos != -1 ) { - OUString sCmp(comphelper::string::remove(sDecoded.copy(nPos+1), ' ')); + OUString sCmp= sDecoded.copy(nPos+1).replaceAll(" ",""); if( !sCmp.isEmpty() ) { sCmp = sCmp.toAsciiLowerCase(); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 0f8c49a312a3..fe2fd8be6361 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -377,8 +377,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCursor, SvStream& rIn, OUString sCmp; if (nPos) { - sCmp = comphelper::string::remove( - m_sJmpMark.copy(nPos + 1), ' '); + sCmp = m_sJmpMark.copy(nPos + 1).replaceAll(" ", ""); } if( !sCmp.isEmpty() ) @@ -5386,8 +5385,7 @@ void SwHTMLParser::ParseMoreMetaOptions() aName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_META_content_script_type ) ) return; - aContent = comphelper::string::remove(aContent, '\r'); - aContent = comphelper::string::remove(aContent, '\n'); + aContent = aContent.replaceAll("\r", "").replaceAll("\n", ""); if( aName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_META_sdendnote ) ) { diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index abc371493dad..b85cb22125dd 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1191,7 +1191,7 @@ OUString SwHTMLWriter::convertHyperlinkHRefValue(const OUString& rURL) sal_Int32 nPos = sURL.lastIndexOf(cMarkSeparator); if (nPos != -1) { - OUString sCompare(comphelper::string::remove(sURL.copy(nPos + 1), ' ')); + OUString sCompare = sURL.copy(nPos + 1).replaceAll(" ", ""); if (!sCompare.isEmpty()) { sCompare = sCompare.toAsciiLowerCase(); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index a5b2c16d4616..c726accae3c9 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2975,7 +2975,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL) if( nPos < 2 ) return; - OUString sCmp(comphelper::string::remove(aURL.copy(nPos+1), ' ')); + OUString sCmp = aURL.copy(nPos+1).replaceAll(" ", ""); if( sCmp.isEmpty() ) return; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 306403b63fa8..aa7cac7f479c 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -1501,7 +1501,7 @@ eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* pF, OUString& rStr ) } } - aDocProperty = comphelper::string::remove(aDocProperty, '"'); + aDocProperty = aDocProperty.replaceAll("\"", ""); /* There are up to 26 fields that may be meant by 'DocumentProperty'. @@ -1691,7 +1691,7 @@ eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* pF, OUString& rStr ) } } - aData = comphelper::string::remove(aData, '"'); + aData = aData.replaceAll("\"", ""); } SwDocInfoField aField( static_cast<SwDocInfoFieldType*>( diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index 5052e3d0303b..8cc3cba5b31d 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -130,7 +130,7 @@ void SwFieldInputDlg::StateChanged( StateChangedType nType ) // Close void SwFieldInputDlg::Apply() { - OUString aTmp(comphelper::string::remove(m_pEditED->GetText(), '\r')); + OUString aTmp = m_pEditED->GetText().replaceAll("\r", ""); rSh.StartAllAction(); bool bModified = false; if(pInpField) diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index a50e74fc415a..1dd1666465f4 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -56,7 +56,7 @@ IMPL_LINK_NOARG_TYPED(SwInsertBookmarkDlg, ModifyHdl, Edit&, void) for (sal_Int32 i = 0; i < BookmarkTable::aForbiddenChars.getLength(); i++) { const sal_Int32 nTmpLen = sTmp.getLength(); - sTmp = comphelper::string::remove(sTmp, BookmarkTable::aForbiddenChars[i]); + sTmp = sTmp.replaceAll(OUString(BookmarkTable::aForbiddenChars[i]), ""); if (sTmp.getLength() != nTmpLen) sMsg += OUString(BookmarkTable::aForbiddenChars[i]); } diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx index 2859c6882321..1779f09f46c3 100644 --- a/sw/source/ui/vba/vbafield.cxx +++ b/sw/source/ui/vba/vbafield.cxx @@ -435,7 +435,7 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_DocProperty( const break; } } - aDocProperty = comphelper::string::remove(aDocProperty, '"'); + aDocProperty = aDocProperty.replaceAll("\"", ""); OSL_TRACE("SwVbaFields::Create_Field_DocProperty, the document property name is %s ",OUStringToOString( aDocProperty, RTL_TEXTENCODING_UTF8 ).getStr() ); if( aDocProperty.isEmpty() ) { diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index 63cfd8458b7b..e26316305c34 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -78,7 +78,7 @@ OUString InsertLabEnvText( SwWrtShell& rSh, SwFieldMgr& rFieldMgr, const OUString& rText ) { OUString sRet; - OUString aText(comphelper::string::remove(rText, '\r')); + OUString aText = rText.replaceAll("\r", ""); sal_Int32 nTokenPos = 0; while( -1 != nTokenPos ) diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index a480b73d47d9..0d2517129de4 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -202,7 +202,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) if( !sText.isEmpty() ) { - OUStringBuffer sTmp(comphelper::string::remove(sText, 0xad)); + OUStringBuffer sTmp(sText.replaceAll(OUString(sal_Unicode(0xad)), "")); for (sal_Int32 i = 0; i < sTmp.getLength(); ++i) { if (sTmp[i] < 0x20) diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index ad207523df3d..5ff38fdd9273 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -416,7 +416,7 @@ void SwZoomBox_Impl::Select() { if ( !IsTravelSelect() ) { - OUString sEntry(comphelper::string::remove(GetText(), '%')); + OUString sEntry = GetText().replaceAll("%", ""); SvxZoomItem aZoom(SvxZoomType::PERCENT,100); if(sEntry == SVX_RESSTR( RID_SVXSTR_ZOOM_PAGE_WIDTH ) ) aZoom.SetType(SvxZoomType::PAGEWIDTH); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 121a77a554bb..67911a5ee199 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1931,7 +1931,7 @@ bool SwView::JumpToSwMark( const OUString& rMark ) IDocumentMarkAccess::const_iterator_t ppMark; IDocumentMarkAccess* const pMarkAccess = m_pWrtShell->getIDocumentMarkAccess(); if( -1 != nPos ) - sCmp = comphelper::string::remove(sMark.copy(nPos + 1), ' '); + sCmp = sMark.copy(nPos + 1).replaceAll(" ", ""); if( !sCmp.isEmpty() ) { diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index 3c2a476969e1..70a438a8294d 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -638,7 +638,7 @@ void AquaSalMenu::SetItemText( unsigned /*i_nPos*/, SalMenuItem* i_pSalMenuItem, AquaSalMenuItem *pAquaSalMenuItem = static_cast<AquaSalMenuItem *>(i_pSalMenuItem); // Delete mnemonics - OUString aText( comphelper::string::remove(i_rText, '~') ); + OUString aText = i_rText.replaceAll("~", ""); /* #i90015# until there is a correct solution strip out any appended (.*) in menubar entries @@ -867,7 +867,7 @@ AquaSalMenuItem::AquaSalMenuItem( const SalItemParams* pItemData ) : mpMenuItem( nil ) { // Delete mnemonics - OUString aText( comphelper::string::remove(pItemData->aText, '~') ); + OUString aText = pItemData->aText.replaceAll("~", ""); if (pItemData->eType == MenuItemType::SEPARATOR) { diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index ddad3e3738e8..b43f00ca332a 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -237,7 +237,7 @@ FieldUnitStringList* ImplGetCleanedFieldUnits() for( size_t i = 0; i < nUnits; ++i ) { OUString aUnit( (*pUnits)[i].first ); - aUnit = comphelper::string::remove(aUnit, ' '); + aUnit = aUnit.replaceAll(" ", ""); aUnit = aUnit.toAsciiLowerCase(); std::pair< OUString, FieldUnit > aElement( aUnit, (*pUnits)[i].second ); pSVData->maCtrlData.mpCleanUnitStrings->push_back( aElement ); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 0e267cd9665e..2152c28ceca0 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -771,8 +771,7 @@ void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uI OUString Edit::ImplGetValidString( const OUString& rString ) const { OUString aValidString( rString ); - aValidString = comphelper::string::remove(aValidString, '\n'); - aValidString = comphelper::string::remove(aValidString, '\r'); + aValidString = aValidString.replaceAll("\n", "").replaceAll("\r", ""); aValidString = aValidString.replace('\t', ' '); return aValidString; } @@ -2324,7 +2323,7 @@ OUString TextFilter::filter(const OUString &rText) OUString sTemp(rText); for (sal_Int32 i = 0; i < sForbiddenChars.getLength(); ++i) { - sTemp = comphelper::string::remove(sTemp, sForbiddenChars[i]); + sTemp = sTemp.replaceAll(OUString(sForbiddenChars[i]), ""); } return sTemp; } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 03debfb9f1ef..96e1f3cebb2d 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -1087,8 +1087,7 @@ static FieldUnit ImplStringToMetric(const OUString &rMetricString) if( pList ) { // return FieldUnit - OUString aStr(rMetricString.toAsciiLowerCase()); - aStr = string::remove(aStr, ' '); + OUString aStr = rMetricString.toAsciiLowerCase().replaceAll(" ", ""); for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it ) { if ( it->first == aStr ) diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index 10e84cc53f68..c062c50474ff 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -1109,7 +1109,7 @@ void SgfFontLst::ReadList() for (i=0;i<Anz;i++) { - FID = comphelper::string::remove(aCfg.GetKeyName(i), ' '); + FID = aCfg.GetKeyName(i).replaceAll(" ", ""); Dsc = aCfg.ReadKey( i ); if (comphelper::string::isdigitAsciiString(FID)) { |