[Libreoffice-commits] core.git: Branch 'feature/RotateFlyFrame' - sw/source

Armin Le Grand Armin.Le.Grand at cib.de
Fri Oct 27 10:41:18 UTC 2017


 sw/source/core/inc/frame.hxx    |    4 ++--
 sw/source/core/layout/wsfrm.cxx |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 21ec10af46830524dc83cb9ac94fae927e476e25
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date:   Fri Oct 27 12:39:00 2017 +0200

    RotateFlyFrame: Moved change executers to cxx
    
    Moved SwFrameRect::FrameWriteAccess::~FrameWriteAccess()
    and SwFrameRect::PrintWriteAccess::~PrintWriteAccess() to
    implementation side and added compare op's for SwRcet to
    write only if needed
    
    Change-Id: I85d0e61009116f4b17d1ce0337e3f0d2cc031159

diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index cfe5589a10b1..e57c2af0617b 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -148,7 +148,7 @@ public:
 
     public:
         FrameWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwFrame()), mrTarget(rTarget) {}
-        ~FrameWriteAccess() { mrTarget.maFrameRect = *this; }
+        ~FrameWriteAccess();
         void setSwRect(const SwRect& rNew) { *(reinterpret_cast< SwRect* >(this)) = rNew; }
     };
 
@@ -163,7 +163,7 @@ public:
 
     public:
         PrintWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwPrint()), mrTarget(rTarget) {}
-        ~PrintWriteAccess() { mrTarget.maPrintRect = *this; }
+        ~PrintWriteAccess();
         void setSwRect(const SwRect& rNew) { *(reinterpret_cast< SwRect* >(this)) = rNew; }
     };
 };
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 1c301a161d2f..40ffaa5d0eec 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -59,6 +59,22 @@ SwFrameRect::SwFrameRect()
 {
 }
 
+SwFrameRect::FrameWriteAccess::~FrameWriteAccess()
+{
+    if(mrTarget.maFrameRect != *this)
+    {
+        mrTarget.maFrameRect = *this;
+    }
+}
+
+SwFrameRect::PrintWriteAccess::~PrintWriteAccess()
+{
+    if(mrTarget.maPrintRect != *this)
+    {
+        mrTarget.maPrintRect = *this;
+    }
+}
+
 SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib )
 :   SwFrameRect(),
     SwClient( pMod ),


More information about the Libreoffice-commits mailing list