summaryrefslogtreecommitdiff
path: root/sw/inc/ndhints.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/inc/ndhints.hxx')
-rw-r--r--sw/inc/ndhints.hxx26
1 files changed, 15 insertions, 11 deletions
diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index 6643a6a920c3..88f61a8700d7 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -77,6 +77,8 @@ class SwpHtEnd : public o3tl::sorted_vector<SwTextAttr*, CompareSwpHtEnd,
class SwpHints
{
private:
+ const SwTextNode& m_rParent;
+
// SAL_MAX_SIZE is used by GetStartOf to return
// failure, so just allow SAL_MAX_SIZE-1 hints
static const size_t MAX_HINTS = SAL_MAX_SIZE-1;
@@ -88,9 +90,11 @@ private:
/// true: the Node is in Split and Frames are moved
bool m_bInSplitNode : 1;
- /// m_bHasHiddenParaField is invalid, call CalcHiddenParaField()
- bool m_bCalcHiddenParaField : 1;
- bool m_bHasHiddenParaField : 1; ///< HiddenParaField
+ // m_bHiddenByParaField is invalid, call CalcHiddenParaField()
+ mutable bool m_bCalcHiddenParaField : 1;
+ // if all fields controlling visibility of the paragraph require to hide it
+ // (if there's no such fields, or if any field requires to show, then this is false)
+ mutable bool m_bHiddenByParaField : 1;
bool m_bFootnote : 1; ///< footnotes
bool m_bDDEFields : 1; ///< the TextNode has DDE fields
@@ -108,15 +112,15 @@ private:
void Delete( SwTextAttr* pTextHt );
void SetInSplitNode(bool bInSplit) { m_bInSplitNode = bInSplit; }
- void SetCalcHiddenParaField() { m_bCalcHiddenParaField = true; }
- void SetHiddenParaField( const bool bNew ) { m_bHasHiddenParaField = bNew; }
- bool HasHiddenParaField() const
+ void SetCalcHiddenParaField() const { m_bCalcHiddenParaField = true; }
+ void SetHiddenByParaField( const bool bNew ) const { m_bHiddenByParaField = bNew; }
+ bool IsHiddenByParaField() const
{
if ( m_bCalcHiddenParaField )
{
- (const_cast<SwpHints*>(this))->CalcHiddenParaField();
+ CalcHiddenParaField();
}
- return m_bHasHiddenParaField;
+ return m_bHiddenByParaField;
}
void InsertNesting(SwTextAttrNesting & rNewHint);
@@ -144,7 +148,7 @@ private:
#endif
public:
- SwpHints();
+ SwpHints(const SwTextNode& rParent);
size_t Count() const { return m_HintsByStart.size(); }
bool Contains( const SwTextAttr *pHt ) const;
@@ -179,8 +183,8 @@ public:
bool HasFootnote() const { return m_bFootnote; }
bool IsInSplitNode() const { return m_bInSplitNode; }
- /// calc current value of m_bHasHiddenParaField, returns true iff changed
- bool CalcHiddenParaField();
+ // calc current value of m_bHiddenByParaField, returns true iff changed
+ bool CalcHiddenParaField() const; // changes mutable state
DECL_FIXEDMEMPOOL_NEWDEL(SwpHints)
};