diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-09-04 12:41:12 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-09-05 09:38:39 +0200 |
commit | 8664e88bc2006d6bcf477f7efafc0308b75a77d7 (patch) | |
tree | 293280ed72cd1483411cffd08ee0468a4622d3b1 /svx | |
parent | 661e6cf497b8a83543ff10b21a01f3590d1bf504 (diff) |
XubString to OUString
And simplify:
SdrMarkView::ImpTakeDescriptionStr
SdrUndoObj::GetDescriptionStringForObject
ImpTakeDescriptionStr checks for %1 occurence first, this seems to me like an
optimization. So I left it in.
Change-Id: I2d0ecfdf2b83a9a535bd893578837e549dd691c1
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 27 | ||||
-rw-r--r-- | svx/source/svdraw/svdmrkv.cxx | 7 | ||||
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 5 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 3 |
4 files changed, 12 insertions, 30 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 3b143eef2b3b..a2c4e79abd86 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1525,11 +1525,9 @@ void SdrDragMove::TakeSdrDragComment(OUString& rStr) const ImpTakeDescriptionStr(STR_DragMethMove, rStr); rStr += " (x="; getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDX(), aStr); - rStr += aStr; - rStr += " y="; + rStr += aStr + " y="; getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDY(), aStr); - rStr += aStr; - rStr += ")"; + rStr += aStr + ")"; if(getSdrDragView().IsDragWithCopy()) { @@ -2134,8 +2132,7 @@ void SdrDragRotate::TakeSdrDragComment(OUString& rStr) const OUString aStr; getSdrDragView().GetModel()->TakeWinkStr(nTmpWink, aStr); - rStr += aStr; - rStr += ")"; + rStr += aStr + ")"; if(getSdrDragView().IsDragWithCopy()) rStr += ImpGetResStr(STR_EditWithCopy); @@ -2271,8 +2268,7 @@ void SdrDragShear::TakeSdrDragComment(OUString& rStr) const OUString aStr; getSdrDragView().GetModel()->TakeWinkStr(nTmpWink, aStr); - rStr += aStr; - rStr += ")"; + rStr += aStr + ")"; if(getSdrDragView().IsDragWithCopy()) rStr += ImpGetResStr(STR_EditWithCopy); @@ -2858,8 +2854,7 @@ void SdrDragCrook::TakeSdrDragComment(OUString& rStr) const nVal = std::abs(nVal); OUString aStr; getSdrDragView().GetModel()->TakeWinkStr(nVal, aStr); - rStr += aStr; - rStr += ")"; + rStr += aStr + ")"; } if(getSdrDragView().IsDragWithCopy()) @@ -3511,11 +3506,9 @@ void SdrDragDistort::TakeSdrDragComment(OUString& rStr) const rStr += " (x="; getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDX(), aStr); - rStr += aStr; - rStr += " y="; + rStr += aStr + " y="; getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDY(), aStr); - rStr += aStr; - rStr += ")"; + rStr += aStr + ")"; if(getSdrDragView().IsDragWithCopy()) rStr += ImpGetResStr(STR_EditWithCopy); @@ -3666,11 +3659,9 @@ void SdrDragCrop::TakeSdrDragComment(OUString& rStr) const rStr += " (x="; getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDX(), aStr); - rStr += aStr; - rStr += " y="; + rStr += aStr + " y="; getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDY(), aStr); - rStr += aStr; - rStr += ")"; + rStr += aStr + ")"; if(getSdrDragView().IsDragWithCopy()) rStr += ImpGetResStr(STR_EditWithCopy); diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 07e35491db4c..91f85baf3c83 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -2015,12 +2015,7 @@ void SdrMarkView::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, } } - nPos = rStr.indexOf("%2"); - - if(nPos != -1) - { - rStr = rStr.replaceAt(nPos, 2, OUString::number( nVal )); - } + rStr = rStr.replaceFirst("%2", OUString::number( nVal )); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index df7b1e6ad6f8..fcdf5f09546d 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -1315,10 +1315,7 @@ OUString SdrUndoObjStrAttr::GetComment() const { case OBJ_NAME: ImpTakeDescriptionStr( STR_UndoObjName, aStr ); - aStr += " "; - aStr += "\'"; - aStr += msNewStr; - aStr += "\'"; + aStr += " '" + msNewStr + "'"; break; case OBJ_TITLE: ImpTakeDescriptionStr( STR_UndoObjTitle, aStr ); diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 68d258e72f7f..45505090e8b9 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1288,8 +1288,7 @@ OUString SdrView::GetStatusText() if(!aStr.isEmpty()) { // capitalize first letter - OUString aTmpStr(aStr.copy(0, 1)); - aStr = aStr.replaceAt(0, 1, aTmpStr.toAsciiUpperCase()); + aStr = aStr.replaceAt(0, 1, OUString(aStr[0]).toAsciiUpperCase()); } return aStr; } |