summaryrefslogtreecommitdiff
path: root/sw/source/uibase/inc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-11-24 17:45:31 +0100
committerMichael Stahl <mstahl@redhat.com>2016-11-30 16:07:51 +0000
commit2509a590303ccd6dd40f2ae3c82284ad568924a8 (patch)
tree3a61e27caa2f417e0f509ad8f9321673ed4f9131 /sw/source/uibase/inc
parentc7e3d18053b3e841937d8cf5155ef5e43c5dca91 (diff)
SwContentTree: those 3 booleans are mutually exclusive
Which is not immediately obvious but SwContentTree::Display() will set them accordingly, and it looks like none of the code that currently sees 0 or 2 booleans set checks them before Display() cleans them up. Replace with a state enum which is much more obvious. Change-Id: I75aaf10dd2e8e1e0547bad1fabb1b6ab48220d62 (cherry picked from commit 502f0cde77bd45979ba3562e80b59a7d5fd8dc56) Reviewed-on: https://gerrit.libreoffice.org/31430 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/source/uibase/inc')
-rw-r--r--sw/source/uibase/inc/conttree.hxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx
index 4dd2bf4db31a..5d61660c55bb 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -85,9 +85,8 @@ class SwContentTree
ContentTypeId m_nLastSelType;
sal_uInt8 m_nOutlineLevel;
- bool m_bIsActive :1;
- bool m_bIsConstant :1;
- bool m_bIsHidden :1;
+ enum class State { ACTIVE, CONSTANT, HIDDEN } m_eState;
+
bool m_bDocChgdInDragging :1;
bool m_bIsInternalDrag :1;
bool m_bIsRoot :1;
@@ -184,9 +183,7 @@ public:
void SetConstantShell(SwWrtShell* pSh);
SwWrtShell* GetWrtShell()
- {return m_bIsActive||m_bIsConstant ?
- m_pActiveShell :
- m_pHiddenShell;}
+ { return State::HIDDEN == m_eState ? m_pHiddenShell : m_pActiveShell; }
static bool IsInDrag() {return bIsInDrag;}
@@ -205,9 +202,9 @@ public:
/** folded together will not be glidled */
void HideTree();
- bool IsConstantView() {return m_bIsConstant;}
- bool IsActiveView() {return m_bIsActive;}
- bool IsHiddenView() {return m_bIsHidden;}
+ bool IsConstantView() { return State::CONSTANT == m_eState; }
+ bool IsActiveView() { return State::ACTIVE == m_eState; }
+ bool IsHiddenView() { return State::HIDDEN == m_eState; }
const SwWrtShell* GetActiveWrtShell() {return m_pActiveShell;}
SwWrtShell* GetHiddenWrtShell() {return m_pHiddenShell;}