include/svx/svddrgmt.hxx       |    2 
 include/svx/svdobj.hxx         |    2 
 include/svx/svdundo.hxx        |    4 -
 svx/source/svdraw/svddrgmt.cxx |   45 +++++++----------
 svx/source/svdraw/svdobj.cxx   |   13 ++--
 svx/source/svdraw/svdocapt.cxx |    8 ---
 svx/source/svdraw/svdocirc.cxx |    8 ---
 svx/source/svdraw/svdoedge.cxx |    5 -
 svx/source/svdraw/svdopath.cxx |   12 +---
 svx/source/svdraw/svdorect.cxx |    4 -
 svx/source/svdraw/svdotxdr.cxx |    4 -
 svx/source/svdraw/svdundo.cxx  |  108 ++++++++++++-----------------------------
 12 files changed, 73 insertions(+), 142 deletions(-)

New commits:
commit 894c91c73973ec519f7d0035dfc05c9ad1b68fa4
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Oct 9 16:29:35 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Oct 9 20:48:53 2019 +0200

    rename ImpTakeDescriptionStr -> ImpGetDescriptionStr
    
    and make it return the result, rather than doing it via an awkward
    out-parameter
    
    Change-Id: Ia47c66b4f1bae781a679f2f4311e321fdc947928
    Reviewed-on: https://gerrit.libreoffice.org/80547
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svx/svddrgmt.hxx b/include/svx/svddrgmt.hxx
index 94d185547941..0e2995e98cd9 100644
--- a/include/svx/svddrgmt.hxx
+++ b/include/svx/svddrgmt.hxx
@@ -157,7 +157,7 @@ protected:
     void createSdrDragEntries_GlueDrag();
 
     // old call forwarders to the SdrDragView
-    void               ImpTakeDescriptionStr(const char* pStrCacheID, 
OUString& rStr) const;
+    OUString           ImpGetDescriptionStr(const char* pStrCacheID) const;
     SdrHdl*            GetDragHdl() const              { return 
getSdrDragView().mpDragHdl; }
     SdrHdlKind         GetDragHdlKind() const          { return 
getSdrDragView().meDragHdl; }
     SdrDragStat&       DragStat()                      { return 
getSdrDragView().maDragStat; }
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index b16005c37290..97f082563281 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -953,7 +953,7 @@ protected:
     tools::Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
 
     // for GetDragComment
-    void ImpTakeDescriptionStr(const char* pStrCacheID, OUString& rStr) const;
+    OUString ImpGetDescriptionStr(const char* pStrCacheID) const;
 
     void ImpForcePlusData();
 
diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index e4d6ccbce9a1..7b100cb9314b 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -125,7 +125,7 @@ protected:
 protected:
     SdrUndoObj(SdrObject& rNewObj);
 
-    void ImpTakeDescriptionStr(const char* pStrCacheID, OUString& rStr, bool 
bRepeat = false) const;
+    OUString ImpGetDescriptionStr(const char* pStrCacheID, bool bRepeat = 
false) const;
 
     [[nodiscard]] static OUString GetDescriptionStringForObject( const 
SdrObject& _rForObject, const char* pStrCacheID, bool bRepeat = false );
 
@@ -527,7 +527,7 @@ protected:
 protected:
     SdrUndoPage(SdrPage& rNewPg);
 
-    static void ImpTakeDescriptionStr(const char* pStrCacheID, OUString& rStr);
+    static OUString ImpGetDescriptionStr(const char* pStrCacheID);
 };
 
 /**
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 38d72142eebe..ae06b29e8bb3 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -560,7 +560,7 @@ void SdrDragMethod::createSdrDragEntries_GlueDrag()
     }
 }
 
-void SdrDragMethod::ImpTakeDescriptionStr(const char* pStrCacheID, OUString& 
rStr) const
+OUString SdrDragMethod::ImpGetDescriptionStr(const char* pStrCacheID) const
 {
     ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE;
     if (IsDraggingPoints()) {
@@ -568,7 +568,7 @@ void SdrDragMethod::ImpTakeDescriptionStr(const char* 
pStrCacheID, OUString& rSt
     } else if (IsDraggingGluePoints()) {
         nOpt=ImpGetDescriptionOptions::GLUEPOINTS;
     }
-    rStr = getSdrDragView().ImpGetDescriptionString(pStrCacheID, nOpt);
+    return getSdrDragView().ImpGetDescriptionString(pStrCacheID, nOpt);
 }
 
 SdrObject* SdrDragMethod::GetDragObj() const
@@ -1473,7 +1473,7 @@ SdrDragMove::SdrDragMove(SdrDragView& rNewView)
 
 void SdrDragMove::TakeSdrDragComment(OUString& rStr) const
 {
-    ImpTakeDescriptionStr(STR_DragMethMove, rStr);
+    rStr = ImpGetDescriptionStr(STR_DragMethMove);
     rStr += " (x="
             + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDX())
             + " y="
@@ -1722,7 +1722,7 @@ SdrDragResize::SdrDragResize(SdrDragView& rNewView)
 
 void SdrDragResize::TakeSdrDragComment(OUString& rStr) const
 {
-    ImpTakeDescriptionStr(STR_DragMethResize, rStr);
+    rStr = ImpGetDescriptionStr(STR_DragMethResize);
     Fraction aFact1(1,1);
     Point aStart(DragStat().GetStart());
     Point aRef(DragStat().GetRef1());
@@ -2058,7 +2058,7 @@ SdrDragRotate::SdrDragRotate(SdrDragView& rNewView)
 
 void SdrDragRotate::TakeSdrDragComment(OUString& rStr) const
 {
-    ImpTakeDescriptionStr(STR_DragMethRotate, rStr);
+    rStr = ImpGetDescriptionStr(STR_DragMethRotate);
     rStr += " (";
     sal_Int32 nTmpAngle(NormAngle36000(nAngle));
 
@@ -2198,7 +2198,7 @@ SdrDragShear::SdrDragShear(SdrDragView& rNewView, bool 
bSlant1)
 
 void SdrDragShear::TakeSdrDragComment(OUString& rStr) const
 {
-    ImpTakeDescriptionStr(STR_DragMethShear, rStr);
+    rStr = ImpGetDescriptionStr(STR_DragMethShear);
     rStr += " (";
 
     sal_Int32 nTmpAngle(nAngle);
@@ -2413,8 +2413,7 @@ bool SdrDragShear::EndSdrDrag(bool bCopy)
     {
         if (nAngle!=0 && bResize)
         {
-            OUString aStr;
-            ImpTakeDescriptionStr(STR_EditShear,aStr);
+            OUString aStr = ImpGetDescriptionStr(STR_EditShear);
 
             if (bCopy)
                 aStr += SvxResId(STR_EditWithCopy);
@@ -2487,13 +2486,13 @@ bool SdrDragMirror::ImpCheckSide(const Point& rPnt) 
const
 void SdrDragMirror::TakeSdrDragComment(OUString& rStr) const
 {
     if (aDif.X()==0)
-        ImpTakeDescriptionStr(STR_DragMethMirrorHori,rStr);
+        rStr = ImpGetDescriptionStr(STR_DragMethMirrorHori);
     else if (aDif.Y()==0)
-        ImpTakeDescriptionStr(STR_DragMethMirrorVert,rStr);
+        rStr = ImpGetDescriptionStr(STR_DragMethMirrorVert);
     else if (std::abs(aDif.X()) == std::abs(aDif.Y()))
-        ImpTakeDescriptionStr(STR_DragMethMirrorDiag,rStr);
+        rStr = ImpGetDescriptionStr(STR_DragMethMirrorDiag);
     else
-        ImpTakeDescriptionStr(STR_DragMethMirrorFree,rStr);
+        rStr = ImpGetDescriptionStr(STR_DragMethMirrorFree);
 
     if (getSdrDragView().IsDragWithCopy())
         rStr+=SvxResId(STR_EditWithCopy);
@@ -2597,9 +2596,9 @@ SdrDragGradient::SdrDragGradient(SdrDragView& rNewView, 
bool bGrad)
 void SdrDragGradient::TakeSdrDragComment(OUString& rStr) const
 {
     if(IsGradient())
-        ImpTakeDescriptionStr(STR_DragMethGradient, rStr);
+        rStr = ImpGetDescriptionStr(STR_DragMethGradient);
     else
-        ImpTakeDescriptionStr(STR_DragMethTransparence, rStr);
+        rStr = ImpGetDescriptionStr(STR_DragMethTransparence);
 }
 
 bool SdrDragGradient::BeginSdrDrag()
@@ -2770,7 +2769,7 @@ SdrDragCrook::SdrDragCrook(SdrDragView& rNewView)
 
 void SdrDragCrook::TakeSdrDragComment(OUString& rStr) const
 {
-    ImpTakeDescriptionStr(!bContortion ? STR_DragMethCrook : 
STR_DragMethCrookContortion, rStr);
+    rStr = ImpGetDescriptionStr(!bContortion ? STR_DragMethCrook : 
STR_DragMethCrookContortion);
 
     if(bValid)
     {
@@ -3307,8 +3306,7 @@ bool SdrDragCrook::EndSdrDrag(bool bCopy)
     {
         if (bResize && bUndo)
         {
-            OUString aStr;
-            
ImpTakeDescriptionStr(!bContortion?STR_EditCrook:STR_EditCrookContortion,aStr);
+            OUString aStr = 
ImpGetDescriptionStr(!bContortion?STR_EditCrook:STR_EditCrookContortion);
 
             if (bCopy)
                 aStr += SvxResId(STR_EditWithCopy);
@@ -3387,9 +3385,8 @@ SdrDragDistort::SdrDragDistort(SdrDragView& rNewView)
 
 void SdrDragDistort::TakeSdrDragComment(OUString& rStr) const
 {
-    ImpTakeDescriptionStr(STR_DragMethDistort, rStr);
-
-    rStr += " (x="
+    rStr = ImpGetDescriptionStr(STR_DragMethDistort)
+            + " (x="
             + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDX())
             + " y="
             + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDY())
@@ -3532,9 +3529,8 @@ SdrDragCrop::SdrDragCrop(SdrDragView& rNewView)
 
 void SdrDragCrop::TakeSdrDragComment(OUString& rStr) const
 {
-    ImpTakeDescriptionStr(STR_DragMethCrop, rStr);
-
-    rStr += " (x="
+    rStr = ImpGetDescriptionStr(STR_DragMethCrop)
+            + " (x="
             + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDX())
             + " y="
             + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDY())
@@ -3618,8 +3614,7 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/)
 
     if(bUndo)
     {
-        OUString aUndoStr;
-        ImpTakeDescriptionStr(STR_DragMethCrop, aUndoStr);
+        OUString aUndoStr = ImpGetDescriptionStr(STR_DragMethCrop);
 
         getSdrDragView().BegUndo( aUndoStr );
         getSdrDragView().AddUndo( 
getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 58d06fe6b25c..7b3d0bac73c8 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1060,21 +1060,22 @@ OUString SdrObject::TakeObjNamePlural() const
     return SvxResId(STR_ObjNamePluralNONE);
 }
 
-void SdrObject::ImpTakeDescriptionStr(const char* pStrCacheID, OUString& rStr) 
const
+OUString SdrObject::ImpGetDescriptionStr(const char* pStrCacheID) const
 {
-    rStr = SvxResId(pStrCacheID);
-    sal_Int32 nPos = rStr.indexOf("%1");
+    OUString aStr = SvxResId(pStrCacheID);
+    sal_Int32 nPos = aStr.indexOf("%1");
     if (nPos >= 0)
     {
         // Replace '%1' with the object name.
         OUString aObjName(TakeObjNameSingul());
-        rStr = rStr.replaceAt(nPos, 2, aObjName);
+        aStr = aStr.replaceAt(nPos, 2, aObjName);
     }
 
-    nPos = rStr.indexOf("%2");
+    nPos = aStr.indexOf("%2");
     if (nPos >= 0)
         // Replace '%2' with the passed value.
-        rStr = rStr.replaceAt(nPos, 2, "0");
+        aStr = aStr.replaceAt(nPos, 2, "0");
+    return aStr;
 }
 
 void SdrObject::ImpForcePlusData()
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 7e104c45c321..b4714c9e9ee5 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -401,18 +401,14 @@ OUString SdrCaptionObj::getSpecialDragComment(const 
SdrDragStat& rDrag) const
         }
         else
         {
-            OUString aStr;
-
             if(!pHdl)
             {
-                ImpTakeDescriptionStr(STR_DragCaptFram, aStr);
+                return ImpGetDescriptionStr(STR_DragCaptFram);
             }
             else
             {
-                ImpTakeDescriptionStr(STR_DragCaptTail, aStr);
+                return ImpGetDescriptionStr(STR_DragCaptTail);
             }
-
-            return aStr;
         }
     }
 }
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 29a5e54fb336..c104a33ae21a 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -594,9 +594,7 @@ OUString SdrCircObj::getSpecialDragComment(const 
SdrDragStat& rDrag) const
 
     if(bCreateComment)
     {
-        OUString aStr;
-        ImpTakeDescriptionStr(STR_ViewCreateObj, aStr);
-        OUStringBuffer aBuf(aStr);
+        OUStringBuffer aBuf(ImpGetDescriptionStr(STR_ViewCreateObj));
         const sal_uInt32 nPointCount(rDrag.GetPointCount());
 
         if(SdrCircKind::Full != meCircleKind && nPointCount > 2)
@@ -629,9 +627,7 @@ OUString SdrCircObj::getSpecialDragComment(const 
SdrDragStat& rDrag) const
         {
             const sal_Int32 nAngle(1 == rDrag.GetHdl()->GetPointNum() ? 
nStartAngle : nEndAngle);
 
-            OUString aStr;
-            ImpTakeDescriptionStr(STR_DragCircAngle, aStr);
-            OUStringBuffer aBuf(aStr);
+            OUStringBuffer aBuf(ImpGetDescriptionStr(STR_DragCircAngle));
             aBuf.append(" (");
             aBuf.append(SdrModel::GetAngleString(nAngle));
             aBuf.append(')');
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 3e052fc825e1..c2afd2195101 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1989,10 +1989,7 @@ OUString SdrEdgeObj::getSpecialDragComment(const 
SdrDragStat& rDrag) const
     }
     else
     {
-        OUString aStr;
-        ImpTakeDescriptionStr(STR_DragEdgeTail, aStr);
-
-        return aStr;
+        return ImpGetDescriptionStr(STR_DragEdgeTail);
     }
 }
 
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 6cec19162691..0ae3fe029ef7 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -917,9 +917,7 @@ OUString 
ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag
         const ImpPathCreateUser* pU = static_cast<const 
ImpPathCreateUser*>(rDrag.GetUser());
         const SdrObjKind eOriginalKind(meObjectKind);
         mrSdrPathObject.meKind = pU->eCurrentKind;
-        OUString aTmp;
-        mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewCreateObj, aTmp);
-        aStr = aTmp;
+        aStr = mrSdrPathObject.ImpGetDescriptionStr(STR_ViewCreateObj);
         mrSdrPathObject.meKind = eOriginalKind;
 
         Point aPrev(rDrag.GetPrev());
@@ -959,9 +957,7 @@ OUString 
ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag
     {
         // #i103058# fallback when no model and/or Handle, both needed
         // for else-path
-        OUString aTmp;
-        mrSdrPathObject.ImpTakeDescriptionStr(STR_DragPathObj, aTmp);
-        aStr = aTmp;
+        aStr = mrSdrPathObject.ImpGetDescriptionStr(STR_DragPathObj);
     }
     else
     {
@@ -984,9 +980,7 @@ OUString 
ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag
         if(!pDragData->IsMultiPointDrag() && pDragData->bEliminate)
         {
             // point of ...
-            OUString aTmp;
-            mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewMarkedPoint, aTmp);
-            aStr = aTmp;
+            aStr = mrSdrPathObject.ImpGetDescriptionStr(STR_ViewMarkedPoint);
 
             // delete %O
             OUString aStr2(SvxResId(STR_EditDelete));
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index 5a4faf6b1337..0d4ccff0f2c1 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -438,9 +438,7 @@ OUString SdrRectObj::getSpecialDragComment(const 
SdrDragStat& rDrag) const
             if(nRad < 0)
                 nRad = 0;
 
-            OUString aStr;
-            ImpTakeDescriptionStr(STR_DragRectEckRad, aStr);
-            OUStringBuffer aBuf(aStr);
+            OUStringBuffer aBuf(ImpGetDescriptionStr(STR_DragRectEckRad));
             aBuf.append(" (");
             aBuf.append(GetMetrStr(nRad));
             aBuf.append(')');
diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx
index a5aae5432817..b340340a1a3c 100644
--- a/svx/source/svdraw/svdotxdr.cxx
+++ b/svx/source/svdraw/svdotxdr.cxx
@@ -173,9 +173,7 @@ bool SdrTextObj::applySpecialDrag(SdrDragStat& rDrag)
 
 OUString SdrTextObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_DragRectResize,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_DragRectResize);
 }
 
 
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 7c6d43f38818..8d79d0c65b20 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -212,10 +212,11 @@ OUString SdrUndoObj::GetDescriptionStringForObject( const 
SdrObject& _rForObject
     return rStr.replaceAt(nPos, 2, _rForObject.TakeObjNameSingul());
 }
 
-void SdrUndoObj::ImpTakeDescriptionStr(const char* pStrCacheID, OUString& 
rStr, bool bRepeat) const
+OUString SdrUndoObj::ImpGetDescriptionStr(const char* pStrCacheID, bool 
bRepeat) const
 {
     if ( pObj )
-        rStr = GetDescriptionStringForObject( *pObj, pStrCacheID, bRepeat );
+        return GetDescriptionStringForObject( *pObj, pStrCacheID, bRepeat );
+    return OUString();
 }
 
 // common call method for possible change of the page when UNDO/REDO is 
triggered
@@ -481,34 +482,26 @@ void SdrUndoAttrObj::Redo()
 
 OUString SdrUndoAttrObj::GetComment() const
 {
-    OUString aStr;
-
     if(bStyleSheet)
     {
-        ImpTakeDescriptionStr(STR_EditSetStylesheet, aStr);
+        return ImpGetDescriptionStr(STR_EditSetStylesheet);
     }
     else
     {
-        ImpTakeDescriptionStr(STR_EditSetAttributes, aStr);
+        return ImpGetDescriptionStr(STR_EditSetAttributes);
     }
-
-    return aStr;
 }
 
 OUString SdrUndoAttrObj::GetSdrRepeatComment(SdrView& /*rView*/) const
 {
-    OUString aStr;
-
     if(bStyleSheet)
     {
-        ImpTakeDescriptionStr(STR_EditSetStylesheet, aStr, true);
+        return ImpGetDescriptionStr(STR_EditSetStylesheet, true);
     }
     else
     {
-        ImpTakeDescriptionStr(STR_EditSetAttributes, aStr, true);
+        return ImpGetDescriptionStr(STR_EditSetAttributes, true);
     }
-
-    return aStr;
 }
 
 
@@ -532,9 +525,7 @@ void SdrUndoMoveObj::Redo()
 
 OUString SdrUndoMoveObj::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_EditMove,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_EditMove);
 }
 
 void SdrUndoMoveObj::SdrRepeat(SdrView& rView)
@@ -549,9 +540,7 @@ bool SdrUndoMoveObj::CanSdrRepeat(SdrView& rView) const
 
 OUString SdrUndoMoveObj::GetSdrRepeatComment(SdrView& /*rView*/) const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_EditMove,aStr,true);
-    return aStr;
+    return ImpGetDescriptionStr(STR_EditMove,true);
 }
 
 
@@ -630,9 +619,7 @@ void SdrUndoGeoObj::Redo()
 
 OUString SdrUndoGeoObj::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_DragMethObjOwn,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_DragMethObjOwn);
 }
 
 
@@ -784,9 +771,7 @@ void SdrUndoDelObj::Redo()
 
 OUString SdrUndoDelObj::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_EditDelete,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_EditDelete);
 }
 
 void SdrUndoDelObj::SdrRepeat(SdrView& rView)
@@ -801,9 +786,7 @@ bool SdrUndoDelObj::CanSdrRepeat(SdrView& rView) const
 
 OUString SdrUndoDelObj::GetSdrRepeatComment(SdrView& /*rView*/) const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_EditDelete,aStr,true);
-    return aStr;
+    return ImpGetDescriptionStr(STR_EditDelete,true);
 }
 
 
@@ -828,9 +811,7 @@ OUString SdrUndoNewObj::GetComment( const SdrObject& 
_rForObject )
 
 OUString SdrUndoNewObj::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoInsertObj,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoInsertObj);
 }
 
 SdrUndoReplaceObj::SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1)
@@ -919,9 +900,7 @@ void SdrUndoReplaceObj::SetOldOwner(bool bNew)
 
 OUString SdrUndoCopyObj::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoCopyObj,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoCopyObj);
 }
 
 
@@ -984,9 +963,7 @@ void SdrUndoObjOrdNum::Redo()
 
 OUString SdrUndoObjOrdNum::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoObjOrdNum,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoObjOrdNum);
 }
 
 
@@ -1101,16 +1078,12 @@ void SdrUndoObjSetText::Redo()
 
 OUString SdrUndoObjSetText::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoObjSetText,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoObjSetText);
 }
 
 OUString SdrUndoObjSetText::GetSdrRepeatComment(SdrView& /*rView*/) const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoObjSetText,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoObjSetText);
 }
 
 void SdrUndoObjSetText::SdrRepeat(SdrView& rView)
@@ -1122,8 +1095,7 @@ void SdrUndoObjSetText::SdrRepeat(SdrView& rView)
         const bool bUndo = rView.IsUndoEnabled();
         if( bUndo )
         {
-            OUString aStr;
-            ImpTakeDescriptionStr(STR_UndoObjSetText,aStr);
+            OUString aStr = ImpGetDescriptionStr(STR_UndoObjSetText);
             rView.BegUndo(aStr);
         }
 
@@ -1212,14 +1184,14 @@ OUString SdrUndoObjStrAttr::GetComment() const
     switch ( meObjStrAttr )
     {
     case ObjStrAttrType::Name:
-        ImpTakeDescriptionStr( STR_UndoObjName, aStr );
-        aStr += " '" + msNewStr + "'";
+        aStr = ImpGetDescriptionStr( STR_UndoObjName) +
+                " '" + msNewStr + "'";
         break;
     case ObjStrAttrType::Title:
-        ImpTakeDescriptionStr( STR_UndoObjTitle, aStr );
+        aStr = ImpGetDescriptionStr( STR_UndoObjTitle );
         break;
     case ObjStrAttrType::Description:
-        ImpTakeDescriptionStr( STR_UndoObjDescription, aStr );
+        aStr = ImpGetDescriptionStr( STR_UndoObjDescription );
         break;
     }
 
@@ -1343,9 +1315,9 @@ void SdrUndoPage::ImpMovePage(sal_uInt16 nOldNum, 
sal_uInt16 nNewNum)
     }
 }
 
-void SdrUndoPage::ImpTakeDescriptionStr(const char* pStrCacheID, OUString& 
rStr)
+OUString SdrUndoPage::ImpGetDescriptionStr(const char* pStrCacheID)
 {
-    rStr = SvxResId(pStrCacheID);
+    return SvxResId(pStrCacheID);
 }
 
 
@@ -1442,16 +1414,12 @@ void SdrUndoDelPage::Redo()
 
 OUString SdrUndoDelPage::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoDelPage,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoDelPage);
 }
 
 OUString SdrUndoDelPage::GetSdrRepeatComment(SdrView& /*rView*/) const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoDelPage,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoDelPage);
 }
 
 void SdrUndoDelPage::SdrRepeat(SdrView& /*rView*/)
@@ -1535,24 +1503,18 @@ void SdrUndoNewPage::Redo()
 
 OUString SdrUndoNewPage::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoNewPage,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoNewPage);
 }
 
 
 OUString SdrUndoCopyPage::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoCopPage,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoCopPage);
 }
 
 OUString SdrUndoCopyPage::GetSdrRepeatComment(SdrView& /*rView*/) const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoCopPage,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoCopPage);
 }
 
 void SdrUndoCopyPage::SdrRepeat(SdrView& /*rView*/)
@@ -1578,9 +1540,7 @@ void SdrUndoSetPageNum::Redo()
 
 OUString SdrUndoSetPageNum::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoMovPage,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoMovPage);
 }
 
 SdrUndoPageMasterPage::SdrUndoPageMasterPage(SdrPage& rChangedPage)
@@ -1621,9 +1581,7 @@ void SdrUndoPageRemoveMasterPage::Redo()
 
 OUString SdrUndoPageRemoveMasterPage::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoDelPageMasterDscr,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoDelPageMasterDscr);
 }
 
 SdrUndoPageChangeMasterPage::SdrUndoPageChangeMasterPage(SdrPage& rChangedPage)
@@ -1665,9 +1623,7 @@ void SdrUndoPageChangeMasterPage::Redo()
 
 OUString SdrUndoPageChangeMasterPage::GetComment() const
 {
-    OUString aStr;
-    ImpTakeDescriptionStr(STR_UndoChgPageMasterDscr,aStr);
-    return aStr;
+    return ImpGetDescriptionStr(STR_UndoChgPageMasterDscr);
 }
 
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to