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

Noel (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 24 13:33:47 UTC 2021


 include/svx/svdobj.hxx         |    2 +-
 svx/source/svdraw/svdogrp.cxx  |    2 +-
 svx/source/svdraw/svdovirt.cxx |    8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 4f3fb443cea4364b2ec8cb56515ec9bdfe6f5391
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Wed Mar 24 10:38:52 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Mar 24 14:33:04 2021 +0100

    use mutable rather than const_cast..this
    
    Change-Id: I0512ac563a8065814bccbcd942a47f1c5fa11c04
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113018
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 38bdc98eea5d..c759f3cfff14 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -871,7 +871,7 @@ public:
     const Graphic* getFillGraphic() const;
 
 protected:
-    tools::Rectangle            aOutRect;     // surrounding rectangle for Paint (incl. LineWidth, ...)
+    mutable tools::Rectangle    aOutRect;     // surrounding rectangle for Paint (incl. LineWidth, ...)
     Point                       aAnchor;      // anchor position (Writer)
     SdrObjUserCall*             pUserCall;
     std::unique_ptr<SdrObjPlusData>
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index 67783b147c3e..9124e0849090 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -199,7 +199,7 @@ const tools::Rectangle& SdrObjGroup::GetCurrentBoundRect() const
     // <aOutRect> has to contain the bounding rectangle
     if(0 != GetObjCount())
     {
-        const_cast< SdrObjGroup* >(this)->aOutRect = GetAllObjBoundRect();
+        aOutRect = GetAllObjBoundRect();
     }
 
     return aOutRect;
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index 552eb438b755..34b1361d7521 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -114,15 +114,15 @@ SdrObjList* SdrVirtObj::GetSubList() const
 
 const tools::Rectangle& SdrVirtObj::GetCurrentBoundRect() const
 {
-    const_cast<SdrVirtObj*>(this)->aOutRect=rRefObj.GetCurrentBoundRect(); // TODO: Optimize this.
-    const_cast<SdrVirtObj*>(this)->aOutRect+=aAnchor;
+    aOutRect = rRefObj.GetCurrentBoundRect(); // TODO: Optimize this.
+    aOutRect += aAnchor;
     return aOutRect;
 }
 
 const tools::Rectangle& SdrVirtObj::GetLastBoundRect() const
 {
-    const_cast<SdrVirtObj*>(this)->aOutRect=rRefObj.GetLastBoundRect(); // TODO: Optimize this.
-    const_cast<SdrVirtObj*>(this)->aOutRect+=aAnchor;
+    aOutRect = rRefObj.GetLastBoundRect(); // TODO: Optimize this.
+    aOutRect += aAnchor;
     return aOutRect;
 }
 


More information about the Libreoffice-commits mailing list