summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2013-10-17 11:43:40 +0200
committerThomas Arnhold <thomas@arnhold.org>2013-10-17 15:22:20 +0200
commitc65eb7e56934b22f9bea68e62c0a51fd59869f1c (patch)
tree969c97ef97180a4d70cb6b1ccc610c0240800d5c
parent5df4743236c0d41ad0d28ba7e743f2ea4f74c8e5 (diff)
Related: fdo#38838 remove String::SearchAndReplace
Change-Id: I1cc52d0be360b05e722a18b3ca5d08b2b0b0842d
-rw-r--r--include/tools/string.hxx5
-rw-r--r--reportdesign/source/core/sdr/UndoActions.cxx5
-rw-r--r--reportdesign/source/ui/inc/StartMarker.hxx2
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx10
-rw-r--r--reportdesign/source/ui/report/SectionWindow.cxx6
-rw-r--r--reportdesign/source/ui/report/StartMarker.cxx2
-rw-r--r--sw/source/core/view/printdata.cxx5
-rw-r--r--tools/source/string/tustring.cxx36
8 files changed, 13 insertions, 58 deletions
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 8441ac05453c..f8a9d88df906 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -233,11 +233,6 @@ public:
xub_StrLen Search( sal_Unicode c, xub_StrLen nIndex = 0 ) const;
xub_StrLen Search( const UniString& rStr, xub_StrLen nIndex = 0 ) const;
- xub_StrLen SearchAndReplace( sal_Unicode c, sal_Unicode cRep,
- xub_StrLen nIndex = 0 );
- xub_StrLen SearchAndReplace( const UniString& rStr, const UniString& rRepStr,
- xub_StrLen nIndex = 0 );
-
UniString GetToken( xub_StrLen nToken, sal_Unicode cTok, sal_Int32& rIndex ) const;
UniString GetToken( xub_StrLen nToken, sal_Unicode cTok = ';' ) const;
diff --git a/reportdesign/source/core/sdr/UndoActions.cxx b/reportdesign/source/core/sdr/UndoActions.cxx
index 943a5e30a656..b43033724c01 100644
--- a/reportdesign/source/core/sdr/UndoActions.cxx
+++ b/reportdesign/source/core/sdr/UndoActions.cxx
@@ -392,10 +392,9 @@ void ORptUndoPropertyAction::setProperty(sal_Bool _bOld)
OUString ORptUndoPropertyAction::GetComment() const
{
- String aStr(ModuleRes(RID_STR_UNDO_PROPERTY).toString());
+ OUString aStr( ModuleRes(RID_STR_UNDO_PROPERTY).toString() );
- aStr.SearchAndReplace(OUString('#'), m_aPropertyName);
- return aStr;
+ return aStr.replaceFirst("#", m_aPropertyName);
}
OUndoPropertyGroupSectionAction::OUndoPropertyGroupSectionAction(SdrModel& _rMod
diff --git a/reportdesign/source/ui/inc/StartMarker.hxx b/reportdesign/source/ui/inc/StartMarker.hxx
index 0c3115cfb87a..77e2fa80a6ae 100644
--- a/reportdesign/source/ui/inc/StartMarker.hxx
+++ b/reportdesign/source/ui/inc/StartMarker.hxx
@@ -60,7 +60,7 @@ namespace rptui
virtual void RequestHelp( const HelpEvent& rHEvt );
using Window::Notify;
- void setTitle(const String& _sTitle);
+ void setTitle(const OUString& _sTitle);
sal_Int32 getMinHeight() const;
/** shows or hides the ruler.
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 7741b491b78a..146e01fedf6a 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -3281,15 +3281,13 @@ void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs
SequenceAsHashMap aMap(_aArgs);
sal_Bool bStateOfPage = aMap.getUnpackedValueOrDefault(PROPERTY_STATE,sal_False);
- String sFunction = String(ModuleRes(STR_RPT_PN_PAGE));
- OUString sPageNumber("PageNumber()");
- sFunction.SearchAndReplace(OUString("#PAGENUMBER#"),sPageNumber);
+ OUString sFunction( ModuleRes(STR_RPT_PN_PAGE).toString() );
+ sFunction = sFunction.replaceFirst("#PAGENUMBER#", "PageNumber()");
if ( bStateOfPage )
{
- OUString sPageCount("PageCount()");
- sFunction += String(ModuleRes(STR_RPT_PN_PAGE_OF));
- sFunction.SearchAndReplace(OUString("#PAGECOUNT#"),sPageCount);
+ sFunction += ModuleRes(STR_RPT_PN_PAGE_OF).toString();
+ sFunction = sFunction.replaceFirst("#PAGECOUNT#", "PageCount()");
}
sal_Bool bInPageHeader = aMap.getUnpackedValueOrDefault(PROPERTY_PAGEHEADERON,sal_True);
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index 3dbc65f06e69..96e03c3d1e4a 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -184,9 +184,9 @@ bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>&
sExpression = sLabel;
}
- String sTitle = ModuleRes(_nResId).toString();
- sTitle.SearchAndReplace(OUString('#') ,sExpression);
- m_aStartMarker.setTitle(sTitle);
+ OUString sTitle( ModuleRes(_nResId).toString() );
+ sTitle = sTitle.replaceFirst("#", sExpression);
+ m_aStartMarker.setTitle( sTitle );
m_aStartMarker.Invalidate(INVALIDATE_CHILDREN);
}
return bRet;
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
index fbb10b47f914..cdb9eef19cd3 100644
--- a/reportdesign/source/ui/report/StartMarker.cxx
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -235,7 +235,7 @@ void OStartMarker::Resize()
m_aImage.SetPosSizePixel(aPos,aImageSize);
}
// -----------------------------------------------------------------------------
-void OStartMarker::setTitle(const String& _sTitle)
+void OStartMarker::setTitle(const OUString& _sTitle)
{
m_aText.SetText(_sTitle);
}
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index a55184ab2f80..ce90177ed43b 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -202,9 +202,8 @@ SwPrintUIOptions::SwPrintUIOptions(
// create "writer" section (new tab page in dialog)
SvtModuleOptions aModOpt;
- String aAppGroupname( aLocalizedStrings.GetString( 0 ) );
- aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
- aModOpt.GetModuleName( SvtModuleOptions::E_SWRITER ) );
+ OUString aAppGroupname( aLocalizedStrings.GetString( 0 ) );
+ aAppGroupname = aAppGroupname.replaceFirst( "%s", aModOpt.GetModuleName( SvtModuleOptions::E_SWRITER ) );
m_aUIProperties[ nIdx++ ].Value = setGroupControlOpt("tabcontrol-page2", aAppGroupname, ".HelpID:vcl:PrintDialog:TabPage:AppPage");
// create sub section for Contents
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx
index 1463a3b50c0c..e8395b05b193 100644
--- a/tools/source/string/tustring.cxx
+++ b/tools/source/string/tustring.cxx
@@ -58,28 +58,6 @@ sal_Int32 UniString::ToInt32() const
return rtl_ustr_toInt32( mpData->maStr, 10 );
}
-xub_StrLen STRING::SearchAndReplace( STRCODE c, STRCODE cRep, xub_StrLen nIndex )
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-
- sal_Int32 nLen = mpData->mnLen;
- const STRCODE* pStr = mpData->maStr;
- pStr += nIndex;
- while ( nIndex < nLen )
- {
- if ( *pStr == c )
- {
- ImplCopyData();
- mpData->maStr[nIndex] = cRep;
- return nIndex;
- }
- ++pStr,
- ++nIndex;
- }
-
- return STRING_NOTFOUND;
-}
-
STRING& STRING::Insert( const STRING& rStr, xub_StrLen nPos, xub_StrLen nLen,
xub_StrLen nIndex )
{
@@ -316,20 +294,6 @@ STRING& STRING::Assign( STRCODE c )
return *this;
}
-xub_StrLen STRING::SearchAndReplace( const STRING& rStr, const STRING& rRepStr,
- xub_StrLen nIndex )
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
- DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
- DBG_CHKOBJ( &rRepStr, STRING, DBGCHECKSTRING );
-
- xub_StrLen nSPos = Search( rStr, nIndex );
- if ( nSPos != STRING_NOTFOUND )
- Replace( nSPos, rStr.Len(), rRepStr );
-
- return nSPos;
-}
-
STRING& STRING::Assign( const STRCODE* pCharStr )
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );