[Libreoffice-commits] core.git: cui/source svx/source
Thomas Arnhold
thomas at arnhold.org
Thu Sep 5 01:06:02 PDT 2013
cui/source/options/optsave.cxx | 3 +--
svx/source/svdraw/svddrgv.cxx | 12 ++----------
2 files changed, 3 insertions(+), 12 deletions(-)
New commits:
commit 4c491c1253de0210dcd4d4ff593ee73562e4d958
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Thu Sep 5 10:04:02 2013 +0200
Make use replaceFirst
Change-Id: Ieedb318f36afc5d85fa90533578e847a1d9d6840
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 27f7b78..094f636 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 9b1a15e..7c3bbc1 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)
{
More information about the Libreoffice-commits
mailing list