Related: fdo#38838 remove UniString::SearchAndReplaceAscii

Change-Id: I86019d7ab248679cd8518a621fe8e3721b44aeb0
This commit is contained in:
Caolán McNamara 2013-10-07 10:12:16 +01:00
parent 511b3ce85e
commit b8cf30e93f
25 changed files with 82 additions and 127 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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: */