include/svx/svdobj.hxx       |   16 ++++++++++++++--
 svx/source/svdraw/svdobj.cxx |   11 +++++++++--
 2 files changed, 23 insertions(+), 4 deletions(-)

New commits:
commit 47b907e0b403ad966153721cd59bc902c69e60d2
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Tue Feb 21 22:05:02 2023 +0900
Commit:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
CommitDate: Tue Feb 21 22:05:02 2023 +0900

    svx: change SdrObjGeoData aBoundRectangle using gfx::Range2DLWrap
    
    Change-Id: I13213ea2bdbfc5badb87d1bbd836192b8ae45e72

diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 7c3cad7443ea..5ec178b1ffee 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -174,8 +174,20 @@ public:
  */
 class SVXCORE_DLLPUBLIC SdrObjGeoData
 {
+private:
+    gfx::Range2DLWrap maBoundRange;
+
 public:
-    tools::Rectangle                   aBoundRect;
+    gfx::Range2DLWrap const& getBoundRange() const
+    {
+        return maBoundRange;
+    }
+
+    void setBoundRange(gfx::Range2DLWrap const& rRange)
+    {
+        maBoundRange = rRange;
+    }
+
     Point                       aAnchor;
     std::unique_ptr<SdrGluePointList>
                                 pGPL;
@@ -186,7 +198,6 @@ public:
     bool                        mbVisible;
     SdrLayerID                  mnLayerID;
 
-public:
     SdrObjGeoData();
     virtual ~SdrObjGeoData();
 };
@@ -418,6 +429,7 @@ public:
     // non-useful BoundRects sometimes) i rename that method from 
GetBoundRect() to
     // GetCurrentBoundRect().
     virtual const tools::Rectangle& GetCurrentBoundRect() const;
+    virtual const gfx::Range2DLWrap& getCurrentBoundRange() const;
 
     // To have a possibility to get the last calculated BoundRect e.g for 
producing
     // the first rectangle for repaints (old and new need to be used) without 
forcing
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 3f33e41f7cba..ec3fc6fced4f 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -932,6 +932,13 @@ const tools::Rectangle& SdrObject::GetCurrentBoundRect() 
const
     return getOutRectangle();
 }
 
+const gfx::Range2DLWrap& SdrObject::getCurrentBoundRange() const
+{
+    if (m_aOutterRange.isEmpty())
+        const_cast<SdrObject*>(this)->RecalcBoundRect();
+    return m_aOutterRange;
+}
+
 // To have a possibility to get the last calculated BoundRect e.g for producing
 // the first rectangle for repaints (old and new need to be used) without 
forcing
 // a RecalcBoundRect (which may be problematical and expensive sometimes) I 
add here
@@ -1866,7 +1873,7 @@ std::unique_ptr<SdrObjGeoData> SdrObject::NewGeoData() 
const
 
 void SdrObject::SaveGeoData(SdrObjGeoData& rGeo) const
 {
-    rGeo.aBoundRect    =GetCurrentBoundRect();
+    rGeo.setBoundRange(getCurrentBoundRange());
     rGeo.aAnchor       =m_aAnchor       ;
     rGeo.bMovProt      =m_bMovProt      ;
     rGeo.bSizProt      =m_bSizProt      ;
@@ -1890,7 +1897,7 @@ void SdrObject::SaveGeoData(SdrObjGeoData& rGeo) const
 void SdrObject::RestoreGeoData(const SdrObjGeoData& rGeo)
 {
     SetBoundAndSnapRectsDirty();
-    setOutRectangle(rGeo.aBoundRect);
+    m_aOutterRange = rGeo.getBoundRange();
     m_aAnchor       =rGeo.aAnchor       ;
     m_bMovProt      =rGeo.bMovProt      ;
     m_bSizProt      =rGeo.bSizProt      ;

Reply via email to