[Libreoffice-commits] core.git: sw/inc sw/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Nov 29 08:20:58 UTC 2016


 sw/inc/crsrsh.hxx                                       |    2 
 sw/inc/doc.hxx                                          |    2 
 sw/inc/ndgrf.hxx                                        |    4 -
 sw/inc/ndnotxt.hxx                                      |    6 -
 sw/inc/ndole.hxx                                        |    4 -
 sw/inc/ndtxt.hxx                                        |    4 -
 sw/inc/ndtyp.hxx                                        |   27 ++++--
 sw/inc/node.hxx                                         |   52 ++++++-------
 sw/source/core/access/accframebase.cxx                  |    4 -
 sw/source/core/access/accframebase.hxx                  |    2 
 sw/source/core/access/accmap.cxx                        |    4 -
 sw/source/core/crsr/callnk.cxx                          |   14 +--
 sw/source/core/crsr/callnk.hxx                          |    4 -
 sw/source/core/crsr/crsrsh.cxx                          |   10 +-
 sw/source/core/doc/DocumentContentOperationsManager.cxx |    2 
 sw/source/core/doc/DocumentLayoutManager.cxx            |    8 +-
 sw/source/core/doc/DocumentStatisticsManager.cxx        |   15 ++-
 sw/source/core/doc/doccomp.cxx                          |   43 ++++++----
 sw/source/core/doc/docedt.cxx                           |    7 +
 sw/source/core/doc/docfmt.cxx                           |    2 
 sw/source/core/doc/doclay.cxx                           |   19 ++--
 sw/source/core/doc/docnew.cxx                           |    2 
 sw/source/core/doc/docnum.cxx                           |    8 +-
 sw/source/core/doc/notxtfrm.cxx                         |    6 -
 sw/source/core/docnode/ndnotxt.cxx                      |    2 
 sw/source/core/docnode/ndsect.cxx                       |    2 
 sw/source/core/docnode/ndtbl.cxx                        |   14 +--
 sw/source/core/docnode/node.cxx                         |   61 +++++++--------
 sw/source/core/docnode/nodes.cxx                        |   64 ++++++++--------
 sw/source/core/edit/edattr.cxx                          |    6 -
 sw/source/core/edit/editsh.cxx                          |    9 --
 sw/source/core/edit/edws.cxx                            |    7 +
 sw/source/core/frmedt/feshview.cxx                      |   10 +-
 sw/source/core/graphic/ndgrf.cxx                        |    6 -
 sw/source/core/inc/rolbck.hxx                           |    6 -
 sw/source/core/ole/ndole.cxx                            |    4 -
 sw/source/core/txtnode/ndtxt.cxx                        |   14 +--
 sw/source/core/undo/rolbck.cxx                          |    6 -
 sw/source/core/undo/undel.cxx                           |    4 -
 sw/source/core/undo/unins.cxx                           |   12 +--
 sw/source/core/undo/unmove.cxx                          |    6 -
 sw/source/core/undo/untbl.cxx                           |    4 -
 sw/source/core/unocore/unocoll.cxx                      |   12 +--
 sw/source/core/unocore/unoobj2.cxx                      |    6 -
 sw/source/core/unocore/unoredline.cxx                   |    6 -
 sw/source/core/unocore/unotext.cxx                      |    4 -
 sw/source/filter/writer/wrt_fn.cxx                      |    6 -
 sw/source/filter/ww8/writerhelper.cxx                   |    4 -
 sw/source/filter/ww8/wrtw8esh.cxx                       |    4 -
 sw/source/filter/ww8/wrtw8nds.cxx                       |   15 +--
 sw/source/filter/ww8/ww8par2.cxx                        |    4 -
 sw/source/uibase/dochdl/swdtflvr.cxx                    |    4 -
 52 files changed, 284 insertions(+), 269 deletions(-)

New commits:
commit b8aa1def37b62091f15bf09529104ca38333d5f5
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Nov 29 09:22:43 2016 +0200

    convert ND constants to o3tl::typed_flags
    
    Change-Id: I5fe3df5515017ec24db1184e8aca823714fcfdb3
    Reviewed-on: https://gerrit.libreoffice.org/31343
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index ca5a772..10e13a1 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -188,7 +188,7 @@ private:
     long m_nLeftFramePos;
     sal_uLong m_nAktNode;             // save CursorPos at Start-Action
     sal_Int32 m_nAktContent;
-    sal_uInt16 m_nAktNdTyp;
+    SwNodeType m_nAktNdTyp;
     bool m_bAktSelection;
 
     /*
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 90ec570..175dc6e 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -715,7 +715,7 @@ public:
     std::set<SwRootFrame*> GetAllLayouts();
 
     void SetFlyName( SwFlyFrameFormat& rFormat, const OUString& rName );
-    const SwFlyFrameFormat* FindFlyByName( const OUString& rName, sal_Int8 nNdTyp = 0 ) const;
+    const SwFlyFrameFormat* FindFlyByName( const OUString& rName, SwNodeType nNdTyp = SwNodeType::NONE ) const;
 
     static void GetGrfNms( const SwFlyFrameFormat& rFormat, OUString* pGrfName, OUString* pFltName );
 
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 307e8ac..326f567 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -205,12 +205,12 @@ public:
 // Inline methods from Node.hxx - it is only now that we know TextNode!!
 inline       SwGrfNode   *SwNode::GetGrfNode()
 {
-     return ND_GRFNODE == m_nNodeType ? static_cast<SwGrfNode*>(this) : nullptr;
+     return SwNodeType::Grf == m_nNodeType ? static_cast<SwGrfNode*>(this) : nullptr;
 }
 
 inline const SwGrfNode   *SwNode::GetGrfNode() const
 {
-     return ND_GRFNODE == m_nNodeType ? static_cast<const SwGrfNode*>(this) : nullptr;
+     return SwNodeType::Grf == m_nNodeType ? static_cast<const SwGrfNode*>(this) : nullptr;
 }
 
 inline bool SwGrfNode::IsLinkedFile() const
diff --git a/sw/inc/ndnotxt.hxx b/sw/inc/ndnotxt.hxx
index 69347e9c7..7ba253e 100644
--- a/sw/inc/ndnotxt.hxx
+++ b/sw/inc/ndnotxt.hxx
@@ -45,7 +45,7 @@ class SW_DLLPUBLIC SwNoTextNode : public SwContentNode
     SwNoTextNode &operator=( const SwNoTextNode& ) = delete;
 
 protected:
-    SwNoTextNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
+    SwNoTextNode( const SwNodeIndex &rWhere, const SwNodeType nNdType,
                 SwGrfFormatColl *pGrColl, SwAttrSet* pAutoAttr );
 
 public:
@@ -93,11 +93,11 @@ public:
 // Inline methods from Node.hxx - we know TextNode only here!!
 inline SwNoTextNode *SwNode::GetNoTextNode()
 {
-    return ND_NOTXTNODE & m_nNodeType ? static_cast<SwNoTextNode*>(this) : nullptr;
+    return SwNodeType::NoTextMask & m_nNodeType ? static_cast<SwNoTextNode*>(this) : nullptr;
 }
 inline const SwNoTextNode *SwNode::GetNoTextNode() const
 {
-    return ND_NOTXTNODE & m_nNodeType ? static_cast<const SwNoTextNode*>(this) : nullptr;
+    return SwNodeType::NoTextMask & m_nNodeType ? static_cast<const SwNoTextNode*>(this) : nullptr;
 }
 
 #endif // INCLUDED_SW_INC_NDNOTXT_HXX
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 28d427d..c878689 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -153,12 +153,12 @@ public:
 /// Inline methods from Node.hxx
 inline SwOLENode *SwNode::GetOLENode()
 {
-     return ND_OLENODE == m_nNodeType ? static_cast<SwOLENode*>(this) : nullptr;
+     return SwNodeType::Ole == m_nNodeType ? static_cast<SwOLENode*>(this) : nullptr;
 }
 
 inline const SwOLENode *SwNode::GetOLENode() const
 {
-     return ND_OLENODE == m_nNodeType ? static_cast<const SwOLENode*>(this) : nullptr;
+     return SwNodeType::Ole == m_nNodeType ? static_cast<const SwOLENode*>(this) : nullptr;
 }
 
 #endif  // _ INCLUDED_SW_INC_NDOLE_HXX
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 87f4a7b..6bbaf2e 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -833,12 +833,12 @@ inline SwTextFormatColl* SwTextNode::GetTextColl() const
 /// Inline methods from Node.hxx
 inline SwTextNode *SwNode::GetTextNode()
 {
-     return ND_TEXTNODE == m_nNodeType ? static_cast<SwTextNode*>(this) : nullptr;
+     return SwNodeType::Text == m_nNodeType ? static_cast<SwTextNode*>(this) : nullptr;
 }
 
 inline const SwTextNode *SwNode::GetTextNode() const
 {
-     return ND_TEXTNODE == m_nNodeType ? static_cast<const SwTextNode*>(this) : nullptr;
+     return SwNodeType::Text == m_nNodeType ? static_cast<const SwTextNode*>(this) : nullptr;
 }
 
 inline void
diff --git a/sw/inc/ndtyp.hxx b/sw/inc/ndtyp.hxx
index 081ccad..6e1909b 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.
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 173f3d0..f0ab99f 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -82,7 +82,7 @@ class SW_DLLPUBLIC SwNode
 {
     friend class SwNodes;
 
-    sal_uInt8 m_nNodeType;
+    SwNodeType m_nNodeType;
 
     /// For text nodes: level of auto format. Was put here because we had still free bits.
     sal_uInt8 m_nAFormatNumLvl : 3;
@@ -102,10 +102,10 @@ class SW_DLLPUBLIC SwNode
 protected:
     SwStartNode* m_pStartOfSection;
 
-    SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNodeId );
+    SwNode( const SwNodeIndex &rWhere, const SwNodeType nNodeId );
 
     /// for the initial StartNode
-    SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNodeId );
+    SwNode( SwNodes& rNodes, sal_uLong nPos, const SwNodeType nNodeId );
 
 public:
     /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
@@ -134,7 +134,7 @@ public:
     inline bool IsIgnoreDontExpand() const  { return m_bIgnoreDontExpand; }
     inline void SetIgnoreDontExpand( bool bNew )  { m_bIgnoreDontExpand = bNew; }
 
-    sal_uInt8   GetNodeType() const { return m_nNodeType; }
+    SwNodeType   GetNodeType() const { return m_nNodeType; }
 
     inline       SwStartNode *GetStartNode();
     inline const SwStartNode *GetStartNode() const;
@@ -311,7 +311,7 @@ class SwStartNode: public SwNode
 
 protected:
     SwStartNode( const SwNodeIndex &rWhere,
-                 const sal_uInt8 nNodeType = ND_STARTNODE,
+                 const SwNodeType nNodeType = SwNodeType::Start,
                  SwStartNodeType = SwNormalStartNode );
 public:
     DECL_FIXEDMEMPOOL_NEWDEL(SwStartNode)
@@ -359,7 +359,7 @@ class SW_DLLPUBLIC SwContentNode: public SwModify, public SwNode, public SwIndex
     mutable bool mbSetModifyAtAttr;
 
 protected:
-    SwContentNode( const SwNodeIndex &rWhere, const sal_uInt8 nNodeType,
+    SwContentNode( const SwNodeIndex &rWhere, const SwNodeType nNodeType,
                 SwFormatColl *pFormatColl );
     /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
        from subclasses */
@@ -585,80 +585,80 @@ private:
 
 inline       SwEndNode   *SwNode::GetEndNode()
 {
-     return ND_ENDNODE == m_nNodeType ? static_cast<SwEndNode*>(this) : nullptr;
+     return SwNodeType::End == m_nNodeType ? static_cast<SwEndNode*>(this) : nullptr;
 }
 inline const SwEndNode   *SwNode::GetEndNode() const
 {
-     return ND_ENDNODE == m_nNodeType ? static_cast<const SwEndNode*>(this) : nullptr;
+     return SwNodeType::End == m_nNodeType ? static_cast<const SwEndNode*>(this) : nullptr;
 }
 inline       SwStartNode *SwNode::GetStartNode()
 {
-     return ND_STARTNODE & m_nNodeType ? static_cast<SwStartNode*>(this) : nullptr;
+     return SwNodeType::Start & m_nNodeType ? static_cast<SwStartNode*>(this) : nullptr;
 }
 inline const SwStartNode *SwNode::GetStartNode() const
 {
-     return ND_STARTNODE & m_nNodeType ? static_cast<const SwStartNode*>(this) : nullptr;
+     return SwNodeType::Start & m_nNodeType ? static_cast<const SwStartNode*>(this) : nullptr;
 }
 inline       SwTableNode *SwNode::GetTableNode()
 {
-     return ND_TABLENODE == m_nNodeType ? static_cast<SwTableNode*>(this) : nullptr;
+     return SwNodeType::Table == m_nNodeType ? static_cast<SwTableNode*>(this) : nullptr;
 }
 inline const SwTableNode *SwNode::GetTableNode() const
 {
-     return ND_TABLENODE == m_nNodeType ? static_cast<const SwTableNode*>(this) : nullptr;
+     return SwNodeType::Table == m_nNodeType ? static_cast<const SwTableNode*>(this) : nullptr;
 }
 inline       SwSectionNode *SwNode::GetSectionNode()
 {
-     return ND_SECTIONNODE == m_nNodeType ? static_cast<SwSectionNode*>(this) : nullptr;
+     return SwNodeType::Section == m_nNodeType ? static_cast<SwSectionNode*>(this) : nullptr;
 }
 inline const SwSectionNode *SwNode::GetSectionNode() const
 {
-     return ND_SECTIONNODE == m_nNodeType ? static_cast<const SwSectionNode*>(this) : nullptr;
+     return SwNodeType::Section == m_nNodeType ? static_cast<const SwSectionNode*>(this) : nullptr;
 }
 inline       SwContentNode *SwNode::GetContentNode()
 {
-     return ND_CONTENTNODE & m_nNodeType ? static_cast<SwContentNode*>(this) : nullptr;
+     return SwNodeType::ContentMask & m_nNodeType ? static_cast<SwContentNode*>(this) : nullptr;
 }
 inline const SwContentNode *SwNode::GetContentNode() const
 {
-     return ND_CONTENTNODE & m_nNodeType ? static_cast<const SwContentNode*>(this) : nullptr;
+     return SwNodeType::ContentMask & m_nNodeType ? static_cast<const SwContentNode*>(this) : nullptr;
 }
 
 inline bool SwNode::IsStartNode() const
 {
-    return (ND_STARTNODE & m_nNodeType) != 0;
+    return bool(SwNodeType::Start & m_nNodeType);
 }
 inline bool SwNode::IsContentNode() const
 {
-    return (ND_CONTENTNODE & m_nNodeType) != 0;
+    return bool(SwNodeType::ContentMask & m_nNodeType);
 }
 inline bool SwNode::IsEndNode() const
 {
-    return ND_ENDNODE == m_nNodeType;
+    return SwNodeType::End == m_nNodeType;
 }
 inline bool SwNode::IsTextNode() const
 {
-    return ND_TEXTNODE == m_nNodeType;
+    return SwNodeType::Text == m_nNodeType;
 }
 inline bool SwNode::IsTableNode() const
 {
-    return ND_TABLENODE == m_nNodeType;
+    return SwNodeType::Table == m_nNodeType;
 }
 inline bool SwNode::IsSectionNode() const
 {
-    return ND_SECTIONNODE == m_nNodeType;
+    return SwNodeType::Section == m_nNodeType;
 }
 inline bool SwNode::IsNoTextNode() const
 {
-    return (ND_NOTXTNODE & m_nNodeType) != 0;
+    return bool(SwNodeType::NoTextMask & m_nNodeType);
 }
 inline bool SwNode::IsOLENode() const
 {
-    return ND_OLENODE == m_nNodeType;
+    return SwNodeType::Ole == m_nNodeType;
 }
 inline bool SwNode::IsGrfNode() const
 {
-    return ND_GRFNODE == m_nNodeType;
+    return SwNodeType::Grf == m_nNodeType;
 }
 
 inline const SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp ) const
@@ -737,7 +737,7 @@ inline const SfxPoolItem& SwContentNode::GetAttr( sal_uInt16 nWhich,
 }
 
 inline SwPlaceholderNode::SwPlaceholderNode(const SwNodeIndex &rWhere)
-    : SwNode(rWhere, ND_PLACEHOLDER)
+    : SwNode(rWhere, SwNodeType::PlaceHolder)
 {
 }
 
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index 1382315..e402179 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -94,9 +94,9 @@ void SwAccessibleFrameBase::GetStates(
         rStateSet.AddState( AccessibleStateType::SELECTED );
 }
 
-sal_uInt8 SwAccessibleFrameBase::GetNodeType( const SwFlyFrame *pFlyFrame )
+SwNodeType SwAccessibleFrameBase::GetNodeType( const SwFlyFrame *pFlyFrame )
 {
-    sal_uInt8 nType = ND_TEXTNODE;
+    SwNodeType nType = SwNodeType::Text;
     if( pFlyFrame->Lower() )
     {
          if( pFlyFrame->Lower()->IsNoTextFrame() )
diff --git a/sw/source/core/access/accframebase.hxx b/sw/source/core/access/accframebase.hxx
index 6809fb0..89ed1c0 100644
--- a/sw/source/core/access/accframebase.hxx
+++ b/sw/source/core/access/accframebase.hxx
@@ -54,7 +54,7 @@ public:
 
     virtual bool HasCursor() override;   // required by map to remember that object
 
-    static sal_uInt8 GetNodeType( const SwFlyFrame *pFlyFrame );
+    static SwNodeType GetNodeType( const SwFlyFrame *pFlyFrame );
 
     // The object is not visible an longer and should be destroyed
     virtual void Dispose(bool bRecursive, bool bCanSkipInvisible = true) override;
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 2e7cc70..02b7a49 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1887,10 +1887,10 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrame *pFrame,
                             static_cast < const SwFlyFrame * >( pFrame );
                         switch( SwAccessibleFrameBase::GetNodeType( pFlyFrame ) )
                         {
-                        case ND_GRFNODE:
+                        case SwNodeType::Grf:
                             pAcc = new SwAccessibleGraphic( this, pFlyFrame );
                             break;
-                        case ND_OLENODE:
+                        case SwNodeType::Ole:
                             pAcc = new SwAccessibleEmbeddedObject( this, pFlyFrame );
                             break;
                         default:
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 6e97ba4..24bfb61 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -37,7 +37,7 @@
 #include <vcl/window.hxx>
 
 SwCallLink::SwCallLink( SwCursorShell & rSh, sal_uLong nAktNode, sal_Int32 nAktContent,
-                        sal_uInt8 nAktNdTyp, long nLRPos, bool bAktSelection )
+                        SwNodeType nAktNdTyp, long nLRPos, bool bAktSelection )
     : rShell( rSh ), nNode( nAktNode ), nContent( nAktContent ),
       nNdTyp( nAktNdTyp ), nLeftFramePos( nLRPos ),
       bHasSelection( bAktSelection )
@@ -66,9 +66,9 @@ SwCallLink::SwCallLink( SwCursorShell & rSh )
         // When deleting the header/footer, footnotes SwFeShell sets the
         // Cursor to NULL (Node + Content).
         // If the Cursor is not on a ContentNode (ContentNode) this fact gets
-        // saved in NdType.
-        if( ND_CONTENTNODE & nNdTyp )
-            nNdTyp = 0;
+        // saved in nNdType.
+        if( SwNodeType::ContentMask & nNdTyp )
+            nNdTyp = SwNodeType::NONE;
     }
 }
 
@@ -105,7 +105,7 @@ static void lcl_notifyRow(const SwContentNode* pNode, SwCursorShell& rShell)
 
 SwCallLink::~SwCallLink()
 {
-    if( !nNdTyp || !rShell.m_bCallChgLnk ) // see ctor
+    if( nNdTyp == SwNodeType::NONE || !rShell.m_bCallChgLnk ) // see ctor
         return ;
 
     // If travelling over Nodes check formats and register them anew at the
@@ -126,7 +126,7 @@ SwCallLink::~SwCallLink()
     lcl_notifyRow(pNode, rShell);
 
     sal_Int32 nCmp, nAktContent = pCurrentCursor->GetPoint()->nContent.GetIndex();
-    sal_uInt16 nNdWhich = pCNd->GetNodeType();
+    SwNodeType nNdWhich = pCNd->GetNodeType();
     sal_uLong nAktNode = pCurrentCursor->GetPoint()->nNode.GetIndex();
 
     // Register the Shell as dependent at the current Node. By doing this all
@@ -146,7 +146,7 @@ SwCallLink::~SwCallLink()
         // always call change link when selection changes
         rShell.CallChgLnk();
     }
-    else if( rShell.m_aChgLnk.IsSet() && ND_TEXTNODE == nNdWhich &&
+    else if( rShell.m_aChgLnk.IsSet() && SwNodeType::Text == nNdWhich &&
              nContent != nAktContent )
     {
         // If travelling with left/right only and the frame is
diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx
index d2a7b4d..21e7ddf 100644
--- a/sw/source/core/crsr/callnk.hxx
+++ b/sw/source/core/crsr/callnk.hxx
@@ -32,13 +32,13 @@ public:
     SwCursorShell & rShell;
     sal_uLong nNode;
     sal_Int32 nContent;
-    sal_uInt8 nNdTyp;
+    SwNodeType nNdTyp;
     long nLeftFramePos;
     bool bHasSelection;
 
     explicit SwCallLink( SwCursorShell & rSh );
     SwCallLink( SwCursorShell & rSh, sal_uLong nAktNode, sal_Int32 nAktContent,
-                                    sal_uInt8 nAktNdTyp, long nLRPos,
+                                    SwNodeType nAktNdTyp, long nLRPos,
                                     bool bAktSelection );
     ~SwCallLink();
 
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 69ca21f..618b0e8 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -278,7 +278,7 @@ void SwCursorShell::EndAction( const bool bIdleEnd, const bool DoSetPosX )
 
             {
                 // watch Cursor-Moves, call Link if needed, the DTOR is key here!
-                SwCallLink aLk( *this, m_nAktNode, m_nAktContent, (sal_uInt8)m_nAktNdTyp,
+                SwCallLink aLk( *this, m_nAktNode, m_nAktContent, m_nAktNdTyp,
                                 m_nLeftFramePos, m_bAktSelection );
 
             }
@@ -299,7 +299,7 @@ void SwCursorShell::EndAction( const bool bIdleEnd, const bool DoSetPosX )
     {
         SwCallLink aLk( *this );        // watch Cursor-Moves
         aLk.nNode = m_nAktNode;           // call Link if needed
-        aLk.nNdTyp = (sal_uInt8)m_nAktNdTyp;
+        aLk.nNdTyp = m_nAktNdTyp;
         aLk.nContent = m_nAktContent;
         aLk.nLeftFramePos = m_nLeftFramePos;
 
@@ -2647,7 +2647,7 @@ SwCursorShell::SwCursorShell( SwCursorShell& rShell, vcl::Window *pInitWin )
     , m_nLeftFramePos(0)
     , m_nAktNode(0)
     , m_nAktContent(0)
-    , m_nAktNdTyp(0)
+    , m_nAktNdTyp(SwNodeType::NONE)
     , m_bAktSelection(false)
     , m_nCursorMove( 0 )
     , m_nBasicActionCnt( 0 )
@@ -2685,7 +2685,7 @@ SwCursorShell::SwCursorShell( SwDoc& rDoc, vcl::Window *pInitWin,
     , m_nLeftFramePos(0)
     , m_nAktNode(0)
     , m_nAktContent(0)
-    , m_nAktNdTyp(0)
+    , m_nAktNdTyp(SwNodeType::NONE)
     , m_bAktSelection(false)
     , m_nCursorMove( 0 )
     , m_nBasicActionCnt( 0 )
@@ -2937,7 +2937,7 @@ bool SwCursorShell::FindValidContentNode( bool bOnlyText )
                     {
                         SwCallLink aTmp( *this );
                         SwCursorSaveState aSaveState( *m_pCurrentCursor );
-                        aTmp.nNdTyp = 0; // don't do anything in DTOR
+                        aTmp.nNdTyp = SwNodeType::NONE; // don't do anything in DTOR
                         if( !m_pCurrentCursor->IsInProtectTable( true ) )
                         {
                             const SwSectionNode* pSNd = pCNd->FindSectionNode();
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 9e64e0a..9bc74d0 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3188,7 +3188,7 @@ void DocumentContentOperationsManager::CopyWithFlyInFly(
             !aTmpI.GetNode().IsEndNode() )
         {
             // If the range starts with a SwStartNode, it isn't copied
-            sal_uInt16 offset = (rRg.aStart.GetNode().GetNodeType() != ND_STARTNODE) ? 1 : 0;
+            sal_uInt16 offset = (rRg.aStart.GetNode().GetNodeType() != SwNodeType::Start) ? 1 : 0;
             OSL_ENSURE( rInsPos.GetIndex() - aSavePos.GetIndex() ==
                     rRg.aEnd.GetIndex() - rRg.aStart.GetIndex() - 1 + offset,
                     "An insufficient number of nodes were copied!" );
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx
index 254a4ee..cb84403 100644
--- a/sw/source/core/doc/DocumentLayoutManager.cxx
+++ b/sw/source/core/doc/DocumentLayoutManager.cxx
@@ -416,16 +416,16 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat(
             else
             {
                 // Test first if the name is already taken, if so generate a new one.
-                sal_Int8 nNdTyp = aRg.aStart.GetNode().GetNodeType();
+                SwNodeType nNdTyp = aRg.aStart.GetNode().GetNodeType();
 
                 OUString sOld( pDest->GetName() );
                 pDest->SetName( OUString() );
                 if( m_rDoc.FindFlyByName( sOld, nNdTyp ) )     // found one
                     switch( nNdTyp )
                     {
-                    case ND_GRFNODE:    sOld = m_rDoc.GetUniqueGrfName();      break;
-                    case ND_OLENODE:    sOld = m_rDoc.GetUniqueOLEName();      break;
-                    default:            sOld = m_rDoc.GetUniqueFrameName();    break;
+                    case SwNodeType::Grf:    sOld = m_rDoc.GetUniqueGrfName();      break;
+                    case SwNodeType::Ole:    sOld = m_rDoc.GetUniqueOLEName();      break;
+                    default:                 sOld = m_rDoc.GetUniqueFrameName();    break;
                     }
 
                 pDest->SetName( sOld );
diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx
index 86c055c..46d4373 100644
--- a/sw/source/core/doc/DocumentStatisticsManager.cxx
+++ b/sw/source/core/doc/DocumentStatisticsManager.cxx
@@ -140,10 +140,10 @@ bool DocumentStatisticsManager::IncrementalDocStatCalculate(long nChars, bool bF
     // This is the inner loop - at least while the paras are dirty.
     for( sal_uLong i = m_rDoc.GetNodes().Count(); i > 0 && nChars > 0; )
     {
-        SwNode* pNd;
-        switch( ( pNd = m_rDoc.GetNodes()[ --i ])->GetNodeType() )
+        SwNode* pNd = m_rDoc.GetNodes()[ --i ];
+        switch( pNd->GetNodeType() )
         {
-        case ND_TEXTNODE:
+        case SwNodeType::Text:
         {
             long const nOldChars(mpDocStat->nChar);
             SwTextNode *pText = static_cast< SwTextNode * >( pNd );
@@ -153,10 +153,11 @@ bool DocumentStatisticsManager::IncrementalDocStatCalculate(long nChars, bool bF
             }
             break;
         }
-        case ND_TABLENODE:      ++mpDocStat->nTable;   break;
-        case ND_GRFNODE:        ++mpDocStat->nGrf;   break;
-        case ND_OLENODE:        ++mpDocStat->nOLE;   break;
-        case ND_SECTIONNODE:    break;
+        case SwNodeType::Table:      ++mpDocStat->nTable;   break;
+        case SwNodeType::Grf:        ++mpDocStat->nGrf;   break;
+        case SwNodeType::Ole:        ++mpDocStat->nOLE;   break;
+        case SwNodeType::Section:    break;
+        default: break;
         }
     }
 
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 5357682..bb0c9af 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1032,11 +1032,11 @@ sal_uLong SwCompareLine::GetHashValue() const
     sal_uLong nRet = 0;
     switch( rNode.GetNodeType() )
     {
-    case ND_TEXTNODE:
+    case SwNodeType::Text:
         nRet = GetTextNodeHashValue( *rNode.GetTextNode(), nRet );
         break;
 
-    case ND_TABLENODE:
+    case SwNodeType::Table:
         {
             const SwNode* pEndNd = rNode.EndOfSectionNode();
             SwNodeIndex aIdx( rNode );
@@ -1049,7 +1049,7 @@ sal_uLong SwCompareLine::GetHashValue() const
         }
         break;
 
-    case ND_SECTIONNODE:
+    case SwNodeType::Section:
         {
             OUString sStr( GetText() );
             for( sal_Int32 n = 0; n < sStr.getLength(); ++n )
@@ -1057,10 +1057,11 @@ sal_uLong SwCompareLine::GetHashValue() const
         }
         break;
 
-    case ND_GRFNODE:
-    case ND_OLENODE:
+    case SwNodeType::Grf:
+    case SwNodeType::Ole:
         // Fixed ID? Should never occur ...
         break;
+    default: break;
     }
     return nRet;
 }
@@ -1070,11 +1071,11 @@ const SwNode& SwCompareLine::GetEndNode() const
     const SwNode* pNd = &rNode;
     switch( rNode.GetNodeType() )
     {
-    case ND_TABLENODE:
+    case SwNodeType::Table:
         pNd = rNode.EndOfSectionNode();
         break;
 
-    case ND_SECTIONNODE:
+    case SwNodeType::Section:
         {
             const SwSectionNode& rSNd = static_cast<const SwSectionNode&>(rNode);
             const SwSection& rSect = rSNd.GetSection();
@@ -1082,6 +1083,7 @@ const SwNode& SwCompareLine::GetEndNode() const
                 pNd = rNode.EndOfSectionNode();
         }
         break;
+    default: break;
     }
     return *pNd;
 }
@@ -1123,12 +1125,12 @@ bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
 
     switch( rDstNd.GetNodeType() )
     {
-    case ND_TEXTNODE:
+    case SwNodeType::Text:
         bRet = CompareTextNd( *rDstNd.GetTextNode(), *rSrcNd.GetTextNode() )
             && ( !CmpOptions.bUseRsid || rDstNd.GetTextNode()->CompareParRsid( *rSrcNd.GetTextNode() ) );
         break;
 
-    case ND_TABLENODE:
+    case SwNodeType::Table:
         {
             const SwTableNode& rTSrcNd = static_cast<const SwTableNode&>(rSrcNd);
             const SwTableNode& rTDstNd = static_cast<const SwTableNode&>(rDstNd);
@@ -1144,7 +1146,7 @@ bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
         }
         break;
 
-    case ND_SECTIONNODE:
+    case SwNodeType::Section:
         {
             const SwSectionNode& rSSrcNd = static_cast<const SwSectionNode&>(rSrcNd),
                                & rSDstNd = static_cast<const SwSectionNode&>(rDstNd);
@@ -1191,18 +1193,20 @@ bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
         }
         break;
 
-    case ND_ENDNODE:
+    case SwNodeType::End:
         bRet = rSrcNd.StartOfSectionNode()->GetNodeType() ==
                rDstNd.StartOfSectionNode()->GetNodeType();
 
         // --> #i107826#: compare actual table content
-        if (bRet && rSrcNd.StartOfSectionNode()->GetNodeType() == ND_TABLENODE)
+        if (bRet && rSrcNd.StartOfSectionNode()->GetNodeType() == SwNodeType::Table)
         {
             bRet = CompareNode(
                 *rSrcNd.StartOfSectionNode(), *rDstNd.StartOfSectionNode());
         }
 
         break;
+
+    default: break;
     }
     return bRet;
 }
@@ -1212,17 +1216,17 @@ OUString SwCompareLine::GetText() const
     OUString sRet;
     switch( rNode.GetNodeType() )
     {
-    case ND_TEXTNODE:
+    case SwNodeType::Text:
         sRet = rNode.GetTextNode()->GetExpandText();
         break;
 
-    case ND_TABLENODE:
+    case SwNodeType::Table:
         {
             sRet = "Tabelle: " + SimpleTableToText(rNode);
         }
         break;
 
-    case ND_SECTIONNODE:
+    case SwNodeType::Section:
         {
             sRet = "Section - Node:";
 
@@ -1254,12 +1258,13 @@ OUString SwCompareLine::GetText() const
         }
         break;
 
-    case ND_GRFNODE:
+    case SwNodeType::Grf:
         sRet = "Grafik - Node:";
         break;
-    case ND_OLENODE:
+    case SwNodeType::Ole:
         sRet = "OLE - Node:";
         break;
+    default: break;
     }
     return sRet;
 }
@@ -1291,8 +1296,8 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
     bool bRet = false;
 
     // Only compare textnodes
-    if( ND_TEXTNODE == rNode.GetNodeType() &&
-        ND_TEXTNODE == rLine.GetNode().GetNodeType() )
+    if( SwNodeType::Text == rNode.GetNodeType() &&
+        SwNodeType::Text == rLine.GetNode().GetNodeType() )
     {
         SwTextNode& rDstNd = *const_cast<SwTextNode*>(rNode.GetTextNode());
         const SwTextNode& rSrcNd = *rLine.GetNode().GetTextNode();
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 88e13c6..4025cfd 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -520,7 +520,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
             SwNode* pNd = GetNodes()[ nCurrNd ];
             switch( pNd->GetNodeType() )
             {
-            case ND_TEXTNODE:
+            case SwNodeType::Text:
                 if( nullptr != ( pContentFrame = pNd->GetTextNode()->getLayoutFrame( getIDocumentLayoutAccess().GetCurrentLayout() )) )
                 {
                     // skip protected and hidden Cells and Flys
@@ -638,15 +638,16 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
                     }
                 }
                 break;
-            case ND_SECTIONNODE:
+            case SwNodeType::Section:
                 if( ( static_cast<SwSectionNode*>(pNd)->GetSection().IsProtect() ||
                     static_cast<SwSectionNode*>(pNd)->GetSection().IsHidden() ) )
                     nCurrNd = pNd->EndOfSectionIndex();
                 break;
-            case ND_ENDNODE:
+            case SwNodeType::End:
                 {
                     break;
                 }
+            default: break;
             }
 
             bGoOn = nCurrNd < nEndNd;
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 025ab92..c8a0354 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1059,7 +1059,7 @@ static bool lcl_SetTextFormatColl( const SwNodePtr& rpNode, void* pArgs )
     // add to History so that old data is saved, if necessary
     if( pPara->pHistory )
         pPara->pHistory->Add( pCNd->GetFormatColl(), pCNd->GetIndex(),
-                ND_TEXTNODE );
+                SwNodeType::Text );
 
     pCNd->ChgFormatColl( pFormat );
 
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 820a4b5..0f1c560 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -172,8 +172,8 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos,
     if( !mbInReading )
         switch( rNode.GetNodeType() )
         {
-        case ND_GRFNODE:        sName = GetUniqueGrfName();     break;
-        case ND_OLENODE:        sName = GetUniqueOLEName();     break;
+        case SwNodeType::Grf:        sName = GetUniqueGrfName();     break;
+        case SwNodeType::Ole:        sName = GetUniqueOLEName();     break;
         default:                sName = GetUniqueFrameName();   break;
         }
     SwFlyFrameFormat* pFormat = MakeFlyFrameFormat( sName, pFrameFormat );
@@ -1356,7 +1356,7 @@ OUString SwDoc::GetUniqueShapeName() const
     return lcl_GetUniqueFlyName(this, STR_SHAPE_DEFNAME, RES_DRAWFRMFMT);
 }
 
-const SwFlyFrameFormat* SwDoc::FindFlyByName( const OUString& rName, sal_Int8 nNdTyp ) const
+const SwFlyFrameFormat* SwDoc::FindFlyByName( const OUString& rName, SwNodeType nNdTyp ) const
 {
     auto range = GetSpzFrameFormats()->rangeFind( RES_FLYFRMFMT, rName );
     for( auto it = range.first; it != range.second; it++ )
@@ -1367,11 +1367,11 @@ const SwFlyFrameFormat* SwDoc::FindFlyByName( const OUString& rName, sal_Int8 nN
             nullptr != ( pIdx = pFlyFormat->GetContent().GetContentIdx() ) &&
             pIdx->GetNode().GetNodes().IsDocNodes() )
         {
-            if( nNdTyp )
+            if( nNdTyp != SwNodeType::NONE )
             {
                 // query for the right NodeType
                 const SwNode* pNd = GetNodes()[ pIdx->GetIndex()+1 ];
-                if( nNdTyp == ND_TEXTNODE
+                if( nNdTyp == SwNodeType::Text
                         ? !pNd->IsNoTextNode()
                         : nNdTyp == pNd->GetNodeType() )
                     return static_cast<const SwFlyFrameFormat*>(pFlyFormat);
@@ -1394,12 +1394,13 @@ void SwDoc::SetFlyName( SwFlyFrameFormat& rFormat, const OUString& rName )
         {
             switch( GetNodes()[ pIdx->GetIndex() + 1 ]->GetNodeType() )
             {
-                case ND_GRFNODE:
+                case SwNodeType::Grf:
                     nTyp = STR_GRAPHIC_DEFNAME;
                     break;
-                case ND_OLENODE:
+                case SwNodeType::Ole:
                     nTyp = STR_OBJECT_DEFNAME;
                     break;
+                default: break;
             }
         }
         sName = lcl_GetUniqueFlyName(this, nTyp, RES_FLYFRMFMT);
@@ -1484,10 +1485,10 @@ void SwDoc::SetAllUniqueFlyNames()
         {
             switch( GetNodes()[ pIdx->GetIndex() + 1 ]->GetNodeType() )
             {
-            case ND_GRFNODE:
+            case SwNodeType::Grf:
                 pFlyFormat->SetName( sGrfNm + OUString::number( ++nGrfNum ));
                 break;
-            case ND_OLENODE:
+            case SwNodeType::Ole:
                 pFlyFormat->SetName( sOLENm + OUString::number( ++nOLENum ));
                 break;
             default:
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index bbe64fe..dc07f06 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -965,7 +965,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu
     aSourceIdx++;
     SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << (int) aSourceIdx.GetNode().GetNodeType()
                                             << std::dec << " " << aSourceIdx.GetNode().GetIndex() );
-    if ( aSourceIdx.GetNode().GetNodeType() != ND_ENDNODE ) {
+    if ( aSourceIdx.GetNode().GetNodeType() != SwNodeType::End ) {
         aSourceIdx++;
         SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << (int) aSourceIdx.GetNode().GetNodeType() << std::dec );
         aSourceIdx--;
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 867157f..202eb06 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -1381,18 +1381,20 @@ static bool lcl_IsValidPrevNextNumNode( const SwNodeIndex& rIdx )
     const SwNode& rNd = rIdx.GetNode();
     switch( rNd.GetNodeType() )
     {
-    case ND_ENDNODE:
+    case SwNodeType::End:
         bRet = SwTableBoxStartNode == rNd.StartOfSectionNode()->GetStartNodeType() ||
                 rNd.StartOfSectionNode()->IsSectionNode();
         break;
 
-    case ND_STARTNODE:
+    case SwNodeType::Start:
         bRet = SwTableBoxStartNode == static_cast<const SwStartNode&>(rNd).GetStartNodeType();
         break;
 
-    case ND_SECTIONNODE:            // that one's valid, so proceed
+    case SwNodeType::Section:            // that one's valid, so proceed
         bRet = true;
         break;
+
+    default: break;
     }
     return bRet;
 }
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 5ac99b8..f90b2e1 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -580,7 +580,7 @@ void SwNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
         break;
 
     case RES_GRF_REREAD_AND_INCACHE:
-        if( ND_GRFNODE == GetNode()->GetNodeType() )
+        if( SwNodeType::Grf == GetNode()->GetNodeType() )
         {
             bComplete = false;
             SwGrfNode* pNd = static_cast<SwGrfNode*>( GetNode());
@@ -609,7 +609,7 @@ void SwNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
         break;
 
     case RES_UPDATE_ATTR:
-        if (GetNode()->GetNodeType() != ND_GRFNODE) {
+        if (GetNode()->GetNodeType() != SwNodeType::Grf) {
             break;
         }
         SAL_FALLTHROUGH;
@@ -636,7 +636,7 @@ void SwNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
     case RES_GRAPHIC_ARRIVED:
     // i73788# - handle RES_LINKED_GRAPHIC_STREAM_ARRIVED as RES_GRAPHIC_ARRIVED
     case RES_LINKED_GRAPHIC_STREAM_ARRIVED:
-        if ( GetNode()->GetNodeType() == ND_GRFNODE )
+        if ( GetNode()->GetNodeType() == SwNodeType::Grf )
         {
             bComplete = false;
             SwGrfNode* pNd = static_cast<SwGrfNode*>( GetNode());
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx
index 5ff587e..8b2bbde 100644
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -37,7 +37,7 @@
 #include <frmfmt.hxx>
 
 SwNoTextNode::SwNoTextNode( const SwNodeIndex & rWhere,
-                  const sal_uInt8 nNdType,
+                  const SwNodeType nNdType,
                   SwGrfFormatColl *pGrfColl,
                   SwAttrSet* pAutoAttr ) :
     SwContentNode( rWhere, nNdType, pGrfColl ),
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index a7eff36..62d87c8 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -985,7 +985,7 @@ lcl_initParent(SwSectionNode & rThis, SwSectionFormat & rFormat)
 
 SwSectionNode::SwSectionNode(SwNodeIndex const& rIdx,
         SwSectionFormat & rFormat, SwTOXBase const*const pTOXBase)
-    : SwStartNode( rIdx, ND_SECTIONNODE )
+    : SwStartNode( rIdx, SwNodeType::Section )
     , m_pSection( (pTOXBase)
         ? new SwTOXBaseSection(*pTOXBase, lcl_initParent(*this, rFormat))
         : new SwSection( CONTENT_SECTION, rFormat.GetName(),
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index b1e99a3..da7d011 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -290,7 +290,7 @@ bool SwNodes::InsBoxen( SwTableNode* pTableNd,
     SwNodeIndex aEndIdx( *this, nIdxPos );
     for( sal_uInt16 n = 0; n < nCnt; ++n )
     {
-        SwStartNode* pSttNd = new SwStartNode( aEndIdx, ND_STARTNODE,
+        SwStartNode* pSttNd = new SwStartNode( aEndIdx, SwNodeType::Start,
                                                 SwTableBoxStartNode );
         pSttNd->m_pStartOfSection = pTableNd;
         new SwEndNode( aEndIdx, *pSttNd );
@@ -584,7 +584,7 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
     {
         for( sal_uInt16 nB = 0; nB < nBoxes; ++nB )
         {
-            SwStartNode* pSttNd = new SwStartNode( aIdx, ND_STARTNODE,
+            SwStartNode* pSttNd = new SwStartNode( aIdx, SwNodeType::Start,
                                                     SwTableBoxStartNode );
             pSttNd->m_pStartOfSection = pTableNd;
 
@@ -1073,7 +1073,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
 
                     // Set the TableNode as StartNode for all TextNodes in the Table
                     const SwNodeIndex aTmpIdx( aCntPos.nNode, -1 );
-                    pSttNd = new SwStartNode( aTmpIdx, ND_STARTNODE,
+                    pSttNd = new SwStartNode( aTmpIdx, SwNodeType::Start,
                                                 SwTableBoxStartNode );
                     new SwEndNode( aCntPos.nNode, *pSttNd );
                     pNewNd->m_pStartOfSection = pSttNd;
@@ -1093,7 +1093,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
         if( !pContentStore->Empty())
             pContentStore->Restore( *pTextNd, pTextNd->GetText().getLength(), pTextNd->GetText().getLength()+1 );
 
-        pSttNd = new SwStartNode( aCntPos.nNode, ND_STARTNODE, SwTableBoxStartNode );
+        pSttNd = new SwStartNode( aCntPos.nNode, SwNodeType::Start, SwTableBoxStartNode );
         const SwNodeIndex aTmpIdx( aCntPos.nNode, 1 );
         new SwEndNode( aTmpIdx, *pSttNd  );
         pTextNd->m_pStartOfSection = pSttNd;
@@ -1404,7 +1404,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
 
                SwNodeIndex aCellEndIdx(aCellIter->aEnd);
                ++aCellEndIdx;
-               SwStartNode* pSttNd = new SwStartNode( aTmpIdx, ND_STARTNODE,
+               SwStartNode* pSttNd = new SwStartNode( aTmpIdx, SwNodeType::Start,
                                             SwTableBoxStartNode );
 
                 // Quotation of http://nabble.documentfoundation.org/Some-strange-lines-by-taking-a-look-at-the-bt-of-fdo-51916-tp3994561p3994639.html
@@ -2340,7 +2340,7 @@ sal_uInt16 SwDoc::MergeTable( SwPaM& rPam )
 }
 
 SwTableNode::SwTableNode( const SwNodeIndex& rIdx )
-    : SwStartNode( rIdx, ND_TABLENODE )
+    : SwStartNode( rIdx, SwNodeType::Table )
 {
     m_pTable = new SwTable;
 }
@@ -2929,7 +2929,7 @@ void SwDoc::SetRowsToRepeat( SwTable &rTable, sal_uInt16 nSet )
 void SwCollectTableLineBoxes::AddToUndoHistory( const SwContentNode& rNd )
 {
     if( pHst )
-        pHst->Add( rNd.GetFormatColl(), rNd.GetIndex(), ND_TEXTNODE );
+        pHst->Add( rNd.GetFormatColl(), rNd.GetIndex(), SwNodeType::Text );
 }
 
 void SwCollectTableLineBoxes::AddBox( const SwTableBox& rBox )
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index e267ffb..7e54c68 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -280,7 +280,7 @@ sal_uInt16 SwNode::GetSectionLevel() const
 long SwNode::s_nSerial = 0;
 #endif
 
-SwNode::SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType )
+SwNode::SwNode( const SwNodeIndex &rWhere, const SwNodeType nNdType )
     : m_nNodeType( nNdType )
     , m_nAFormatNumLvl( 0 )
     , m_bSetNumLSpace( false )
@@ -313,7 +313,7 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType )
  * @param nPos position within the array where the node will be inserted
  * @param nNdType the type of node to insert
  */
-SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNdType )
+SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const SwNodeType nNdType )
     : m_nNodeType( nNdType )
     , m_nAFormatNumLvl( 0 )
     , m_bSetNumLSpace( false )
@@ -362,12 +362,12 @@ bool SwNode::IsInVisibleArea( SwViewShell const * pSh ) const
     bool bRet = false;
     const SwContentNode* pNd;
 
-    if( ND_STARTNODE & m_nNodeType )
+    if( SwNodeType::Start & m_nNodeType )
     {
         SwNodeIndex aIdx( *this );
         pNd = GetNodes().GoNext( &aIdx );
     }
-    else if( ND_ENDNODE & m_nNodeType )
+    else if( SwNodeType::End & m_nNodeType )
     {
         SwNodeIndex aIdx( *EndOfSectionNode() );
         pNd = SwNodes::GoPrevious( &aIdx );
@@ -403,7 +403,7 @@ bool SwNode::IsInVisibleArea( SwViewShell const * pSh ) const
 
 bool SwNode::IsInProtectSect() const
 {
-    const SwNode* pNd = ND_SECTIONNODE == m_nNodeType ? m_pStartOfSection : this;
+    const SwNode* pNd = SwNodeType::Section == m_nNodeType ? m_pStartOfSection : this;
     const SwSectionNode* pSectNd = pNd->FindSectionNode();
     return pSectNd && pSectNd->GetSection().IsProtectFlag();
 }
@@ -413,7 +413,7 @@ bool SwNode::IsInProtectSect() const
 /// Frames/Footnotes/...
 bool SwNode::IsProtect() const
 {
-    const SwNode* pNd = ND_SECTIONNODE == m_nNodeType ? m_pStartOfSection : this;
+    const SwNode* pNd = SwNodeType::Section == m_nNodeType ? m_pStartOfSection : this;
     const SwStartNode* pSttNd = pNd->FindSectionNode();
     if( pSttNd && static_cast<const SwSectionNode*>(pSttNd)->GetSection().IsProtectFlag() )
         return true;
@@ -467,12 +467,12 @@ const SwPageDesc* SwNode::FindPageDesc( size_t* pPgDescNdIdx ) const
     const SwPageDesc* pPgDesc = nullptr;
 
     const SwContentNode* pNode;
-    if( ND_STARTNODE & m_nNodeType )
+    if( SwNodeType::Start & m_nNodeType )
     {
         SwNodeIndex aIdx( *this );
         pNode = GetNodes().GoNext( &aIdx );
     }
-    else if( ND_ENDNODE & m_nNodeType )
+    else if( SwNodeType::End & m_nNodeType )
     {
         SwNodeIndex aIdx( *EndOfSectionNode() );
         pNode = SwNodes::GoPrevious( &aIdx );
@@ -810,10 +810,10 @@ const SwTextNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const
 
 inline bool IsValidNextPrevNd( const SwNode& rNd )
 {
-    return ND_TABLENODE == rNd.GetNodeType() ||
-           ( ND_CONTENTNODE & rNd.GetNodeType() ) ||
-            ( ND_ENDNODE == rNd.GetNodeType() && rNd.StartOfSectionNode() &&
-            ND_TABLENODE == rNd.StartOfSectionNode()->GetNodeType() );
+    return SwNodeType::Table == rNd.GetNodeType() ||
+           ( SwNodeType::ContentMask & rNd.GetNodeType() ) ||
+            ( SwNodeType::End == rNd.GetNodeType() && rNd.StartOfSectionNode() &&
+            SwNodeType::Table == rNd.StartOfSectionNode()->GetNodeType() );
 }
 
 sal_uInt8 SwNode::HasPrevNextLayNode() const
@@ -852,34 +852,35 @@ void SwNode::dumpAsXml(xmlTextWriterPtr pWriter) const
     const char* pName = "???";
     switch (GetNodeType())
     {
-    case ND_ENDNODE:
+    case SwNodeType::End:
         pName = "end";
         break;
-    case ND_STARTNODE:
-    case ND_TEXTNODE:
+    case SwNodeType::Start:
+    case SwNodeType::Text:
         abort(); // overridden
-    case ND_TABLENODE:
+    case SwNodeType::Table:
         pName = "table";
         break;
-    case ND_GRFNODE:
+    case SwNodeType::Grf:
         pName = "grf";
         break;
-    case ND_OLENODE:
+    case SwNodeType::Ole:
         pName = "ole";
         break;
+    default: break;
     }
     xmlTextWriterStartElement(pWriter, BAD_CAST(pName));
 
     xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
-    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"), BAD_CAST(OString::number(GetNodeType()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"), BAD_CAST(OString::number((sal_uInt8)GetNodeType()).getStr()));
     xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"), BAD_CAST(OString::number(GetIndex()).getStr()));
 
     xmlTextWriterEndElement(pWriter);
-    if (GetNodeType() == ND_ENDNODE)
+    if (GetNodeType() == SwNodeType::End)
         xmlTextWriterEndElement(pWriter); // end start node
 }
 
-SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
+SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const SwNodeType nNdType,
                             SwStartNodeType eSttNd )
     : SwNode( rWhere, nNdType ), m_eStartNodeType( eSttNd )
 {
@@ -894,7 +895,7 @@ SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
 }
 
 SwStartNode::SwStartNode( SwNodes& rNodes, sal_uLong nPos )
-    : SwNode( rNodes, nPos, ND_STARTNODE ), m_eStartNodeType( SwNormalStartNode )
+    : SwNode( rNodes, nPos, SwNodeType::Start ), m_eStartNodeType( SwNormalStartNode )
 {
     if( !nPos )
     {
@@ -922,10 +923,10 @@ void SwStartNode::dumpAsXml(xmlTextWriterPtr pWriter) const
     const char* pName = "???";
     switch (GetNodeType())
     {
-    case ND_TABLENODE:
+    case SwNodeType::Table:
         pName = "table";
         break;
-    case ND_SECTIONNODE:
+    case SwNodeType::Section:
         pName = "section";
         break;
     default:
@@ -955,7 +956,7 @@ void SwStartNode::dumpAsXml(xmlTextWriterPtr pWriter) const
 
     xmlTextWriterStartElement(pWriter, BAD_CAST(pName));
     xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
-    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"), BAD_CAST(OString::number(GetNodeType()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"), BAD_CAST(OString::number((sal_uInt8)GetNodeType()).getStr()));
     xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"), BAD_CAST(OString::number(GetIndex()).getStr()));
 
     if (IsTableNode())
@@ -980,20 +981,20 @@ void SwStartNode::dumpAsXml(xmlTextWriterPtr pWriter) const
  */
 
 SwEndNode::SwEndNode( const SwNodeIndex &rWhere, SwStartNode& rSttNd )
-    : SwNode( rWhere, ND_ENDNODE )
+    : SwNode( rWhere, SwNodeType::End )
 {
     m_pStartOfSection = &rSttNd;
     m_pStartOfSection->m_pEndOfSection = this;
 }
 
 SwEndNode::SwEndNode( SwNodes& rNds, sal_uLong nPos, SwStartNode& rSttNd )
-    : SwNode( rNds, nPos, ND_ENDNODE )
+    : SwNode( rNds, nPos, SwNodeType::End )
 {
     m_pStartOfSection = &rSttNd;
     m_pStartOfSection->m_pEndOfSection = this;
 }
 
-SwContentNode::SwContentNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
+SwContentNode::SwContentNode( const SwNodeIndex &rWhere, const SwNodeType nNdType,
                             SwFormatColl *pColl )
     : SwModify( pColl ),     // CursorsShell, FrameFormat,
     SwNode( rWhere, nNdType ),
@@ -1813,8 +1814,8 @@ bool SwContentNode::IsAnyCondition( SwCollCondition& rTmp ) const
         {
             switch( pSttNd->GetNodeType() )
             {
-            case ND_TABLENODE:      nCond = PARA_IN_TABLEBODY; break;
-            case ND_SECTIONNODE:    nCond = PARA_IN_SECTION; break;
+            case SwNodeType::Table:      nCond = PARA_IN_TABLEBODY; break;
+            case SwNodeType::Section:    nCond = PARA_IN_SECTION; break;
 
             default:
                 switch( pSttNd->GetStartNodeType() )
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index aec2552..7c5d983 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -414,7 +414,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
     SwNodeRange aRg( aRange );
 
     // skip "simple" start or end nodes
-    while( ND_STARTNODE == (pAktNode = &aRg.aStart.GetNode())->GetNodeType()
+    while( SwNodeType::Start == (pAktNode = &aRg.aStart.GetNode())->GetNodeType()
             || ( pAktNode->IsEndNode() &&
                 !pAktNode->m_pStartOfSection->IsSectionNode() ) )
         ++aRg.aStart;
@@ -425,7 +425,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
     while( ( (( pAktNode = &aRg.aEnd.GetNode())->GetStartNode() &&
             !pAktNode->IsSectionNode() ) ||
             ( pAktNode->IsEndNode() &&
-            ND_STARTNODE == pAktNode->m_pStartOfSection->GetNodeType()) ) &&
+            SwNodeType::Start == pAktNode->m_pStartOfSection->GetNodeType()) ) &&
             aRg.aEnd > aRg.aStart )
         --aRg.aEnd;
 
@@ -463,7 +463,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
     while( aRg.aStart < aRg.aEnd )
         switch( (pAktNode = &aRg.aEnd.GetNode())->GetNodeType() )
         {
-        case ND_ENDNODE:
+        case SwNodeType::End:
             {
                 if( nInsPos ) // move everything until here
                 {
@@ -607,7 +607,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
                         {
                             // create StartNode and EndNode at InsertPos
                             SwStartNode* pTmp = new SwStartNode( aIdx,
-                                                    ND_STARTNODE,
+                                                    SwNodeType::Start,
 /*?? NodeType ??*/                                  SwNormalStartNode );
 
                             nLevel++; // put the index to StartNode on the stack
@@ -678,7 +678,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
             }
             break;
 
-        case ND_SECTIONNODE:
+        case SwNodeType::Section:
             if( !nLevel &&
                 GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNodes))
             {
@@ -698,8 +698,8 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
                 break;
             }
             SAL_FALLTHROUGH;
-        case ND_TABLENODE:
-        case ND_STARTNODE:
+        case SwNodeType::Table:
+        case SwNodeType::Start:
             {
                 // empty section -> nothing to do
                 //  and only if it's a top level section
@@ -714,7 +714,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
                     // create decrease
                     SwNodeIndex aTmpSIdx( aOrigInsPos.aStart, 1 );
                     SwStartNode* pTmpStt = new SwStartNode( aTmpSIdx,
-                                ND_STARTNODE,
+                                SwNodeType::Start,
                                 static_cast<SwStartNode*>(pAktNode)->GetStartNodeType() );
 
                     --aTmpSIdx;
@@ -780,7 +780,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
 
                 // delete all resulting empty start/end node pairs
                 SwNode* pTmpNode = (*this)[ aRg.aEnd.GetIndex()+1 ]->GetEndNode();
-                if( pTmpNode && ND_STARTNODE == (pAktNode = &aRg.aEnd.GetNode())
+                if( pTmpNode && SwNodeType::Start == (pAktNode = &aRg.aEnd.GetNode())
                     ->GetNodeType() && pAktNode->StartOfSectionIndex() &&
                     pTmpNode->StartOfSectionNode() == pAktNode )
                 {
@@ -790,7 +790,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
             }
             break;
 
-        case ND_TEXTNODE:
+        case SwNodeType::Text:
             //Add special function to text node.
             {
                 if( bNewFrames && pAktNode->GetContentNode() )
@@ -800,8 +800,8 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
                 --aRg.aEnd;
             }
             break;
-        case ND_GRFNODE:
-        case ND_OLENODE:
+        case SwNodeType::Grf:
+        case SwNodeType::Ole:
             {
                 if( bNewFrames && pAktNode->GetContentNode() )
                     static_cast<SwContentNode*>(pAktNode)->DelFrames();
@@ -812,7 +812,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
             }
             break;
 
-        case ND_PLACEHOLDER:
+        case SwNodeType::PlaceHolder:
             if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(*this))
             {
                 if( &rNodes == this ) // inside UndoNodesArray
@@ -917,7 +917,7 @@ void SwNodes::SectionDown(SwNodeRange *pRange, SwStartNodeType eSttNdTyp )
     else
     {
         // insert a new StartNode
-        SwNode* pSttNd = new SwStartNode( pRange->aStart, ND_STARTNODE, eSttNdTyp );
+        SwNode* pSttNd = new SwStartNode( pRange->aStart, SwNodeType::Start, eSttNdTyp );
         pRange->aStart = *pSttNd;
         aTmpIdx = pRange->aStart;
     }
@@ -1689,7 +1689,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
     SwNodeRange aRg( rRange );
 
     // skip "simple" StartNodes or EndNodes
-    while( ND_STARTNODE == (pAktNode = & aRg.aStart.GetNode())->GetNodeType()
+    while( SwNodeType::Start == (pAktNode = & aRg.aStart.GetNode())->GetNodeType()
             || ( pAktNode->IsEndNode() &&
                 !pAktNode->m_pStartOfSection->IsSectionNode() ) )
         ++aRg.aStart;
@@ -1709,7 +1709,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
             while( ((pAktNode = & aRg.aEnd.GetNode())->GetStartNode() &&
                     !pAktNode->IsSectionNode() ) ||
                     ( pAktNode->IsEndNode() &&
-                    ND_STARTNODE == pAktNode->m_pStartOfSection->GetNodeType()) )
+                    SwNodeType::Start == pAktNode->m_pStartOfSection->GetNodeType()) )
             {
                 --aRg.aEnd;
             }
@@ -1741,7 +1741,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
         pAktNode = &aRg.aStart.GetNode();
         switch( pAktNode->GetNodeType() )
         {
-        case ND_TABLENODE:
+        case SwNodeType::Table:
             // Does it copy a table in(to) a footnote?
             if( aInsPos < pDoc->GetNodes().GetEndOfInserts().GetIndex() &&
                     pDoc->GetNodes().GetEndOfInserts().StartOfSectionIndex()
@@ -1804,7 +1804,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
             }
             break;
 
-        case ND_SECTIONNODE:
+        case SwNodeType::Section:
             // If the end of the section is outside the copy range,
             // the section node will skipped, not copied!
             // If someone want to change this behaviour, he has to adjust the function
@@ -1829,9 +1829,9 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
             }
             break;
 
-        case ND_STARTNODE:
+        case SwNodeType::Start:
             {
-                SwStartNode* pTmp = new SwStartNode( aInsPos, ND_STARTNODE,
+                SwStartNode* pTmp = new SwStartNode( aInsPos, SwNodeType::Start,
                             static_cast<SwStartNode*>(pAktNode)->GetStartNodeType() );
                 new SwEndNode( aInsPos, *pTmp );
                 --aInsPos;
@@ -1839,7 +1839,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
             }
             break;
 
-        case ND_ENDNODE:
+        case SwNodeType::End:
             if( nLevel ) // complete section
             {
                 --nLevel;
@@ -1857,9 +1857,9 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
             }
             break;
 
-        case ND_TEXTNODE:
-        case ND_GRFNODE:
-        case ND_OLENODE:
+        case SwNodeType::Text:
+        case SwNodeType::Grf:
+        case SwNodeType::Ole:
             {
                 SwContentNode* pNew = static_cast<SwContentNode*>(pAktNode)->MakeCopy(
                                             pDoc, aInsPos );
@@ -1869,7 +1869,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
             }
             break;
 
-        case ND_PLACEHOLDER:
+        case SwNodeType::PlaceHolder:
             if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(*this))
             {
                 // than a SectionNode (start/end) is needed at the current
@@ -1896,7 +1896,7 @@ void SwNodes::DelDummyNodes( const SwNodeRange& rRg )
     SwNodeIndex aIdx( rRg.aStart );
     while( aIdx.GetIndex() < rRg.aEnd.GetIndex() )
     {
-        if (ND_PLACEHOLDER == aIdx.GetNode().GetNodeType())
+        if (SwNodeType::PlaceHolder == aIdx.GetNode().GetNodeType())
             RemoveNode( aIdx.GetIndex(), 1, true );
         else
             ++aIdx;
@@ -1906,7 +1906,7 @@ void SwNodes::DelDummyNodes( const SwNodeRange& rRg )
 SwStartNode* SwNodes::MakeEmptySection( const SwNodeIndex& rIdx,
                                         SwStartNodeType eSttNdTyp )
 {
-    SwStartNode* pSttNd = new SwStartNode( rIdx, ND_STARTNODE, eSttNdTyp );
+    SwStartNode* pSttNd = new SwStartNode( rIdx, SwNodeType::Start, eSttNdTyp );
     new SwEndNode( rIdx, *pSttNd );
     return pSttNd;
 }
@@ -1915,7 +1915,7 @@ SwStartNode* SwNodes::MakeTextSection( const SwNodeIndex & rWhere,
                                         SwStartNodeType eSttNdTyp,
                                         SwTextFormatColl *pColl )
 {
-    SwStartNode* pSttNd = new SwStartNode( rWhere, ND_STARTNODE, eSttNdTyp );
+    SwStartNode* pSttNd = new SwStartNode( rWhere, SwNodeType::Start, eSttNdTyp );
     new SwEndNode( rWhere, *pSttNd );
     MakeTextNode( SwNodeIndex( rWhere, - 1 ), pColl );
     return pSttNd;
@@ -1943,7 +1943,7 @@ SwContentNode* SwNodes::GoNextSection( SwNodeIndex * pIdx,
     while( aTmp < Count() - 1 )
     {
         pNd = & aTmp.GetNode();
-        if (ND_SECTIONNODE == pNd->GetNodeType())
+        if (SwNodeType::Section == pNd->GetNodeType())
         {
             const SwSection& rSect = static_cast<const SwSectionNode*>(pNd)->GetSection();
             if( (bSkipHidden && rSect.IsHiddenFlag()) ||
@@ -1963,7 +1963,7 @@ SwContentNode* SwNodes::GoNextSection( SwNodeIndex * pIdx,
                     aTmp = *pNd->EndOfSectionNode();
             }
         }
-        else if( ND_CONTENTNODE & pNd->GetNodeType() )
+        else if( SwNodeType::ContentMask & pNd->GetNodeType() )
         {
             const SwSectionNode* pSectNd;
             if( ( bSkipHidden || bSkipProtect ) &&
@@ -1995,7 +1995,7 @@ SwContentNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx,
     while( aTmp > 0 )
     {
         pNd = & aTmp.GetNode();
-        if (ND_ENDNODE == pNd->GetNodeType())
+        if (SwNodeType::End == pNd->GetNodeType())
         {
             if( pNd->m_pStartOfSection->IsSectionNode() )
             {
@@ -2021,7 +2021,7 @@ SwContentNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx,
                     aTmp = *pNd->StartOfSectionNode();
             }
         }
-        else if( ND_CONTENTNODE & pNd->GetNodeType() )
+        else if( SwNodeType::ContentMask & pNd->GetNodeType() )
         {
             const SwSectionNode* pSectNd;
             if( ( bSkipHidden || bSkipProtect ) &&
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index a4e27a0..19e7439 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -131,7 +131,7 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
             SwNode* pNd = GetDoc()->GetNodes()[ n ];
             switch( pNd->GetNodeType() )
             {
-            case ND_TEXTNODE:
+            case SwNodeType::Text:
                 {
                     const sal_Int32 nStt = (n == nSttNd) ? nSttCnt : 0;
                     const sal_Int32 nEnd = (n == nEndNd)
@@ -143,8 +143,8 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
                                                 bMergeIndentValuesOfNumRule );
                 }
                 break;
-            case ND_GRFNODE:
-            case ND_OLENODE:
+            case SwNodeType::Grf:
+            case SwNodeType::Ole:
                 static_cast<SwContentNode*>(pNd)->GetAttr( *pSet );
                 break;
 
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 0a0057a..94686b6 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -746,7 +746,7 @@ void SwEditShell::SetNumberingRestart()
                 SwNode* pNd = GetDoc()->GetNodes()[ nCurrNd ];
                 switch( pNd->GetNodeType() )
                 {
-                case ND_TEXTNODE:
+                case SwNodeType::Text:
                     if( nullptr != ( pContentFrame = static_cast<SwTextNode*>(pNd)->getLayoutFrame( GetLayout() )) )
                     {
                         // skip hidden frames - ignore protection!
@@ -787,15 +787,12 @@ void SwEditShell::SetNumberingRestart()
                         }
                     }
                     break;
-                case ND_SECTIONNODE:
+                case SwNodeType::Section:
                     // skip hidden sections  - ignore protection!
                     if(static_cast<SwSectionNode*>(pNd)->GetSection().IsHidden() )
                         nCurrNd = pNd->EndOfSectionIndex();
                     break;
-                case ND_ENDNODE:
-                    {
-                        break;
-                    }
+                default: break;
                 }
 
                 bGoOn = nCurrNd < nEndNd;
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 25c8906..f96fd03 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -116,9 +116,10 @@ sal_uInt16 SwEditShell::GetCntType() const
     else
         switch( GetCursor()->GetNode().GetNodeType() )
         {
-        case ND_TEXTNODE:   nRet = CNT_TXT; break;
-        case ND_GRFNODE:    nRet = CNT_GRF; break;
-        case ND_OLENODE:    nRet = CNT_OLE; break;
+        case SwNodeType::Text:   nRet = CNT_TXT; break;
+        case SwNodeType::Grf:    nRet = CNT_GRF; break;
+        case SwNodeType::Ole:    nRet = CNT_OLE; break;
+        default: break;
         }
 
     OSL_ASSERT( nRet );
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 840fc93..de6fcc5 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2452,11 +2452,11 @@ void SwFEShell::MirrorSelection( bool bHorizontal )
 bool SwFEShell::GotoFly( const OUString& rName, FlyCntType eType, bool bSelFrame )
 {
     bool bRet = false;
-    static sal_uInt8 const aChkArr[ 4 ] = {
-             /* FLYCNTTYPE_ALL */   0,
-             /* FLYCNTTYPE_FRM */   ND_TEXTNODE,
-             /* FLYCNTTYPE_GRF */   ND_GRFNODE,
-             /* FLYCNTTYPE_OLE */   ND_OLENODE
+    static SwNodeType const aChkArr[ 4 ] = {
+             /* FLYCNTTYPE_ALL */   SwNodeType::NONE,
+             /* FLYCNTTYPE_FRM */   SwNodeType::Text,
+             /* FLYCNTTYPE_GRF */   SwNodeType::Grf,
+             /* FLYCNTTYPE_OLE */   SwNodeType::Ole
             };
 
     const SwFlyFrameFormat* pFlyFormat = mpDoc->FindFlyByName( rName, aChkArr[ eType]);
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index bc83866..2326706 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -64,7 +64,7 @@ SwGrfNode::SwGrfNode(
         const Graphic* pGraphic,
         SwGrfFormatColl *pGrfColl,
         SwAttrSet* pAutoAttr ) :
-    SwNoTextNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
+    SwNoTextNode( rWhere, SwNodeType::Grf, pGrfColl, pAutoAttr ),
     maGrfObj(),
     mpReplacementGraphic(nullptr),
     // #i73788#
@@ -82,7 +82,7 @@ SwGrfNode::SwGrfNode(
 SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
                           const GraphicObject& rGrfObj,
                       SwGrfFormatColl *pGrfColl, SwAttrSet* pAutoAttr ) :
-    SwNoTextNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
+    SwNoTextNode( rWhere, SwNodeType::Grf, pGrfColl, pAutoAttr ),
     maGrfObj(rGrfObj),
     mpReplacementGraphic(nullptr),
     // #i73788#
@@ -105,7 +105,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
                       const OUString& rGrfName, const OUString& rFltName,
                       SwGrfFormatColl *pGrfColl,
                       SwAttrSet* pAutoAttr ) :
-    SwNoTextNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
+    SwNoTextNode( rWhere, SwNodeType::Grf, pGrfColl, pAutoAttr ),
     maGrfObj(),
     mpReplacementGraphic(nullptr),
     // #i73788#
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index 07edd55..ad238ce 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -215,10 +215,10 @@ class SwHistoryChangeFormatColl : public SwHistoryHint
 {
     SwFormatColl * const m_pColl;
     const sal_uLong m_nNodeIndex;
-    const sal_uInt8 m_nNodeType;
+    const SwNodeType m_nNodeType;
 
 public:
-    SwHistoryChangeFormatColl( SwFormatColl* pColl, sal_uLong nNode, sal_uInt8 nNodeWhich );
+    SwHistoryChangeFormatColl( SwFormatColl* pColl, sal_uLong nNode, SwNodeType nNodeWhich );
     virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ) override;
 
 };
@@ -329,7 +329,7 @@ public:
     void Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
               sal_uLong nNodeIdx );
     void Add( SwTextAttr* pTextHt, sal_uLong nNodeIdx, bool bNewAttr );
-    void Add( SwFormatColl*, sal_uLong nNodeIdx, sal_uInt8 nWhichNd );
+    void Add( SwFormatColl*, sal_uLong nNodeIdx, SwNodeType nWhichNd );
     void Add( const ::sw::mark::IMark&, bool bSavePos, bool bSaveOtherPos );
     void Add( SwFrameFormat& rFormat );
     void Add( SwFlyFrameFormat&, sal_uInt16& rSetPos );
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index a235bfd..2ca0d18a 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -214,7 +214,7 @@ SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
                     const svt::EmbeddedObjectRef& xObj,
                     SwGrfFormatColl *pGrfColl,
                     SwAttrSet* pAutoAttr ) :
-    SwNoTextNode( rWhere, ND_OLENODE, pGrfColl, pAutoAttr ),
+    SwNoTextNode( rWhere, SwNodeType::Ole, pGrfColl, pAutoAttr ),
     aOLEObj( xObj ),
     bOLESizeInvalid( false ),
     mpObjectLink( nullptr )
@@ -227,7 +227,7 @@ SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
                     sal_Int64 nAspect,
                     SwGrfFormatColl *pGrfColl,
                     SwAttrSet* pAutoAttr ) :
-    SwNoTextNode( rWhere, ND_OLENODE, pGrfColl, pAutoAttr ),
+    SwNoTextNode( rWhere, SwNodeType::Ole, pGrfColl, pAutoAttr ),
     aOLEObj( rString, nAspect ),
     bOLESizeInvalid( false ),
     mpObjectLink( nullptr )
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 5e78fc0..6e63962 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -140,11 +140,11 @@ SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
         SwNode * pNd = & aTmp.GetNode();
         switch (pNd->GetNodeType())
         {
-        case ND_TABLENODE:
+        case SwNodeType::Table:
             static_cast<SwTableNode*>(pNd)->MakeFrames( aIdx );
             return pNode;
 
-        case ND_SECTIONNODE:
+        case SwNodeType::Section:
             if( static_cast<SwSectionNode*>(pNd)->GetSection().IsHidden() ||
                 static_cast<SwSectionNode*>(pNd)->IsContentHidden() )
             {
@@ -158,13 +158,13 @@ SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
             static_cast<SwSectionNode*>(pNd)->MakeFrames( aIdx );
             return pNode;
 
-        case ND_TEXTNODE:
-        case ND_GRFNODE:
-        case ND_OLENODE:
+        case SwNodeType::Text:
+        case SwNodeType::Grf:
+        case SwNodeType::Ole:
             static_cast<SwContentNode*>(pNd)->MakeFrames( *pNode );
             return pNode;
 
-        case ND_ENDNODE:
+        case SwNodeType::End:
             if( pNd->StartOfSectionNode()->IsSectionNode() &&
                 aTmp.GetIndex() < rWhere.GetIndex() )
             {
@@ -198,7 +198,7 @@ SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
 }
 
 SwTextNode::SwTextNode( const SwNodeIndex &rWhere, SwTextFormatColl *pTextColl, const SfxItemSet* pAutoAttr )
-:   SwContentNode( rWhere, ND_TEXTNODE, pTextColl ),
+:   SwContentNode( rWhere, SwNodeType::Text, pTextColl ),
     m_pSwpHints( nullptr ),
     mpNodeNum( nullptr ),
     m_Text(),
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index a8cafba..1435736 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -503,7 +503,7 @@ void SwHistorySetFootnote::SetInDoc( SwDoc* pDoc, bool )
 }
 
 SwHistoryChangeFormatColl::SwHistoryChangeFormatColl( SwFormatColl* pFormatColl, sal_uLong nNd,
-                            sal_uInt8 nNodeWhich )
+                            SwNodeType nNodeWhich )
     : SwHistoryHint( HSTRY_CHGFMTCOLL )
     , m_pColl( pFormatColl )
     , m_nNodeIndex( nNd )
@@ -520,7 +520,7 @@ void SwHistoryChangeFormatColl::SetInDoc( SwDoc* pDoc, bool )
     // document. if it has been deleted, there is no undo!
     if ( pContentNd && m_nNodeType == pContentNd->GetNodeType() )
     {
-        if ( ND_TEXTNODE == m_nNodeType )
+        if ( SwNodeType::Text == m_nNodeType )
         {
             if (pDoc->GetTextFormatColls()->Contains( static_cast<SwTextFormatColl * const>(m_pColl) ))
             {
@@ -965,7 +965,7 @@ void SwHistory::Add( SwTextAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr )
     m_SwpHstry.push_back( pHt );
 }
 
-void SwHistory::Add( SwFormatColl* pColl, sal_uLong nNodeIdx, sal_uInt8 nWhichNd )
+void SwHistory::Add( SwFormatColl* pColl, sal_uLong nNodeIdx, SwNodeType nWhichNd )
 {
     OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
 
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index bf476b2..073ed50 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -186,8 +186,8 @@ SwUndoDelete::SwUndoDelete(
     if( pSttTextNd && pEndTextNd && pSttTextNd != pEndTextNd )
     {
         // two different TextNodes, thus save also the TextFormatCollection
-        pHistory->Add( pSttTextNd->GetTextColl(),pStt->nNode.GetIndex(), ND_TEXTNODE );
-        pHistory->Add( pEndTextNd->GetTextColl(),pEnd->nNode.GetIndex(), ND_TEXTNODE );
+        pHistory->Add( pSttTextNd->GetTextColl(),pStt->nNode.GetIndex(), SwNodeType::Text );
+        pHistory->Add( pEndTextNd->GetTextColl(),pEnd->nNode.GetIndex(), SwNodeType::Text );
 
         if( !m_bJoinNext )        // Selection from bottom to top
         {
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 159dee7..57fc3c0 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -397,7 +397,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
 
     switch( pCNd->GetNodeType() )
     {
-    case ND_TEXTNODE:
+    case SwNodeType::Text:
         if( bIsAppend )
         {
             rDoc.getIDocumentContentOperations().AppendTextNode( *rContext.GetRepeatPaM().GetPoint() );
@@ -410,7 +410,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
                 aText.copy(nContent - nLen, nLen) );
         }
         break;
-    case ND_GRFNODE:
+    case SwNodeType::Grf:
         {
             SwGrfNode* pGrfNd = static_cast<SwGrfNode*>(pCNd);
             OUString sFile;
@@ -424,7 +424,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
         }
         break;
 
-    case ND_OLENODE:
+    case SwNodeType::Ole:
         {
             // StarView does not yet provide an option to copy a StarOBJ
             tools::SvRef<SotStorage> aRef = new SotStorage( OUString() );
@@ -446,6 +446,8 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
 
             break;
         }
+
+    default: break;
     }
 }
 
@@ -623,7 +625,7 @@ SwUndoReplace::Impl::Impl(
     {
         if( pNd->HasSwAttrSet() )
             pHistory->CopyFormatAttr( *pNd->GetpSwAttrSet(), nNewPos );
-        pHistory->Add( pNd->GetTextColl(), nNewPos, ND_TEXTNODE );
+        pHistory->Add( pNd->GetTextColl(), nNewPos, SwNodeType::Text );
 
         SwTextNode* pNext = pEnd->nNode.GetNode().GetTextNode();
         sal_uLong nTmp = pNext->GetIndex();
@@ -631,7 +633,7 @@ SwUndoReplace::Impl::Impl(
                             pNext->GetText().getLength(), true );
         if( pNext->HasSwAttrSet() )
             pHistory->CopyFormatAttr( *pNext->GetpSwAttrSet(), nTmp );
-        pHistory->Add( pNext->GetTextColl(),nTmp, ND_TEXTNODE );
+        pHistory->Add( pNext->GetTextColl(),nTmp, SwNodeType::Text );
         // METADATA: store
         m_pMetadataUndoStart = pNd  ->CreateUndo();
         m_pMetadataUndoEnd   = pNext->CreateUndo();
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index 439e61c..c833359 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -52,7 +52,7 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
 
     if( pTextNd )
     {
-        pHistory->Add( pTextNd->GetTextColl(), nSttNode, ND_TEXTNODE );
+        pHistory->Add( pTextNd->GetTextColl(), nSttNode, SwNodeType::Text );
         if ( pTextNd->GetpSwpHints() )
         {
             pHistory->CopyAttr( pTextNd->GetpSwpHints(), nSttNode,
@@ -63,7 +63,7 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
     }
     if( pEndTextNd && pEndTextNd != pTextNd )
     {
-        pHistory->Add( pEndTextNd->GetTextColl(), nEndNode, ND_TEXTNODE );
+        pHistory->Add( pEndTextNd->GetTextColl(), nEndNode, SwNodeType::Text );
         if ( pEndTextNd->GetpSwpHints() )
         {
             pHistory->CopyAttr( pEndTextNd->GetpSwpHints(), nEndNode,
@@ -76,7 +76,7 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
     pTextNd = rMvPos.nNode.GetNode().GetTextNode();
     if (nullptr != pTextNd)
     {
-        pHistory->Add( pTextNd->GetTextColl(), nMvDestNode, ND_TEXTNODE );
+        pHistory->Add( pTextNd->GetTextColl(), nMvDestNode, SwNodeType::Text );
         if ( pTextNd->GetpSwpHints() )
         {
             pHistory->CopyAttr( pTextNd->GetpSwpHints(), nMvDestNode,
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index c0cf47d..9e7723c 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -365,7 +365,7 @@ SwTableToTextSave::SwTableToTextSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEnd
     {
         m_pHstry = new SwHistory;
 
-        m_pHstry->Add( pNd->GetTextColl(), nNd, ND_TEXTNODE );
+        m_pHstry->Add( pNd->GetTextColl(), nNd, SwNodeType::Text );
         if ( pNd->GetpSwpHints() )
         {
             m_pHstry->CopyAttr( pNd->GetpSwpHints(), nNd, 0,
@@ -606,7 +606,7 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd,
         }
 
         aEndIdx = pSave->m_nEndNd;
-        SwStartNode* pSttNd = new SwStartNode( aSttIdx, ND_STARTNODE,
+        SwStartNode* pSttNd = new SwStartNode( aSttIdx, SwNodeType::Start,
                                                 SwTableBoxStartNode );
         pSttNd->m_pStartOfSection = pTableNd;
         new SwEndNode( aEndIdx, *pSttNd );
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 3e7760e..814b1e9 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1219,13 +1219,13 @@ uno::Any SwXFrames::getByName(const OUString& rName)
     switch(m_eType)
     {
         case FLYCNTTYPE_GRF:
-            pFormat = GetDoc()->FindFlyByName(rName, ND_GRFNODE);
+            pFormat = GetDoc()->FindFlyByName(rName, SwNodeType::Grf);
             break;
         case FLYCNTTYPE_OLE:
-            pFormat = GetDoc()->FindFlyByName(rName, ND_OLENODE);
+            pFormat = GetDoc()->FindFlyByName(rName, SwNodeType::Ole);
             break;
         default:
-            pFormat = GetDoc()->FindFlyByName(rName, ND_TEXTNODE);
+            pFormat = GetDoc()->FindFlyByName(rName, SwNodeType::Text);
             break;
     }
     if(!pFormat)
@@ -1258,11 +1258,11 @@ sal_Bool SwXFrames::hasByName(const OUString& rName) throw( uno::RuntimeExceptio
     switch(m_eType)
     {
         case FLYCNTTYPE_GRF:
-            return GetDoc()->FindFlyByName(rName, ND_GRFNODE) != nullptr;
+            return GetDoc()->FindFlyByName(rName, SwNodeType::Grf) != nullptr;
         case FLYCNTTYPE_OLE:
-            return GetDoc()->FindFlyByName(rName, ND_OLENODE) != nullptr;
+            return GetDoc()->FindFlyByName(rName, SwNodeType::Ole) != nullptr;
         default:
-            return GetDoc()->FindFlyByName(rName, ND_TEXTNODE) != nullptr;
+            return GetDoc()->FindFlyByName(rName, SwNodeType::Text) != nullptr;
     }
 }
 
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index da92fca..d68923a 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -397,7 +397,7 @@ void SwUnoCursorHelper::GetCursorAttr(SwPaM & rPam,
             SwNode *const pNd = rPam.GetDoc()->GetNodes()[ n ];
             switch (pNd->GetNodeType())
             {
-                case ND_TEXTNODE:
+                case SwNodeType::Text:
                 {
                     const sal_Int32 nStart = (n == nSttNd)
                         ? rStart.nContent.GetIndex() : 0;
@@ -408,8 +408,8 @@ void SwUnoCursorHelper::GetCursorAttr(SwPaM & rPam,
                 }
                 break;
 
-                case ND_GRFNODE:
-                case ND_OLENODE:
+                case SwNodeType::Grf:
+                case SwNodeType::Ole:
                     static_cast<SwContentNode*>(pNd)->GetAttr( *pSet );
                 break;
 
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 3e38c6b..b64a315 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -443,14 +443,14 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
             pNode = &pRedline->GetNode(false);
         switch(pNode->GetNodeType())
         {
-            case ND_SECTIONNODE:
+            case SwNodeType::Section:
             {
                 SwSectionNode* pSectNode = pNode->GetSectionNode();
                 OSL_ENSURE(pSectNode, "No section node!");
                 xRet = SwXTextSections::GetObject( *pSectNode->GetSection().GetFormat() );
             }
             break;
-            case ND_TABLENODE :
+            case SwNodeType::Table :
             {
                 SwTableNode* pTableNode = pNode->GetTableNode();
                 OSL_ENSURE(pTableNode, "No table node!");
@@ -459,7 +459,7 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
                 xRet = SwXTextTables::GetObject( *pTableFormat );
             }
             break;
-            case ND_TEXTNODE :
+            case SwNodeType::Text :
             {
                 SwPosition* pPoint = nullptr;
                 if(bStart || !pRedline->HasMark())
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index b692531..49f2cbe 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -944,8 +944,8 @@ SwXText::setString(const OUString& rString) throw (uno::RuntimeException, std::e
         {
             ++aStartIdx;
             SwNode& rCurrentNode = aStartIdx.GetNode();
-            if(rCurrentNode.GetNodeType() == ND_SECTIONNODE
-                ||rCurrentNode.GetNodeType() == ND_TABLENODE)
+            if(rCurrentNode.GetNodeType() == SwNodeType::Section
+                ||rCurrentNode.GetNodeType() == SwNodeType::Table)
             {
                 bInsertNodes = true;
                 break;
diff --git a/sw/source/filter/writer/wrt_fn.cxx b/sw/source/filter/writer/wrt_fn.cxx
index 6eca856..6d06165 100644
--- a/sw/source/filter/writer/wrt_fn.cxx
+++ b/sw/source/filter/writer/wrt_fn.cxx
@@ -133,13 +133,13 @@ Writer& Out( const SwNodeFnTab pTab, SwNode& rNode, Writer & rWrt )
     sal_uInt16 nId = RES_TXTNODE;
     switch (pCNd->GetNodeType())
     {
-        case ND_TEXTNODE:
+        case SwNodeType::Text:
             nId = RES_TXTNODE;
              break;
-        case ND_GRFNODE:
+        case SwNodeType::Grf:
             nId = RES_GRFNODE;
             break;
-        case ND_OLENODE:
+        case SwNodeType::Ole:
             nId = RES_OLENODE;
             break;
         default:
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 5d38ce1..5b7f5a9 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -221,11 +221,11 @@ namespace ww8
                     }
                     switch (rNd.GetNodeType())
                     {
-                        case ND_GRFNODE:
+                        case SwNodeType::Grf:
                             meWriterType = eGraphic;
                             maSize = rNd.GetNoTextNode()->GetTwipSize();
                             break;
-                        case ND_OLENODE:
+                        case SwNodeType::Ole:
                             meWriterType = eOle;
                             maSize = rNd.GetNoTextNode()->GetTwipSize();
                             break;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index b654cdb..645116c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2915,10 +2915,10 @@ sal_Int32 SwEscherEx::WriteFlyFrame(const DrawObj &rObj, sal_uInt32 &rShapeId,
         SwNodeIndex aIdx( *pNdIdx, 1 );
         switch( aIdx.GetNode().GetNodeType() )
         {
-        case ND_GRFNODE:
+        case SwNodeType::Grf:
             nBorderThick = WriteGrfFlyFrame( rFormat, rShapeId = GenerateShapeId() );
             break;
-        case ND_OLENODE:
+        case SwNodeType::Ole:
             nBorderThick = WriteOLEFlyFrame( rFormat, rShapeId = GenerateShapeId() );
             break;
         default:
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 87173db..94839ed 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3099,20 +3099,17 @@ void MSWordExportBase::OutputContentNode( const SwContentNode& rNode )
 {
     switch ( rNode.GetNodeType() )
     {
-        case ND_TEXTNODE:
-        {
-            const SwTextNode& rTextNode = *rNode.GetTextNode();
-            OutputTextNode( rTextNode );
-        }
-        break;
-        case ND_GRFNODE:
+        case SwNodeType::Text:
+            OutputTextNode( *rNode.GetTextNode() );
+            break;
+        case SwNodeType::Grf:
             OutputGrfNode( *rNode.GetGrfNode() );
             break;
-        case ND_OLENODE:
+        case SwNodeType::Ole:
             OutputOLENode( *rNode.GetOLENode() );
             break;
         default:
-            OSL_TRACE("Unhandled node, type == %d", rNode.GetNodeType() );
+            OSL_TRACE("Unhandled node, type == %d", (int)rNode.GetNodeType() );
             break;
     }
 }
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index c777532..ecd2326 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2674,7 +2674,7 @@ void WW8TabDesc::ParkPaM()
         {
             m_pIo->m_pPaM->GetPoint()->nNode = nSttNd;
         }
-        while (m_pIo->m_pPaM->GetNode().GetNodeType() != ND_TEXTNODE && ++nSttNd < nEndNd);
+        while (m_pIo->m_pPaM->GetNode().GetNodeType() != SwNodeType::Text && ++nSttNd < nEndNd);
 
         m_pIo->m_pPaM->GetPoint()->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), 0);
         m_pIo->m_rDoc.SetTextFormatColl(*m_pIo->m_pPaM, const_cast<SwTextFormatColl*>(m_pIo->m_pDfltTextFormatColl));
@@ -2967,7 +2967,7 @@ void WW8TabDesc::SetPamInCell(short nWwCol, bool bPam)
             {
                 m_pIo->m_pPaM->GetPoint()->nNode = nSttNd;
             }
-            while (m_pIo->m_pPaM->GetNode().GetNodeType() != ND_TEXTNODE && ++nSttNd < nEndNd);
+            while (m_pIo->m_pPaM->GetNode().GetNodeType() != SwNodeType::Text && ++nSttNd < nEndNd);
             m_pIo->m_pPaM->GetPoint()->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), 0);
             // Precautionally set now, otherwise the style is not set for cells
             // that are inserted for margin balancing.
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 61da23c..9e8a3f8 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -329,7 +329,7 @@ uno::Reference < embed::XEmbeddedObject > SwTransferable::FindOLEObj( sal_Int64&
     {
         SwIterator<SwContentNode,SwFormatColl> aIter( *m_pClpDocFac->GetDoc()->GetDfltGrfFormatColl() );
         for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
-            if( ND_OLENODE == pNd->GetNodeType() )
+            if( SwNodeType::Ole == pNd->GetNodeType() )
             {
                 xObj = static_cast<SwOLENode*>(pNd)->GetOLEObj().GetOleRef();
                 nAspect = static_cast<SwOLENode*>(pNd)->GetAspect();
@@ -345,7 +345,7 @@ const Graphic* SwTransferable::FindOLEReplacementGraphic() const
     {
         SwIterator<SwContentNode,SwFormatColl> aIter( *m_pClpDocFac->GetDoc()->GetDfltGrfFormatColl() );
         for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
-            if( ND_OLENODE == pNd->GetNodeType() )
+            if( SwNodeType::Ole == pNd->GetNodeType() )
             {
                 return static_cast<SwOLENode*>(pNd)->GetGraphic();
             }


More information about the Libreoffice-commits mailing list