diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-11-09 08:59:09 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-11-09 09:38:04 +0100 |
commit | 78e0da267774a35f4abfef52f0ce74b1972128a4 (patch) | |
tree | 2c3388898c7e35f108b75fe07f38b54df8832d1a | |
parent | 59301a4ab8ffc1bb8d5516825627a9a371c640f0 (diff) |
sw: prefix members of StackHack, SwActualSection, SwFrameHolder and ...
... SwOszControl
See tdf#94879 for motivation.
Change-Id: If36742218a4deca1b688ef8996702c5985310110
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105472
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/source/core/inc/frmtool.hxx | 16 | ||||
-rw-r--r-- | sw/source/core/layout/flycnt.cxx | 70 | ||||
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 40 | ||||
-rw-r--r-- | sw/source/core/layout/laycache.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/layout/layhelp.hxx | 16 |
5 files changed, 78 insertions, 74 deletions
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index c525f59be56e..cdbc4dbbd420 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -449,23 +449,23 @@ public: class StackHack { - static sal_uInt8 nCnt; - static bool bLocked; + static sal_uInt8 s_nCnt; + static bool s_bLocked; public: StackHack() { - if ( ++StackHack::nCnt > 50 ) - StackHack::bLocked = true; + if ( ++StackHack::s_nCnt > 50 ) + StackHack::s_bLocked = true; } ~StackHack() { - if ( --StackHack::nCnt < 5 ) - StackHack::bLocked = false; + if ( --StackHack::s_nCnt < 5 ) + StackHack::s_bLocked = false; } - static bool IsLocked() { return StackHack::bLocked; } - static sal_uInt8 Count() { return StackHack::nCnt; } + static bool IsLocked() { return StackHack::s_bLocked; } + static sal_uInt8 Count() { return StackHack::s_nCnt; } }; // Should upper (or lower) border be evaluated for this frame? diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index c19794e98e28..4dc2db5921d7 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -206,11 +206,11 @@ namespace { // #i3317# - re-factoring of the position stack class SwOszControl { - static const SwFlyFrame* m_pStack1; - static const SwFlyFrame* m_pStack2; - static const SwFlyFrame* m_pStack3; - static const SwFlyFrame* m_pStack4; - static const SwFlyFrame* m_pStack5; + static const SwFlyFrame* s_pStack1; + static const SwFlyFrame* s_pStack2; + static const SwFlyFrame* s_pStack3; + static const SwFlyFrame* s_pStack4; + static const SwFlyFrame* s_pStack5; const SwFlyFrame* m_pFly; std::vector<Point> maObjPositions; @@ -224,54 +224,54 @@ public: } -const SwFlyFrame* SwOszControl::m_pStack1 = nullptr; -const SwFlyFrame* SwOszControl::m_pStack2 = nullptr; -const SwFlyFrame* SwOszControl::m_pStack3 = nullptr; -const SwFlyFrame* SwOszControl::m_pStack4 = nullptr; -const SwFlyFrame* SwOszControl::m_pStack5 = nullptr; +const SwFlyFrame* SwOszControl::s_pStack1 = nullptr; +const SwFlyFrame* SwOszControl::s_pStack2 = nullptr; +const SwFlyFrame* SwOszControl::s_pStack3 = nullptr; +const SwFlyFrame* SwOszControl::s_pStack4 = nullptr; +const SwFlyFrame* SwOszControl::s_pStack5 = nullptr; SwOszControl::SwOszControl(const SwFlyFrame* pFrame) : m_pFly(pFrame) { - if (!SwOszControl::m_pStack1) - SwOszControl::m_pStack1 = m_pFly; - else if (!SwOszControl::m_pStack2) - SwOszControl::m_pStack2 = m_pFly; - else if (!SwOszControl::m_pStack3) - SwOszControl::m_pStack3 = m_pFly; - else if (!SwOszControl::m_pStack4) - SwOszControl::m_pStack4 = m_pFly; - else if (!SwOszControl::m_pStack5) - SwOszControl::m_pStack5 = m_pFly; + if (!SwOszControl::s_pStack1) + SwOszControl::s_pStack1 = m_pFly; + else if (!SwOszControl::s_pStack2) + SwOszControl::s_pStack2 = m_pFly; + else if (!SwOszControl::s_pStack3) + SwOszControl::s_pStack3 = m_pFly; + else if (!SwOszControl::s_pStack4) + SwOszControl::s_pStack4 = m_pFly; + else if (!SwOszControl::s_pStack5) + SwOszControl::s_pStack5 = m_pFly; } SwOszControl::~SwOszControl() { - if (SwOszControl::m_pStack1 == m_pFly) - SwOszControl::m_pStack1 = nullptr; - else if (SwOszControl::m_pStack2 == m_pFly) - SwOszControl::m_pStack2 = nullptr; - else if (SwOszControl::m_pStack3 == m_pFly) - SwOszControl::m_pStack3 = nullptr; - else if (SwOszControl::m_pStack4 == m_pFly) - SwOszControl::m_pStack4 = nullptr; - else if (SwOszControl::m_pStack5 == m_pFly) - SwOszControl::m_pStack5 = nullptr; + if (SwOszControl::s_pStack1 == m_pFly) + SwOszControl::s_pStack1 = nullptr; + else if (SwOszControl::s_pStack2 == m_pFly) + SwOszControl::s_pStack2 = nullptr; + else if (SwOszControl::s_pStack3 == m_pFly) + SwOszControl::s_pStack3 = nullptr; + else if (SwOszControl::s_pStack4 == m_pFly) + SwOszControl::s_pStack4 = nullptr; + else if (SwOszControl::s_pStack5 == m_pFly) + SwOszControl::s_pStack5 = nullptr; // #i3317# maObjPositions.clear(); } bool SwOszControl::IsInProgress( const SwFlyFrame *pFly ) { - if (SwOszControl::m_pStack1 && !pFly->IsLowerOf(SwOszControl::m_pStack1)) + if (SwOszControl::s_pStack1 && !pFly->IsLowerOf(SwOszControl::s_pStack1)) return true; - if (SwOszControl::m_pStack2 && !pFly->IsLowerOf(SwOszControl::m_pStack2)) + if (SwOszControl::s_pStack2 && !pFly->IsLowerOf(SwOszControl::s_pStack2)) return true; - if (SwOszControl::m_pStack3 && !pFly->IsLowerOf(SwOszControl::m_pStack3)) + if (SwOszControl::s_pStack3 && !pFly->IsLowerOf(SwOszControl::s_pStack3)) return true; - if (SwOszControl::m_pStack4 && !pFly->IsLowerOf(SwOszControl::m_pStack4)) + if (SwOszControl::s_pStack4 && !pFly->IsLowerOf(SwOszControl::s_pStack4)) return true; - if (SwOszControl::m_pStack5 && !pFly->IsLowerOf(SwOszControl::m_pStack5)) + if (SwOszControl::s_pStack5 && !pFly->IsLowerOf(SwOszControl::s_pStack5)) return true; return false; } diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 947f0f520141..7f60bb165ad5 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -82,8 +82,8 @@ bool bObjsDirect = true; bool bDontCreateObjects = false; bool bSetCompletePaintOnInvalidate = false; -sal_uInt8 StackHack::nCnt = 0; -bool StackHack::bLocked = false; +sal_uInt8 StackHack::s_nCnt = 0; +bool StackHack::s_bLocked = false; SwFrameNotify::SwFrameNotify( SwFrame *pF ) : mpFrame( pF ), @@ -3621,44 +3621,48 @@ namespace { class SwFrameHolder : private SfxListener { - SwFrame* pFrame; - bool bSet; + SwFrame* m_pFrame; + bool m_bSet; virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; public: - SwFrameHolder() : pFrame(nullptr), bSet(false) {} + SwFrameHolder() + : m_pFrame(nullptr) + , m_bSet(false) + { + } void SetFrame( SwFrame* pHold ); - SwFrame* GetFrame() { return pFrame; } + SwFrame* GetFrame() { return m_pFrame; } void Reset(); - bool IsSet() const { return bSet; } + bool IsSet() const { return m_bSet; } }; } void SwFrameHolder::SetFrame( SwFrame* pHold ) { - bSet = true; - if (pFrame != pHold) + m_bSet = true; + if (m_pFrame != pHold) { - if (pFrame) - EndListening(*pFrame); + if (m_pFrame) + EndListening(*m_pFrame); StartListening(*pHold); - pFrame = pHold; + m_pFrame = pHold; } } void SwFrameHolder::Reset() { - if (pFrame) - EndListening(*pFrame); - bSet = false; - pFrame = nullptr; + if (m_pFrame) + EndListening(*m_pFrame); + m_bSet = false; + m_pFrame = nullptr; } void SwFrameHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if ( rHint.GetId() == SfxHintId::Dying && &rBC == pFrame ) + if (rHint.GetId() == SfxHintId::Dying && &rBC == m_pFrame) { - pFrame = nullptr; + m_pFrame = nullptr; } } diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index f64c3251a24b..f28191d0600f 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -455,14 +455,14 @@ SwLayoutCache::~SwLayoutCache() SwActualSection::SwActualSection( SwActualSection *pUp, SwSectionFrame *pSect, SwSectionNode *pNd ) : - pUpper( pUp ), - pSectFrame( pSect ), - pSectNode( pNd ) + m_pUpper( pUp ), + m_pSectFrame( pSect ), + m_pSectNode( pNd ) { - if ( !pSectNode ) + if ( !m_pSectNode ) { const SwNodeIndex *pIndex = pSect->GetFormat()->GetContent().GetContentIdx(); - pSectNode = pIndex->GetNode().FindSectionNode(); + m_pSectNode = pIndex->GetNode().FindSectionNode(); } } diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx index 25858f49ac4b..8408b311742d 100644 --- a/sw/source/core/layout/layhelp.hxx +++ b/sw/source/core/layout/layhelp.hxx @@ -83,19 +83,19 @@ public: // by controlling nested sections. class SwActualSection { - SwActualSection *pUpper; - SwSectionFrame *pSectFrame; - SwSectionNode *pSectNode; + SwActualSection *m_pUpper; + SwSectionFrame *m_pSectFrame; + SwSectionNode *m_pSectNode; public: SwActualSection( SwActualSection *pUpper, SwSectionFrame *pSect, SwSectionNode *pNd ); - SwSectionFrame *GetSectionFrame() { return pSectFrame; } - void SetSectionFrame( SwSectionFrame *p ) { pSectFrame = p; } - SwSectionNode *GetSectionNode() { return pSectNode;} - void SetUpper(SwActualSection *p) { pUpper = p; } - SwActualSection *GetUpper() { return pUpper; } + SwSectionFrame *GetSectionFrame() { return m_pSectFrame; } + void SetSectionFrame( SwSectionFrame *p ) { m_pSectFrame = p; } + SwSectionNode *GetSectionNode() { return m_pSectNode;} + void SetUpper(SwActualSection *p) { m_pUpper = p; } + SwActualSection *GetUpper() { return m_pUpper; } }; /// Helps during the InsertCnt_ function to create new pages. |