[Libreoffice-commits] core.git: 2 commits - chart2/source include/svx svx/inc svx/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 10 06:14:20 UTC 2019


 chart2/source/controller/main/DragMethod_Base.cxx          |    4 
 chart2/source/controller/main/DragMethod_Base.hxx          |    2 
 chart2/source/controller/main/DragMethod_PieSegment.cxx    |    7 
 chart2/source/controller/main/DragMethod_PieSegment.hxx    |    2 
 chart2/source/controller/main/DragMethod_RotateDiagram.cxx |    3 
 chart2/source/controller/main/DragMethod_RotateDiagram.hxx |    2 
 include/svx/svddrgmt.hxx                                   |    8 
 include/svx/svdpool.hxx                                    |    2 
 svx/inc/dragmt3d.hxx                                       |    2 
 svx/source/engine3d/dragmt3d.cxx                           |    3 
 svx/source/svdraw/svdattr.cxx                              |  132 ++-----------
 svx/source/svdraw/svddrgm1.hxx                             |   16 -
 svx/source/svdraw/svddrgmt.cxx                             |  110 ++++++----
 svx/source/svdraw/svdibrow.cxx                             |    2 
 svx/source/svdraw/svdview.cxx                              |    6 
 15 files changed, 119 insertions(+), 182 deletions(-)

New commits:
commit cfa4801cd0d8bfd5d6e692c0a3afa9639df45522
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Oct 9 16:54:36 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Oct 10 08:13:42 2019 +0200

    rename TakeItemName -> GetItemName
    
    and return a value instead of the awkward out-parameter
    
    Change-Id: I3b68c4e3b31f3ebc84ac5aecfb393c8d89e60b62
    Reviewed-on: https://gerrit.libreoffice.org/80550
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdpool.hxx b/include/svx/svdpool.hxx
index 13c5fddd31d7..04bd7c83f2e6 100644
--- a/include/svx/svdpool.hxx
+++ b/include/svx/svdpool.hxx
@@ -42,7 +42,7 @@ public:
                                  OUString& rText,
                                  const IntlWrapper& rIntlWrapper) const override;
 
-    static void TakeItemName(sal_uInt16 nWhich, OUString& rItemName);
+    static OUString GetItemName(sal_uInt16 nWhich);
 };
 
 #endif // INCLUDED_SVX_SVDPOOL_HXX
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 274a3541a2ec..80ee71ba8da7 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -382,10 +382,7 @@ bool SdrItemPool::GetPresentation(
             rItem.GetPresentation(SfxItemPresentation::Nameless,
                         GetMetric(nWhich),ePresentationMetric,rText,
                         rIntlWrapper);
-            OUString aStr;
-
-            TakeItemName(nWhich, aStr);
-            rText = aStr + " " + rText;
+            rText = GetItemName(nWhich) + " " + rText;
 
             return true;
         }
@@ -393,7 +390,7 @@ bool SdrItemPool::GetPresentation(
     return XOutdevItemPool::GetPresentation(rItem,ePresentationMetric,rText,rIntlWrapper);
 }
 
-void SdrItemPool::TakeItemName(sal_uInt16 nWhich, OUString& rItemName)
+OUString SdrItemPool::GetItemName(sal_uInt16 nWhich)
 {
     const char* pResId = SIP_UNKNOWN_ATTR;
 
@@ -612,7 +609,7 @@ void SdrItemPool::TakeItemName(sal_uInt16 nWhich, OUString& rItemName)
         case EE_FEATURE_FIELD   : pResId = SIP_EE_FEATURE_FIELD;break;
     } // switch
 
-    rItemName = SvxResId(pResId);
+    return SvxResId(pResId);
 }
 
 
@@ -646,10 +643,7 @@ bool SdrFractionItem::GetPresentation(
 
     if(ePresentation == SfxItemPresentation::Complete)
     {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
         return true;
     }
     else if(ePresentation == SfxItemPresentation::Nameless)
@@ -684,10 +678,7 @@ bool SdrScaleItem::GetPresentation(
 
     if(ePresentation == SfxItemPresentation::Complete)
     {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
 
     return true;
@@ -719,10 +710,7 @@ bool SdrOnOffItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByVal(GetValue());
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -745,10 +733,7 @@ bool SdrYesNoItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByVal(GetValue());
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -771,10 +756,7 @@ bool SdrPercentItem::GetPresentation(
 
     if(ePres == SfxItemPresentation::Complete)
     {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
 
     return true;
@@ -840,9 +822,7 @@ bool SdrAngleItem::GetPresentation(
 
     if(ePres == SfxItemPresentation::Complete)
     {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
+        OUString aStr = SdrItemPool::GetItemName(Which());
         aText.insert(0, ' ');
         aText.insert(0, aStr);
     }
@@ -886,10 +866,7 @@ bool SdrMetricItem::GetPresentation(SfxItemPresentation ePres,
     SdrFormatter::TakeUnitStr(ePresMetric,aStr);
     rText += " " + aStr;
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr2;
-
-        SdrItemPool::TakeItemName(Which(), aStr2);
-        rText = aStr2 + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -920,10 +897,7 @@ bool SdrCaptionTypeItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -950,10 +924,7 @@ bool SdrCaptionEscDirItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -988,10 +959,7 @@ bool SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1054,10 +1022,7 @@ bool SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1116,10 +1081,7 @@ bool SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1171,10 +1133,7 @@ bool SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1224,10 +1183,7 @@ bool SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1266,10 +1222,7 @@ bool SdrTextAniDelayItem::GetPresentation(
 
     if(ePres == SfxItemPresentation::Complete)
     {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
 
     return true;
@@ -1319,10 +1272,7 @@ bool SdrTextAniAmountItem::GetPresentation(
 
     if(ePres == SfxItemPresentation::Complete)
     {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
 
     return true;
@@ -1340,9 +1290,7 @@ bool SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres,
     rText = GetValueTextByVal( GetValue() );
     if (ePres==SfxItemPresentation::Complete)
     {
-        OUString aStr;
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1390,10 +1338,7 @@ bool SdrEdgeKindItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1559,10 +1504,7 @@ bool SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1612,10 +1554,7 @@ bool SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1666,10 +1605,7 @@ bool SdrMeasureTextVPosItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1717,10 +1653,7 @@ bool SdrMeasureUnitItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1764,10 +1697,7 @@ bool SdrCircKindItem::GetPresentation(SfxItemPresentation ePres,
 {
     rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
     if (ePres==SfxItemPresentation::Complete) {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
     return true;
 }
@@ -1812,10 +1742,7 @@ bool SdrSignedPercentItem::GetPresentation(
 
     if(ePres == SfxItemPresentation::Complete)
     {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName(Which(), aStr);
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName(Which()) + " " + rText;
     }
 
     return true;
@@ -1935,10 +1862,7 @@ bool SdrGrafModeItem::GetPresentation( SfxItemPresentation ePres,
 
     if( ePres == SfxItemPresentation::Complete )
     {
-        OUString aStr;
-
-        SdrItemPool::TakeItemName( Which(), aStr );
-        rText = aStr + " " + rText;
+        rText = SdrItemPool::GetItemName( Which() ) + " " + rText;
     }
 
     return true;
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 91cbd07ff29f..532df4f7a8b2 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -937,7 +937,7 @@ void SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItemS
                     }
                     nWhich0=nWhich;
                     ImpItemListRow aEntry;
-                    SdrItemPool::TakeItemName(nWhich, aEntry.aName);
+                    aEntry.aName = SdrItemPool::GetItemName(nWhich);
                     nIndent*=2;
 
                     while(nIndent > 0)
commit 3277446dc37f445b4d95a6c1272caf20242518c5
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Oct 9 16:41:16 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Oct 10 08:13:33 2019 +0200

    rename TakeSdrDragComment to GetSdrDragComment
    
    and return the value, instead of using an awkward out-parameter
    
    Change-Id: Ie1b2b31d36a2aa352b40b3582e0014e6b1f95390
    Reviewed-on: https://gerrit.libreoffice.org/80549
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/controller/main/DragMethod_Base.cxx b/chart2/source/controller/main/DragMethod_Base.cxx
index 0ea306632448..9e01d5c3bd7b 100644
--- a/chart2/source/controller/main/DragMethod_Base.cxx
+++ b/chart2/source/controller/main/DragMethod_Base.cxx
@@ -61,9 +61,9 @@ OUString DragMethod_Base::getUndoDescription() const
                 m_eActionType,
                 ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aObjectCID )));
 }
-void DragMethod_Base::TakeSdrDragComment(OUString& rStr) const
+OUString DragMethod_Base::GetSdrDragComment() const
 {
-    rStr = getUndoDescription();
+    return getUndoDescription();
 }
 PointerStyle DragMethod_Base::GetSdrDragPointer() const
 {
diff --git a/chart2/source/controller/main/DragMethod_Base.hxx b/chart2/source/controller/main/DragMethod_Base.hxx
index 03494044b032..a558bdfbf533 100644
--- a/chart2/source/controller/main/DragMethod_Base.hxx
+++ b/chart2/source/controller/main/DragMethod_Base.hxx
@@ -39,7 +39,7 @@ public:
 
     OUString getUndoDescription() const;
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual PointerStyle GetSdrDragPointer() const override;
 
 protected:
diff --git a/chart2/source/controller/main/DragMethod_PieSegment.cxx b/chart2/source/controller/main/DragMethod_PieSegment.cxx
index e3f0a820a272..9e8e995838f0 100644
--- a/chart2/source/controller/main/DragMethod_PieSegment.cxx
+++ b/chart2/source/controller/main/DragMethod_PieSegment.cxx
@@ -69,10 +69,11 @@ DragMethod_PieSegment::DragMethod_PieSegment( DrawViewWrapper& rDrawViewWrapper
 DragMethod_PieSegment::~DragMethod_PieSegment()
 {
 }
-void DragMethod_PieSegment::TakeSdrDragComment(OUString& rStr) const
+OUString DragMethod_PieSegment::GetSdrDragComment() const
 {
-    rStr = SchResId(STR_STATUS_PIE_SEGMENT_EXPLODED);
-    rStr = rStr.replaceFirst( "%PERCENTVALUE", OUString::number( static_cast<sal_Int32>((m_fAdditionalOffset+m_fInitialOffset)*100.0) ));
+    OUString aStr = SchResId(STR_STATUS_PIE_SEGMENT_EXPLODED);
+    aStr = aStr.replaceFirst( "%PERCENTVALUE", OUString::number( static_cast<sal_Int32>((m_fAdditionalOffset+m_fInitialOffset)*100.0) ));
+    return aStr;
 }
 bool DragMethod_PieSegment::BeginSdrDrag()
 {
diff --git a/chart2/source/controller/main/DragMethod_PieSegment.hxx b/chart2/source/controller/main/DragMethod_PieSegment.hxx
index 35739769c106..4a1264a017f1 100644
--- a/chart2/source/controller/main/DragMethod_PieSegment.hxx
+++ b/chart2/source/controller/main/DragMethod_PieSegment.hxx
@@ -32,7 +32,7 @@ public:
         , const css::uno::Reference< css::frame::XModel >& xChartModel );
     virtual ~DragMethod_PieSegment() override;
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
index 5ed1cb16c5ed..8e29facf3cd5 100644
--- a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
+++ b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
@@ -96,8 +96,9 @@ DragMethod_RotateDiagram::DragMethod_RotateDiagram( DrawViewWrapper& rDrawViewWr
 DragMethod_RotateDiagram::~DragMethod_RotateDiagram()
 {
 }
-void DragMethod_RotateDiagram::TakeSdrDragComment(OUString& /*rStr*/) const
+OUString DragMethod_RotateDiagram::GetSdrDragComment() const
 {
+    return OUString();
 }
 bool DragMethod_RotateDiagram::BeginSdrDrag()
 {
diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.hxx b/chart2/source/controller/main/DragMethod_RotateDiagram.hxx
index b2698bf85b18..a9401c923a1c 100644
--- a/chart2/source/controller/main/DragMethod_RotateDiagram.hxx
+++ b/chart2/source/controller/main/DragMethod_RotateDiagram.hxx
@@ -47,7 +47,7 @@ public:
         );
     virtual ~DragMethod_RotateDiagram() override;
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
 
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
diff --git a/include/svx/svddrgmt.hxx b/include/svx/svddrgmt.hxx
index 0e2995e98cd9..10be51127053 100644
--- a/include/svx/svddrgmt.hxx
+++ b/include/svx/svddrgmt.hxx
@@ -195,7 +195,7 @@ public:
     void Hide();
     bool IsShiftPressed() const { return mbShiftPressed; }
     void SetShiftPressed(bool bShiftPressed) { mbShiftPressed = bShiftPressed; }
-    virtual void TakeSdrDragComment(OUString& rStr) const=0;
+    virtual OUString GetSdrDragComment() const=0;
     virtual bool BeginSdrDrag()=0;
     virtual void MoveSdrDrag(const Point& rPnt)=0;
     virtual bool EndSdrDrag(bool bCopy)=0;
@@ -242,7 +242,7 @@ protected:
 public:
     SdrDragMove(SdrDragView& rNewView);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
@@ -264,7 +264,7 @@ protected:
 public:
     SdrDragResize(SdrDragView& rNewView);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
@@ -293,7 +293,7 @@ public:
     SdrDragObjOwn(SdrDragView& rNewView);
     virtual ~SdrDragObjOwn() override;
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
diff --git a/svx/inc/dragmt3d.hxx b/svx/inc/dragmt3d.hxx
index 475fa05a69df..a92f3be188f7 100644
--- a/svx/inc/dragmt3d.hxx
+++ b/svx/inc/dragmt3d.hxx
@@ -71,7 +71,7 @@ public:
         E3dDragConstraint eConstr,
         bool bFull);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual void CancelSdrDrag() override;
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx
index 616e9182e925..68881166e651 100644
--- a/svx/source/engine3d/dragmt3d.cxx
+++ b/svx/source/engine3d/dragmt3d.cxx
@@ -103,8 +103,9 @@ E3dDragMethod::E3dDragMethod (
     }
 }
 
-void E3dDragMethod::TakeSdrDragComment(OUString& /*rStr*/) const
+OUString E3dDragMethod::GetSdrDragComment() const
 {
+    return OUString();
 }
 
 // Create the wireframe model for all actions
diff --git a/svx/source/svdraw/svddrgm1.hxx b/svx/source/svdraw/svddrgm1.hxx
index 5323056668e3..02cbe111de10 100644
--- a/svx/source/svdraw/svddrgm1.hxx
+++ b/svx/source/svdraw/svddrgm1.hxx
@@ -36,7 +36,7 @@ protected:
 public:
     explicit SdrDragMovHdl(SdrDragView& rNewView);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
@@ -56,7 +56,7 @@ private:
 public:
     explicit SdrDragRotate(SdrDragView& rNewView);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
@@ -81,7 +81,7 @@ private:
 public:
     SdrDragShear(SdrDragView& rNewView,bool bSlant1);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
@@ -104,7 +104,7 @@ private:
 public:
     explicit SdrDragMirror(SdrDragView& rNewView);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
@@ -128,7 +128,7 @@ public:
 
     bool IsGradient() const { return bIsGradient; }
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
@@ -174,7 +174,7 @@ protected:
 public:
     explicit SdrDragCrook(SdrDragView& rNewView);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
@@ -204,7 +204,7 @@ protected:
 public:
     explicit SdrDragDistort(SdrDragView& rNewView);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual void MoveSdrDrag(const Point& rPnt) override;
     virtual bool EndSdrDrag(bool bCopy) override;
@@ -221,7 +221,7 @@ class SdrDragCrop : public SdrDragObjOwn
 public:
     explicit SdrDragCrop(SdrDragView& rNewView);
 
-    virtual void TakeSdrDragComment(OUString& rStr) const override;
+    virtual OUString GetSdrDragComment() const override;
     virtual bool BeginSdrDrag() override;
     virtual bool EndSdrDrag(bool bCopy) override;
     virtual PointerStyle GetSdrDragPointer() const override;
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index ae06b29e8bb3..8bc1ef3689ce 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -960,10 +960,11 @@ void SdrDragMovHdl::createSdrDragEntries()
     // but creates nothing
 }
 
-void SdrDragMovHdl::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragMovHdl::GetSdrDragComment() const
 {
-    rStr=SvxResId(STR_DragMethMovHdl);
-    if (getSdrDragView().IsDragWithCopy()) rStr+=SvxResId(STR_EditWithCopy);
+    OUString aStr=SvxResId(STR_DragMethMovHdl);
+    if (getSdrDragView().IsDragWithCopy()) aStr+=SvxResId(STR_EditWithCopy);
+    return aStr;
 }
 
 bool SdrDragMovHdl::BeginSdrDrag()
@@ -1229,13 +1230,14 @@ void SdrDragObjOwn::createSdrDragEntries()
     }
 }
 
-void SdrDragObjOwn::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragObjOwn::GetSdrDragComment() const
 {
+    OUString aStr;
     // #i103058# get info string from the clone preferred, the original will
     // not be changed. For security, use original as fallback
     if(mxClone)
     {
-        rStr = mxClone->getSpecialDragComment(DragStat());
+        aStr = mxClone->getSpecialDragComment(DragStat());
     }
     else
     {
@@ -1243,9 +1245,10 @@ void SdrDragObjOwn::TakeSdrDragComment(OUString& rStr) const
 
         if(pObj)
         {
-            rStr = pObj->getSpecialDragComment(DragStat());
+            aStr = pObj->getSpecialDragComment(DragStat());
         }
     }
+    return aStr;
 }
 
 bool SdrDragObjOwn::BeginSdrDrag()
@@ -1471,10 +1474,10 @@ SdrDragMove::SdrDragMove(SdrDragView& rNewView)
     setMoveOnly(true);
 }
 
-void SdrDragMove::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragMove::GetSdrDragComment() const
 {
-    rStr = ImpGetDescriptionStr(STR_DragMethMove);
-    rStr += " (x="
+    OUString aStr = ImpGetDescriptionStr(STR_DragMethMove)
+            + " (x="
             + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDX())
             + " y="
             + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDY())
@@ -1484,9 +1487,10 @@ void SdrDragMove::TakeSdrDragComment(OUString& rStr) const
     {
         if(!getSdrDragView().IsInsObjPoint() && !getSdrDragView().IsInsGluePoint())
         {
-            rStr += SvxResId(STR_EditWithCopy);
+            aStr += SvxResId(STR_EditWithCopy);
         }
     }
+    return aStr;
 }
 
 bool SdrDragMove::BeginSdrDrag()
@@ -1720,9 +1724,9 @@ SdrDragResize::SdrDragResize(SdrDragView& rNewView)
 {
 }
 
-void SdrDragResize::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragResize::GetSdrDragComment() const
 {
-    rStr = ImpGetDescriptionStr(STR_DragMethResize);
+    OUString aStr = ImpGetDescriptionStr(STR_DragMethResize);
     Fraction aFact1(1,1);
     Point aStart(DragStat().GetStart());
     Point aRef(DragStat().GetRef1());
@@ -1741,30 +1745,31 @@ void SdrDragResize::TakeSdrDragComment(OUString& rStr) const
 
     if(bX || bY)
     {
-        rStr += " (";
+        aStr += " (";
 
         bool bEqual(aXFact == aYFact);
         if(bX)
         {
             if(!bEqual)
-                rStr += "x=";
+                aStr += "x=";
 
-            rStr += SdrModel::GetPercentString(aXFact);
+            aStr += SdrModel::GetPercentString(aXFact);
         }
 
         if(bY && !bEqual)
         {
             if(bX)
-                rStr += " ";
+                aStr += " ";
 
-            rStr += "y=" + SdrModel::GetPercentString(aYFact);
+            aStr += "y=" + SdrModel::GetPercentString(aYFact);
         }
 
-        rStr += ")";
+        aStr += ")";
     }
 
     if(getSdrDragView().IsDragWithCopy())
-        rStr += SvxResId(STR_EditWithCopy);
+        aStr += SvxResId(STR_EditWithCopy);
+    return aStr;
 }
 
 bool SdrDragResize::BeginSdrDrag()
@@ -2056,10 +2061,10 @@ SdrDragRotate::SdrDragRotate(SdrDragView& rNewView)
 {
 }
 
-void SdrDragRotate::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragRotate::GetSdrDragComment() const
 {
-    rStr = ImpGetDescriptionStr(STR_DragMethRotate);
-    rStr += " (";
+    OUString aStr = ImpGetDescriptionStr(STR_DragMethRotate) +
+        " (";
     sal_Int32 nTmpAngle(NormAngle36000(nAngle));
 
     if(bRight && nAngle)
@@ -2067,10 +2072,11 @@ void SdrDragRotate::TakeSdrDragComment(OUString& rStr) const
         nTmpAngle -= 36000;
     }
 
-    rStr += SdrModel::GetAngleString(nTmpAngle) + ")";
+    aStr += SdrModel::GetAngleString(nTmpAngle) + ")";
 
     if(getSdrDragView().IsDragWithCopy())
-        rStr += SvxResId(STR_EditWithCopy);
+        aStr += SvxResId(STR_EditWithCopy);
+    return aStr;
 }
 
 bool SdrDragRotate::BeginSdrDrag()
@@ -2196,10 +2202,10 @@ SdrDragShear::SdrDragShear(SdrDragView& rNewView, bool bSlant1)
 {
 }
 
-void SdrDragShear::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragShear::GetSdrDragComment() const
 {
-    rStr = ImpGetDescriptionStr(STR_DragMethShear);
-    rStr += " (";
+    OUString aStr = ImpGetDescriptionStr(STR_DragMethShear) +
+        " (";
 
     sal_Int32 nTmpAngle(nAngle);
 
@@ -2208,10 +2214,11 @@ void SdrDragShear::TakeSdrDragComment(OUString& rStr) const
 
     nTmpAngle = NormAngle18000(nTmpAngle);
 
-    rStr += SdrModel::GetAngleString(nTmpAngle) + ")";
+    aStr += SdrModel::GetAngleString(nTmpAngle) + ")";
 
     if(getSdrDragView().IsDragWithCopy())
-        rStr += SvxResId(STR_EditWithCopy);
+        aStr += SvxResId(STR_EditWithCopy);
+    return aStr;
 }
 
 bool SdrDragShear::BeginSdrDrag()
@@ -2483,19 +2490,21 @@ bool SdrDragMirror::ImpCheckSide(const Point& rPnt) const
     return nAngle1<18000;
 }
 
-void SdrDragMirror::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragMirror::GetSdrDragComment() const
 {
+    OUString aStr;
     if (aDif.X()==0)
-        rStr = ImpGetDescriptionStr(STR_DragMethMirrorHori);
+        aStr = ImpGetDescriptionStr(STR_DragMethMirrorHori);
     else if (aDif.Y()==0)
-        rStr = ImpGetDescriptionStr(STR_DragMethMirrorVert);
+        aStr = ImpGetDescriptionStr(STR_DragMethMirrorVert);
     else if (std::abs(aDif.X()) == std::abs(aDif.Y()))
-        rStr = ImpGetDescriptionStr(STR_DragMethMirrorDiag);
+        aStr = ImpGetDescriptionStr(STR_DragMethMirrorDiag);
     else
-        rStr = ImpGetDescriptionStr(STR_DragMethMirrorFree);
+        aStr = ImpGetDescriptionStr(STR_DragMethMirrorFree);
 
     if (getSdrDragView().IsDragWithCopy())
-        rStr+=SvxResId(STR_EditWithCopy);
+        aStr+=SvxResId(STR_EditWithCopy);
+    return aStr;
 }
 
 bool SdrDragMirror::BeginSdrDrag()
@@ -2593,12 +2602,12 @@ SdrDragGradient::SdrDragGradient(SdrDragView& rNewView, bool bGrad)
 {
 }
 
-void SdrDragGradient::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragGradient::GetSdrDragComment() const
 {
     if(IsGradient())
-        rStr = ImpGetDescriptionStr(STR_DragMethGradient);
+        return ImpGetDescriptionStr(STR_DragMethGradient);
     else
-        rStr = ImpGetDescriptionStr(STR_DragMethTransparence);
+        return ImpGetDescriptionStr(STR_DragMethTransparence);
 }
 
 bool SdrDragGradient::BeginSdrDrag()
@@ -2767,13 +2776,13 @@ SdrDragCrook::SdrDragCrook(SdrDragView& rNewView)
 {
 }
 
-void SdrDragCrook::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragCrook::GetSdrDragComment() const
 {
-    rStr = ImpGetDescriptionStr(!bContortion ? STR_DragMethCrook : STR_DragMethCrookContortion);
+    OUString aStr = ImpGetDescriptionStr(!bContortion ? STR_DragMethCrook : STR_DragMethCrookContortion);
 
     if(bValid)
     {
-        rStr += " (";
+        aStr += " (";
 
         sal_Int32 nVal(nAngle);
 
@@ -2781,11 +2790,12 @@ void SdrDragCrook::TakeSdrDragComment(OUString& rStr) const
             nVal *= 2;
 
         nVal = std::abs(nVal);
-        rStr += SdrModel::GetAngleString(nVal) + ")";
+        aStr += SdrModel::GetAngleString(nVal) + ")";
     }
 
     if(getSdrDragView().IsDragWithCopy())
-        rStr += SvxResId(STR_EditWithCopy);
+        aStr += SvxResId(STR_EditWithCopy);
+    return aStr;
 }
 
 // These defines parametrize the created raster
@@ -3383,9 +3393,9 @@ SdrDragDistort::SdrDragDistort(SdrDragView& rNewView)
 {
 }
 
-void SdrDragDistort::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragDistort::GetSdrDragComment() const
 {
-    rStr = ImpGetDescriptionStr(STR_DragMethDistort)
+    OUString aStr = ImpGetDescriptionStr(STR_DragMethDistort)
             + " (x="
             + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDX())
             + " y="
@@ -3393,7 +3403,8 @@ void SdrDragDistort::TakeSdrDragComment(OUString& rStr) const
             + ")";
 
     if(getSdrDragView().IsDragWithCopy())
-        rStr += SvxResId(STR_EditWithCopy);
+        aStr += SvxResId(STR_EditWithCopy);
+    return aStr;
 }
 
 void SdrDragDistort::createSdrDragEntries()
@@ -3527,9 +3538,9 @@ SdrDragCrop::SdrDragCrop(SdrDragView& rNewView)
     setSolidDraggingActive(false);
 }
 
-void SdrDragCrop::TakeSdrDragComment(OUString& rStr) const
+OUString SdrDragCrop::GetSdrDragComment() const
 {
-    rStr = ImpGetDescriptionStr(STR_DragMethCrop)
+    OUString aStr = ImpGetDescriptionStr(STR_DragMethCrop)
             + " (x="
             + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDX())
             + " y="
@@ -3537,7 +3548,8 @@ void SdrDragCrop::TakeSdrDragComment(OUString& rStr) const
             + ")";
 
     if(getSdrDragView().IsDragWithCopy())
-        rStr += SvxResId(STR_EditWithCopy);
+        aStr += SvxResId(STR_EditWithCopy);
+    return aStr;
 }
 
 bool SdrDragCrop::BeginSdrDrag()
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 17821df622df..ec9514698168 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1161,10 +1161,8 @@ PointerStyle SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDe
 #define STR_NOTHING "nothing"
 OUString SdrView::GetStatusText()
 {
-    OUString aStr;
     OUString aName;
-
-    aStr += STR_NOTHING;
+    OUString aStr = STR_NOTHING;
 
     if (pCurrentCreate!=nullptr)
     {
@@ -1189,7 +1187,7 @@ OUString SdrView::GetStatusText()
                 SAL_INFO(
                     "svx.svdraw",
                     "(" << this << ") " << mpCurrentSdrDragMethod.get());
-                mpCurrentSdrDragMethod->TakeSdrDragComment(aStr);
+                aStr = mpCurrentSdrDragMethod->GetSdrDragComment();
             }
         }
     }


More information about the Libreoffice-commits mailing list