summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-12-09 15:36:47 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-12-09 15:40:24 +0100
commit3dec8b847f3522cd037c861047fc536f1bdc6f8c (patch)
tree7778cba6520a4d8a4390b1d315d0b2f431a6c977 /sw/inc
parent3cbb44bdb4ad075e4dc26d35a7dfc04cf8a8c46d (diff)
make SwNode and SwCntntNode abstract base classes
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/node.hxx29
1 files changed, 27 insertions, 2 deletions
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index f50e65f3feb9..ec8f58fb1024 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -114,7 +114,9 @@ protected:
SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNodeId );
public:
- virtual ~SwNode();
+ // the = 0 forces the class to be an abstract base class, but the dtor can be still called
+ // from subclasses
+ virtual ~SwNode() = 0;
#ifdef DBG_UTIL
long GetSerial() const { return m_nSerial; }
@@ -387,7 +389,9 @@ class SW_DLLPUBLIC SwCntntNode: public SwModify, public SwNode, public SwIndexRe
protected:
SwCntntNode( const SwNodeIndex &rWhere, const sal_uInt8 nNodeType,
SwFmtColl *pFmtColl );
- virtual ~SwCntntNode();
+ // the = 0 forces the class to be an abstract base class, but the dtor can be still called
+ // from subclasses
+ virtual ~SwCntntNode() = 0;
// Attribute-set for all auto attributes of a CntntNode.
// (e.g. TxtNode or NoTxtNode).
@@ -601,6 +605,21 @@ public:
};
+//----------------
+// SwDummySectionNode
+//----------------
+
+// This class is internal. And quite frankly I don't know what ND_SECTIONDUMMY is for,
+// the class has been merely created to replace "SwNode( ND_SECTIONDUMMY )", the only case
+// of instantiating SwNode directly. Now SwNode can be an abstract base class.
+class SwDummySectionNode
+ : private SwNode
+{
+private:
+ friend class SwNodes;
+ SwDummySectionNode( const SwNodeIndex &rWhere );
+};
+
inline SwEndNode *SwNode::GetEndNode()
{
@@ -756,6 +775,12 @@ inline const SfxPoolItem& SwCntntNode::GetAttr( sal_uInt16 nWhich,
{
return GetSwAttrSet().Get( nWhich, bInParents );
}
+
+inline SwDummySectionNode::SwDummySectionNode( const SwNodeIndex &rWhere )
+ : SwNode( rWhere, ND_SECTIONDUMMY )
+{
+}
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */