summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-07 10:12:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-07 11:46:58 +0100
commitb8cf30e93f18ddc16fd648976a41a6bbb6c6d8b2 (patch)
tree2f1aeba61b0b943fcd67d3f4b2ca73002eaf60dd
parent511b3ce85ebb2261f5ea866efdb333eaf94c64f8 (diff)
Related: fdo#38838 remove UniString::SearchAndReplaceAscii
Change-Id: I86019d7ab248679cd8518a621fe8e3721b44aeb0
-rw-r--r--include/tools/string.hxx2
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx30
-rw-r--r--sc/source/ui/Accessibility/AccessibleCellBase.cxx5
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx6
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeader.cxx10
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx6
-rw-r--r--sc/source/ui/Accessibility/AccessibleTableBase.cxx6
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx6
-rw-r--r--sc/source/ui/dbgui/sortdlg.cxx6
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
-rw-r--r--sc/source/ui/docshell/docsh4.cxx4
-rw-r--r--sw/inc/shellres.hxx2
-rw-r--r--sw/source/ui/config/optpage.cxx7
-rw-r--r--sw/source/ui/dbui/dbtablepreviewdialog.cxx5
-rw-r--r--sw/source/ui/dbui/mailmergechildwindow.cxx23
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx12
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx6
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx8
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.hxx2
-rw-r--r--sw/source/ui/dbui/mmoutputpage.hxx2
-rw-r--r--sw/source/ui/frmdlg/column.cxx25
-rw-r--r--sw/source/ui/index/cnttab.cxx6
-rw-r--r--sw/source/ui/uiview/view2.cxx5
-rw-r--r--sw/source/ui/utlui/initui.cxx7
-rw-r--r--tools/source/string/strascii.cxx14
25 files changed, 82 insertions, 127 deletions
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 5ca0047642be..c6217dcda3ff 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -245,8 +245,6 @@ public:
xub_StrLen nIndex = 0 );
xub_StrLen SearchAndReplace( const UniString& rStr, const UniString& rRepStr,
xub_StrLen nIndex = 0 );
- xub_StrLen SearchAndReplaceAscii( const sal_Char* pAsciiStr, const UniString& rRepStr,
- xub_StrLen nIndex = 0 );
void SearchAndReplaceAll( sal_Unicode c, sal_Unicode cRep );
void SearchAndReplaceAll( const UniString& rStr, const UniString& rRepStr );
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 1b4e5a087f8a..3f40709f7d87 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -1719,12 +1719,11 @@ void GeometryHandler::impl_fillScopeList_nothrow(::std::vector< OUString >& _out
else if ( xSection == xReportDefinition->getDetail() )
nPos = xGroups->getCount()-1;
- const String sGroup = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ const OUString sGroup = ModuleRes(RID_STR_SCOPE_GROUP).toString();
for (sal_Int32 i = 0 ; i <= nPos ; ++i)
{
xGroup.set(xGroups->getByIndex(i),uno::UNO_QUERY_THROW);
- String sGroupName = sGroup;
- sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression());
+ OUString sGroupName = sGroup.replaceFirst("%1",xGroup->getExpression());
_out_rList.push_back(sGroupName);
}
_out_rList.push_back(xReportDefinition->getName());
@@ -1747,10 +1746,9 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(OUS
const uno::Reference< report::XGroup> xGroup(xSection->getGroup(),uno::UNO_QUERY);
if ( xGroup.is() )
{
- String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ OUString sGroupName = ModuleRes(RID_STR_SCOPE_GROUP).toString();
_rsNamePostFix = xGroup->getExpression();
- sGroupName.SearchAndReplaceAscii("%1",_rsNamePostFix);
- m_sScope = sGroupName;
+ m_sScope = sGroupName.replaceFirst("%1",_rsNamePostFix);
xReturn = xGroup.get();
}
else if ( xSection == xReportDefinition->getDetail() )
@@ -1760,10 +1758,9 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(OUS
if ( nCount )
{
const uno::Reference< report::XGroup> xGroup2(xGroups->getByIndex(nCount - 1),uno::UNO_QUERY_THROW);
- String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ OUString sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
_rsNamePostFix = xGroup2->getExpression();
- sGroupName.SearchAndReplaceAscii("%1",_rsNamePostFix);
- m_sScope = sGroupName;
+ m_sScope = sGroupName.replaceFirst("%1",_rsNamePostFix);
xReturn = xGroup2.get();
}
}
@@ -1786,9 +1783,8 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(OUS
for (sal_Int32 i = 0 ; i < nCount; ++i)
{
const uno::Reference< report::XGroup> xGroup(xGroups->getByIndex(i),uno::UNO_QUERY_THROW);
- String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
- sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression());
- if ( m_sScope == OUString(sGroupName) )
+ OUString sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ if ( m_sScope == sGroupName.replaceFirst("%1",xGroup->getExpression()) )
{
_rsNamePostFix = xGroup->getExpression();
xReturn = xGroup.get();
@@ -1833,9 +1829,8 @@ sal_Bool GeometryHandler::isDefaultFunction( const OUString& _sQuotedFunction
uno::Reference< report::XGroup> xGroup(aFind.first->second.second,uno::UNO_QUERY);
if ( xGroup.is() )
{
- String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
- sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression());
- m_sScope = sGroupName;
+ OUString sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ m_sScope = sGroupName.replaceFirst("%1",xGroup->getExpression());
}
else
m_sScope = xReportDefinition->getName();
@@ -2095,9 +2090,8 @@ bool GeometryHandler::impl_isCounterFunction_throw(const OUString& _sQuotedFunct
const uno::Reference< report::XGroup > xGroup(aFind.first->second.second,uno::UNO_QUERY);
if ( xGroup.is() )
{
- String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
- sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression());
- _Out_sScope = sGroupName;
+ OUString sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ _Out_sScope = sGroupName.replaceFirst("%1",xGroup->getExpression());
}
else
_Out_sScope = uno::Reference< report::XReportDefinition >(aFind.first->second.second,uno::UNO_QUERY_THROW)->getName();
diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
index 0d6f431c08b3..a1a901146221 100644
--- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
@@ -212,15 +212,14 @@ OUString SAL_CALL
ScAccessibleCellBase::createAccessibleName(void)
throw (uno::RuntimeException)
{
- String sName( ScResId(STR_ACC_CELL_NAME) );
+ OUString sName( SC_RESSTR(STR_ACC_CELL_NAME) );
// Document not needed, because only the cell address, but not the tablename is needed
// always us OOO notation
OUString sAddress(maCellAddress.Format(SCA_VALID, NULL));
- sName.SearchAndReplaceAscii("%1", sAddress);
/* #i65103# ZoomText merges cell address and contents, e.g. if value 2 is
contained in cell A1, ZT reads "cell A twelve" instead of "cell A1 - 2".
Simple solution: Append a space character to the cell address. */
- sName.Append( ' ' );
+ sName = sName.replaceFirst("%1", sAddress) + " ";
return OUString(sName);
}
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 3e858224e6a6..44d6b46e88ed 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -2084,14 +2084,14 @@ void ScAccessibleDocument::RemoveChild(const uno::Reference<XAccessible>& xAcc,
OUString ScAccessibleDocument::GetCurrentCellName() const
{
- String sName( ScResId(STR_ACC_CELL_NAME) );
+ OUString sName(SC_RESSTR(STR_ACC_CELL_NAME));
if (mpViewShell)
{
// Document not needed, because only the cell address, but not the tablename is needed
OUString sAddress(mpViewShell->GetViewData()->GetCurPos().Format(SCA_VALID, NULL));
- sName.SearchAndReplaceAscii("%1", sAddress);
+ sName = sName.replaceFirst("%1", sAddress);
}
- return OUString(sName);
+ return sName;
}
OUString ScAccessibleDocument::GetCurrentCellDescription() const
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
index 824049887371..3d7b46f0c05d 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
@@ -339,17 +339,15 @@ uno::Sequence<OUString> SAL_CALL ScAccessiblePageHeader::getSupportedServiceName
OUString SAL_CALL ScAccessiblePageHeader::createAccessibleDescription(void)
throw (uno::RuntimeException)
{
- String sDesc(ScResId(mbHeader ? STR_ACC_HEADER_DESCR : STR_ACC_FOOTER_DESCR));
- sDesc.SearchAndReplaceAscii("%1", String(ScResId(SCSTR_UNKNOWN)));
- return OUString( sDesc );
+ OUString sDesc(SC_RESSTR(mbHeader ? STR_ACC_HEADER_DESCR : STR_ACC_FOOTER_DESCR));
+ return sDesc.replaceFirst("%1", SC_RESSTR(SCSTR_UNKNOWN));
}
OUString SAL_CALL ScAccessiblePageHeader::createAccessibleName(void)
throw (uno::RuntimeException)
{
- String sName(ScResId(mbHeader ? STR_ACC_HEADER_NAME : STR_ACC_FOOTER_NAME));
- sName.SearchAndReplaceAscii("%1", String(ScResId(SCSTR_UNKNOWN)));
- return OUString( sName );
+ OUString sName(SC_RESSTR(mbHeader ? STR_ACC_HEADER_NAME : STR_ACC_FOOTER_NAME));
+ return sName.replaceFirst("%1", SC_RESSTR(SCSTR_UNKNOWN));
}
Rectangle ScAccessiblePageHeader::GetBoundingBoxOnScreen() const throw (uno::RuntimeException)
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index 2ed5c55fcb5f..f0b17d6d00f6 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -615,7 +615,7 @@ OUString SAL_CALL ScAccessiblePreviewTable::createAccessibleDescription(void)
OUString SAL_CALL ScAccessiblePreviewTable::createAccessibleName(void)
throw (uno::RuntimeException)
{
- String sName(ScResId(STR_ACC_TABLE_NAME));
+ OUString sName(SC_RESSTR(STR_ACC_TABLE_NAME));
if (mpViewShell && mpViewShell->GetDocument())
{
@@ -625,11 +625,11 @@ OUString SAL_CALL ScAccessiblePreviewTable::createAccessibleName(void)
{
OUString sCoreName;
if (mpViewShell->GetDocument()->GetName( mpTableInfo->GetTab(), sCoreName ))
- sName.SearchAndReplaceAscii("%1", sCoreName);
+ sName = sName.replaceFirst("%1", sCoreName);
}
}
- return OUString(sName);
+ return sName;
}
Rectangle ScAccessiblePreviewTable::GetBoundingBoxOnScreen() const throw (uno::RuntimeException)
diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
index 95d8e1b293bf..6272f06fd69c 100644
--- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
@@ -358,11 +358,11 @@ OUString SAL_CALL
ScAccessibleTableBase::createAccessibleName(void)
throw (uno::RuntimeException)
{
- String sName(ScResId(STR_ACC_TABLE_NAME));
+ OUString sName(SC_RESSTR(STR_ACC_TABLE_NAME));
OUString sCoreName;
if (mpDoc && mpDoc->GetName( maRange.aStart.Tab(), sCoreName ))
- sName.SearchAndReplaceAscii("%1", sCoreName);
- return OUString(sName);
+ sName = sName.replaceFirst("%1", sCoreName);
+ return sName;
}
uno::Reference<XAccessibleRelationSet> SAL_CALL
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index d5f478821e8c..1670ca267ca8 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -133,9 +133,9 @@ ScImportOptionsDlg::ScImportOptionsDlg(
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) )
{
- String sFieldSep( ScResId( SCSTR_FIELDSEP ) );
- sFieldSep.SearchAndReplaceAscii( "%TAB", String(ScResId(SCSTR_FIELDSEP_TAB)) );
- sFieldSep.SearchAndReplaceAscii( "%SPACE", String(ScResId(SCSTR_FIELDSEP_SPACE)) );
+ OUString sFieldSep(SC_RESSTR(SCSTR_FIELDSEP));
+ sFieldSep = sFieldSep.replaceFirst( "%TAB", SC_RESSTR(SCSTR_FIELDSEP_TAB) );
+ sFieldSep = sFieldSep.replaceFirst( "%SPACE", SC_RESSTR(SCSTR_FIELDSEP_SPACE) );
// im Ctor-Initializer nicht moeglich (MSC kann das nicht):
pFieldSepTab = new ScDelimiterTable( sFieldSep );
diff --git a/sc/source/ui/dbgui/sortdlg.cxx b/sc/source/ui/dbgui/sortdlg.cxx
index 3c539b2b1d66..683c267394c6 100644
--- a/sc/source/ui/dbgui/sortdlg.cxx
+++ b/sc/source/ui/dbgui/sortdlg.cxx
@@ -54,9 +54,9 @@ ScSortWarningDlg::ScSortWarningDlg( Window* pParent,
get( aBtnExtSort, "extend" );
get( aBtnCurSort, "current" );
- String sTextName = aFtText->GetText();
- sTextName.SearchAndReplaceAscii("%1", rExtendText);
- sTextName.SearchAndReplaceAscii("%2", rCurrentText);
+ OUString sTextName = aFtText->GetText();
+ sTextName = sTextName.replaceFirst("%1", rExtendText);
+ sTextName = sTextName.replaceFirst("%2", rCurrentText);
aFtText->SetText( sTextName );
aBtnExtSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 1259646692ed..c39499a788dd 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -792,8 +792,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
else
{
- String aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) );
- aMessage.SearchAndReplaceAscii( "%1", aUserName );
+ OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) );
+ aMessage = aMessage.replaceFirst( "%1", aUserName );
WarningBox aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage );
if ( aBox.Execute() == RET_RETRY )
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 6d3d4eff98e1..1d7e1d1b5d5e 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1010,8 +1010,8 @@ void ScDocShell::Execute( SfxRequest& rReq )
catch ( uno::Exception& )
{
}
- String aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) );
- aMessage.SearchAndReplaceAscii( "%1", aUserName );
+ OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) );
+ aMessage = aMessage.replaceFirst( "%1", aUserName );
WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage );
aBox.Execute();
diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx
index 112233406c5b..793cad60d561 100644
--- a/sw/inc/shellres.hxx
+++ b/sw/inc/shellres.hxx
@@ -80,7 +80,7 @@ struct SW_DLLPUBLIC ShellResource : public Resource
// Returns for the specific filter the new names of pagedescs
// This method is for the old code of the specific filters with
// now localized names.
- String GetPageDescName( sal_uInt16 nNo, PageNameMode eMode );
+ OUString GetPageDescName(sal_uInt16 nNo, PageNameMode eMode);
ShellResource();
~ShellResource();
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index a92ea298b8c4..1e368ef8cdeb 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -752,14 +752,13 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet)
if( SFX_ITEM_SET == rSet.GetItemState(nLangSlot, sal_False, &pLang))
eLanguage = ((const SvxLanguageItem*)pLang)->GetValue();
- String sTmp = pLabelFT->GetText();
- String sToReplace = sScriptWestern;
+ OUString sTmp = pLabelFT->GetText();
+ OUString sToReplace = sScriptWestern;
if(FONT_GROUP_CJK == nFontGroup )
sToReplace = sScriptAsian;
else if(FONT_GROUP_CTL == nFontGroup )
sToReplace = sScriptComplex;
- sTmp.SearchAndReplaceAscii("%1", sToReplace);
- pLabelFT->SetText(sTmp);
+ pLabelFT->SetText(sTmp.replaceFirst("%1", sToReplace));
const SfxPoolItem* pItem;
diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx
index e1faea9f6218..593de925d41a 100644
--- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx
+++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx
@@ -53,11 +53,10 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b
{
if ( pValues[nValue].Name == "Command" )
{
- String sDescription = m_aDescriptionFI.GetText();
+ OUString sDescription = m_aDescriptionFI.GetText();
OUString sTemp;
pValues[nValue].Value >>= sTemp;
- sDescription.SearchAndReplaceAscii("%1", sTemp);
- m_aDescriptionFI.SetText(sDescription);
+ m_aDescriptionFI.SetText(sDescription.replaceFirst("%1", sTemp));
break;
}
}
diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx
index f03fc874fbce..2b9e2ebbe414 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.cxx
+++ b/sw/source/ui/dbui/mailmergechildwindow.cxx
@@ -547,12 +547,11 @@ void SwSendMailDialog::IterateMails()
{
Image aInsertImg = m_aImageList.GetImage( FN_FORMULA_CANCEL );
- String sMessage = m_sSendingTo;
+ OUString sMessage = m_sSendingTo;
String sTmp(pCurrentMailDescriptor->sEMail);
sTmp += '\t';
sTmp += m_sFailed;
- sMessage.SearchAndReplaceAscii("%1", sTmp);
- m_aStatusLB.InsertEntry( sMessage, aInsertImg, aInsertImg);
+ m_aStatusLB.InsertEntry( sMessage.replaceFirst("%1", sTmp), aInsertImg, aInsertImg);
++m_nSendCount;
++m_nErrorCount;
UpdateTransferStatus( );
@@ -646,12 +645,11 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag
}
Image aInsertImg = m_aImageList.GetImage( bResult ? FN_FORMULA_APPLY : FN_FORMULA_CANCEL );
- String sMessage = m_sSendingTo;
- String sTmp(xMessage->getRecipients()[0]);
- sTmp += '\t';
+ OUString sMessage = m_sSendingTo;
+ OUString sTmp(xMessage->getRecipients()[0]);
+ sTmp += "\t";
sTmp += bResult ? m_sCompleted : m_sFailed;
- sMessage.SearchAndReplaceAscii("%1", sTmp);
- m_aStatusLB.InsertEntry( sMessage, aInsertImg, aInsertImg);
+ m_aStatusLB.InsertEntry( sMessage.replaceFirst("%1", sTmp), aInsertImg, aInsertImg);
++m_nSendCount;
if(!bResult)
++m_nErrorCount;
@@ -667,13 +665,12 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag
void SwSendMailDialog::UpdateTransferStatus()
{
- String sStatus( m_sTransferStatus );
- sStatus.SearchAndReplaceAscii("%1", OUString::number(m_nSendCount) );
- sStatus.SearchAndReplaceAscii("%2", OUString::number(m_pImpl->nDocumentCount));
+ OUString sStatus( m_sTransferStatus );
+ sStatus = sStatus.replaceFirst("%1", OUString::number(m_nSendCount) );
+ sStatus = sStatus.replaceFirst("%2", OUString::number(m_pImpl->nDocumentCount));
m_aTransferStatusFT.SetText(sStatus);
- sStatus = m_sErrorStatus;
- sStatus.SearchAndReplaceAscii("%1", OUString::number(m_nErrorCount) );
+ sStatus = m_sErrorStatus.replaceFirst("%1", OUString::number(m_nErrorCount) );
m_aErrorStatusFT.SetText(sStatus);
if(m_pImpl->aDescriptors.size())
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 8cfec103e39c..c1411f63fb03 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -138,9 +138,7 @@ void SwMailMergeAddressBlockPage::ActivatePage()
if(bIsLetter)
{
m_aHideEmptyParagraphsCB.Check( rConfigItem.IsHideEmptyParagraphs() );
- String sTemp(m_sDocument);
- sTemp.SearchAndReplaceAscii("%1", OUString::number(1));
- m_aDocumentIndexFI.SetText(sTemp);
+ m_aDocumentIndexFI.SetText(m_sDocument.replaceFirst("%1", OUString::number(1)));
m_aSettingsWIN.Clear();
const uno::Sequence< OUString> aBlocks =
@@ -319,18 +317,14 @@ IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton
}
}
m_aPrevSetIB.Enable(bEnable);
- String sTemp(m_sDocument);
- sTemp.SearchAndReplaceAscii("%1", OUString::number(nPos));
- m_aDocumentIndexFI.SetText(sTemp);
+ m_aDocumentIndexFI.SetText(m_sDocument.replaceFirst("%1", OUString::number(nPos)));
GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE));
sal_Bool bHasResultSet = rConfig.GetResultSet().is();
m_aCurrentAddressFI.Show(bHasResultSet);
if(bHasResultSet)
{
- String sTmp = m_sCurrentAddress;
- sTmp.SearchAndReplaceAscii("%1", rConfig.GetCurrentDBData().sDataSource );
- m_aCurrentAddressFI.SetText(sTmp);
+ m_aCurrentAddressFI.SetText(m_sCurrentAddress.replaceFirst("%1", rConfig.GetCurrentDBData().sDataSource));
m_aAddressListPB.SetText(m_sChangeAddress);
}
EnableAddressBlock(bHasResultSet, m_aAddressCB.IsChecked());
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index 03dabbc52edc..992df365c4dc 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -69,9 +69,9 @@ class SwMailMergeAddressBlockPage : public svt::OWizardPage
ImageButton m_aPrevSetIB;
ImageButton m_aNextSetIB;
- String m_sDocument;
- String m_sCurrentAddress;
- String m_sChangeAddress;
+ OUString m_sDocument;
+ OUString m_sCurrentAddress;
+ OUString m_sChangeAddress;
SwMailMergeWizard* m_pWizard;
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index c1126eb3908a..d5d6f1a7c621 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -319,9 +319,7 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent)
lcl_FillGreetingsBox(m_aMaleLB, rConfig, SwMailMergeConfigItem::MALE);
lcl_FillGreetingsBox(m_aNeutralCB, rConfig, SwMailMergeConfigItem::NEUTRAL);
- String sTemp(m_sDocument);
- sTemp.SearchAndReplaceAscii("%1", OUString::number(1));
- m_aDocumentIndexFI.SetText(sTemp);
+ m_aDocumentIndexFI.SetText(m_sDocument.replaceFirst("%1", OUString::number(1)));
}
SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage()
@@ -428,9 +426,7 @@ IMPL_LINK(SwMailMergeGreetingsPage, InsertDataHdl_Impl, ImageButton*, pButton)
m_aPrevSetIB.Enable(bEnable);
m_aNextSetIB.Enable(bEnable);
m_aDocumentIndexFI.Enable(bEnable);
- String sTemp(m_sDocument);
- sTemp.SearchAndReplaceAscii("%1", OUString::number(nPos));
- m_aDocumentIndexFI.SetText(sTemp);
+ m_aDocumentIndexFI.SetText(m_sDocument.replaceFirst("%1", OUString::number(nPos)));
return 0;
}
diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx
index 7738463c9ce0..479b5e413bc2 100644
--- a/sw/source/ui/dbui/mmgreetingspage.hxx
+++ b/sw/source/ui/dbui/mmgreetingspage.hxx
@@ -100,7 +100,7 @@ class SwMailMergeGreetingsPage : public svt::OWizardPage,
ImageButton m_aPrevSetIB;
ImageButton m_aNextSetIB;
- String m_sDocument;
+ OUString m_sDocument;
DECL_LINK(ContainsHdl_Impl, CheckBox*);
DECL_LINK(InsertDataHdl_Impl, ImageButton*);
diff --git a/sw/source/ui/dbui/mmoutputpage.hxx b/sw/source/ui/dbui/mmoutputpage.hxx
index eb0b0a3f34b3..874c5cf2ebc7 100644
--- a/sw/source/ui/dbui/mmoutputpage.hxx
+++ b/sw/source/ui/dbui/mmoutputpage.hxx
@@ -174,7 +174,7 @@ class SW_DLLPUBLIC SwSendMailDialog : public ModelessDialog //SfxModalDialog
String m_sStop;
String m_sSend;
String m_sTransferStatus;
- String m_sErrorStatus;
+ OUString m_sErrorStatus;
String m_sSendingTo;
String m_sCompleted;
String m_sFailed;
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index cae138a98f60..ebbeae08e471 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -924,27 +924,24 @@ void SwColumnPage::SetLabels( sal_uInt16 nVis )
String tmp3(sLbl2);
sLbl2.Insert(sLbl, sLbl2.Len() - 1);
m_pLbl3->SetText(sLbl2);
- String sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
- sColumnWidth.SearchAndReplaceAscii("%1", tmp1);
- aEd1.SetAccessibleName(sColumnWidth);
+ OUString sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
+ aEd1.SetAccessibleName(sColumnWidth.replaceFirst("%1", tmp1));
sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
- sColumnWidth.SearchAndReplaceAscii("%1", tmp2);
- aEd2.SetAccessibleName(sColumnWidth);
+ aEd2.SetAccessibleName(sColumnWidth.replaceFirst("%1", tmp2));
sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
- sColumnWidth.SearchAndReplaceAscii("%1", tmp3);
- aEd3.SetAccessibleName(sColumnWidth);
+ aEd3.SetAccessibleName(sColumnWidth.replaceFirst("%1", tmp3));
- String sDist = SW_RESSTR( STR_ACCESS_PAGESETUP_SPACING ) ;
- String sDist1 = sDist;
- sDist1.SearchAndReplaceAscii("%1", tmp1);
- sDist1.SearchAndReplaceAscii("%2", tmp2);
+ OUString sDist = SW_RESSTR( STR_ACCESS_PAGESETUP_SPACING ) ;
+ OUString sDist1 = sDist;
+ sDist1 = sDist1.replaceFirst("%1", tmp1);
+ sDist1 = sDist1.replaceFirst("%2", tmp2);
aDistEd1.SetAccessibleName(sDist1);
- String sDist2 = sDist;
- sDist2.SearchAndReplaceAscii("%1", tmp2);
- sDist2.SearchAndReplaceAscii("%2", tmp3);
+ OUString sDist2 = sDist;
+ sDist2 = sDist2.replaceFirst("%1", tmp2);
+ sDist2 = sDist2.replaceFirst("%2", tmp3);
aDistEd2.SetAccessibleName(sDist2);
}
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 4bf24ff897df..3064a955a695 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -513,9 +513,9 @@ IMPL_LINK_NOARG( SwMultiTOXTabDialog, ShowPreviewHdl )
if(!bExist)
{
- String sInfo(SW_RES(STR_FILE_NOT_FOUND));
- sInfo.SearchAndReplaceAscii( "%1", sTemplate );
- sInfo.SearchAndReplaceAscii( "%2", aOpt.GetTemplatePath() );
+ OUString sInfo(SW_RESSTR(STR_FILE_NOT_FOUND));
+ sInfo = sInfo.replaceFirst( "%1", sTemplate );
+ sInfo = sInfo.replaceFirst( "%2", aOpt.GetTemplatePath() );
InfoBox aInfo(GetParent(), sInfo);
aInfo.Execute();
}
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 9b578c6ba967..85188f4586bf 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -2327,9 +2327,8 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
{
SwMergeSourceWarningBox_Impl aWarning( &GetViewFrame()->GetWindow());
- String sTmp(aWarning.GetMessText());
- sTmp.SearchAndReplaceAscii("%1", sSource);
- aWarning.SetMessText(sTmp);
+ OUString sTmp(aWarning.GetMessText());
+ aWarning.SetMessText(sTmp.replaceFirst("%1", sSource));
if(RET_OK == aWarning.Execute())
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx
index 4ff061018555..d506db521c92 100644
--- a/sw/source/ui/utlui/initui.cxx
+++ b/sw/source/ui/utlui/initui.cxx
@@ -230,9 +230,9 @@ ShellResource::~ShellResource()
delete pAutoFmtNameLst;
}
-String ShellResource::GetPageDescName( sal_uInt16 nNo, PageNameMode eMode )
+OUString ShellResource::GetPageDescName(sal_uInt16 nNo, PageNameMode eMode)
{
- String sRet;
+ OUString sRet;
switch (eMode)
{
@@ -247,8 +247,7 @@ String ShellResource::GetPageDescName( sal_uInt16 nNo, PageNameMode eMode )
break;
}
- sRet.SearchAndReplaceAscii( "$(ARG1)", OUString::number( nNo ));
- return sRet;
+ return sRet.replaceFirst( "$(ARG1)", OUString::number( nNo ));
}
diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx
index 53a2babc634f..56e7122b5060 100644
--- a/tools/source/string/strascii.cxx
+++ b/tools/source/string/strascii.cxx
@@ -247,18 +247,4 @@ xub_StrLen UniString::SearchAscii( const sal_Char* pAsciiStr, xub_StrLen nIndex
return STRING_NOTFOUND;
}
-xub_StrLen UniString::SearchAndReplaceAscii( const sal_Char* pAsciiStr, const UniString& rRepStr,
- xub_StrLen nIndex )
-{
- DBG_CHKTHIS( UniString, DbgCheckUniString );
- DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
- "UniString::SearchAndReplaceAscii() - pAsciiStr include characters > 127" );
-
- xub_StrLen nSPos = SearchAscii( pAsciiStr, nIndex );
- if ( nSPos != STRING_NOTFOUND )
- Replace( nSPos, ImplStringLen( pAsciiStr ), rRepStr );
-
- return nSPos;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */