Related: fdo#38838 remove String::SearchAndReplace

Change-Id: I1cc52d0be360b05e722a18b3ca5d08b2b0b0842d
This commit is contained in:
Thomas Arnhold 2013-10-17 11:43:40 +02:00
parent 5df4743236
commit c65eb7e569
8 changed files with 13 additions and 58 deletions

View File

@ -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;

View File

@ -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

View File

@ -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.

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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

View File

@ -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 );