summaryrefslogtreecommitdiff
path: root/sw/inc/ndtyp.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-29 09:22:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-29 08:20:23 +0000
commitb8aa1def37b62091f15bf09529104ca38333d5f5 (patch)
treec9e61d8b33d24283a8639ac3d4269801d5e7e69f /sw/inc/ndtyp.hxx
parent53a156fc3b500f5647493319acb264ba24b2b3fb (diff)
convert ND constants to o3tl::typed_flags
Change-Id: I5fe3df5515017ec24db1184e8aca823714fcfdb3 Reviewed-on: https://gerrit.libreoffice.org/31343 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc/ndtyp.hxx')
-rw-r--r--sw/inc/ndtyp.hxx27
1 files changed, 17 insertions, 10 deletions
diff --git a/sw/inc/ndtyp.hxx b/sw/inc/ndtyp.hxx
index 081ccadf1637..6e1909bdf721 100644
--- a/sw/inc/ndtyp.hxx
+++ b/sw/inc/ndtyp.hxx
@@ -21,22 +21,29 @@
#define INCLUDED_SW_INC_NDTYP_HXX
#include <tools/solar.h>
+#include <o3tl/typed_flags_set.hxx>
// IDs for different nodes. The member indicating the type of node is
// in base class.
-const sal_uInt8 ND_ENDNODE = 0x01;
-const sal_uInt8 ND_STARTNODE = 0x02;
-const sal_uInt8 ND_TABLENODE = 0x04 | ND_STARTNODE; ///< SwTableNode is derived from SwStartNode.
-const sal_uInt8 ND_TEXTNODE = 0x08;
-const sal_uInt8 ND_GRFNODE = 0x10;
-const sal_uInt8 ND_OLENODE = 0x20;
-const sal_uInt8 ND_SECTIONNODE = 0x40 | ND_STARTNODE; ///< SwSectionNode is derived from SwStartNode.
-const sal_uInt8 ND_PLACEHOLDER = 0x80;
+enum class SwNodeType : sal_uInt8 {
+ NONE = 0x00,
+ End = 0x01,
+ Start = 0x02,
+ Table = 0x04 | Start, ///< SwTableNode is derived from SwStartNode.
+ Text = 0x08,
+ Grf = 0x10,
+ Ole = 0x20,
+ Section = 0x40 | Start, ///< SwSectionNode is derived from SwStartNode.
+ PlaceHolder = 0x80,
// NoTextNode (if any of the 2 bits are set).
-const sal_uInt8 ND_NOTXTNODE = ND_GRFNODE | ND_OLENODE;
+ NoTextMask = Grf | Ole,
// ContentNode (if any of the 3 bits are set).
-const sal_uInt8 ND_CONTENTNODE = ND_TEXTNODE | ND_NOTXTNODE;
+ ContentMask = Text | NoTextMask,
+};
+namespace o3tl {
+ template<> struct typed_flags<SwNodeType> : is_typed_flags<SwNodeType, 0xff> {};
+}
// Special types of StartNodes that are not derivations but keep
// "sections" together.