RotateFlyFrame: Isolate SwFrame members maFrame and maPrt

To gain more control over changes of the Writer layout,
isolated mentioned members and replaced all calls with
inline methods for read access. Moved to own class to
also identify 'private' accesses reliably. Added access
dedicated classes for write access, the only allowed
way to do changes. Adapted all usages and made test builds
on logerrit and locally

Change-Id: Ib0b7f852f5176744e860e2aad12dd13c9a906d68

RotateFlyFrame: Migrated from SwFrame::FrameWA to setFrame

Change-Id: I01f7b828fe2134411cc76639e880da46b415d767

RotateFlyFrame: Migrated from SwFrame::PrintWA to setPrint

Change-Id: Ieea3b467f296a190de5b5f47721bef148bebf60b

RotateFlyFrame: Adapted to get/setSwFrame and get/setSwPrint

Change-Id: I6cce40ec49dd5bd32d94fe06b9d2dabd368448be

RotateFlyFrame: Adapted to get methods and WriteAccess helpers

Change-Id: Ife3c1b2391ad7beae8c7f31f796b1454709ddd26

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

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
This commit is contained in:
Armin Le Grand
2017-10-25 13:46:44 +02:00
parent 3444a3086c
commit 4eec79bb37
2 changed files with 20 additions and 4 deletions

View File

@@ -148,8 +148,8 @@ public:
public: public:
FrameWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwFrame()), mrTarget(rTarget) {} FrameWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwFrame()), mrTarget(rTarget) {}
~FrameWriteAccess() { mrTarget.maFrameRect = *this; } ~FrameWriteAccess();
void setSwRect(const SwRect& rNew) { *(reinterpret_cast< SwRect* >(this)) = rNew; } void setSwRect(const SwRect& rNew) { *reinterpret_cast< SwRect* >(this) = rNew; }
}; };
// same for print // same for print
@@ -163,8 +163,8 @@ public:
public: public:
PrintWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwPrint()), mrTarget(rTarget) {} PrintWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwPrint()), mrTarget(rTarget) {}
~PrintWriteAccess() { mrTarget.maPrintRect = *this; } ~PrintWriteAccess();
void setSwRect(const SwRect& rNew) { *(reinterpret_cast< SwRect* >(this)) = rNew; } void setSwRect(const SwRect& rNew) { *reinterpret_cast< SwRect* >(this) = rNew; }
}; };
}; };

View File

@@ -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 ) SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib )
: SwFrameRect(), : SwFrameRect(),
SwClient( pMod ), SwClient( pMod ),