diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index cfe5589a10b1..a46a50bf8326 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -148,8 +148,8 @@ public: public: FrameWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwFrame()), mrTarget(rTarget) {} - ~FrameWriteAccess() { mrTarget.maFrameRect = *this; } - void setSwRect(const SwRect& rNew) { *(reinterpret_cast< SwRect* >(this)) = rNew; } + ~FrameWriteAccess(); + void setSwRect(const SwRect& rNew) { *reinterpret_cast< SwRect* >(this) = rNew; } }; // same for print @@ -163,8 +163,8 @@ public: public: PrintWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwPrint()), mrTarget(rTarget) {} - ~PrintWriteAccess() { mrTarget.maPrintRect = *this; } - void setSwRect(const SwRect& rNew) { *(reinterpret_cast< SwRect* >(this)) = rNew; } + ~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 ),