summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2013-09-05 10:04:02 +0200
committerThomas Arnhold <thomas@arnhold.org>2013-09-05 10:05:29 +0200
commit4c491c1253de0210dcd4d4ff593ee73562e4d958 (patch)
tree2dc2829b28ee0c829264e26be6bee2fbfa9ad148
parent17ff0d2b866f0e501057695d1485bf7d8d882f2a (diff)
Make use replaceFirst
Change-Id: Ieedb318f36afc5d85fa90533578e847a1d9d6840
-rw-r--r--cui/source/options/optsave.cxx3
-rw-r--r--svx/source/svdraw/svddrgv.cxx12
2 files changed, 3 insertions, 12 deletions
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 27f7b7885a7c..094f6362c9f2 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -427,8 +427,7 @@ void SfxSaveTabPage::Reset( const SfxItemSet& )
case APP_MATH : sReplace = "com.sun.star.formula.FormulaProperties";break;
default: OSL_FAIL("illegal user data");
}
- OUString sTmp = sCommand.replaceFirst("%1", sReplace);
- sCommand = sTmp;
+ sCommand = sCommand.replaceFirst("%1", sReplace);
Reference< XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand);
SequenceAsVector< OUString > lList;
SequenceAsVector< sal_Bool > lAlienList;
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 9b1a15e31d72..7c3bbc15738d 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -640,15 +640,9 @@ sal_Bool SdrDragView::ImpBegInsObjPoint(sal_Bool bIdxZwang, sal_uInt32 nIdx, con
DBG_ASSERT( pInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
OUString aStr(ImpGetResStr(STR_DragInsertPoint));
- OUString aName(pMarkedObj->TakeObjNameSingul());
- sal_Int32 nPos(aStr.indexOf("%1"));
- if(-1 != nPos)
- {
- aStr = aStr.replaceAt(nPos, 2, aName);
- }
+ aInsPointUndoStr = aStr.replaceFirst("%1", pMarkedObj->TakeObjNameSingul() );
- aInsPointUndoStr = aStr;
Point aPt(rPnt);
if(bNewObj)
@@ -749,11 +743,9 @@ sal_Bool SdrDragView::BegInsGluePoint(const Point& rPnt)
pInsPointUndo= dynamic_cast< SdrUndoGeoObj* >( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj) );
DBG_ASSERT( pInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
OUString aStr(ImpGetResStr(STR_DragInsertGluePoint));
- OUString aName(pObj->TakeObjNameSingul());
- aStr = aStr.replaceFirst("%1", aName);
+ aInsPointUndoStr = aStr.replaceFirst("%1", pObj->TakeObjNameSingul() );
- aInsPointUndoStr=aStr;
SdrGluePointList* pGPL=pObj->ForceGluePointList();
if (pGPL!=NULL)
{