summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-01-06 17:41:42 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-02-11 15:42:54 +0100
commitd0216f56862d2c8d35a8a174262f3e5a1dc58d45 (patch)
tree0d8dbb328678232fb06da0c5090fb9f0072ea9aa /svx/source/svdraw
parentdbc3c4eda146fe1132fb35911a4d0656ce0e68e2 (diff)
SdrMarkView: provide OUString as return value
Change-Id: I2d45f4ada683da4f69df6d81a072d2f3ba813dae
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svddrgmt.cxx8
-rw-r--r--svx/source/svdraw/svdedtv1.cxx71
-rw-r--r--svx/source/svdraw/svdedxv.cxx8
-rw-r--r--svx/source/svdraw/svdmrkv.cxx18
-rw-r--r--svx/source/svdraw/svdview.cxx6
5 files changed, 56 insertions, 55 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 4a93aa1fd2fd..6233184ab494 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -552,13 +552,13 @@ void SdrDragMethod::createSdrDragEntries_GlueDrag()
void SdrDragMethod::ImpTakeDescriptionStr(const char* pStrCacheID, OUString& rStr) const
{
- ImpTakeDescriptionOptions nOpt=ImpTakeDescriptionOptions::NONE;
+ ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE;
if (IsDraggingPoints()) {
- nOpt=ImpTakeDescriptionOptions::POINTS;
+ nOpt=ImpGetDescriptionOptions::POINTS;
} else if (IsDraggingGluePoints()) {
- nOpt=ImpTakeDescriptionOptions::GLUEPOINTS;
+ nOpt=ImpGetDescriptionOptions::GLUEPOINTS;
}
- getSdrDragView().ImpTakeDescriptionStr(pStrCacheID,rStr,nOpt);
+ rStr = getSdrDragView().ImpGetDescriptionString(pStrCacheID, nOpt);
}
SdrObject* SdrDragMethod::GetDragObj() const
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index ab5389aacf13..d2469a703c67 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -83,12 +83,10 @@ void SdrEditView::SetMarkedObjRect(const tools::Rectangle& rRect)
long y1=rRect.Top();
long w1=rRect.Right()-x1;
long h1=rRect.Bottom()-y1;
- OUString aStr;
- ImpTakeDescriptionStr(STR_EditPosSize,aStr);
const bool bUndo = IsUndoEnabled();
if( bUndo )
- BegUndo(aStr);
+ BegUndo(ImpGetDescriptionString(STR_EditPosSize));
for (size_t nm=0; nm<nCount; ++nm)
{
@@ -211,8 +209,7 @@ void SdrEditView::ResizeMarkedObj(const Point& rRef, const Fraction& xFact, cons
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- OUString aStr;
- ImpTakeDescriptionStr(STR_EditResize,aStr);
+ OUString aStr {ImpGetDescriptionString(STR_EditResize)};
if (bCopy)
aStr+=ImpGetResStr(STR_EditWithCopy);
BegUndo(aStr);
@@ -247,9 +244,7 @@ void SdrEditView::ResizeMultMarkedObj(const Point& rRef,
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- OUString aStr;
- ImpTakeDescriptionStr(STR_EditResize,aStr);
- BegUndo(aStr);
+ BegUndo(ImpGetDescriptionString(STR_EditResize));
}
const size_t nMarkCount=GetMarkedObjectCount();
@@ -310,8 +305,7 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nAngle, bool bCopy)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- OUString aStr;
- ImpTakeDescriptionStr(STR_EditRotate,aStr);
+ OUString aStr {ImpGetDescriptionString(STR_EditRotate)};
if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
BegUndo(aStr);
}
@@ -370,10 +364,14 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b
{
OUString aStr;
Point aDif(rRef2-rRef1);
- if (aDif.X()==0) ImpTakeDescriptionStr(STR_EditMirrorHori,aStr);
- else if (aDif.Y()==0) ImpTakeDescriptionStr(STR_EditMirrorVert,aStr);
- else if (std::abs(aDif.X()) == std::abs(aDif.Y())) ImpTakeDescriptionStr(STR_EditMirrorDiag,aStr);
- else ImpTakeDescriptionStr(STR_EditMirrorFree,aStr);
+ if (aDif.X()==0)
+ aStr = ImpGetDescriptionString(STR_EditMirrorHori);
+ else if (aDif.Y()==0)
+ aStr = ImpGetDescriptionString(STR_EditMirrorVert);
+ else if (std::abs(aDif.X()) == std::abs(aDif.Y()))
+ aStr = ImpGetDescriptionString(STR_EditMirrorDiag);
+ else
+ aStr = ImpGetDescriptionString(STR_EditMirrorFree);
if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
BegUndo(aStr);
}
@@ -464,8 +462,7 @@ void SdrEditView::ShearMarkedObj(const Point& rRef, long nAngle, bool bVShear, b
if( bUndo )
{
- OUString aStr;
- ImpTakeDescriptionStr(STR_EditShear,aStr);
+ OUString aStr {ImpGetDescriptionString(STR_EditShear)};
if (bCopy)
aStr+=ImpGetResStr(STR_EditWithCopy);
BegUndo(aStr);
@@ -581,8 +578,7 @@ void SdrEditView::CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookM
if( bUndo )
{
- OUString aStr;
- ImpTakeDescriptionStr(bNoContortion?STR_EditCrook:STR_EditCrookContortion,aStr);
+ OUString aStr {ImpGetDescriptionString(bNoContortion ? STR_EditCrook : STR_EditCrookContortion)};
if (bCopy)
aStr+=ImpGetResStr(STR_EditWithCopy);
BegUndo(aStr);
@@ -655,8 +651,7 @@ void SdrEditView::DistortMarkedObj(const tools::Rectangle& rRef, const XPolygon&
if( bUndo )
{
- OUString aStr;
- ImpTakeDescriptionStr(STR_EditDistort,aStr);
+ OUString aStr {ImpGetDescriptionString(STR_EditDistort)};
if (bCopy)
aStr+=ImpGetResStr(STR_EditWithCopy);
BegUndo(aStr);
@@ -1009,9 +1004,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- OUString aStr;
- ImpTakeDescriptionStr(STR_EditSetAttributes,aStr);
- BegUndo(aStr);
+ BegUndo(ImpGetDescriptionString(STR_EditSetAttributes));
}
const size_t nMarkCount(GetMarkedObjectCount());
@@ -1190,9 +1183,9 @@ void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRe
{
OUString aStr;
if (pStyleSheet!=nullptr)
- ImpTakeDescriptionStr(STR_EditSetStylesheet,aStr);
+ aStr = ImpGetDescriptionString(STR_EditSetStylesheet);
else
- ImpTakeDescriptionStr(STR_EditDelStylesheet,aStr);
+ aStr = ImpGetDescriptionString(STR_EditDelStylesheet);
BegUndo(aStr);
}
@@ -1748,9 +1741,15 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
{
switch (eVert)
{
- case SdrVertAlign::Top : ImpTakeDescriptionStr(STR_EditAlignVTop ,aStr); break;
- case SdrVertAlign::Bottom: ImpTakeDescriptionStr(STR_EditAlignVBottom,aStr); break;
- case SdrVertAlign::Center: ImpTakeDescriptionStr(STR_EditAlignVCenter,aStr); break;
+ case SdrVertAlign::Top:
+ aStr = ImpGetDescriptionString(STR_EditAlignVTop);
+ break;
+ case SdrVertAlign::Bottom:
+ aStr = ImpGetDescriptionString(STR_EditAlignVBottom);
+ break;
+ case SdrVertAlign::Center:
+ aStr = ImpGetDescriptionString(STR_EditAlignVCenter);
+ break;
default: break;
}
}
@@ -1758,19 +1757,25 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
{
switch (eHor)
{
- case SdrHorAlign::Left : ImpTakeDescriptionStr(STR_EditAlignHLeft ,aStr); break;
- case SdrHorAlign::Right : ImpTakeDescriptionStr(STR_EditAlignHRight ,aStr); break;
- case SdrHorAlign::Center: ImpTakeDescriptionStr(STR_EditAlignHCenter,aStr); break;
+ case SdrHorAlign::Left:
+ aStr = ImpGetDescriptionString(STR_EditAlignHLeft);
+ break;
+ case SdrHorAlign::Right:
+ aStr = ImpGetDescriptionString(STR_EditAlignHRight);
+ break;
+ case SdrHorAlign::Center:
+ aStr = ImpGetDescriptionString(STR_EditAlignHCenter);
+ break;
default: break;
}
}
else if (eHor==SdrHorAlign::Center && eVert==SdrVertAlign::Center)
{
- ImpTakeDescriptionStr(STR_EditAlignCenter,aStr);
+ aStr = ImpGetDescriptionString(STR_EditAlignCenter);
}
else
{
- ImpTakeDescriptionStr(STR_EditAlign,aStr);
+ aStr = ImpGetDescriptionString(STR_EditAlign);
}
BegUndo(aStr);
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 29d54d576e4f..f239c5cb5b8b 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2096,9 +2096,7 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
if( bUndo )
{
- OUString aStr;
- ImpTakeDescriptionStr(STR_EditSetAttributes,aStr);
- BegUndo(aStr);
+ BegUndo(ImpGetDescriptionString(STR_EditSetAttributes));
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get()));
// If this is a text object also rescue the OutlinerParaObject since
@@ -2143,9 +2141,7 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
{
if( IsUndoEnabled() )
{
- OUString aStr;
- ImpTakeDescriptionStr(STR_EditSetAttributes,aStr);
- BegUndo(aStr);
+ BegUndo(ImpGetDescriptionString(STR_EditSetAttributes));
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get()));
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*mxTextEditObj.get()));
EndUndo();
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 7e148a98c303..85ede4828fa7 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -2075,28 +2075,28 @@ const tools::Rectangle& SdrMarkView::GetMarkedObjRect() const
}
-void SdrMarkView::ImpTakeDescriptionStr(const char* pStrCacheID, OUString& rStr, ImpTakeDescriptionOptions nOpt) const
+OUString SdrMarkView::ImpGetDescriptionString(const char* pStrCacheID, ImpGetDescriptionOptions nOpt) const
{
- rStr = ImpGetResStr(pStrCacheID);
- sal_Int32 nPos = rStr.indexOf("%1");
+ OUString sStr = ImpGetResStr(pStrCacheID);
+ const sal_Int32 nPos = sStr.indexOf("%1");
if(nPos != -1)
{
- if(nOpt == ImpTakeDescriptionOptions::POINTS)
+ if(nOpt == ImpGetDescriptionOptions::POINTS)
{
- rStr = rStr.replaceAt(nPos, 2, GetDescriptionOfMarkedPoints());
+ sStr = sStr.replaceAt(nPos, 2, GetDescriptionOfMarkedPoints());
}
- else if(nOpt == ImpTakeDescriptionOptions::GLUEPOINTS)
+ else if(nOpt == ImpGetDescriptionOptions::GLUEPOINTS)
{
- rStr = rStr.replaceAt(nPos, 2, GetDescriptionOfMarkedGluePoints());
+ sStr = sStr.replaceAt(nPos, 2, GetDescriptionOfMarkedGluePoints());
}
else
{
- rStr = rStr.replaceAt(nPos, 2, GetDescriptionOfMarkedObjects());
+ sStr = sStr.replaceAt(nPos, 2, GetDescriptionOfMarkedObjects());
}
}
- rStr = rStr.replaceFirst("%2", "0");
+ return sStr.replaceFirst("%2", "0");
}
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 798afa63c23c..ed9157389e8b 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1269,14 +1269,14 @@ OUString SdrView::GetStatusText()
if(aStr == STR_NOTHING)
{
if (AreObjectsMarked()) {
- ImpTakeDescriptionStr(STR_ViewMarked,aStr);
+ aStr = ImpGetDescriptionString(STR_ViewMarked);
if (IsGluePointEditMode()) {
if (HasMarkedGluePoints()) {
- ImpTakeDescriptionStr(STR_ViewMarked,aStr,ImpTakeDescriptionOptions::GLUEPOINTS);
+ aStr = ImpGetDescriptionString(STR_ViewMarked, ImpGetDescriptionOptions::GLUEPOINTS);
}
} else {
if (HasMarkedPoints()) {
- ImpTakeDescriptionStr(STR_ViewMarked,aStr,ImpTakeDescriptionOptions::POINTS);
+ aStr = ImpGetDescriptionString(STR_ViewMarked, ImpGetDescriptionOptions::POINTS);
}
}
} else {