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 nIndex = 0 );
xub_StrLen SearchAndReplace( const UniString& rStr, const UniString& rRepStr, xub_StrLen SearchAndReplace( const UniString& rStr, const UniString& rRepStr,
xub_StrLen nIndex = 0 ); 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( sal_Unicode c, sal_Unicode cRep );
void SearchAndReplaceAll( const UniString& rStr, const UniString& rRepStr ); 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() ) else if ( xSection == xReportDefinition->getDetail() )
nPos = xGroups->getCount()-1; 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) for (sal_Int32 i = 0 ; i <= nPos ; ++i)
{ {
xGroup.set(xGroups->getByIndex(i),uno::UNO_QUERY_THROW); xGroup.set(xGroups->getByIndex(i),uno::UNO_QUERY_THROW);
String sGroupName = sGroup; OUString sGroupName = sGroup.replaceFirst("%1",xGroup->getExpression());
sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression());
_out_rList.push_back(sGroupName); _out_rList.push_back(sGroupName);
} }
_out_rList.push_back(xReportDefinition->getName()); _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); const uno::Reference< report::XGroup> xGroup(xSection->getGroup(),uno::UNO_QUERY);
if ( xGroup.is() ) if ( xGroup.is() )
{ {
String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP)); OUString sGroupName = ModuleRes(RID_STR_SCOPE_GROUP).toString();
_rsNamePostFix = xGroup->getExpression(); _rsNamePostFix = xGroup->getExpression();
sGroupName.SearchAndReplaceAscii("%1",_rsNamePostFix); m_sScope = sGroupName.replaceFirst("%1",_rsNamePostFix);
m_sScope = sGroupName;
xReturn = xGroup.get(); xReturn = xGroup.get();
} }
else if ( xSection == xReportDefinition->getDetail() ) else if ( xSection == xReportDefinition->getDetail() )
@ -1760,10 +1758,9 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(OUS
if ( nCount ) if ( nCount )
{ {
const uno::Reference< report::XGroup> xGroup2(xGroups->getByIndex(nCount - 1),uno::UNO_QUERY_THROW); 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(); _rsNamePostFix = xGroup2->getExpression();
sGroupName.SearchAndReplaceAscii("%1",_rsNamePostFix); m_sScope = sGroupName.replaceFirst("%1",_rsNamePostFix);
m_sScope = sGroupName;
xReturn = xGroup2.get(); xReturn = xGroup2.get();
} }
} }
@ -1786,9 +1783,8 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(OUS
for (sal_Int32 i = 0 ; i < nCount; ++i) for (sal_Int32 i = 0 ; i < nCount; ++i)
{ {
const uno::Reference< report::XGroup> xGroup(xGroups->getByIndex(i),uno::UNO_QUERY_THROW); const uno::Reference< report::XGroup> xGroup(xGroups->getByIndex(i),uno::UNO_QUERY_THROW);
String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP)); OUString sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression()); if ( m_sScope == sGroupName.replaceFirst("%1",xGroup->getExpression()) )
if ( m_sScope == OUString(sGroupName) )
{ {
_rsNamePostFix = xGroup->getExpression(); _rsNamePostFix = xGroup->getExpression();
xReturn = xGroup.get(); 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); uno::Reference< report::XGroup> xGroup(aFind.first->second.second,uno::UNO_QUERY);
if ( xGroup.is() ) if ( xGroup.is() )
{ {
String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP)); OUString sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression()); m_sScope = sGroupName.replaceFirst("%1",xGroup->getExpression());
m_sScope = sGroupName;
} }
else else
m_sScope = xReportDefinition->getName(); 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); const uno::Reference< report::XGroup > xGroup(aFind.first->second.second,uno::UNO_QUERY);
if ( xGroup.is() ) if ( xGroup.is() )
{ {
String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP)); OUString sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression()); _Out_sScope = sGroupName.replaceFirst("%1",xGroup->getExpression());
_Out_sScope = sGroupName;
} }
else else
_Out_sScope = uno::Reference< report::XReportDefinition >(aFind.first->second.second,uno::UNO_QUERY_THROW)->getName(); _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) ScAccessibleCellBase::createAccessibleName(void)
throw (uno::RuntimeException) 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 // Document not needed, because only the cell address, but not the tablename is needed
// always us OOO notation // always us OOO notation
OUString sAddress(maCellAddress.Format(SCA_VALID, NULL)); OUString sAddress(maCellAddress.Format(SCA_VALID, NULL));
sName.SearchAndReplaceAscii("%1", sAddress);
/* #i65103# ZoomText merges cell address and contents, e.g. if value 2 is /* #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". contained in cell A1, ZT reads "cell A twelve" instead of "cell A1 - 2".
Simple solution: Append a space character to the cell address. */ Simple solution: Append a space character to the cell address. */
sName.Append( ' ' ); sName = sName.replaceFirst("%1", sAddress) + " ";
return OUString(sName); return OUString(sName);
} }

View File

@ -2084,14 +2084,14 @@ void ScAccessibleDocument::RemoveChild(const uno::Reference<XAccessible>& xAcc,
OUString ScAccessibleDocument::GetCurrentCellName() const OUString ScAccessibleDocument::GetCurrentCellName() const
{ {
String sName( ScResId(STR_ACC_CELL_NAME) ); OUString sName(SC_RESSTR(STR_ACC_CELL_NAME));
if (mpViewShell) if (mpViewShell)
{ {
// Document not needed, because only the cell address, but not the tablename is needed // Document not needed, because only the cell address, but not the tablename is needed
OUString sAddress(mpViewShell->GetViewData()->GetCurPos().Format(SCA_VALID, NULL)); 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 OUString ScAccessibleDocument::GetCurrentCellDescription() const

View File

@ -339,17 +339,15 @@ uno::Sequence<OUString> SAL_CALL ScAccessiblePageHeader::getSupportedServiceName
OUString SAL_CALL ScAccessiblePageHeader::createAccessibleDescription(void) OUString SAL_CALL ScAccessiblePageHeader::createAccessibleDescription(void)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
String sDesc(ScResId(mbHeader ? STR_ACC_HEADER_DESCR : STR_ACC_FOOTER_DESCR)); OUString sDesc(SC_RESSTR(mbHeader ? STR_ACC_HEADER_DESCR : STR_ACC_FOOTER_DESCR));
sDesc.SearchAndReplaceAscii("%1", String(ScResId(SCSTR_UNKNOWN))); return sDesc.replaceFirst("%1", SC_RESSTR(SCSTR_UNKNOWN));
return OUString( sDesc );
} }
OUString SAL_CALL ScAccessiblePageHeader::createAccessibleName(void) OUString SAL_CALL ScAccessiblePageHeader::createAccessibleName(void)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
String sName(ScResId(mbHeader ? STR_ACC_HEADER_NAME : STR_ACC_FOOTER_NAME)); OUString sName(SC_RESSTR(mbHeader ? STR_ACC_HEADER_NAME : STR_ACC_FOOTER_NAME));
sName.SearchAndReplaceAscii("%1", String(ScResId(SCSTR_UNKNOWN))); return sName.replaceFirst("%1", SC_RESSTR(SCSTR_UNKNOWN));
return OUString( sName );
} }
Rectangle ScAccessiblePageHeader::GetBoundingBoxOnScreen() const throw (uno::RuntimeException) 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) OUString SAL_CALL ScAccessiblePreviewTable::createAccessibleName(void)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
String sName(ScResId(STR_ACC_TABLE_NAME)); OUString sName(SC_RESSTR(STR_ACC_TABLE_NAME));
if (mpViewShell && mpViewShell->GetDocument()) if (mpViewShell && mpViewShell->GetDocument())
{ {
@ -625,11 +625,11 @@ OUString SAL_CALL ScAccessiblePreviewTable::createAccessibleName(void)
{ {
OUString sCoreName; OUString sCoreName;
if (mpViewShell->GetDocument()->GetName( mpTableInfo->GetTab(), 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) Rectangle ScAccessiblePreviewTable::GetBoundingBoxOnScreen() const throw (uno::RuntimeException)

View File

@ -358,11 +358,11 @@ OUString SAL_CALL
ScAccessibleTableBase::createAccessibleName(void) ScAccessibleTableBase::createAccessibleName(void)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
String sName(ScResId(STR_ACC_TABLE_NAME)); OUString sName(SC_RESSTR(STR_ACC_TABLE_NAME));
OUString sCoreName; OUString sCoreName;
if (mpDoc && mpDoc->GetName( maRange.aStart.Tab(), sCoreName )) if (mpDoc && mpDoc->GetName( maRange.aStart.Tab(), sCoreName ))
sName.SearchAndReplaceAscii("%1", sCoreName); sName = sName.replaceFirst("%1", sCoreName);
return OUString(sName); return sName;
} }
uno::Reference<XAccessibleRelationSet> SAL_CALL uno::Reference<XAccessibleRelationSet> SAL_CALL

View File

@ -133,9 +133,9 @@ ScImportOptionsDlg::ScImportOptionsDlg(
aBtnCancel ( this, ScResId( BTN_CANCEL ) ), aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ) aBtnHelp ( this, ScResId( BTN_HELP ) )
{ {
String sFieldSep( ScResId( SCSTR_FIELDSEP ) ); OUString sFieldSep(SC_RESSTR(SCSTR_FIELDSEP));
sFieldSep.SearchAndReplaceAscii( "%TAB", String(ScResId(SCSTR_FIELDSEP_TAB)) ); sFieldSep = sFieldSep.replaceFirst( "%TAB", SC_RESSTR(SCSTR_FIELDSEP_TAB) );
sFieldSep.SearchAndReplaceAscii( "%SPACE", String(ScResId(SCSTR_FIELDSEP_SPACE)) ); sFieldSep = sFieldSep.replaceFirst( "%SPACE", SC_RESSTR(SCSTR_FIELDSEP_SPACE) );
// im Ctor-Initializer nicht moeglich (MSC kann das nicht): // im Ctor-Initializer nicht moeglich (MSC kann das nicht):
pFieldSepTab = new ScDelimiterTable( sFieldSep ); pFieldSepTab = new ScDelimiterTable( sFieldSep );

View File

@ -54,9 +54,9 @@ ScSortWarningDlg::ScSortWarningDlg( Window* pParent,
get( aBtnExtSort, "extend" ); get( aBtnExtSort, "extend" );
get( aBtnCurSort, "current" ); get( aBtnCurSort, "current" );
String sTextName = aFtText->GetText(); OUString sTextName = aFtText->GetText();
sTextName.SearchAndReplaceAscii("%1", rExtendText); sTextName = sTextName.replaceFirst("%1", rExtendText);
sTextName.SearchAndReplaceAscii("%2", rCurrentText); sTextName = sTextName.replaceFirst("%2", rCurrentText);
aFtText->SetText( sTextName ); aFtText->SetText( sTextName );
aBtnExtSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) ); aBtnExtSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );

View File

@ -792,8 +792,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
} }
else else
{ {
String aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) ); OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) );
aMessage.SearchAndReplaceAscii( "%1", aUserName ); aMessage = aMessage.replaceFirst( "%1", aUserName );
WarningBox aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage ); WarningBox aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage );
if ( aBox.Execute() == RET_RETRY ) if ( aBox.Execute() == RET_RETRY )

View File

@ -1010,8 +1010,8 @@ void ScDocShell::Execute( SfxRequest& rReq )
catch ( uno::Exception& ) catch ( uno::Exception& )
{ {
} }
String aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) ); OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) );
aMessage.SearchAndReplaceAscii( "%1", aUserName ); aMessage = aMessage.replaceFirst( "%1", aUserName );
WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage ); WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage );
aBox.Execute(); aBox.Execute();

View File

@ -80,7 +80,7 @@ struct SW_DLLPUBLIC ShellResource : public Resource
// Returns for the specific filter the new names of pagedescs // Returns for the specific filter the new names of pagedescs
// This method is for the old code of the specific filters with // This method is for the old code of the specific filters with
// now localized names. // now localized names.
String GetPageDescName( sal_uInt16 nNo, PageNameMode eMode ); OUString GetPageDescName(sal_uInt16 nNo, PageNameMode eMode);
ShellResource(); ShellResource();
~ShellResource(); ~ShellResource();

View File

@ -752,14 +752,13 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet)
if( SFX_ITEM_SET == rSet.GetItemState(nLangSlot, sal_False, &pLang)) if( SFX_ITEM_SET == rSet.GetItemState(nLangSlot, sal_False, &pLang))
eLanguage = ((const SvxLanguageItem*)pLang)->GetValue(); eLanguage = ((const SvxLanguageItem*)pLang)->GetValue();
String sTmp = pLabelFT->GetText(); OUString sTmp = pLabelFT->GetText();
String sToReplace = sScriptWestern; OUString sToReplace = sScriptWestern;
if(FONT_GROUP_CJK == nFontGroup ) if(FONT_GROUP_CJK == nFontGroup )
sToReplace = sScriptAsian; sToReplace = sScriptAsian;
else if(FONT_GROUP_CTL == nFontGroup ) else if(FONT_GROUP_CTL == nFontGroup )
sToReplace = sScriptComplex; sToReplace = sScriptComplex;
sTmp.SearchAndReplaceAscii("%1", sToReplace); pLabelFT->SetText(sTmp.replaceFirst("%1", sToReplace));
pLabelFT->SetText(sTmp);
const SfxPoolItem* pItem; const SfxPoolItem* pItem;

View File

@ -53,11 +53,10 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b
{ {
if ( pValues[nValue].Name == "Command" ) if ( pValues[nValue].Name == "Command" )
{ {
String sDescription = m_aDescriptionFI.GetText(); OUString sDescription = m_aDescriptionFI.GetText();
OUString sTemp; OUString sTemp;
pValues[nValue].Value >>= sTemp; pValues[nValue].Value >>= sTemp;
sDescription.SearchAndReplaceAscii("%1", sTemp); m_aDescriptionFI.SetText(sDescription.replaceFirst("%1", sTemp));
m_aDescriptionFI.SetText(sDescription);
break; break;
} }
} }

View File

@ -547,12 +547,11 @@ void SwSendMailDialog::IterateMails()
{ {
Image aInsertImg = m_aImageList.GetImage( FN_FORMULA_CANCEL ); Image aInsertImg = m_aImageList.GetImage( FN_FORMULA_CANCEL );
String sMessage = m_sSendingTo; OUString sMessage = m_sSendingTo;
String sTmp(pCurrentMailDescriptor->sEMail); String sTmp(pCurrentMailDescriptor->sEMail);
sTmp += '\t'; sTmp += '\t';
sTmp += m_sFailed; sTmp += m_sFailed;
sMessage.SearchAndReplaceAscii("%1", sTmp); m_aStatusLB.InsertEntry( sMessage.replaceFirst("%1", sTmp), aInsertImg, aInsertImg);
m_aStatusLB.InsertEntry( sMessage, aInsertImg, aInsertImg);
++m_nSendCount; ++m_nSendCount;
++m_nErrorCount; ++m_nErrorCount;
UpdateTransferStatus( ); 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 ); Image aInsertImg = m_aImageList.GetImage( bResult ? FN_FORMULA_APPLY : FN_FORMULA_CANCEL );
String sMessage = m_sSendingTo; OUString sMessage = m_sSendingTo;
String sTmp(xMessage->getRecipients()[0]); OUString sTmp(xMessage->getRecipients()[0]);
sTmp += '\t'; sTmp += "\t";
sTmp += bResult ? m_sCompleted : m_sFailed; sTmp += bResult ? m_sCompleted : m_sFailed;
sMessage.SearchAndReplaceAscii("%1", sTmp); m_aStatusLB.InsertEntry( sMessage.replaceFirst("%1", sTmp), aInsertImg, aInsertImg);
m_aStatusLB.InsertEntry( sMessage, aInsertImg, aInsertImg);
++m_nSendCount; ++m_nSendCount;
if(!bResult) if(!bResult)
++m_nErrorCount; ++m_nErrorCount;
@ -667,13 +665,12 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag
void SwSendMailDialog::UpdateTransferStatus() void SwSendMailDialog::UpdateTransferStatus()
{ {
String sStatus( m_sTransferStatus ); OUString sStatus( m_sTransferStatus );
sStatus.SearchAndReplaceAscii("%1", OUString::number(m_nSendCount) ); sStatus = sStatus.replaceFirst("%1", OUString::number(m_nSendCount) );
sStatus.SearchAndReplaceAscii("%2", OUString::number(m_pImpl->nDocumentCount)); sStatus = sStatus.replaceFirst("%2", OUString::number(m_pImpl->nDocumentCount));
m_aTransferStatusFT.SetText(sStatus); m_aTransferStatusFT.SetText(sStatus);
sStatus = m_sErrorStatus; sStatus = m_sErrorStatus.replaceFirst("%1", OUString::number(m_nErrorCount) );
sStatus.SearchAndReplaceAscii("%1", OUString::number(m_nErrorCount) );
m_aErrorStatusFT.SetText(sStatus); m_aErrorStatusFT.SetText(sStatus);
if(m_pImpl->aDescriptors.size()) if(m_pImpl->aDescriptors.size())

View File

@ -138,9 +138,7 @@ void SwMailMergeAddressBlockPage::ActivatePage()
if(bIsLetter) if(bIsLetter)
{ {
m_aHideEmptyParagraphsCB.Check( rConfigItem.IsHideEmptyParagraphs() ); m_aHideEmptyParagraphsCB.Check( rConfigItem.IsHideEmptyParagraphs() );
String sTemp(m_sDocument); m_aDocumentIndexFI.SetText(m_sDocument.replaceFirst("%1", OUString::number(1)));
sTemp.SearchAndReplaceAscii("%1", OUString::number(1));
m_aDocumentIndexFI.SetText(sTemp);
m_aSettingsWIN.Clear(); m_aSettingsWIN.Clear();
const uno::Sequence< OUString> aBlocks = const uno::Sequence< OUString> aBlocks =
@ -319,18 +317,14 @@ IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton
} }
} }
m_aPrevSetIB.Enable(bEnable); m_aPrevSetIB.Enable(bEnable);
String sTemp(m_sDocument); m_aDocumentIndexFI.SetText(m_sDocument.replaceFirst("%1", OUString::number(nPos)));
sTemp.SearchAndReplaceAscii("%1", OUString::number(nPos));
m_aDocumentIndexFI.SetText(sTemp);
GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE));
sal_Bool bHasResultSet = rConfig.GetResultSet().is(); sal_Bool bHasResultSet = rConfig.GetResultSet().is();
m_aCurrentAddressFI.Show(bHasResultSet); m_aCurrentAddressFI.Show(bHasResultSet);
if(bHasResultSet) if(bHasResultSet)
{ {
String sTmp = m_sCurrentAddress; m_aCurrentAddressFI.SetText(m_sCurrentAddress.replaceFirst("%1", rConfig.GetCurrentDBData().sDataSource));
sTmp.SearchAndReplaceAscii("%1", rConfig.GetCurrentDBData().sDataSource );
m_aCurrentAddressFI.SetText(sTmp);
m_aAddressListPB.SetText(m_sChangeAddress); m_aAddressListPB.SetText(m_sChangeAddress);
} }
EnableAddressBlock(bHasResultSet, m_aAddressCB.IsChecked()); EnableAddressBlock(bHasResultSet, m_aAddressCB.IsChecked());

View File

@ -69,9 +69,9 @@ class SwMailMergeAddressBlockPage : public svt::OWizardPage
ImageButton m_aPrevSetIB; ImageButton m_aPrevSetIB;
ImageButton m_aNextSetIB; ImageButton m_aNextSetIB;
String m_sDocument; OUString m_sDocument;
String m_sCurrentAddress; OUString m_sCurrentAddress;
String m_sChangeAddress; OUString m_sChangeAddress;
SwMailMergeWizard* m_pWizard; SwMailMergeWizard* m_pWizard;

View File

@ -319,9 +319,7 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent)
lcl_FillGreetingsBox(m_aMaleLB, rConfig, SwMailMergeConfigItem::MALE); lcl_FillGreetingsBox(m_aMaleLB, rConfig, SwMailMergeConfigItem::MALE);
lcl_FillGreetingsBox(m_aNeutralCB, rConfig, SwMailMergeConfigItem::NEUTRAL); lcl_FillGreetingsBox(m_aNeutralCB, rConfig, SwMailMergeConfigItem::NEUTRAL);
String sTemp(m_sDocument); m_aDocumentIndexFI.SetText(m_sDocument.replaceFirst("%1", OUString::number(1)));
sTemp.SearchAndReplaceAscii("%1", OUString::number(1));
m_aDocumentIndexFI.SetText(sTemp);
} }
SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage() SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage()
@ -428,9 +426,7 @@ IMPL_LINK(SwMailMergeGreetingsPage, InsertDataHdl_Impl, ImageButton*, pButton)
m_aPrevSetIB.Enable(bEnable); m_aPrevSetIB.Enable(bEnable);
m_aNextSetIB.Enable(bEnable); m_aNextSetIB.Enable(bEnable);
m_aDocumentIndexFI.Enable(bEnable); m_aDocumentIndexFI.Enable(bEnable);
String sTemp(m_sDocument); m_aDocumentIndexFI.SetText(m_sDocument.replaceFirst("%1", OUString::number(nPos)));
sTemp.SearchAndReplaceAscii("%1", OUString::number(nPos));
m_aDocumentIndexFI.SetText(sTemp);
return 0; return 0;
} }

View File

@ -100,7 +100,7 @@ class SwMailMergeGreetingsPage : public svt::OWizardPage,
ImageButton m_aPrevSetIB; ImageButton m_aPrevSetIB;
ImageButton m_aNextSetIB; ImageButton m_aNextSetIB;
String m_sDocument; OUString m_sDocument;
DECL_LINK(ContainsHdl_Impl, CheckBox*); DECL_LINK(ContainsHdl_Impl, CheckBox*);
DECL_LINK(InsertDataHdl_Impl, ImageButton*); DECL_LINK(InsertDataHdl_Impl, ImageButton*);

View File

@ -174,7 +174,7 @@ class SW_DLLPUBLIC SwSendMailDialog : public ModelessDialog //SfxModalDialog
String m_sStop; String m_sStop;
String m_sSend; String m_sSend;
String m_sTransferStatus; String m_sTransferStatus;
String m_sErrorStatus; OUString m_sErrorStatus;
String m_sSendingTo; String m_sSendingTo;
String m_sCompleted; String m_sCompleted;
String m_sFailed; String m_sFailed;

View File

@ -924,27 +924,24 @@ void SwColumnPage::SetLabels( sal_uInt16 nVis )
String tmp3(sLbl2); String tmp3(sLbl2);
sLbl2.Insert(sLbl, sLbl2.Len() - 1); sLbl2.Insert(sLbl, sLbl2.Len() - 1);
m_pLbl3->SetText(sLbl2); m_pLbl3->SetText(sLbl2);
String sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ; OUString sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
sColumnWidth.SearchAndReplaceAscii("%1", tmp1); aEd1.SetAccessibleName(sColumnWidth.replaceFirst("%1", tmp1));
aEd1.SetAccessibleName(sColumnWidth);
sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ; sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
sColumnWidth.SearchAndReplaceAscii("%1", tmp2); aEd2.SetAccessibleName(sColumnWidth.replaceFirst("%1", tmp2));
aEd2.SetAccessibleName(sColumnWidth);
sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ; sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
sColumnWidth.SearchAndReplaceAscii("%1", tmp3); aEd3.SetAccessibleName(sColumnWidth.replaceFirst("%1", tmp3));
aEd3.SetAccessibleName(sColumnWidth);
String sDist = SW_RESSTR( STR_ACCESS_PAGESETUP_SPACING ) ; OUString sDist = SW_RESSTR( STR_ACCESS_PAGESETUP_SPACING ) ;
String sDist1 = sDist; OUString sDist1 = sDist;
sDist1.SearchAndReplaceAscii("%1", tmp1); sDist1 = sDist1.replaceFirst("%1", tmp1);
sDist1.SearchAndReplaceAscii("%2", tmp2); sDist1 = sDist1.replaceFirst("%2", tmp2);
aDistEd1.SetAccessibleName(sDist1); aDistEd1.SetAccessibleName(sDist1);
String sDist2 = sDist; OUString sDist2 = sDist;
sDist2.SearchAndReplaceAscii("%1", tmp2); sDist2 = sDist2.replaceFirst("%1", tmp2);
sDist2.SearchAndReplaceAscii("%2", tmp3); sDist2 = sDist2.replaceFirst("%2", tmp3);
aDistEd2.SetAccessibleName(sDist2); aDistEd2.SetAccessibleName(sDist2);
} }

View File

@ -513,9 +513,9 @@ IMPL_LINK_NOARG( SwMultiTOXTabDialog, ShowPreviewHdl )
if(!bExist) if(!bExist)
{ {
String sInfo(SW_RES(STR_FILE_NOT_FOUND)); OUString sInfo(SW_RESSTR(STR_FILE_NOT_FOUND));
sInfo.SearchAndReplaceAscii( "%1", sTemplate ); sInfo = sInfo.replaceFirst( "%1", sTemplate );
sInfo.SearchAndReplaceAscii( "%2", aOpt.GetTemplatePath() ); sInfo = sInfo.replaceFirst( "%2", aOpt.GetTemplatePath() );
InfoBox aInfo(GetParent(), sInfo); InfoBox aInfo(GetParent(), sInfo);
aInfo.Execute(); aInfo.Execute();
} }

View File

@ -2327,9 +2327,8 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
if(!GetWrtShell().IsFieldDataSourceAvailable(sSource)) if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
{ {
SwMergeSourceWarningBox_Impl aWarning( &GetViewFrame()->GetWindow()); SwMergeSourceWarningBox_Impl aWarning( &GetViewFrame()->GetWindow());
String sTmp(aWarning.GetMessText()); OUString sTmp(aWarning.GetMessText());
sTmp.SearchAndReplaceAscii("%1", sSource); aWarning.SetMessText(sTmp.replaceFirst("%1", sSource));
aWarning.SetMessText(sTmp);
if(RET_OK == aWarning.Execute()) if(RET_OK == aWarning.Execute())
{ {
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();

View File

@ -230,9 +230,9 @@ ShellResource::~ShellResource()
delete pAutoFmtNameLst; delete pAutoFmtNameLst;
} }
String ShellResource::GetPageDescName( sal_uInt16 nNo, PageNameMode eMode ) OUString ShellResource::GetPageDescName(sal_uInt16 nNo, PageNameMode eMode)
{ {
String sRet; OUString sRet;
switch (eMode) switch (eMode)
{ {
@ -247,8 +247,7 @@ String ShellResource::GetPageDescName( sal_uInt16 nNo, PageNameMode eMode )
break; break;
} }
sRet.SearchAndReplaceAscii( "$(ARG1)", OUString::number( nNo )); return sRet.replaceFirst( "$(ARG1)", OUString::number( nNo ));
return sRet;
} }

View File

@ -247,18 +247,4 @@ xub_StrLen UniString::SearchAscii( const sal_Char* pAsciiStr, xub_StrLen nIndex
return STRING_NOTFOUND; 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */