diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-07 10:12:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-07 11:46:58 +0100 |
commit | b8cf30e93f18ddc16fd648976a41a6bbb6c6d8b2 (patch) | |
tree | 2f1aeba61b0b943fcd67d3f4b2ca73002eaf60dd /sc | |
parent | 511b3ce85ebb2261f5ea866efdb333eaf94c64f8 (diff) |
Related: fdo#38838 remove UniString::SearchAndReplaceAscii
Change-Id: I86019d7ab248679cd8518a621fe8e3721b44aeb0
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCellBase.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocument.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessiblePageHeader.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessiblePreviewTable.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleTableBase.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/dbgui/scuiimoptdlg.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/dbgui/sortdlg.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 4 |
9 files changed, 25 insertions, 28 deletions
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(); |