include/svx/fontworkgallery.hxx | 1 include/svx/tbcontrl.hxx | 1 include/tools/string.hxx | 5 -- reportdesign/source/core/sdr/UndoActions.cxx | 5 +- reportdesign/source/ui/inc/StartMarker.hxx | 2 - reportdesign/source/ui/report/ReportController.cxx | 10 ++--- reportdesign/source/ui/report/SectionWindow.cxx | 6 +-- reportdesign/source/ui/report/StartMarker.cxx | 2 - sw/source/core/view/printdata.cxx | 5 +- tools/source/string/tustring.cxx | 36 --------------------- 10 files changed, 13 insertions(+), 60 deletions(-)
New commits: commit c65eb7e56934b22f9bea68e62c0a51fd59869f1c Author: Thomas Arnhold <tho...@arnhold.org> Date: Thu Oct 17 11:43:40 2013 +0200 Related: fdo#38838 remove String::SearchAndReplace Change-Id: I1cc52d0be360b05e722a18b3ca5d08b2b0b0842d diff --git a/include/tools/string.hxx b/include/tools/string.hxx index 8441ac0..f8a9d88 100644 --- a/include/tools/string.hxx +++ b/include/tools/string.hxx @@ -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; diff --git a/reportdesign/source/core/sdr/UndoActions.cxx b/reportdesign/source/core/sdr/UndoActions.cxx index 943a5e3..b430337 100644 --- a/reportdesign/source/core/sdr/UndoActions.cxx +++ b/reportdesign/source/core/sdr/UndoActions.cxx @@ -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 diff --git a/reportdesign/source/ui/inc/StartMarker.hxx b/reportdesign/source/ui/inc/StartMarker.hxx index 0c3115c..77e2fa8 100644 --- a/reportdesign/source/ui/inc/StartMarker.hxx +++ b/reportdesign/source/ui/inc/StartMarker.hxx @@ -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. diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 7741b49..146e01f 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -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); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index 3dbc65f..96e03c3 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -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; diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index fbb10b4..cdb9eef 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -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); } diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index a55184a..ce90177 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -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 diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index 1463a3b..e8395b0 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -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 ); commit 5df4743236c0d41ad0d28ba7e743f2ea4f74c8e5 Author: Thomas Arnhold <tho...@arnhold.org> Date: Wed Oct 16 22:26:12 2013 +0200 remove some unused code Change-Id: If3e7c03aedf7b953c7bd3017534b3d5fbeeb6192 diff --git a/include/svx/fontworkgallery.hxx b/include/svx/fontworkgallery.hxx index ad46332..24f5d5b 100644 --- a/include/svx/fontworkgallery.hxx +++ b/include/svx/fontworkgallery.hxx @@ -42,7 +42,6 @@ class SdrObject; class SdrModel; class SfxBindings; -class SfxStatusForwarder; //------------------------------------------------------------------------ diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx index a0c194a..fee0726 100644 --- a/include/svx/tbcontrl.hxx +++ b/include/svx/tbcontrl.hxx @@ -268,7 +268,6 @@ class SVX_DLLPUBLIC SvxColorExtToolBoxControl : public SfxToolBoxControl using SfxToolBoxControl::StateChanged; using SfxToolBoxControl::Select; - // SfxStatusForwarder aForward; ::svx::ToolboxButtonColorUpdater* pBtnUpdater; Color mLastColor; sal_Bool bChoiceFromPalette; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits