sw/inc/IDocumentStylePoolAccess.hxx                     |   20 
 sw/inc/SwStyleNameMapper.hxx                            |   25 
 sw/inc/ToxLinkProcessor.hxx                             |    2 
 sw/inc/doc.hxx                                          |    2 
 sw/inc/editsh.hxx                                       |   10 
 sw/inc/fmtinfmt.hxx                                     |   13 
 sw/inc/fmtruby.hxx                                      |    6 
 sw/inc/format.hxx                                       |    7 
 sw/inc/numrule.hxx                                      |    6 
 sw/inc/pagedesc.hxx                                     |    4 
 sw/inc/poolfmt.hxx                                      |  563 +++++++-------
 sw/inc/redline.hxx                                      |    4 
 sw/inc/tox.hxx                                          |    5 
 sw/qa/core/test_ToxLinkProcessor.cxx                    |   13 
 sw/qa/filter/md/md.cxx                                  |   10 
 sw/qa/uibase/shells/textsh1.cxx                         |    2 
 sw/source/core/attr/format.cxx                          |    3 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   24 
 sw/source/core/doc/DocumentLayoutManager.cxx            |   12 
 sw/source/core/doc/DocumentRedlineManager.cxx           |    3 
 sw/source/core/doc/DocumentStylePoolManager.cxx         |  633 ++++++++--------
 sw/source/core/doc/SwStyleNameMapper.cxx                |  252 +++---
 sw/source/core/doc/acmplwrd.cxx                         |    4 
 sw/source/core/doc/doc.cxx                              |    6 
 sw/source/core/doc/docdesc.cxx                          |    8 
 sw/source/core/doc/docdraw.cxx                          |    6 
 sw/source/core/doc/docfmt.cxx                           |    2 
 sw/source/core/doc/docftn.cxx                           |   32 
 sw/source/core/doc/doclay.cxx                           |   20 
 sw/source/core/doc/docnew.cxx                           |    8 
 sw/source/core/doc/docnum.cxx                           |    6 
 sw/source/core/doc/docredln.cxx                         |   10 
 sw/source/core/doc/doctxm.cxx                           |   30 
 sw/source/core/doc/htmltbl.cxx                          |    4 
 sw/source/core/doc/lineinfo.cxx                         |    2 
 sw/source/core/doc/notxtfrm.cxx                         |    4 
 sw/source/core/doc/number.cxx                           |   11 
 sw/source/core/doc/poolfmt.cxx                          |  140 +--
 sw/source/core/doc/tblafmt.cxx                          |    6 
 sw/source/core/doc/tblcpy.cxx                           |   15 
 sw/source/core/doc/tblrwcl.cxx                          |    4 
 sw/source/core/docnode/ndnum.cxx                        |    2 
 sw/source/core/docnode/ndtbl.cxx                        |   14 
 sw/source/core/docnode/section.cxx                      |    2 
 sw/source/core/edit/autofmt.cxx                         |   40 -
 sw/source/core/edit/edfcol.cxx                          |    8 
 sw/source/core/edit/edfmt.cxx                           |    6 
 sw/source/core/fields/docufld.cxx                       |    2 
 sw/source/core/fields/reffld.cxx                        |   28 
 sw/source/core/frmedt/fedesc.cxx                        |    5 
 sw/source/core/inc/DocumentStylePoolManager.hxx         |   18 
 sw/source/core/layout/ftnfrm.cxx                        |    2 
 sw/source/core/layout/pagedesc.cxx                      |    4 
 sw/source/core/layout/paintfrm.cxx                      |    2 
 sw/source/core/swg/SwXMLTextBlocks.cxx                  |    2 
 sw/source/core/tox/ToxLinkProcessor.cxx                 |    7 
 sw/source/core/tox/ToxTextGenerator.cxx                 |    2 
 sw/source/core/tox/tox.cxx                              |    4 
 sw/source/core/txtnode/atrftn.cxx                       |    6 
 sw/source/core/txtnode/fmtatr2.cxx                      |   14 
 sw/source/core/txtnode/ndtxt.cxx                        |    2 
 sw/source/core/txtnode/thints.cxx                       |    4 
 sw/source/core/txtnode/txtatr2.cxx                      |    6 
 sw/source/core/undo/SwUndoFmt.cxx                       |   18 
 sw/source/core/undo/undel.cxx                           |    2 
 sw/source/core/undo/unsect.cxx                          |    4 
 sw/source/core/undo/untbl.cxx                           |    2 
 sw/source/core/unocore/unocrsrhelper.cxx                |    8 
 sw/source/core/unocore/unofield.cxx                     |   14 
 sw/source/core/unocore/unoflatpara.cxx                  |    2 
 sw/source/core/unocore/unoframe.cxx                     |    6 
 sw/source/core/unocore/unoobj.cxx                       |    4 
 sw/source/core/unocore/unoredline.cxx                   |    2 
 sw/source/core/unocore/unoredlines.cxx                  |    4 
 sw/source/core/unocore/unosett.cxx                      |   16 
 sw/source/core/unocore/unostyle.cxx                     |   97 +-
 sw/source/filter/ascii/parasc.cxx                       |    4 
 sw/source/filter/basflt/shellio.cxx                     |   12 
 sw/source/filter/docx/swdocxreader.cxx                  |    4 
 sw/source/filter/html/css1atr.cxx                       |  199 ++---
 sw/source/filter/html/htmlatr.cxx                       |   36 
 sw/source/filter/html/htmlcss1.cxx                      |  156 +--
 sw/source/filter/html/htmlctxt.cxx                      |    4 
 sw/source/filter/html/htmldrawreader.cxx                |    2 
 sw/source/filter/html/htmlflywriter.cxx                 |    4 
 sw/source/filter/html/htmlgrin.cxx                      |   16 
 sw/source/filter/html/htmlnumreader.cxx                 |    8 
 sw/source/filter/html/htmlsect.cxx                      |    4 
 sw/source/filter/html/htmltab.cxx                       |   33 
 sw/source/filter/html/htmltabw.cxx                      |    8 
 sw/source/filter/html/swcss1.hxx                        |   14 
 sw/source/filter/html/swhtml.cxx                        |   86 +-
 sw/source/filter/html/swhtml.hxx                        |   12 
 sw/source/filter/html/wrthtml.cxx                       |   24 
 sw/source/filter/html/wrthtml.hxx                       |    8 
 sw/source/filter/md/mdcallbcks.cxx                      |    4 
 sw/source/filter/md/swmd.cxx                            |   30 
 sw/source/filter/md/wrtmd.cxx                           |   30 
 sw/source/filter/rtf/swparrtf.cxx                       |    4 
 sw/source/filter/ww8/docxattributeoutput.cxx            |    2 
 sw/source/filter/ww8/docxexport.cxx                     |    4 
 sw/source/filter/ww8/writerhelper.cxx                   |   10 
 sw/source/filter/ww8/writerwordglue.cxx                 |   72 -
 sw/source/filter/ww8/wrtw8esh.cxx                       |    2 
 sw/source/filter/ww8/wrtw8nds.cxx                       |    2 
 sw/source/filter/ww8/wrtw8sty.cxx                       |  142 +--
 sw/source/filter/ww8/wrtww8.cxx                         |    2 
 sw/source/filter/ww8/ww8atr.cxx                         |    6 
 sw/source/filter/ww8/ww8glsy.cxx                        |    2 
 sw/source/filter/ww8/ww8par.cxx                         |    6 
 sw/source/filter/ww8/ww8par2.cxx                        |    2 
 sw/source/filter/ww8/ww8par5.cxx                        |    6 
 sw/source/filter/xml/XMLRedlineImportHelper.cxx         |    4 
 sw/source/filter/xml/swxml.cxx                          |    2 
 sw/source/filter/xml/xmlfmt.cxx                         |    4 
 sw/source/filter/xml/xmlfmte.cxx                        |    3 
 sw/source/filter/xml/xmlimp.cxx                         |    2 
 sw/source/filter/xml/xmltbli.cxx                        |    2 
 sw/source/ui/chrdlg/break.cxx                           |    4 
 sw/source/ui/config/optload.cxx                         |    8 
 sw/source/ui/config/optpage.cxx                         |   34 
 sw/source/ui/dbui/dbinsdlg.cxx                          |    6 
 sw/source/ui/envelp/envfmt.cxx                          |    4 
 sw/source/ui/envelp/envlop1.cxx                         |    4 
 sw/source/ui/fmtui/tmpdlg.cxx                           |    6 
 sw/source/ui/frmdlg/cption.cxx                          |   16 
 sw/source/ui/index/cnttab.cxx                           |   16 
 sw/source/ui/misc/docfnote.cxx                          |    6 
 sw/source/ui/misc/num.cxx                               |    4 
 sw/source/ui/misc/outline.cxx                           |    8 
 sw/source/ui/misc/titlepage.cxx                         |    6 
 sw/source/ui/table/tabledlg.cxx                         |    2 
 sw/source/uibase/app/appenv.cxx                         |   20 
 sw/source/uibase/app/applab.cxx                         |    6 
 sw/source/uibase/app/docshini.cxx                       |   50 -
 sw/source/uibase/app/docst.cxx                          |   20 
 sw/source/uibase/app/docstyle.cxx                       |  206 ++---
 sw/source/uibase/config/uinums.cxx                      |    4 
 sw/source/uibase/frmdlg/frmmgr.cxx                      |   10 
 sw/source/uibase/inc/uinums.hxx                         |    2 
 sw/source/uibase/shells/txtattr.cxx                     |    4 
 sw/source/uibase/shells/txtnum.cxx                      |    4 
 sw/source/uibase/uiview/viewdlg2.cxx                    |    6 
 sw/source/uibase/uno/unotxdoc.cxx                       |    4 
 sw/source/uibase/uno/unotxvw.cxx                        |    2 
 sw/source/uibase/utlui/uitool.cxx                       |    8 
 sw/source/uibase/wrtsh/wrtsh1.cxx                       |   12 
 sw/source/writerfilter/dmapper/StyleSheetTable.cxx      |  234 ++---
 148 files changed, 2009 insertions(+), 1980 deletions(-)

New commits:
commit d11198b7bd6659647e491dbbdc17a13f3ef93611
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Jan 16 15:52:00 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Jan 20 11:53:19 2026 +0100

    convert RES_POOL* constants to scoped enum
    
    Add a new UNKNOWN constant instead of using USHRT_MAX.
    
    Not sure about the naming of the ZERO constant. Maybe
    it should be DEFAULT.
    
    Change-Id: Ia1d0c0e0036c3dbd52cb4cdd935d0c736dcea5fd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197455
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/inc/IDocumentStylePoolAccess.hxx 
b/sw/inc/IDocumentStylePoolAccess.hxx
index 32a16634a624..70e98f97c75e 100644
--- a/sw/inc/IDocumentStylePoolAccess.hxx
+++ b/sw/inc/IDocumentStylePoolAccess.hxx
@@ -27,6 +27,7 @@ class SwFormat;
 class SwFrameFormat;
 class SwNumRule;
 class SwPageDesc;
+enum class SwPoolFormatId : sal_uInt16;
 
 /** Access to the style pool
  */
@@ -38,29 +39,30 @@ public:
         If string pointer is defined request only description
         of attributes, do not create style sheet!
     */
-    virtual SwTextFormatColl* GetTextCollFromPool(sal_uInt16 nId, bool 
bRegardLanguage = true) = 0;
+    virtual SwTextFormatColl* GetTextCollFromPool(SwPoolFormatId nId, bool 
bRegardLanguage = true)
+        = 0;
 
     /** Return required automatic format base class.
     */
-    virtual SwFormat* GetFormatFromPool(sal_uInt16 nId) = 0;
+    virtual SwFormat* GetFormatFromPool(SwPoolFormatId nId) = 0;
 
     /** Return required automatic format.
      */
-    virtual SwFrameFormat* GetFrameFormatFromPool(sal_uInt16 nId) = 0;
+    virtual SwFrameFormat* GetFrameFormatFromPool(SwPoolFormatId nId) = 0;
 
-    virtual SwCharFormat* GetCharFormatFromPool(sal_uInt16 nId) = 0;
+    virtual SwCharFormat* GetCharFormatFromPool(SwPoolFormatId nId) = 0;
 
     /** Return required automatic page style.
      */
-    virtual SwPageDesc* GetPageDescFromPool(sal_uInt16 nId, bool 
bRegardLanguage = true) = 0;
+    virtual SwPageDesc* GetPageDescFromPool(SwPoolFormatId nId, bool 
bRegardLanguage = true) = 0;
 
-    virtual SwNumRule* GetNumRuleFromPool(sal_uInt16 nId) = 0;
+    virtual SwNumRule* GetNumRuleFromPool(SwPoolFormatId nId) = 0;
 
     /** Check whether this "auto-collection" is used in document.
      */
-    virtual bool IsPoolTextCollUsed(sal_uInt16 nId) const = 0;
-    virtual bool IsPoolFormatUsed(sal_uInt16 nId) const = 0;
-    virtual bool IsPoolPageDescUsed(sal_uInt16 nId) const = 0;
+    virtual bool IsPoolTextCollUsed(SwPoolFormatId nId) const = 0;
+    virtual bool IsPoolFormatUsed(SwPoolFormatId nId) const = 0;
+    virtual bool IsPoolPageDescUsed(SwPoolFormatId nId) const = 0;
 
 protected:
     virtual ~IDocumentStylePoolAccess(){};
diff --git a/sw/inc/SwStyleNameMapper.hxx b/sw/inc/SwStyleNameMapper.hxx
index eff343c9c76f..4cde545b0b0f 100644
--- a/sw/inc/SwStyleNameMapper.hxx
+++ b/sw/inc/SwStyleNameMapper.hxx
@@ -27,6 +27,8 @@
 #include <unordered_map>
 #include <vector>
 
+enum class SwPoolFormatId : sal_uInt16;
+
 /** This class holds all data about the names of styles used in the user
  * interface (UI names...these are localised into different languages).
  * These UI names are loaded from the resource files on demand.
@@ -71,7 +73,6 @@
  * " (user)", we simply remove it.
  */
 
-
 typedef std::unordered_map<OUString, sal_uInt16> NameToIdHash;
 
 class SwStyleNameMapper final
@@ -79,9 +80,9 @@ class SwStyleNameMapper final
     friend void InitCore();
     friend void FinitCore();
 
-    static void fillProgNameFromId(sal_uInt16 nId, ProgName &rName);
-    static void fillUINameFromId(sal_uInt16 nId, UIName &rName);
-    static const OUString& getNameFromId(sal_uInt16 nId, const OUString &rName,
+    static void fillProgNameFromId(SwPoolFormatId nId, ProgName &rName);
+    static void fillUINameFromId(SwPoolFormatId nId, UIName &rName);
+    static const OUString& getNameFromId(SwPoolFormatId nId, const OUString 
&rName,
                                          bool bProgName);
     static const NameToIdHash& getHashTable ( SwGetPoolIdFromName, bool 
bProgName );
 #ifdef _NEED_TO_DEBUG_MAPPING
@@ -103,30 +104,30 @@ public:
                             SwGetPoolIdFromName);
 
     // This gets the UI Name from the Pool ID
-    SW_DLLPUBLIC static void FillUIName(sal_uInt16 nId, UIName& rFillName);
+    SW_DLLPUBLIC static void FillUIName(SwPoolFormatId nId, UIName& rFillName);
     SAL_WARN_UNUSED_RESULT
-    SW_DLLPUBLIC static UIName GetUIName(sal_uInt16 nId,
+    SW_DLLPUBLIC static UIName GetUIName(SwPoolFormatId nId,
                                                   const ProgName& rName);
 
     // This gets the programmatic Name from the Pool ID
-    static         void FillProgName(sal_uInt16 nId, ProgName& rFillName);
+    static         void FillProgName(SwPoolFormatId nId, ProgName& rFillName);
     SAL_WARN_UNUSED_RESULT
-    SW_DLLPUBLIC static ProgName GetProgName(sal_uInt16 nId,
+    SW_DLLPUBLIC static ProgName GetProgName(SwPoolFormatId nId,
                                                     const UIName& rName);
 
     // This gets the PoolId from the UI Name
     SAL_WARN_UNUSED_RESULT
-    SW_DLLPUBLIC static sal_uInt16 GetPoolIdFromUIName(const UIName& rName,
+    SW_DLLPUBLIC static SwPoolFormatId GetPoolIdFromUIName(const UIName& rName,
                                                        SwGetPoolIdFromName);
 
     // Get the Pool ID from the programmatic name
     SAL_WARN_UNUSED_RESULT
-    SW_DLLPUBLIC static sal_uInt16 GetPoolIdFromProgName(const ProgName& rName,
+    SW_DLLPUBLIC static SwPoolFormatId GetPoolIdFromProgName(const ProgName& 
rName,
                                             SwGetPoolIdFromName);
 
     // used to convert the 4 special ExtraProg/UINames for
-    // RES_POOLCOLL_LABEL_DRAWING,  RES_POOLCOLL_LABEL_ABB,
-    // RES_POOLCOLL_LABEL_TABLE, RES_POOLCOLL_LABEL_FRAME
+    // SwPoolFormatId::COLL_LABEL_DRAWING,  SwPoolFormatId::COLL_LABEL_ABB,
+    // SwPoolFormatId::COLL_LABEL_TABLE, SwPoolFormatId::COLL_LABEL_FRAME
     // forth and back.
     // Non-matching names remain unchanged.
     SAL_WARN_UNUSED_RESULT
diff --git a/sw/inc/ToxLinkProcessor.hxx b/sw/inc/ToxLinkProcessor.hxx
index d3b800ca7050..cab6c9fcd5f5 100644
--- a/sw/inc/ToxLinkProcessor.hxx
+++ b/sw/inc/ToxLinkProcessor.hxx
@@ -53,7 +53,7 @@ private:
      * @internal
      * This method is overridden in the unittests. You should not override it 
yourself.
      */
-    virtual sal_uInt16
+    virtual SwPoolFormatId
     ObtainPoolId(const UIName& characterStyle) const;
 
     /** Information about a started link */
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 07cc168fad7f..13d74f056df6 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1537,7 +1537,7 @@ public:
     void SetAutoFormatRedline( bool bFlag )    { mbIsAutoFormatRedline = 
bFlag; }
 
     // For AutoFormat: with Undo/Redlining.
-    void SetTextFormatCollByAutoFormat( const SwPosition& rPos, sal_uInt16 
nPoolId,
+    void SetTextFormatCollByAutoFormat( const SwPosition& rPos, SwPoolFormatId 
nPoolId,
                                 const SfxItemSet* pSet );
     void SetFormatItemByAutoFormat( const SwPaM& rPam, const SfxItemSet& );
 
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index aaa90df40c6c..716341d3bc56 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -348,21 +348,21 @@ public:
     SW_DLLPUBLIC SwTextFormatColl* FindTextFormatCollByName( const UIName& 
rName ) const;
 
     /// @return "Auto-Collection" with given Id. If it does not exist create 
it.
-    SW_DLLPUBLIC SwTextFormatColl* GetTextCollFromPool( sal_uInt16 nId );
+    SW_DLLPUBLIC SwTextFormatColl* GetTextCollFromPool( SwPoolFormatId nId );
 
     /// @return required automatic format base class.
-    SwFormat* GetFormatFromPool( sal_uInt16 nId );
+    SwFormat* GetFormatFromPool( SwPoolFormatId nId );
 
     /// @return required automatic page style.
-    SW_DLLPUBLIC SwPageDesc* GetPageDescFromPool( sal_uInt16 nId );
+    SW_DLLPUBLIC SwPageDesc* GetPageDescFromPool( SwPoolFormatId nId );
 
     /// Query if the paragraph-/character-/frame-/page-style is used.
     SW_DLLPUBLIC bool IsUsed( const sw::BroadcastingModify& ) const;
 
     /// @return required automatic format.
-    SwFrameFormat* GetFrameFormatFromPool( sal_uInt16 nId )
+    SwFrameFormat* GetFrameFormatFromPool( SwPoolFormatId nId )
         { return static_cast<SwFrameFormat*>(SwEditShell::GetFormatFromPool( 
nId )); }
-    SwCharFormat* GetCharFormatFromPool( sal_uInt16 nId )
+    SwCharFormat* GetCharFormatFromPool( SwPoolFormatId nId )
         { return static_cast<SwCharFormat*>(SwEditShell::GetFormatFromPool( 
nId )); }
 
     void SetClassification(const OUString& rName, SfxClassificationPolicyType 
eType);
diff --git a/sw/inc/fmtinfmt.hxx b/sw/inc/fmtinfmt.hxx
index 0eb796c9ef47..389738b8e443 100644
--- a/sw/inc/fmtinfmt.hxx
+++ b/sw/inc/fmtinfmt.hxx
@@ -29,6 +29,7 @@ class SvxMacro;
 class SvxMacroTableDtor;
 class SwTextINetFormat;
 enum class SvMacroItemId : sal_uInt16;
+enum class SwPoolFormatId : sal_uInt16;
 
 /// SfxPoolItem subclass that contains data about an inserted hyperlink / URL 
in Writer text. Its
 /// location is tracked by the wrapping SwTextINetFormat.
@@ -45,8 +46,8 @@ class SW_DLLPUBLIC SwFormatINetFormat final
     OUString msHyperlinkName;        ///< Name of the link.
     std::unique_ptr<SvxMacroTableDtor> mpMacroTable;
     SwTextINetFormat* mpTextAttr;         ///< My TextAttribute.
-    sal_uInt16 mnINetFormatId;
-    sal_uInt16 mnVisitedFormatId;
+    SwPoolFormatId mnINetFormatId;
+    SwPoolFormatId mnVisitedFormatId;
 public:
     DECLARE_ITEM_TYPE_FUNCTION(SwFormatINetFormat)
     SwFormatINetFormat( OUString aURL, OUString aTarget );
@@ -94,7 +95,7 @@ public:
 
     void SetINetFormatAndId(
             const UIName& rNm,
-            const sal_uInt16 nId )
+            const SwPoolFormatId nId )
     {
         msINetFormatName = rNm;
         mnINetFormatId = nId;
@@ -105,14 +106,14 @@ public:
         return msINetFormatName;
     }
 
-    sal_uInt16 GetINetFormatId() const
+    SwPoolFormatId GetINetFormatId() const
     {
         return mnINetFormatId;
     }
 
     void SetVisitedFormatAndId(
             const UIName& rNm,
-            const sal_uInt16 nId )
+            const SwPoolFormatId nId )
     {
         msVisitedFormatName = rNm;
         mnVisitedFormatId = nId;
@@ -123,7 +124,7 @@ public:
         return msVisitedFormatName;
     }
 
-    sal_uInt16 GetVisitedFormatId() const
+    SwPoolFormatId GetVisitedFormatId() const
     {
         return mnVisitedFormatId;
     }
diff --git a/sw/inc/fmtruby.hxx b/sw/inc/fmtruby.hxx
index e1cf4ff0cd52..161c455d5565 100644
--- a/sw/inc/fmtruby.hxx
+++ b/sw/inc/fmtruby.hxx
@@ -34,7 +34,7 @@ class SW_DLLPUBLIC SwFormatRuby final : public SfxPoolItem
     OUString m_sRubyText;                     ///< The ruby text.
     UIName m_sCharFormatName;                 ///< Name of the charformat.
     SwTextRuby* m_pTextAttr;                  ///< The TextAttribute.
-    sal_uInt16 m_nCharFormatId;               ///< PoolId of the charformat.
+    SwPoolFormatId m_nCharFormatId;           ///< PoolId of the charformat.
     sal_uInt16 m_nPosition;                   ///< Position of the 
Ruby-character.
     css::text::RubyAdjust m_eAdjustment;      ///< Specific adjustment of the 
Ruby-ch.
 
@@ -67,8 +67,8 @@ public:
     const UIName& GetCharFormatName() const             { return 
m_sCharFormatName; }
     void SetCharFormatName( const UIName& rNm )  { m_sCharFormatName = rNm; }
 
-    sal_uInt16 GetCharFormatId() const                 { return 
m_nCharFormatId; }
-    void SetCharFormatId( sal_uInt16 nNew )            { m_nCharFormatId = 
nNew; }
+    SwPoolFormatId GetCharFormatId() const                 { return 
m_nCharFormatId; }
+    void SetCharFormatId( SwPoolFormatId nNew )            { m_nCharFormatId = 
nNew; }
 
     sal_uInt16 GetPosition() const                  { return m_nPosition; }
     void SetPosition( sal_uInt16 nNew )             { m_nPosition = nNew; }
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index bc1ddda6b3ca..06a38919ca4d 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -37,6 +37,7 @@ class IDocumentChartDataProviderAccess;
 class SwDoc;
 class SfxGrabBagItem;
 class SwTextGridItem;
+enum class SwPoolFormatId : sal_uInt16;
 
 namespace drawinglayer::attribute {
     class SdrAllFillAttributesHelper;
@@ -52,7 +53,7 @@ class SW_DLLPUBLIC SwFormat : public sw::BorderCacheOwner, 
public sw::Broadcasti
     SwAttrSet m_aSet;
 
     sal_uInt16 m_nWhichId;
-    sal_uInt16 m_nPoolFormatId;        /**< Id for "automatically" created 
formats.
+    SwPoolFormatId m_nPoolFormatId;        /**< Id for "automatically" created 
formats.
                                        (is not hard attribution!!!) */
     sal_uInt32 m_nPoolHelpId;       ///< HelpId for this Pool-style.
     sal_uInt8 m_nPoolHlpFileId;     ///< FilePos to Doc to these style helps.
@@ -163,8 +164,8 @@ public:
     IDocumentChartDataProviderAccess& getIDocumentChartDataProviderAccess();
 
     /// Get and set Pool style IDs.
-    sal_uInt16 GetPoolFormatId() const { return m_nPoolFormatId; }
-    void SetPoolFormatId( sal_uInt16 nId ) { m_nPoolFormatId = nId; }
+    SwPoolFormatId GetPoolFormatId() const { return m_nPoolFormatId; }
+    void SetPoolFormatId( SwPoolFormatId nId ) { m_nPoolFormatId = nId; }
 
     /// Get and set Help-IDs for document templates.
     sal_uInt32 GetPoolHelpId() const { return m_nPoolHelpId; }
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index c22320d43291..e541d4047c92 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -126,7 +126,7 @@ private:
 
     UIName msName;
     SwNumRuleType meRuleType;
-    sal_uInt16 mnPoolFormatId;      ///< Id-for NumRules created 
"automatically"
+    SwPoolFormatId mnPoolFormatId;      ///< Id-for NumRules created 
"automatically"
     sal_uInt16 mnPoolHelpId;     ///< HelpId for this Pool-style.
     sal_uInt8 mnPoolHlpFileId;   ///< FilePos at Doc on style helps.
     bool mbAutoRuleFlag : 1;
@@ -250,8 +250,8 @@ public:
     void SetUsedByRedline(bool bUsed )  { mbUsedByRedline = bUsed; }
 
     /// Query and set PoolFormat IDs.
-    sal_uInt16 GetPoolFormatId() const         { return mnPoolFormatId; }
-    void SetPoolFormatId( sal_uInt16 nId )     { mnPoolFormatId = nId; }
+    SwPoolFormatId GetPoolFormatId() const         { return mnPoolFormatId; }
+    void SetPoolFormatId( SwPoolFormatId nId )     { mnPoolFormatId = nId; }
 
     /// Query and set Help-IDs for document styles.
     sal_uInt16 GetPoolHelpId() const        { return mnPoolHelpId; }
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index a9bfa1379269..580279efbe18 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -275,8 +275,8 @@ public:
     void RegisterChange();
 
     /// Query and set PoolFormat-Id.
-    sal_uInt16 GetPoolFormatId() const         { return 
m_Master.GetPoolFormatId(); }
-    void SetPoolFormatId(sal_uInt16 const nId) { 
m_Master.SetPoolFormatId(nId); }
+    SwPoolFormatId GetPoolFormatId() const         { return 
m_Master.GetPoolFormatId(); }
+    void SetPoolFormatId(SwPoolFormatId const nId) { 
m_Master.SetPoolFormatId(nId); }
     sal_uInt16 GetPoolHelpId() const        { return m_Master.GetPoolHelpId(); 
}
     void SetPoolHelpId(sal_uInt32 const nId){ m_Master.SetPoolHelpId(nId); }
     sal_uInt8 GetPoolHlpFileId() const      { return 
m_Master.GetPoolHlpFileId(); }
diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx
index 4823e8c47383..fb9307bb82a2 100644
--- a/sw/inc/poolfmt.hxx
+++ b/sw/inc/poolfmt.hxx
@@ -79,18 +79,10 @@ const sal_uInt16 POOLGRP_NUMRULE        = (3 << 11) + 
POOLGRP_NOCOLLID;
 const sal_uInt16 POOLGRP_TABSTYLE       = (4 << 11) + POOLGRP_NOCOLLID;
 const sal_uInt16 POOLGRP_CELLSTYLE      = (5 << 11) + POOLGRP_NOCOLLID;
 
-/// Recognize whether it's a user defined style or not:
-const sal_uInt16 POOL_IDUSER_FMT =
-        USHRT_MAX & ~(COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID);
-
-inline bool IsPoolUserFormat( sal_uInt16 nId )
-{
-    return POOL_IDUSER_FMT == (nId & ~(COLL_GET_RANGE_BITS + 
POOLGRP_NOCOLLID));
-}
-
 /// IDs for the ranges.
-enum RES_POOLFMT
+enum class SwPoolFormatId : sal_uInt16
 {
+ZERO = 0,
 RES_POOLFMT_BEGIN = 1,
 RES_POOL_CHRFMT = RES_POOLFMT_BEGIN,
 RES_POOL_FRMFMT,
@@ -99,359 +91,362 @@ RES_POOL_PAGEFMT,
 
 RES_POOL_PARFMT,
 RES_POOL_GRFFMT,
-RES_POOLFMT_END
-};
+RES_POOLFMT_END,
 
 /// Ranges for the IDs of the formats.
 
 /// IDs for character styles.
-enum RES_POOL_CHRFMT_TYPE
-{
-RES_POOLCHR_BEGIN = POOLGRP_CHARFMT,
-RES_POOLCHR_NORMAL_BEGIN = POOLGRP_CHARFMT,
-
-RES_POOLCHR_FOOTNOTE = RES_POOLCHR_NORMAL_BEGIN,    ///< Footnote.
-RES_POOLCHR_PAGENO,                                 ///< Pages/field.
-RES_POOLCHR_LABEL,                                  ///< Label.
-RES_POOLCHR_DROPCAPS,                               ///< Dropcaps.
-RES_POOLCHR_NUM_LEVEL,                              ///< Numbering symbols
-RES_POOLCHR_BULLET_LEVEL,                           ///< Bullets.
-
-RES_POOLCHR_INET_NORMAL,                            ///< Internet normal.
-RES_POOLCHR_INET_VISIT,                             ///< Internet visited.
-RES_POOLCHR_JUMPEDIT,                               ///< Placeholder.
-RES_POOLCHR_TOXJUMP,                                ///< Jump from index.
-RES_POOLCHR_ENDNOTE,                                ///< Endnote.
-RES_POOLCHR_LINENUM,                                ///< Line numbering.
-RES_POOLCHR_IDX_MAIN_ENTRY,                         ///< Main entry in indices.
-RES_POOLCHR_FOOTNOTE_ANCHOR,                        ///< Footnote anchor.
-RES_POOLCHR_ENDNOTE_ANCHOR,                         ///< Endnote anchor.
-RES_POOLCHR_RUBYTEXT,                               ///< Rubytext.
-RES_POOLCHR_VERT_NUM,                               ///< Vertical numbering 
symbols.
-
-RES_POOLCHR_NORMAL_END,
-
-RES_POOLCHR_HTML_BEGIN = RES_POOLCHR_BEGIN + 50,    ///< HTML-styles.
-RES_POOLCHR_HTML_EMPHASIS = RES_POOLCHR_HTML_BEGIN,
-RES_POOLCHR_HTML_CITATION,
-RES_POOLCHR_HTML_STRONG,
-RES_POOLCHR_HTML_CODE,
-RES_POOLCHR_HTML_SAMPLE,
-RES_POOLCHR_HTML_KEYBOARD,
-RES_POOLCHR_HTML_VARIABLE,
-RES_POOLCHR_HTML_DEFINSTANCE,
-RES_POOLCHR_HTML_TELETYPE,
-RES_POOLCHR_HTML_END,
-
-RES_POOLCHR_END = RES_POOLCHR_HTML_END
-};
+CHR_BEGIN = POOLGRP_CHARFMT,
+CHR_NORMAL_BEGIN = POOLGRP_CHARFMT,
+
+CHR_FOOTNOTE = CHR_NORMAL_BEGIN,    ///< Footnote.
+CHR_PAGENO,                                 ///< Pages/field.
+CHR_LABEL,                                  ///< Label.
+CHR_DROPCAPS,                               ///< Dropcaps.
+CHR_NUM_LEVEL,                              ///< Numbering symbols
+CHR_BULLET_LEVEL,                           ///< Bullets.
+
+CHR_INET_NORMAL,                            ///< Internet normal.
+CHR_INET_VISIT,                             ///< Internet visited.
+CHR_JUMPEDIT,                               ///< Placeholder.
+CHR_TOXJUMP,                                ///< Jump from index.
+CHR_ENDNOTE,                                ///< Endnote.
+CHR_LINENUM,                                ///< Line numbering.
+CHR_IDX_MAIN_ENTRY,                         ///< Main entry in indices.
+CHR_FOOTNOTE_ANCHOR,                        ///< Footnote anchor.
+CHR_ENDNOTE_ANCHOR,                         ///< Endnote anchor.
+CHR_RUBYTEXT,                               ///< Rubytext.
+CHR_VERT_NUM,                               ///< Vertical numbering symbols.
+
+CHR_NORMAL_END,
+
+CHR_HTML_BEGIN = CHR_BEGIN + 50,    ///< HTML-styles.
+CHR_HTML_EMPHASIS = CHR_HTML_BEGIN,
+CHR_HTML_CITATION,
+CHR_HTML_STRONG,
+CHR_HTML_CODE,
+CHR_HTML_SAMPLE,
+CHR_HTML_KEYBOARD,
+CHR_HTML_VARIABLE,
+CHR_HTML_DEFINSTANCE,
+CHR_HTML_TELETYPE,
+CHR_HTML_END,
+
+CHR_END = CHR_HTML_END,
 
 /// IDs for frame styles.
-enum RES_POOL_FRMFMT_TYPE
-{
-RES_POOLFRM_BEGIN = POOLGRP_FRAMEFMT,
-
-RES_POOLFRM_FRAME = RES_POOLFRM_BEGIN,              ///< Frame.
-RES_POOLFRM_GRAPHIC,                                ///< Graphics.
-RES_POOLFRM_OLE,                                    ///< OLE.
-RES_POOLFRM_FORMEL,                                 ///< Formula.
-RES_POOLFRM_MARGINAL,                               ///< Marginalia.
-RES_POOLFRM_WATERSIGN,                              ///< Watermark.
-RES_POOLFRM_LABEL,                                  ///< Labels.
-RES_POOLFRM_INLINE_HEADING,                         ///< Inline Heading.
-
-RES_POOLFRM_END
-};
+FRM_BEGIN = POOLGRP_FRAMEFMT,
+
+FRM_FRAME = FRM_BEGIN,              ///< Frame.
+FRM_GRAPHIC,                                ///< Graphics.
+FRM_OLE,                                    ///< OLE.
+FRM_FORMEL,                                 ///< Formula.
+FRM_MARGINAL,                               ///< Marginalia.
+FRM_WATERSIGN,                              ///< Watermark.
+FRM_LABEL,                                  ///< Labels.
+FRM_INLINE_HEADING,                         ///< Inline Heading.
+
+FRM_END,
 
 /// IDs for page styles.
-enum RES_POOL_PAGEFMT_TYPE
-{
-RES_POOLPAGE_BEGIN = POOLGRP_PAGEDESC,
-
-RES_POOLPAGE_STANDARD = RES_POOLPAGE_BEGIN,         ///< Standard page.
-RES_POOLPAGE_FIRST,                                 ///< First page.
-RES_POOLPAGE_LEFT,                                  ///< Left page.
-RES_POOLPAGE_RIGHT,                                 ///< Right page.
-RES_POOLPAGE_ENVELOPE,                              ///< Envelope.
-RES_POOLPAGE_REGISTER,                              ///< Index.
-RES_POOLPAGE_HTML,                                  ///< HTML.
-RES_POOLPAGE_FOOTNOTE,                              ///< Footnote at end of 
document.
-RES_POOLPAGE_ENDNOTE,                               ///< Endnote page.
-RES_POOLPAGE_LANDSCAPE,                             ///< Landscape page style.
-
-RES_POOLPAGE_END
-};
+PAGE_BEGIN = POOLGRP_PAGEDESC,
+
+PAGE_STANDARD = PAGE_BEGIN,         ///< Standard page.
+PAGE_FIRST,                                 ///< First page.
+PAGE_LEFT,                                  ///< Left page.
+PAGE_RIGHT,                                 ///< Right page.
+PAGE_ENVELOPE,                              ///< Envelope.
+PAGE_REGISTER,                              ///< Index.
+PAGE_HTML,                                  ///< HTML.
+PAGE_FOOTNOTE,                              ///< Footnote at end of document.
+PAGE_ENDNOTE,                               ///< Endnote page.
+PAGE_LANDSCAPE,                             ///< Landscape page style.
+
+PAGE_END,
 
 // IDs for list styles.
-enum RES_POOL_NUMRULE_TYPE
-{
-RES_POOLNUMRULE_BEGIN = POOLGRP_NUMRULE,
-RES_POOLNUMRULE_NOLIST = RES_POOLNUMRULE_BEGIN,
-RES_POOLNUMRULE_NUM1,                               ///< NumRule Numbering 123.
-RES_POOLNUMRULE_NUM2,                               ///< NumRule Numbering ABC.
-RES_POOLNUMRULE_NUM3,                               ///< NumRule Numbering abc.
-RES_POOLNUMRULE_NUM4,                               ///< NumRule Numbering IVX.
-RES_POOLNUMRULE_NUM5,                               ///< NumRule Numbering ivx.
-RES_POOLNUMRULE_BUL1,                               ///< NumRule Bullets 1.
-RES_POOLNUMRULE_BUL2,                               ///< NumRule Bullets 2.
-RES_POOLNUMRULE_BUL3,                               ///< NumRule Bullets 3.
-RES_POOLNUMRULE_BUL4,                               ///< NumRule Bullets 4.
-RES_POOLNUMRULE_BUL5,                               ///< NumRule Bullets 5.
-RES_POOLNUMRULE_END
-};
+NUMRULE_BEGIN = POOLGRP_NUMRULE,
+NUMRULE_NOLIST = NUMRULE_BEGIN,
+NUMRULE_NUM1,                               ///< NumRule Numbering 123.
+NUMRULE_NUM2,                               ///< NumRule Numbering ABC.
+NUMRULE_NUM3,                               ///< NumRule Numbering abc.
+NUMRULE_NUM4,                               ///< NumRule Numbering IVX.
+NUMRULE_NUM5,                               ///< NumRule Numbering ivx.
+NUMRULE_BUL1,                               ///< NumRule Bullets 1.
+NUMRULE_BUL2,                               ///< NumRule Bullets 2.
+NUMRULE_BUL3,                               ///< NumRule Bullets 3.
+NUMRULE_BUL4,                               ///< NumRule Bullets 4.
+NUMRULE_BUL5,                               ///< NumRule Bullets 5.
+NUMRULE_END,
 
 // IDs for table styles.
-enum RES_POOL_TABLESTYLE_TYPE
-{
-RES_POOLTABLESTYLE_BEGIN = POOLGRP_TABSTYLE,
-RES_POOLTABLESTYLE_DEFAULT = RES_POOLTABLESTYLE_BEGIN,
+TABLESTYLE_BEGIN = POOLGRP_TABSTYLE,
+TABLESTYLE_DEFAULT = TABLESTYLE_BEGIN,
 // 16 old styles
-RES_POOLTABLESTYLE_3D,
-RES_POOLTABLESTYLE_BLACK1,
-RES_POOLTABLESTYLE_BLACK2,
-RES_POOLTABLESTYLE_BLUE,
-RES_POOLTABLESTYLE_BROWN,
-RES_POOLTABLESTYLE_CURRENCY,
-RES_POOLTABLESTYLE_CURRENCY_3D,
-RES_POOLTABLESTYLE_CURRENCY_GRAY,
-RES_POOLTABLESTYLE_CURRENCY_LAVENDER,
-RES_POOLTABLESTYLE_CURRENCY_TURQUOISE,
-RES_POOLTABLESTYLE_GRAY,
-RES_POOLTABLESTYLE_GREEN,
-RES_POOLTABLESTYLE_LAVENDER,
-RES_POOLTABLESTYLE_RED,
-RES_POOLTABLESTYLE_TURQUOISE,
-RES_POOLTABLESTYLE_YELLOW,
+TABLESTYLE_3D,
+TABLESTYLE_BLACK1,
+TABLESTYLE_BLACK2,
+TABLESTYLE_BLUE,
+TABLESTYLE_BROWN,
+TABLESTYLE_CURRENCY,
+TABLESTYLE_CURRENCY_3D,
+TABLESTYLE_CURRENCY_GRAY,
+TABLESTYLE_CURRENCY_LAVENDER,
+TABLESTYLE_CURRENCY_TURQUOISE,
+TABLESTYLE_GRAY,
+TABLESTYLE_GREEN,
+TABLESTYLE_LAVENDER,
+TABLESTYLE_RED,
+TABLESTYLE_TURQUOISE,
+TABLESTYLE_YELLOW,
 // 10 new styles since LibreOffice 6.0
-RES_POOLTABLESTYLE_LO6_ACADEMIC,
-RES_POOLTABLESTYLE_LO6_BOX_LIST_BLUE,
-RES_POOLTABLESTYLE_LO6_BOX_LIST_GREEN,
-RES_POOLTABLESTYLE_LO6_BOX_LIST_RED,
-RES_POOLTABLESTYLE_LO6_BOX_LIST_YELLOW,
-RES_POOLTABLESTYLE_LO6_ELEGANT,
-RES_POOLTABLESTYLE_LO6_FINANCIAL,
-RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_COLUMNS,
-RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_ROWS,
-RES_POOLTABLESTYLE_LO6_SIMPLE_LIST_SHADED,
-RES_POOLTABLESTYLE_END
-};
-
-enum RES_POOL_CELLSTYLE_TYPE
-{
-RES_POOLCELLSTYLE_BEGIN = POOLGRP_CELLSTYLE,
-RES_POOLCELLSTYLE_END = RES_POOLCELLSTYLE_BEGIN
-};
+TABLESTYLE_LO6_ACADEMIC,
+TABLESTYLE_LO6_BOX_LIST_BLUE,
+TABLESTYLE_LO6_BOX_LIST_GREEN,
+TABLESTYLE_LO6_BOX_LIST_RED,
+TABLESTYLE_LO6_BOX_LIST_YELLOW,
+TABLESTYLE_LO6_ELEGANT,
+TABLESTYLE_LO6_FINANCIAL,
+TABLESTYLE_LO6_SIMPLE_GRID_COLUMNS,
+TABLESTYLE_LO6_SIMPLE_GRID_ROWS,
+TABLESTYLE_LO6_SIMPLE_LIST_SHADED,
+TABLESTYLE_END,
+
+CELLSTYLE_BEGIN = POOLGRP_CELLSTYLE,
+CELLSTYLE_END = CELLSTYLE_BEGIN,
 
 // IDs for paragraph styles.
-enum RES_POOL_COLLFMT_TYPE
-{
 // Group text.
-RES_POOLCOLL_TEXT_BEGIN = COLL_TEXT_BITS,
+COLL_TEXT_BEGIN = COLL_TEXT_BITS,
 
-RES_POOLCOLL_STANDARD = RES_POOLCOLL_TEXT_BEGIN,        ///< Standard.
-RES_POOLCOLL_TEXT,                                      ///< Text body.
-RES_POOLCOLL_TEXT_IDENT,                                ///< Text body first 
line indent.
-RES_POOLCOLL_TEXT_NEGIDENT,                             ///< Text body hanging 
indent.
-RES_POOLCOLL_TEXT_MOVE,                                 ///< Text body indent.
-RES_POOLCOLL_GREETING,                                  ///< Complimentary 
close.
-RES_POOLCOLL_SIGNATURE,                                 ///< Signature.
-RES_POOLCOLL_CONFRONTATION,                             ///< List indent.
-RES_POOLCOLL_MARGINAL,                                  ///< Marginalia.
+COLL_STANDARD = COLL_TEXT_BEGIN,        ///< Standard.
+COLL_TEXT,                                      ///< Text body.
+COLL_TEXT_IDENT,                                ///< Text body first line 
indent.
+COLL_TEXT_NEGIDENT,                             ///< Text body hanging indent.
+COLL_TEXT_MOVE,                                 ///< Text body indent.
+COLL_GREETING,                                  ///< Complimentary close.
+COLL_SIGNATURE,                                 ///< Signature.
+COLL_CONFRONTATION,                             ///< List indent.
+COLL_MARGINAL,                                  ///< Marginalia.
 
-RES_POOLCOLL_TEXT_END,
+COLL_TEXT_END,
 
 /// Group lists.
-RES_POOLCOLL_LISTS_BEGIN = COLL_LISTS_BITS,
+COLL_LISTS_BEGIN = COLL_LISTS_BITS,
 
-RES_POOLCOLL_NUMBER_BULLET_BASE = RES_POOLCOLL_LISTS_BEGIN,    ///< Base list.
+COLL_NUMBER_BULLET_BASE = COLL_LISTS_BEGIN,    ///< Base list.
 
 /// Subgroup numberings.
-RES_POOLCOLL_NUM_LEVEL1S,                               ///< Start 1st level.
-RES_POOLCOLL_NUM_LEVEL1,                                ///< 1st level.
-RES_POOLCOLL_NUM_LEVEL1E,                               ///< End 1st level.
-RES_POOLCOLL_NUM_NONUM1,                                ///< No numbering.
-RES_POOLCOLL_NUM_LEVEL2S,                               ///< Start 2nd level.
-RES_POOLCOLL_NUM_LEVEL2,                                ///< 2nd level.
-RES_POOLCOLL_NUM_LEVEL2E,                               ///< End 2nd level.
-RES_POOLCOLL_NUM_NONUM2,                                ///< No numbering.
-RES_POOLCOLL_NUM_LEVEL3S,                               ///< Start 3rd level.
-RES_POOLCOLL_NUM_LEVEL3,                                ///< 3rd level.
-RES_POOLCOLL_NUM_LEVEL3E,                               ///< End 3rd level.
-RES_POOLCOLL_NUM_NONUM3,                                ///< No numbering.
-RES_POOLCOLL_NUM_LEVEL4S,                               ///< Start 4th level.
-RES_POOLCOLL_NUM_LEVEL4,                                ///< 4th level.
-RES_POOLCOLL_NUM_LEVEL4E,                               ///< End 4th level.
-RES_POOLCOLL_NUM_NONUM4,                                ///< No numbering.
-RES_POOLCOLL_NUM_LEVEL5S,                               ///< Start 5th level.
-RES_POOLCOLL_NUM_LEVEL5,                                ///< 5th level.
-RES_POOLCOLL_NUM_LEVEL5E,                               ///< End 5th level.
-RES_POOLCOLL_NUM_NONUM5,                                ///< No numbering.
+COLL_NUM_LEVEL1S,                               ///< Start 1st level.
+COLL_NUM_LEVEL1,                                ///< 1st level.
+COLL_NUM_LEVEL1E,                               ///< End 1st level.
+COLL_NUM_NONUM1,                                ///< No numbering.
+COLL_NUM_LEVEL2S,                               ///< Start 2nd level.
+COLL_NUM_LEVEL2,                                ///< 2nd level.
+COLL_NUM_LEVEL2E,                               ///< End 2nd level.
+COLL_NUM_NONUM2,                                ///< No numbering.
+COLL_NUM_LEVEL3S,                               ///< Start 3rd level.
+COLL_NUM_LEVEL3,                                ///< 3rd level.
+COLL_NUM_LEVEL3E,                               ///< End 3rd level.
+COLL_NUM_NONUM3,                                ///< No numbering.
+COLL_NUM_LEVEL4S,                               ///< Start 4th level.
+COLL_NUM_LEVEL4,                                ///< 4th level.
+COLL_NUM_LEVEL4E,                               ///< End 4th level.
+COLL_NUM_NONUM4,                                ///< No numbering.
+COLL_NUM_LEVEL5S,                               ///< Start 5th level.
+COLL_NUM_LEVEL5,                                ///< 5th level.
+COLL_NUM_LEVEL5E,                               ///< End 5th level.
+COLL_NUM_NONUM5,                                ///< No numbering.
 
 ///Subgroup bullets.
-RES_POOLCOLL_BULLET_LEVEL1S,                               ///< Start 1st 
level.
-RES_POOLCOLL_BULLET_LEVEL1,                                ///< 1st level.
-RES_POOLCOLL_BULLET_LEVEL1E,                               ///< End 1st level
-RES_POOLCOLL_BULLET_NONUM1,                                ///< No numbering.
-RES_POOLCOLL_BULLET_LEVEL2S,                               ///< Start 2nd 
level.
-RES_POOLCOLL_BULLET_LEVEL2,                                ///< 2nd level.
-RES_POOLCOLL_BULLET_LEVEL2E,                               ///< End 2nd level.
-RES_POOLCOLL_BULLET_NONUM2,                                ///< No numbering.
-RES_POOLCOLL_BULLET_LEVEL3S,                               ///< Start 3rd 
level.
-RES_POOLCOLL_BULLET_LEVEL3,                                ///< 3rd Level.
-RES_POOLCOLL_BULLET_LEVEL3E,                               ///< End 3rd level.
-RES_POOLCOLL_BULLET_NONUM3,                                ///< No numbering.
-RES_POOLCOLL_BULLET_LEVEL4S,                               ///< Start 4th 
level.
-RES_POOLCOLL_BULLET_LEVEL4,                                ///< 4th level.
-RES_POOLCOLL_BULLET_LEVEL4E,                               ///< End 4th level.
-RES_POOLCOLL_BULLET_NONUM4,                                ///< No numbering.
-RES_POOLCOLL_BULLET_LEVEL5S,                               ///< Start 5th 
level.
-RES_POOLCOLL_BULLET_LEVEL5,                                ///< 5th level.
-RES_POOLCOLL_BULLET_LEVEL5E,                               ///< End 5th Level.
-RES_POOLCOLL_BULLET_NONUM5,                                ///< No numbering.
-
-RES_POOLCOLL_LISTS_END,
+COLL_BULLET_LEVEL1S,                               ///< Start 1st level.
+COLL_BULLET_LEVEL1,                                ///< 1st level.
+COLL_BULLET_LEVEL1E,                               ///< End 1st level
+COLL_BULLET_NONUM1,                                ///< No numbering.
+COLL_BULLET_LEVEL2S,                               ///< Start 2nd level.
+COLL_BULLET_LEVEL2,                                ///< 2nd level.
+COLL_BULLET_LEVEL2E,                               ///< End 2nd level.
+COLL_BULLET_NONUM2,                                ///< No numbering.
+COLL_BULLET_LEVEL3S,                               ///< Start 3rd level.
+COLL_BULLET_LEVEL3,                                ///< 3rd Level.
+COLL_BULLET_LEVEL3E,                               ///< End 3rd level.
+COLL_BULLET_NONUM3,                                ///< No numbering.
+COLL_BULLET_LEVEL4S,                               ///< Start 4th level.
+COLL_BULLET_LEVEL4,                                ///< 4th level.
+COLL_BULLET_LEVEL4E,                               ///< End 4th level.
+COLL_BULLET_NONUM4,                                ///< No numbering.
+COLL_BULLET_LEVEL5S,                               ///< Start 5th level.
+COLL_BULLET_LEVEL5,                                ///< 5th level.
+COLL_BULLET_LEVEL5E,                               ///< End 5th Level.
+COLL_BULLET_NONUM5,                                ///< No numbering.
+
+COLL_LISTS_END,
 
 /// Special ranges.
-RES_POOLCOLL_EXTRA_BEGIN = COLL_EXTRA_BITS,
+COLL_EXTRA_BEGIN = COLL_EXTRA_BITS,
 
 /// Subgroup header.
-RES_POOLCOLL_HEADERFOOTER = RES_POOLCOLL_EXTRA_BEGIN,   ///< Header and Footer.
-RES_POOLCOLL_HEADER,                                    ///< Header Left&Right.
-RES_POOLCOLL_HEADERL,                                   ///< Header Left.
-RES_POOLCOLL_HEADERR,                                   ///< Header Right.
+COLL_HEADERFOOTER = COLL_EXTRA_BEGIN,   ///< Header and Footer.
+COLL_HEADER,                                    ///< Header Left&Right.
+COLL_HEADERL,                                   ///< Header Left.
+COLL_HEADERR,                                   ///< Header Right.
 
 /// Subgroup footer.
-RES_POOLCOLL_FOOTER,                                    ///< Footer Left&Right.
-RES_POOLCOLL_FOOTERL,                                   ///< Footer Left.
-RES_POOLCOLL_FOOTERR,                                   ///< Footer Right.
+COLL_FOOTER,                                    ///< Footer Left&Right.
+COLL_FOOTERL,                                   ///< Footer Left.
+COLL_FOOTERR,                                   ///< Footer Right.
 
 /// Subgroup table.
-RES_POOLCOLL_TABLE,                                     ///< Table of Contents.
-RES_POOLCOLL_TABLE_HDLN,                                ///< Table of Contents 
- heading.
+COLL_TABLE,                                     ///< Table of Contents.
+COLL_TABLE_HDLN,                                ///< Table of Contents - 
heading.
 
 /// Subgroup labels.
-RES_POOLCOLL_LABEL,                                     ///< Base labels.
-RES_POOLCOLL_LABEL_ABB,                                 ///< Label 
illustration.
-RES_POOLCOLL_LABEL_TABLE,                               ///< Label table.
-RES_POOLCOLL_LABEL_FRAME,                               ///< Label frame.
-RES_POOLCOLL_LABEL_FIGURE,                              ///< Label figure
+COLL_LABEL,                                     ///< Base labels.
+COLL_LABEL_ABB,                                 ///< Label illustration.
+COLL_LABEL_TABLE,                               ///< Label table.
+COLL_LABEL_FRAME,                               ///< Label frame.
+COLL_LABEL_FIGURE,                              ///< Label figure
 
 /// Other stuff.
-RES_POOLCOLL_FRAME,                                     ///< Frames.
-RES_POOLCOLL_FOOTNOTE,                                  ///< Footnotes.
-RES_POOLCOLL_ENVELOPE_ADDRESS,                          ///< Addressee.
-RES_POOLCOLL_SEND_ADDRESS,                              ///< Sender.
-RES_POOLCOLL_ENDNOTE,                                   ///< Endnotes.
+COLL_FRAME,                                     ///< Frames.
+COLL_FOOTNOTE,                                  ///< Footnotes.
+COLL_ENVELOPE_ADDRESS,                          ///< Addressee.
+COLL_SEND_ADDRESS,                              ///< Sender.
+COLL_ENDNOTE,                                   ///< Endnotes.
 
-RES_POOLCOLL_LABEL_DRAWING,                             ///< Label drawing 
objects.
-RES_POOLCOLL_COMMENT,                                   ///< Comment
+COLL_LABEL_DRAWING,                             ///< Label drawing objects.
+COLL_COMMENT,                                   ///< Comment
 
-RES_POOLCOLL_EXTRA_END,
+COLL_EXTRA_END,
 
 /// Group indices.
-RES_POOLCOLL_REGISTER_BEGIN = COLL_REGISTER_BITS,
+COLL_REGISTER_BEGIN = COLL_REGISTER_BITS,
 
-RES_POOLCOLL_REGISTER_BASE = RES_POOLCOLL_REGISTER_BEGIN,   ///< Base index.
+COLL_REGISTER_BASE = COLL_REGISTER_BEGIN,   ///< Base index.
 
 /// Subgroup index tables.
-RES_POOLCOLL_TOX_IDXH,                                  ///< Header.
-RES_POOLCOLL_TOX_IDX1,                                  ///< 1st level.
-RES_POOLCOLL_TOX_IDX2,                                  ///< 2nd level.
-RES_POOLCOLL_TOX_IDX3,                                  ///< 3rd level.
-RES_POOLCOLL_TOX_IDXBREAK,                              ///< Separator.
+COLL_TOX_IDXH,                                  ///< Header.
+COLL_TOX_IDX1,                                  ///< 1st level.
+COLL_TOX_IDX2,                                  ///< 2nd level.
+COLL_TOX_IDX3,                                  ///< 3rd level.
+COLL_TOX_IDXBREAK,                              ///< Separator.
 
 /// Subgroup table of contents.
-RES_POOLCOLL_TOX_CNTNTH,                                ///< Header.
-RES_POOLCOLL_TOX_CNTNT1,                                ///< Content 1st level.
-RES_POOLCOLL_TOX_CNTNT2,                                ///< Content 2nd level.
-RES_POOLCOLL_TOX_CNTNT3,                                ///< Content 3rd level.
-RES_POOLCOLL_TOX_CNTNT4,                                ///< Content 4th level.
-RES_POOLCOLL_TOX_CNTNT5,                                ///< Content 5th level.
+COLL_TOX_CNTNTH,                                ///< Header.
+COLL_TOX_CNTNT1,                                ///< Content 1st level.
+COLL_TOX_CNTNT2,                                ///< Content 2nd level.
+COLL_TOX_CNTNT3,                                ///< Content 3rd level.
+COLL_TOX_CNTNT4,                                ///< Content 4th level.
+COLL_TOX_CNTNT5,                                ///< Content 5th level.
 
 /// Subgroup user indices.
-RES_POOLCOLL_TOX_USERH,                                 ///< Header.
-RES_POOLCOLL_TOX_USER1,                                 ///< 1st level.
-RES_POOLCOLL_TOX_USER2,                                 ///< 2nd level.
-RES_POOLCOLL_TOX_USER3,                                 ///< 3rd level.
-RES_POOLCOLL_TOX_USER4,                                 ///< 4th level.
-RES_POOLCOLL_TOX_USER5,                                 ///< 5th level.
-
-RES_POOLCOLL_TOX_CNTNT6,                                ///< Content  6th 
level.
-RES_POOLCOLL_TOX_CNTNT7,                                ///< Content  7th 
level.
-RES_POOLCOLL_TOX_CNTNT8,                                ///< Content  8th 
level.
-RES_POOLCOLL_TOX_CNTNT9,                                ///< Content  9th 
level.
-RES_POOLCOLL_TOX_CNTNT10,                               ///< Content 10th 
level.
+COLL_TOX_USERH,                                 ///< Header.
+COLL_TOX_USER1,                                 ///< 1st level.
+COLL_TOX_USER2,                                 ///< 2nd level.
+COLL_TOX_USER3,                                 ///< 3rd level.
+COLL_TOX_USER4,                                 ///< 4th level.
+COLL_TOX_USER5,                                 ///< 5th level.
+
+COLL_TOX_CNTNT6,                                ///< Content  6th level.
+COLL_TOX_CNTNT7,                                ///< Content  7th level.
+COLL_TOX_CNTNT8,                                ///< Content  8th level.
+COLL_TOX_CNTNT9,                                ///< Content  9th level.
+COLL_TOX_CNTNT10,                               ///< Content 10th level.
 
 /// illustrations index.
-RES_POOLCOLL_TOX_ILLUSH,                                ///< Illustrations 
header.
-RES_POOLCOLL_TOX_ILLUS1,                                ///< Illustrations all 
levels.
+COLL_TOX_ILLUSH,                                ///< Illustrations header.
+COLL_TOX_ILLUS1,                                ///< Illustrations all levels.
 
 ///  object index.
-RES_POOLCOLL_TOX_OBJECTH,                               ///< Objects header.
-RES_POOLCOLL_TOX_OBJECT1,                               ///< Objects all 
levels.
+COLL_TOX_OBJECTH,                               ///< Objects header.
+COLL_TOX_OBJECT1,                               ///< Objects all levels.
 
 ///  tables index.
-RES_POOLCOLL_TOX_TABLESH,                               ///< Tables header.
-RES_POOLCOLL_TOX_TABLES1,                               ///< Tables all levels.
+COLL_TOX_TABLESH,                               ///< Tables header.
+COLL_TOX_TABLES1,                               ///< Tables all levels.
 
 ///  index of authorities.
-RES_POOLCOLL_TOX_AUTHORITIESH,                          ///< Authorities 
header.
-RES_POOLCOLL_TOX_AUTHORITIES1,                          ///< Authorities all 
levels.
+COLL_TOX_AUTHORITIESH,                          ///< Authorities header.
+COLL_TOX_AUTHORITIES1,                          ///< Authorities all levels.
 
 /// user index 6..10.
-RES_POOLCOLL_TOX_USER6,                                 ///< 6th  level.
-RES_POOLCOLL_TOX_USER7,                                 ///< 7th  level.
-RES_POOLCOLL_TOX_USER8,                                 ///< 8th  level.
-RES_POOLCOLL_TOX_USER9,                                 ///< 9th  level.
-RES_POOLCOLL_TOX_USER10,                                ///< 10th level.
+COLL_TOX_USER6,                                 ///< 6th  level.
+COLL_TOX_USER7,                                 ///< 7th  level.
+COLL_TOX_USER8,                                 ///< 8th  level.
+COLL_TOX_USER9,                                 ///< 9th  level.
+COLL_TOX_USER10,                                ///< 10th level.
 
-RES_POOLCOLL_REGISTER_END,
+COLL_REGISTER_END,
 
 /// Group chapter / document.
-RES_POOLCOLL_DOC_BEGIN = COLL_DOC_BITS,
+COLL_DOC_BEGIN = COLL_DOC_BITS,
 
-RES_POOLCOLL_DOC_TITLE = RES_POOLCOLL_DOC_BEGIN,        ///< Doc. title.
-RES_POOLCOLL_DOC_SUBTITLE,                              ///< Doc. subtitle.
-RES_POOLCOLL_DOC_APPENDIX,                              ///< Doc. appendix.
+COLL_DOC_TITLE = COLL_DOC_BEGIN,        ///< Doc. title.
+COLL_DOC_SUBTITLE,                              ///< Doc. subtitle.
+COLL_DOC_APPENDIX,                              ///< Doc. appendix.
 
 /// Subgroup headings.
-RES_POOLCOLL_HEADLINE_BASE, ///< Base heading.
-RES_POOLCOLL_HEADLINE1, ///< Heading 1.
-RES_POOLCOLL_HEADLINE2, ///< Heading 2.
-RES_POOLCOLL_HEADLINE3, ///< Heading 3.
-RES_POOLCOLL_HEADLINE4, ///< Heading 4.
-RES_POOLCOLL_HEADLINE5, ///< Heading 5.
-RES_POOLCOLL_HEADLINE6, ///< Heading 6.
-RES_POOLCOLL_HEADLINE7, ///< Heading 7.
-RES_POOLCOLL_HEADLINE8, ///< Heading 8.
-RES_POOLCOLL_HEADLINE9, ///< Heading 9.
-RES_POOLCOLL_HEADLINE10, ///< Heading 10.
-
-RES_POOLCOLL_DOC_END,
+COLL_HEADLINE_BASE, ///< Base heading.
+COLL_HEADLINE1, ///< Heading 1.
+COLL_HEADLINE2, ///< Heading 2.
+COLL_HEADLINE3, ///< Heading 3.
+COLL_HEADLINE4, ///< Heading 4.
+COLL_HEADLINE5, ///< Heading 5.
+COLL_HEADLINE6, ///< Heading 6.
+COLL_HEADLINE7, ///< Heading 7.
+COLL_HEADLINE8, ///< Heading 8.
+COLL_HEADLINE9, ///< Heading 9.
+COLL_HEADLINE10, ///< Heading 10.
+
+COLL_DOC_END,
 
 /// Group HTML-styles.
-RES_POOLCOLL_HTML_BEGIN = COLL_HTML_BITS,
+COLL_HTML_BEGIN = COLL_HTML_BITS,
 
-RES_POOLCOLL_HTML_BLOCKQUOTE = RES_POOLCOLL_HTML_BEGIN,
-RES_POOLCOLL_HTML_PRE,
-RES_POOLCOLL_HTML_HR,
-RES_POOLCOLL_HTML_DD,
-RES_POOLCOLL_HTML_DT,
+COLL_HTML_BLOCKQUOTE = COLL_HTML_BEGIN,
+COLL_HTML_PRE,
+COLL_HTML_HR,
+COLL_HTML_DD,
+COLL_HTML_DT,
 
-RES_POOLCOLL_HTML_END
+COLL_HTML_END,
 
 /// End of text styles collection.
+
+UNKNOWN = USHRT_MAX
+
 };
+/// End of SwPoolFormatId
+
+// We do a fair amount of calculation on these values to extract sub-ranges, 
etc, so
+// add some operators to make that less verbose.
+inline constexpr SwPoolFormatId operator-(SwPoolFormatId lhs, SwPoolFormatId 
rhs)
+{ return SwPoolFormatId(sal_uInt16(lhs) - sal_uInt16(rhs)); }
+inline constexpr SwPoolFormatId operator&(SwPoolFormatId lhs, SwPoolFormatId 
rhs)
+{ return SwPoolFormatId(sal_uInt16(lhs) & sal_uInt16(rhs)); }
+inline constexpr SwPoolFormatId operator+(SwPoolFormatId lhs, sal_uInt16 rhs)
+{ return SwPoolFormatId(sal_uInt16(lhs) + rhs); }
+inline constexpr SwPoolFormatId operator-(SwPoolFormatId lhs, sal_uInt16 rhs)
+{ return SwPoolFormatId(sal_uInt16(lhs) - rhs); }
+
+/// Recognize whether it's a user defined style or not:
+const sal_uInt16 POOL_IDUSER_FMT =
+        USHRT_MAX & ~(COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID);
+
+inline bool IsPoolUserFormat( SwPoolFormatId nId )
+{
+    return POOL_IDUSER_FMT == (sal_uInt16(nId) & ~(COLL_GET_RANGE_BITS + 
POOLGRP_NOCOLLID));
+}
 
 /** Query defined parent of a POOL-ID
    Returns  0 if standard
-            USHRT_MAX if no parent
+            SwPoolFormatId::UNKNOWN if no parent
             the parent in all other cases. */
-sal_uInt16 GetPoolParent( sal_uInt16 nId );
+SwPoolFormatId GetPoolParent( SwPoolFormatId nId );
 
 SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage);
 
-bool IsConditionalByPoolId(sal_uInt16 nId);
+bool IsConditionalByPoolId(SwPoolFormatId nId);
 
 #endif
 
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 0eca2fb5481f..a37db1e0ebbf 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -55,10 +55,10 @@ class SW_DLLPUBLIC SwRedlineExtraData_FormatColl final : 
public SwRedlineExtraDa
 {
     UIName m_sFormatNm;
     std::shared_ptr<SfxItemSet> m_pSet;
-    sal_uInt16 m_nPoolId;
+    SwPoolFormatId m_nPoolId;
     bool m_bFormatAll; // don't strip the last paragraph mark
 public:
-    SwRedlineExtraData_FormatColl( UIName aColl, sal_uInt16 nPoolFormatId,
+    SwRedlineExtraData_FormatColl( UIName aColl, SwPoolFormatId nPoolFormatId,
                                 const std::shared_ptr<SfxItemSet>& pSet = 
nullptr, bool bFormatAll = true );
     virtual ~SwRedlineExtraData_FormatColl() override;
     virtual SwRedlineExtraData* CreateNew() const override;
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index 44861ad639c1..dbb807f73640 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -37,6 +37,7 @@
 #include "swtypes.hxx"
 #include "toxe.hxx"
 #include "chpfld.hxx"
+#include "poolfmt.hxx"
 
 class SwTOXType;
 class SwTOXMark;
@@ -248,7 +249,7 @@ struct SW_DLLPUBLIC SwFormToken
     UIName          sCharStyleName;
     SwTwips         nTabStopPosition;
     FormTokenType   eTokenType;
-    sal_uInt16          nPoolId;
+    SwPoolFormatId  nPoolId;
     SvxTabAdjust    eTabAlign;
     SwChapterFormat     nChapterFormat;     //SwChapterFormat;
     sal_uInt16          nOutlineLevel;//the maximum permitted outline level in 
numbering
@@ -261,7 +262,7 @@ struct SW_DLLPUBLIC SwFormToken
     SwFormToken(FormTokenType eType ) :
         nTabStopPosition(0),
         eTokenType(eType),
-        nPoolId(USHRT_MAX),
+        nPoolId(SwPoolFormatId::UNKNOWN),
         eTabAlign( SvxTabAdjust::Left ),
         nChapterFormat(SwChapterFormat::Number),
         nOutlineLevel(MAXLEVEL),   //default to maximum outline level
diff --git a/sw/qa/core/test_ToxLinkProcessor.cxx 
b/sw/qa/core/test_ToxLinkProcessor.cxx
index a44626fe7540..027090a4283d 100644
--- a/sw/qa/core/test_ToxLinkProcessor.cxx
+++ b/sw/qa/core/test_ToxLinkProcessor.cxx
@@ -12,6 +12,7 @@
 #include <rtl/ustring.hxx>
 
 #include <ToxLinkProcessor.hxx>
+#include <poolfmt.hxx>
 
 #include <cppunit/TestAssert.h>
 #include <cppunit/extensions/HelperMacros.h>
@@ -42,14 +43,14 @@ public:
 
     static constexpr OUString STYLE_NAME_1 = u"anyStyle1"_ustr;
     static constexpr OUString STYLE_NAME_2 = u"anyStyle2"_ustr;
-    static const sal_uInt16 POOL_ID_1;
-    static const sal_uInt16 POOL_ID_2;
+    static const SwPoolFormatId POOL_ID_1;
+    static const SwPoolFormatId POOL_ID_2;
     static constexpr OUString URL_1 = u"#anyUrl1"_ustr;
     static constexpr OUString URL_2 = u"#anyUrl2"_ustr;
 };
 
-const sal_uInt16 ToxLinkProcessorTest::POOL_ID_1 = 42;
-const sal_uInt16 ToxLinkProcessorTest::POOL_ID_2 = 43;
+const SwPoolFormatId ToxLinkProcessorTest::POOL_ID_1 = SwPoolFormatId(42);
+const SwPoolFormatId ToxLinkProcessorTest::POOL_ID_2 = SwPoolFormatId(43);
 
 void
 ToxLinkProcessorTest::NoExceptionIsThrownIfTooManyLinksAreClosed()
@@ -87,7 +88,7 @@ namespace {
 
 class ToxLinkProcessorWithOverriddenObtainPoolId : public ToxLinkProcessor {
 public:
-    virtual sal_uInt16
+    virtual SwPoolFormatId
     ObtainPoolId(const UIName& characterStyle) const override {
         if (characterStyle == ToxLinkProcessorTest::STYLE_NAME_1) {
             return ToxLinkProcessorTest::POOL_ID_1;
@@ -95,7 +96,7 @@ public:
         if (characterStyle == ToxLinkProcessorTest::STYLE_NAME_2) {
             return ToxLinkProcessorTest::POOL_ID_2;
         }
-        return 0;
+        return SwPoolFormatId::ZERO;
     }
 };
 
diff --git a/sw/qa/filter/md/md.cxx b/sw/qa/filter/md/md.cxx
index bf888e7f555c..c64b16c8b9c1 100644
--- a/sw/qa/filter/md/md.cxx
+++ b/sw/qa/filter/md/md.cxx
@@ -254,7 +254,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingCodeSpan)
     pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, 
/*bBasicCall=*/false);
     pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, 
/*bBasicCall=*/false);
     SwView& rView = pWrtShell->GetView();
-    SwTextFormatColl* pColl = 
rIDSPA.GetTextCollFromPool(RES_POOLCOLL_HTML_PRE);
+    SwTextFormatColl* pColl = 
rIDSPA.GetTextCollFromPool(SwPoolFormatId::COLL_HTML_PRE);
     SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aSet(rView.GetPool());
     aSet.Put(pColl->GetFont());
     pWrtShell->SetAttrSet(aSet);
@@ -425,7 +425,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBlockQuoteMdImport)
     SwFormatColl* pActual = pTextNode->GetFormatColl();
     SwDoc* pDoc = pDocShell->GetDoc();
     IDocumentStylePoolAccess& rIDSPA = pDoc->getIDocumentStylePoolAccess();
-    SwFormatColl* pExpected = 
rIDSPA.GetTextCollFromPool(RES_POOLCOLL_HTML_BLOCKQUOTE);
+    SwFormatColl* pExpected = 
rIDSPA.GetTextCollFromPool(SwPoolFormatId::COLL_HTML_BLOCKQUOTE);
     // Without the accompanying fix in place, this test would have failed with:
     // - Expected: Block Quotation
     // - Actual  : Body Text
@@ -442,7 +442,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBlockQuoteMdExport)
     SwCursor* pCursor = pWrtShell->GetCursor();
     SwDoc* pDoc = pDocShell->GetDoc();
     IDocumentStylePoolAccess& rIDSPA = pDoc->getIDocumentStylePoolAccess();
-    SwTextFormatColl* pColl = 
rIDSPA.GetTextCollFromPool(RES_POOLCOLL_HTML_BLOCKQUOTE);
+    SwTextFormatColl* pColl = 
rIDSPA.GetTextCollFromPool(SwPoolFormatId::COLL_HTML_BLOCKQUOTE);
     pDoc->SetTextFormatColl(*pCursor, pColl);
     pWrtShell->Insert(u"test"_ustr);
 
@@ -471,13 +471,13 @@ CPPUNIT_TEST_FIXTURE(Test, testCodeBlockMdExport)
     SwCursor* pCursor = pWrtShell->GetCursor();
     SwDoc* pDoc = pDocShell->GetDoc();
     IDocumentStylePoolAccess& rIDSPA = pDoc->getIDocumentStylePoolAccess();
-    SwTextFormatColl* pColl = 
rIDSPA.GetTextCollFromPool(RES_POOLCOLL_HTML_PRE);
+    SwTextFormatColl* pColl = 
rIDSPA.GetTextCollFromPool(SwPoolFormatId::COLL_HTML_PRE);
     pDoc->SetTextFormatColl(*pCursor, pColl);
     pWrtShell->SplitNode();
     pWrtShell->Insert(u"C"_ustr);
     pWrtShell->SplitNode();
     pWrtShell->Insert(u"D"_ustr);
-    pColl = rIDSPA.GetTextCollFromPool(RES_POOLCOLL_STANDARD);
+    pColl = rIDSPA.GetTextCollFromPool(SwPoolFormatId::COLL_STANDARD);
     pDoc->SetTextFormatColl(*pCursor, pColl);
 
     // When saving that to markdown:
diff --git a/sw/qa/uibase/shells/textsh1.cxx b/sw/qa/uibase/shells/textsh1.cxx
index 94c20324c801..0af814cddc45 100644
--- a/sw/qa/uibase/shells/textsh1.cxx
+++ b/sw/qa/uibase/shells/textsh1.cxx
@@ -85,7 +85,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDeleteCheckboxContentControl)
                       RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT);
     aSet.Put(aFont);
     SwTextFormatColl* pStyle
-        = 
pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD);
+        = 
pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool(SwPoolFormatId::COLL_STANDARD);
     pStyle->SetFormatAttr(aSet);
 
     // When inserting a content control:
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 58e0680d86da..b431dabba78d 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -25,6 +25,7 @@
 #include <frmatr.hxx>
 #include <hintids.hxx>
 #include <hints.hxx>
+#include <poolfmt.hxx>
 #include <o3tl/unit_conversion.hxx>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
@@ -42,7 +43,7 @@ SwFormat::SwFormat( SwAttrPool& rPool, const UIName& 
rFormatNm,
     m_aFormatName( rFormatNm ),
     m_aSet( rPool, pWhichRanges ),
     m_nWhichId( nFormatWhich ),
-    m_nPoolFormatId( USHRT_MAX ),
+    m_nPoolFormatId( SwPoolFormatId::UNKNOWN ),
     m_nPoolHelpId( USHRT_MAX ),
     m_nPoolHlpFileId( UCHAR_MAX )
 {
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 0472afa6e1eb..9dd24bf13d34 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -1282,7 +1282,7 @@ namespace //local functions originally from docfmt.cxx
                         {
                             // Get the item set that holds all the changes 
properties
                             std::shared_ptr<SfxItemSet> pChangesSet = 
pFormattingChanges->GetItemSet();
-                            xExtra.reset(new 
SwRedlineExtraData_FormatColl(UIName(u""_ustr), USHRT_MAX, pChangesSet));
+                            xExtra.reset(new 
SwRedlineExtraData_FormatColl(UIName(u""_ustr), SwPoolFormatId::UNKNOWN, 
pChangesSet));
                             break;
                         }
                     }
@@ -1325,7 +1325,7 @@ namespace //local functions originally from docfmt.cxx
 
             IStyleAccess& rStyleAccess = rDoc.GetIStyleAccess();
             std::shared_ptr<SfxItemSet> pAutoStyle = 
rStyleAccess.getAutomaticStyle(aSet, IStyleAccess::AUTO_STYLE_CHAR);
-            xExtra.reset(new SwRedlineExtraData_FormatColl(UIName(u""_ustr), 
USHRT_MAX, pAutoStyle));
+            xExtra.reset(new SwRedlineExtraData_FormatColl(UIName(u""_ustr), 
SwPoolFormatId::UNKNOWN, pAutoStyle));
         }
 
         pRedline->SetExtraData(xExtra.get() );
@@ -1703,11 +1703,11 @@ namespace //local functions originally from docfmt.cxx
 
             {
                 // If we have a PoolNumRule, create it if needed
-                sal_uInt16 nPoolId=0;
+                SwPoolFormatId nPoolId=SwPoolFormatId::ZERO;
                 const SwNumRuleItem* pRule = pOtherSet->GetItemIfSet( 
RES_PARATR_NUMRULE, false );
                 if( pRule &&
                     !rDoc.FindNumRulePtr( pRule->GetValue() ) &&
-                    USHRT_MAX != (nPoolId = 
SwStyleNameMapper::GetPoolIdFromUIName ( pRule->GetValue(),
+                    SwPoolFormatId::UNKNOWN != (nPoolId = 
SwStyleNameMapper::GetPoolIdFromUIName ( pRule->GetValue(),
                                     SwGetPoolIdFromName::NumRule )) )
                     rDoc.getIDocumentStylePoolAccess().GetNumRuleFromPool( 
nPoolId );
             }
@@ -3261,7 +3261,7 @@ SwFlyFrameFormat* 
DocumentContentOperationsManager::InsertGraphic(
                             SwFrameFormat* pFrameFormat )
 {
     if( !pFrameFormat )
-        pFrameFormat = 
m_rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( 
RES_POOLFRM_GRAPHIC );
+        pFrameFormat = 
m_rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( 
SwPoolFormatId::FRM_GRAPHIC );
     SwGrfNode* pSwGrfNode = SwNodes::MakeGrfNode(
                             m_rDoc.GetNodes().GetEndOfAutotext(),
                             rGrfName, rFltName, pGraphic,
@@ -3275,13 +3275,13 @@ SwFlyFrameFormat* 
DocumentContentOperationsManager::InsertEmbObject(
         const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj,
                         SfxItemSet* pFlyAttrSet)
 {
-    sal_uInt16 nId = RES_POOLFRM_OLE;
+    SwPoolFormatId nId = SwPoolFormatId::FRM_OLE;
     if (xObj.is())
     {
         SvGlobalName aClassName( xObj->getClassID() );
         if (SotExchange::IsMath(aClassName))
         {
-            nId = RES_POOLFRM_FORMEL;
+            nId = SwPoolFormatId::FRM_FORMEL;
         }
     }
 
@@ -3300,7 +3300,7 @@ SwFlyFrameFormat* 
DocumentContentOperationsManager::InsertOLE(const SwPaM &rRg,
                         const SfxItemSet* pFlyAttrSet,
                         const SfxItemSet* pGrfAttrSet)
 {
-    SwFrameFormat* pFrameFormat = 
m_rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_OLE );
+    SwFrameFormat* pFrameFormat = 
m_rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( 
SwPoolFormatId::FRM_OLE );
 
     return InsNoTextNode( *rRg.GetPoint(),
                             m_rDoc.GetNodes().MakeOLENode(
@@ -3518,7 +3518,7 @@ bool DocumentContentOperationsManager::SplitNode( const 
SwPosition &rPos, bool b
             {
                 SwTextNode* pTextNd = m_rDoc.GetNodes().MakeTextNode(
                                         *pTableNd,
-                                        
m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ));
+                                        
m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( 
SwPoolFormatId::COLL_TEXT ));
                 if( pTextNd )
                 {
                     const_cast<SwPosition&>(rPos).Assign( pTableNd->GetIndex() 
- SwNodeOffset(1) );
@@ -3598,7 +3598,7 @@ bool DocumentContentOperationsManager::AppendTextNode( 
SwPosition& rPos )
         // so then one can be created!
         SwNodeIndex aIdx( rPos.GetNode(), 1 );
         pCurNode = m_rDoc.GetNodes().MakeTextNode( aIdx.GetNode(),
-                        
m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD 
));
+                        
m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( 
SwPoolFormatId::COLL_STANDARD ));
     }
     else
         pCurNode = pCurNode->AppendNode( rPos )->GetTextNode();
@@ -5256,7 +5256,7 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
                 {
                     if( pStart->GetContentIndex() || bOneNode )
                         pDestTextNd = rDoc.GetNodes().MakeTextNode( 
aInsPos.GetNode(),
-                            
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD));
+                            
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(SwPoolFormatId::COLL_STANDARD));
                     else
                     {
                         pDestTextNd = pSttTextNd->MakeCopy(rDoc, 
aInsPos.GetNode(), true)->GetTextNode();
@@ -5382,7 +5382,7 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
             if( !pDestTextNd )
             {
                 pDestTextNd = rDoc.GetNodes().MakeTextNode( aInsPos.GetNode(),
-                            
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD));
+                            
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(SwPoolFormatId::COLL_STANDARD));
                 oInsContentIndex->Assign(pDestTextNd, 0);
                 --aInsPos;
 
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx 
b/sw/source/core/doc/DocumentLayoutManager.cxx
index e15df6de772b..dd9e136410a0 100644
--- a/sw/source/core/doc/DocumentLayoutManager.cxx
+++ b/sw/source/core/doc/DocumentLayoutManager.cxx
@@ -137,14 +137,14 @@ SwFrameFormat *DocumentLayoutManager::MakeLayoutFormat( 
RndStdIds eRequest, cons
                 m_rDoc.GetNodes().MakeTextSection
                 ( rEndOfAutotext,
                   bHeader ? SwHeaderStartNode : SwFooterStartNode,
-                  
m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(o3tl::narrowing<sal_uInt16>(
 bHeader
+                  
m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(bHeader
                                      ? ( eRequest == RndStdIds::HEADERL
-                                         ? RES_POOLCOLL_HEADERL
+                                         ? SwPoolFormatId::COLL_HEADERL
                                          : eRequest == RndStdIds::HEADERR
-                                         ? RES_POOLCOLL_HEADERR
-                                         : RES_POOLCOLL_HEADER )
-                                     : RES_POOLCOLL_FOOTER
-                                     ) ) );
+                                         ? SwPoolFormatId::COLL_HEADERR
+                                         : SwPoolFormatId::COLL_HEADER )
+                                     : SwPoolFormatId::COLL_FOOTER
+                                     ) );
             pFormat->SetFormatAttr( SwFormatContent( pSttNd ));
 
             if( pSet )      // Set a few more attributes
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index e3f0d864fbf1..1284650c0229 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -26,6 +26,7 @@
 #include <wrtsh.hxx>
 #include <fmtfld.hxx>
 #include <frmtool.hxx>
+#include <poolfmt.hxx>
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentFieldsAccess.hxx>
 #include <IDocumentLayoutAccess.hxx>
@@ -458,7 +459,7 @@ namespace
             {
                 IStyleAccess& rStyleAccess = rDoc.GetIStyleAccess();
                 std::shared_ptr<SfxItemSet> pAutoStyle = 
rStyleAccess.getAutomaticStyle(aTmp2, IStyleAccess::AUTO_STYLE_CHAR);
-                return std::make_unique<SwRedlineExtraData_FormatColl>( 
pFromColl->GetName(), USHRT_MAX, pAutoStyle );
+                return std::make_unique<SwRedlineExtraData_FormatColl>( 
pFromColl->GetName(), SwPoolFormatId::UNKNOWN, pAutoStyle );
             }
         }
         return nullptr;
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 1026ebfff434..1c44da184b9a 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -76,12 +76,12 @@
 using namespace ::editeng;
 using namespace ::com::sun::star;
 
-bool IsConditionalByPoolId(sal_uInt16 nId)
+bool IsConditionalByPoolId(SwPoolFormatId nId)
 {
     // TODO: why is this style conditional?
     // If it is changed to no longer be conditional, then a style "Text Body"
     // will be imported without its conditions from ODF.
-    return RES_POOLCOLL_TEXT == nId;
+    return SwPoolFormatId::COLL_TEXT == nId;
 }
 
 namespace
@@ -224,7 +224,7 @@ namespace
                 pColl->SetFormatAttr(aItem);
             }
         }
-        pColl->SetNextTextFormatColl( 
*rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ));
+        pColl->SetNextTextFormatColl( 
*rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( 
SwPoolFormatId::COLL_TEXT ));
     }
 
     void lcl_SetRegister( SwDoc& rDoc, SfxItemSet& rSet, sal_uInt16 nFact,
@@ -253,7 +253,7 @@ namespace
 
     void lcl_SetNumBul( SwDoc& rDoc, SwTextFormatColl* pColl,
                             SfxItemSet& rSet,
-                            sal_uInt16 nNxt, SwTwips nEZ, SwTwips nLeft,
+                            SwPoolFormatId nNxt, SwTwips nEZ, SwTwips nLeft,
                             SwTwips nUpper, SwTwips nLower )
     {
         SvxFirstLineIndentItem firstLine(SvxIndentValue::twips(nEZ), 
RES_MARGIN_FIRSTLINE);
@@ -272,7 +272,7 @@ namespace
 
     void lcl_PutStdPageSizeIntoItemSet( SwDoc& rDoc, SfxItemSet& rSet )
     {
-        SwPageDesc* pStdPgDsc = 
rDoc.getIDocumentStylePoolAccess().GetPageDescFromPool( RES_POOLPAGE_STANDARD );
+        SwPageDesc* pStdPgDsc = 
rDoc.getIDocumentStylePoolAccess().GetPageDescFromPool( 
SwPoolFormatId::PAGE_STANDARD );
         SwFormatFrameSize aFrameSz( pStdPgDsc->GetMaster().GetFrameSize() );
         if( pStdPgDsc->GetLandscape() )
         {
@@ -580,16 +580,16 @@ DocumentStylePoolManager::DocumentStylePoolManager( 
SwDoc& i_rSwdoc ) : m_rDoc(
 {
 }
 
-SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 
nId, bool bRegardLanguage )
+SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( 
SwPoolFormatId nId, bool bRegardLanguage )
 {
     OSL_ENSURE(
-        (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
-        (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) ||
-        (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) ||
-        (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < 
RES_POOLCOLL_REGISTER_END) ||
-        (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) ||
-        (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END),
-            "Wrong  AutoFormat Id" );
+        (SwPoolFormatId::COLL_TEXT_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_TEXT_END) ||
+        (SwPoolFormatId::COLL_LISTS_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_LISTS_END) ||
+        (SwPoolFormatId::COLL_EXTRA_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_EXTRA_END) ||
+        (SwPoolFormatId::COLL_REGISTER_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_REGISTER_END) ||
+        (SwPoolFormatId::COLL_DOC_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_DOC_END) ||
+        (SwPoolFormatId::COLL_HTML_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_HTML_END),
+            "Wrong AutoFormat Id" );
 
     SwTextFormatColl* pNewColl;
     sal_uInt16 nOutLvlBits = 0;
@@ -616,55 +616,55 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
 
     // Didn't find it until here -> create anew
     TranslateId pResId;
-    if (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END)
+    if (SwPoolFormatId::COLL_TEXT_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_TEXT_END)
     {
-        static_assert(std::ssize(STR_POOLCOLL_TEXT_ARY) == 
RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN, "### unexpected size!");
-        pResId = STR_POOLCOLL_TEXT_ARY[nId - RES_POOLCOLL_TEXT_BEGIN];
+        static_assert(std::ssize(STR_POOLCOLL_TEXT_ARY) == 
sal_uInt16(SwPoolFormatId::COLL_TEXT_END - SwPoolFormatId::COLL_TEXT_BEGIN), 
"### unexpected size!");
+        pResId = STR_POOLCOLL_TEXT_ARY[sal_uInt16(nId - 
SwPoolFormatId::COLL_TEXT_BEGIN)];
     }
-    else if (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END)
+    else if (SwPoolFormatId::COLL_LISTS_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_LISTS_END)
     {
-        static_assert(std::ssize(STR_POOLCOLL_LISTS_ARY) == 
RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN, "### unexpected size!");
-        pResId = STR_POOLCOLL_LISTS_ARY[nId - RES_POOLCOLL_LISTS_BEGIN];
+        static_assert(std::ssize(STR_POOLCOLL_LISTS_ARY) == 
sal_uInt16(SwPoolFormatId::COLL_LISTS_END - SwPoolFormatId::COLL_LISTS_BEGIN), 
"### unexpected size!");
+        pResId = STR_POOLCOLL_LISTS_ARY[sal_uInt16(nId - 
SwPoolFormatId::COLL_LISTS_BEGIN)];
     }
-    else if (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END)
+    else if (SwPoolFormatId::COLL_EXTRA_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_EXTRA_END)
     {
-        static_assert(std::ssize(STR_POOLCOLL_EXTRA_ARY) == 
RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN, "### unexpected size!");
-        pResId = STR_POOLCOLL_EXTRA_ARY[nId - RES_POOLCOLL_EXTRA_BEGIN];
+        static_assert(std::ssize(STR_POOLCOLL_EXTRA_ARY) == 
sal_uInt16(SwPoolFormatId::COLL_EXTRA_END - SwPoolFormatId::COLL_EXTRA_BEGIN), 
"### unexpected size!");
+        pResId = STR_POOLCOLL_EXTRA_ARY[sal_uInt16(nId - 
SwPoolFormatId::COLL_EXTRA_BEGIN)];
     }
-    else if (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < 
RES_POOLCOLL_REGISTER_END)
+    else if (SwPoolFormatId::COLL_REGISTER_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_REGISTER_END)
     {
-        static_assert(std::ssize(STR_POOLCOLL_REGISTER_ARY) == 
RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN, "### unexpected 
size!");
-        pResId = STR_POOLCOLL_REGISTER_ARY[nId - RES_POOLCOLL_REGISTER_BEGIN];
+        static_assert(std::ssize(STR_POOLCOLL_REGISTER_ARY) == 
sal_uInt16(SwPoolFormatId::COLL_REGISTER_END - 
SwPoolFormatId::COLL_REGISTER_BEGIN), "### unexpected size!");
+        pResId = STR_POOLCOLL_REGISTER_ARY[sal_uInt16(nId - 
SwPoolFormatId::COLL_REGISTER_BEGIN)];
     }
-    else if (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END)
+    else if (SwPoolFormatId::COLL_DOC_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_DOC_END)
     {
-        static_assert(std::ssize(STR_POOLCOLL_DOC_ARY) == RES_POOLCOLL_DOC_END 
- RES_POOLCOLL_DOC_BEGIN, "### unexpected size!");
-        pResId = STR_POOLCOLL_DOC_ARY[nId - RES_POOLCOLL_DOC_BEGIN];
+        static_assert(std::ssize(STR_POOLCOLL_DOC_ARY) == 
sal_uInt16(SwPoolFormatId::COLL_DOC_END - SwPoolFormatId::COLL_DOC_BEGIN), "### 
unexpected size!");
+        pResId = STR_POOLCOLL_DOC_ARY[sal_uInt16(nId - 
SwPoolFormatId::COLL_DOC_BEGIN)];
     }
-    else if (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END)
+    else if (SwPoolFormatId::COLL_HTML_BEGIN <= nId && nId < 
SwPoolFormatId::COLL_HTML_END)
     {
-        static_assert(std::ssize(STR_POOLCOLL_HTML_ARY) == 
RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN, "### unexpected size!");
-        pResId = STR_POOLCOLL_HTML_ARY[nId - RES_POOLCOLL_HTML_BEGIN];
+        static_assert(std::ssize(STR_POOLCOLL_HTML_ARY) == 
sal_uInt16(SwPoolFormatId::COLL_HTML_END - SwPoolFormatId::COLL_HTML_BEGIN), 
"### unexpected size!");
+        pResId = STR_POOLCOLL_HTML_ARY[sal_uInt16(nId - 
SwPoolFormatId::COLL_HTML_BEGIN)];
     }
 
     OSL_ENSURE(pResId, "Invalid Pool ID");
     if (!pResId)
-        return GetTextCollFromPool(RES_POOLCOLL_STANDARD);
+        return GetTextCollFromPool(SwPoolFormatId::COLL_STANDARD);
 
     UIName aNm(SwResId(pResId));
 
     // A Set for all to-be-set Attributes
     SwAttrSet aSet( m_rDoc.GetAttrPool(), aTextFormatCollSetRange );
-    sal_uInt16 nParent = GetPoolParent( nId );
+    SwPoolFormatId nParent = GetPoolParent( nId );
 
     {
 
         if(::IsConditionalByPoolId( nId ))
-            pNewColl = new SwConditionTextFormatColl( m_rDoc.GetAttrPool(), 
aNm, !nParent
+            pNewColl = new SwConditionTextFormatColl( m_rDoc.GetAttrPool(), 
aNm, nParent == SwPoolFormatId::ZERO
                                                 ? 
m_rDoc.GetDfltTextFormatColl()
                                                 : GetTextCollFromPool( nParent 
));
         else
-            pNewColl = new SwTextFormatColl( m_rDoc.GetAttrPool(), aNm, 
!nParent
+            pNewColl = new SwTextFormatColl( m_rDoc.GetAttrPool(), aNm, 
nParent == SwPoolFormatId::ZERO
                                             ? m_rDoc.GetDfltTextFormatColl()
                                             : GetTextCollFromPool( nParent ));
         pNewColl->SetPoolFormatId( nId );
@@ -677,7 +677,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
         switch( nId )
         {
         // General content forms
-        case RES_POOLCOLL_STANDARD:
+        case SwPoolFormatId::COLL_STANDARD:
             /* koreans do not like SvxScriptItem(TRUE) */
             if (bRegardLanguage)
             {
@@ -690,7 +690,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             }
             break;
 
-        case RES_POOLCOLL_TEXT:                 // Text body
+        case SwPoolFormatId::COLL_TEXT:                 // Text body
             {
                 SvxLineSpacingItem aLSpc( LINE_SPACE_DEFAULT_HEIGHT, 
RES_PARATR_LINESPACING );
                 SvxULSpaceItem aUL( 0, PT_7, RES_UL_SPACE );
@@ -700,7 +700,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                 aSet.Put( aLSpc );
             }
             break;
-        case RES_POOLCOLL_TEXT_IDENT:           // Text body indentation
+        case SwPoolFormatId::COLL_TEXT_IDENT:           // Text body 
indentation
             {
                 auto const first(o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
                 SvxFirstLineIndentItem const 
firstLine(SvxIndentValue::twips(first),
@@ -710,7 +710,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                 aSet.Put(leftMargin);
             }
             break;
-        case RES_POOLCOLL_TEXT_NEGIDENT:        // Text body neg. indentation
+        case SwPoolFormatId::COLL_TEXT_NEGIDENT:        // Text body neg. 
indentation
             {
                 auto const first(-o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
                 auto const left(o3tl::convert(1, o3tl::Length::cm, 
o3tl::Length::twip));
@@ -726,7 +726,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                 aSet.Put( aTStops );
             }
             break;
-        case RES_POOLCOLL_TEXT_MOVE:            // Text body move
+        case SwPoolFormatId::COLL_TEXT_MOVE:            // Text body move
             {
                 auto const left(o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
                 SvxFirstLineIndentItem const firstLine(RES_MARGIN_FIRSTLINE);
@@ -737,7 +737,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             }
             break;
 
-        case RES_POOLCOLL_CONFRONTATION:    // Text body confrontation
+        case SwPoolFormatId::COLL_CONFRONTATION:    // Text body confrontation
             {
                 auto const first(-o3tl::convert(45, o3tl::Length::mm, 
o3tl::Length::twip));
                 auto const left(o3tl::convert(5, o3tl::Length::cm, 
o3tl::Length::twip));
@@ -753,7 +753,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                 aSet.Put( aTStops );
             }
             break;
-        case RES_POOLCOLL_MARGINAL:         // Text body marginal
+        case SwPoolFormatId::COLL_MARGINAL:         // Text body marginal
             {
                 auto const left(o3tl::convert(4, o3tl::Length::cm, 
o3tl::Length::twip));
                 SvxFirstLineIndentItem const firstLine(RES_MARGIN_FIRSTLINE);
@@ -764,7 +764,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             }
             break;
 
-        case RES_POOLCOLL_HEADLINE_BASE:            // Base headline
+        case SwPoolFormatId::COLL_HEADLINE_BASE:            // Base headline
             {
                 static const sal_uInt16 aFontWhich[] =
                 {   RES_CHRATR_FONT,
@@ -810,25 +810,25 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                     aUL.SetLower( HTML_PARSPACE );
                 aSet.Put( SvxFormatKeepItem( true, RES_KEEP ));
 
-                pNewColl->SetNextTextFormatColl( *GetTextCollFromPool( 
RES_POOLCOLL_TEXT ));
+                pNewColl->SetNextTextFormatColl( *GetTextCollFromPool( 
SwPoolFormatId::COLL_TEXT ));
 
                 aSet.Put( aUL );
                 SetAllScriptItem( aSet, aFntSize );
             }
             break;
 
-        case RES_POOLCOLL_NUMBER_BULLET_BASE:          // Base Numbering
+        case SwPoolFormatId::COLL_NUMBER_BULLET_BASE:          // Base 
Numbering
             break;
 
-        case RES_POOLCOLL_GREETING:             // Greeting
-        case RES_POOLCOLL_REGISTER_BASE:        // Base indexes
-        case RES_POOLCOLL_SIGNATURE:            // Signatures
-        case RES_POOLCOLL_TABLE:                // Table content
+        case SwPoolFormatId::COLL_GREETING:             // Greeting
+        case SwPoolFormatId::COLL_REGISTER_BASE:        // Base indexes
+        case SwPoolFormatId::COLL_SIGNATURE:            // Signatures
+        case SwPoolFormatId::COLL_TABLE:                // Table content
             {
                 SwFormatLineNumber aLN;
                 aLN.SetCountLines( false );
                 aSet.Put( aLN );
-                if (nId == RES_POOLCOLL_TABLE)
+                if (nId == SwPoolFormatId::COLL_TABLE)
                 {
                     aSet.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) );
                     aSet.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
@@ -836,70 +836,70 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             }
             break;
 
-        case RES_POOLCOLL_HEADLINE1:        // Heading 1
+        case SwPoolFormatId::COLL_HEADLINE1:        // Heading 1
             {
                 SvxULSpaceItem aUL( PT_12, PT_6, RES_UL_SPACE );
                 aSet.Put( aUL );
                 lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 0, false 
);
             }
             break;
-        case RES_POOLCOLL_HEADLINE2:        // Heading 2
+        case SwPoolFormatId::COLL_HEADLINE2:        // Heading 2
             {
                 SvxULSpaceItem aUL( PT_10, PT_6, RES_UL_SPACE );
                 aSet.Put( aUL );
                 lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 1, false 
);
             }
             break;
-        case RES_POOLCOLL_HEADLINE3:        // Heading 3
+        case SwPoolFormatId::COLL_HEADLINE3:        // Heading 3
             {
                 SvxULSpaceItem aUL( PT_7, PT_6, RES_UL_SPACE );
                 aSet.Put( aUL );
                 lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 2, false 
);
             }
             break;
-        case RES_POOLCOLL_HEADLINE4:        // Heading 4
+        case SwPoolFormatId::COLL_HEADLINE4:        // Heading 4
             {
                 SvxULSpaceItem aUL( PT_6, PT_6, RES_UL_SPACE );
                 aSet.Put( aUL );
                 lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 3, true 
);
             }
             break;
-        case RES_POOLCOLL_HEADLINE5:        // Heading 5
+        case SwPoolFormatId::COLL_HEADLINE5:        // Heading 5
             {
                 SvxULSpaceItem aUL( PT_6, PT_3, RES_UL_SPACE );
                 aSet.Put( aUL );
                 lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 4, false 
);
             }
             break;
-        case RES_POOLCOLL_HEADLINE6:        // Heading 6
+        case SwPoolFormatId::COLL_HEADLINE6:        // Heading 6
             {
                 SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
                 aSet.Put( aUL );
                 lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 5, true 
);
             }
             break;
-        case RES_POOLCOLL_HEADLINE7:        // Heading 7
+        case SwPoolFormatId::COLL_HEADLINE7:        // Heading 7
             {
                 SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
                 aSet.Put( aUL );
                 lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 6, false 
);
             }
             break;
-        case RES_POOLCOLL_HEADLINE8:        // Heading 8
+        case SwPoolFormatId::COLL_HEADLINE8:        // Heading 8
             {
                 SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
                 aSet.Put( aUL );
                 lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 7, true 
);
             }
             break;
-        case RES_POOLCOLL_HEADLINE9:        // Heading 9
+        case SwPoolFormatId::COLL_HEADLINE9:        // Heading 9
             {
                 SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
                 aSet.Put( aUL );
                 lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 8, false 
);
             }
             break;
-        case RES_POOLCOLL_HEADLINE10:       // Heading 10
+        case SwPoolFormatId::COLL_HEADLINE10:       // Heading 10
             {
                 SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
                 aSet.Put( aUL );
@@ -909,14 +909,14 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
 
         // Special sections:
         // Header
-        case RES_POOLCOLL_HEADERFOOTER:
-        case RES_POOLCOLL_HEADER:
-        case RES_POOLCOLL_HEADERL:
-        case RES_POOLCOLL_HEADERR:
+        case SwPoolFormatId::COLL_HEADERFOOTER:
+        case SwPoolFormatId::COLL_HEADER:
+        case SwPoolFormatId::COLL_HEADERL:
+        case SwPoolFormatId::COLL_HEADERR:
         // Footer
-        case RES_POOLCOLL_FOOTER:
-        case RES_POOLCOLL_FOOTERL:
-        case RES_POOLCOLL_FOOTERR:
+        case SwPoolFormatId::COLL_FOOTER:
+        case SwPoolFormatId::COLL_FOOTERL:
+        case SwPoolFormatId::COLL_FOOTERR:
             {
                 SwFormatLineNumber aLN;
                 aLN.SetCountLines( false );
@@ -930,14 +930,14 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
 
                 aSet.Put( aTStops );
 
-                if ( (nId==RES_POOLCOLL_HEADERR) || 
(nId==RES_POOLCOLL_FOOTERR) ) {
+                if ( (nId==SwPoolFormatId::COLL_HEADERR) || 
(nId==SwPoolFormatId::COLL_FOOTERR) ) {
                     SvxAdjustItem aAdjust(SvxAdjust::Right, RES_PARATR_ADJUST 
);
                     aSet.Put(aAdjust);
                 }
             }
             break;
 
-        case RES_POOLCOLL_TABLE_HDLN:
+        case SwPoolFormatId::COLL_TABLE_HDLN:
             {
                 SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, 
RES_CHRATR_WEIGHT ) );
                 aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST 
) );
@@ -947,8 +947,8 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             }
             break;
 
-        case RES_POOLCOLL_FOOTNOTE:             // paragraph style Footnote
-        case RES_POOLCOLL_ENDNOTE:              // paragraph style Endnote
+        case SwPoolFormatId::COLL_FOOTNOTE:             // paragraph style 
Footnote
+        case SwPoolFormatId::COLL_ENDNOTE:              // paragraph style 
Endnote
             {
                 auto const first(-o3tl::convert(6, o3tl::Length::mm, 
o3tl::Length::twip));
                 auto const left(o3tl::convert(6, o3tl::Length::mm, 
o3tl::Length::twip));
@@ -966,7 +966,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             }
             break;
 
-        case RES_POOLCOLL_LABEL:                // basic caption
+        case SwPoolFormatId::COLL_LABEL:                // basic caption
             {
                 SvxULSpaceItem aUL( RES_UL_SPACE );
                 aUL.SetUpper( PT_6 );
@@ -980,15 +980,15 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             }
             break;
 
-        case RES_POOLCOLL_FRAME:                // Frame content
-        case RES_POOLCOLL_LABEL_ABB:            // caption image
-        case RES_POOLCOLL_LABEL_TABLE:          // caption table
-        case RES_POOLCOLL_LABEL_FRAME:          // caption frame
-        case RES_POOLCOLL_LABEL_DRAWING:        // caption drawing
-        case RES_POOLCOLL_LABEL_FIGURE:
+        case SwPoolFormatId::COLL_FRAME:                // Frame content
+        case SwPoolFormatId::COLL_LABEL_ABB:            // caption image
+        case SwPoolFormatId::COLL_LABEL_TABLE:          // caption table
+        case SwPoolFormatId::COLL_LABEL_FRAME:          // caption frame
+        case SwPoolFormatId::COLL_LABEL_DRAWING:        // caption drawing
+        case SwPoolFormatId::COLL_LABEL_FIGURE:
             break;
 
-        case RES_POOLCOLL_ENVELOPE_ADDRESS:          // envelope address
+        case SwPoolFormatId::COLL_ENVELOPE_ADDRESS:          // envelope 
address
             {
                 SvxULSpaceItem aUL( RES_UL_SPACE );
                 aUL.SetLower( PT_3 );
@@ -999,7 +999,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             }
             break;
 
-        case RES_POOLCOLL_SEND_ADDRESS:           // Sender address
+        case SwPoolFormatId::COLL_SEND_ADDRESS:           // Sender address
             {
                 if( 
m_rDoc.GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE) )
                     SetAllScriptItem( aSet, SvxPostureItem(ITALIC_NORMAL, 
RES_CHRATR_POSTURE) );
@@ -1014,7 +1014,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             }
             break;
 
-        case RES_POOLCOLL_COMMENT:       // Comment
+        case SwPoolFormatId::COLL_COMMENT:       // Comment
             {
                 SetAllScriptItem(aSet, SvxFontHeightItem(PT_10, 100, 
RES_CHRATR_FONTSIZE));
 
@@ -1049,7 +1049,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             break;
 
         // User defined indexes:
-        case RES_POOLCOLL_TOX_USERH:            // Header
+        case SwPoolFormatId::COLL_TOX_USERH:            // Header
             lcl_SetRegister( m_rDoc, aSet, 0, true, false );
             {
                 SwFormatLineNumber aLN;
@@ -1057,39 +1057,39 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                 aSet.Put( aLN );
             }
             break;
-        case RES_POOLCOLL_TOX_USER1:            // 1st level
+        case SwPoolFormatId::COLL_TOX_USER1:            // 1st level
             lcl_SetRegister( m_rDoc, aSet, 0, false, true );
             break;
-        case RES_POOLCOLL_TOX_USER2:            // 2nd level
+        case SwPoolFormatId::COLL_TOX_USER2:            // 2nd level
             lcl_SetRegister( m_rDoc, aSet, 1, false, true );
             break;
-        case RES_POOLCOLL_TOX_USER3:            // 3rd level
+        case SwPoolFormatId::COLL_TOX_USER3:            // 3rd level
             lcl_SetRegister( m_rDoc, aSet, 2, false, true );
             break;
-        case RES_POOLCOLL_TOX_USER4:            // 4th level
+        case SwPoolFormatId::COLL_TOX_USER4:            // 4th level
             lcl_SetRegister( m_rDoc, aSet, 3, false, true );
             break;
-        case RES_POOLCOLL_TOX_USER5:            // 5th level
+        case SwPoolFormatId::COLL_TOX_USER5:            // 5th level
             lcl_SetRegister( m_rDoc, aSet, 4, false, true );
             break;
-        case RES_POOLCOLL_TOX_USER6:            // 6th level
+        case SwPoolFormatId::COLL_TOX_USER6:            // 6th level
             lcl_SetRegister( m_rDoc, aSet, 5, false, true );
             break;
-        case RES_POOLCOLL_TOX_USER7:            // 7th level
+        case SwPoolFormatId::COLL_TOX_USER7:            // 7th level
             lcl_SetRegister( m_rDoc, aSet, 6, false, true );
             break;
-        case RES_POOLCOLL_TOX_USER8:            // 8th level
+        case SwPoolFormatId::COLL_TOX_USER8:            // 8th level
             lcl_SetRegister( m_rDoc, aSet, 7, false, true );
             break;
-        case RES_POOLCOLL_TOX_USER9:            // 9th level
+        case SwPoolFormatId::COLL_TOX_USER9:            // 9th level
             lcl_SetRegister( m_rDoc, aSet, 8, false, true );
             break;
-        case RES_POOLCOLL_TOX_USER10:           // 10th level
+        case SwPoolFormatId::COLL_TOX_USER10:           // 10th level
             lcl_SetRegister( m_rDoc, aSet, 9, false, true );
             break;
 
         // Index
-        case RES_POOLCOLL_TOX_IDXH:         // Header
+        case SwPoolFormatId::COLL_TOX_IDXH:         // Header
             lcl_SetRegister( m_rDoc, aSet, 0, true, false );
             {
                 SwFormatLineNumber aLN;
@@ -1097,21 +1097,21 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                 aSet.Put( aLN );
             }
             break;
-        case RES_POOLCOLL_TOX_IDX1:         // 1st level
+        case SwPoolFormatId::COLL_TOX_IDX1:         // 1st level
             lcl_SetRegister( m_rDoc, aSet, 0, false, false );
             break;
-        case RES_POOLCOLL_TOX_IDX2:         // 2nd level
+        case SwPoolFormatId::COLL_TOX_IDX2:         // 2nd level
             lcl_SetRegister( m_rDoc, aSet, 1, false, false );
             break;
-        case RES_POOLCOLL_TOX_IDX3:         // 3rd level
+        case SwPoolFormatId::COLL_TOX_IDX3:         // 3rd level
             lcl_SetRegister( m_rDoc, aSet, 2, false, false );
             break;
-        case RES_POOLCOLL_TOX_IDXBREAK:     // Separator
+        case SwPoolFormatId::COLL_TOX_IDXBREAK:     // Separator
             lcl_SetRegister( m_rDoc, aSet, 0, false, false );
             break;
 
         // Table of Content
-        case RES_POOLCOLL_TOX_CNTNTH:       // Header
+        case SwPoolFormatId::COLL_TOX_CNTNTH:       // Header
             lcl_SetRegister( m_rDoc, aSet, 0, true, false );
             {
                 SwFormatLineNumber aLN;
@@ -1119,41 +1119,41 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                 aSet.Put( aLN );
             }
             break;
-        case RES_POOLCOLL_TOX_CNTNT1:       // 1st level
+        case SwPoolFormatId::COLL_TOX_CNTNT1:       // 1st level
             lcl_SetRegister( m_rDoc, aSet, 0, false, true );
             break;
-        case RES_POOLCOLL_TOX_CNTNT2:       // 2nd level
+        case SwPoolFormatId::COLL_TOX_CNTNT2:       // 2nd level
             lcl_SetRegister( m_rDoc, aSet, 1, false, true );
             break;
-        case RES_POOLCOLL_TOX_CNTNT3:       // 3rd level
+        case SwPoolFormatId::COLL_TOX_CNTNT3:       // 3rd level
             lcl_SetRegister( m_rDoc, aSet, 2, false, true );
             break;
-        case RES_POOLCOLL_TOX_CNTNT4:       // 4th level
+        case SwPoolFormatId::COLL_TOX_CNTNT4:       // 4th level
             lcl_SetRegister( m_rDoc, aSet, 3, false, true );
             break;
-        case RES_POOLCOLL_TOX_CNTNT5:       // 5th level
+        case SwPoolFormatId::COLL_TOX_CNTNT5:       // 5th level
             lcl_SetRegister( m_rDoc, aSet, 4, false, true );
             break;
-        case RES_POOLCOLL_TOX_CNTNT6:       // 6th level
+        case SwPoolFormatId::COLL_TOX_CNTNT6:       // 6th level
             lcl_SetRegister( m_rDoc, aSet, 5, false, true );
             break;
-        case RES_POOLCOLL_TOX_CNTNT7:       // 7th level
+        case SwPoolFormatId::COLL_TOX_CNTNT7:       // 7th level
             lcl_SetRegister( m_rDoc, aSet, 6, false, true );
             break;
-        case RES_POOLCOLL_TOX_CNTNT8:       // 8th level
+        case SwPoolFormatId::COLL_TOX_CNTNT8:       // 8th level
             lcl_SetRegister( m_rDoc, aSet, 7, false, true );
             break;
-        case RES_POOLCOLL_TOX_CNTNT9:       // 9th level
+        case SwPoolFormatId::COLL_TOX_CNTNT9:       // 9th level
             lcl_SetRegister( m_rDoc, aSet, 8, false, true );
             break;
-        case RES_POOLCOLL_TOX_CNTNT10:      // 10th level
+        case SwPoolFormatId::COLL_TOX_CNTNT10:      // 10th level
             lcl_SetRegister( m_rDoc, aSet, 9, false, true );
             break;
 
-        case RES_POOLCOLL_TOX_ILLUSH:
-        case RES_POOLCOLL_TOX_OBJECTH:
-        case RES_POOLCOLL_TOX_TABLESH:
-        case RES_POOLCOLL_TOX_AUTHORITIESH:
+        case SwPoolFormatId::COLL_TOX_ILLUSH:
+        case SwPoolFormatId::COLL_TOX_OBJECTH:
+        case SwPoolFormatId::COLL_TOX_TABLESH:
+        case SwPoolFormatId::COLL_TOX_AUTHORITIESH:
             lcl_SetRegister( m_rDoc, aSet, 0, true, false );
             {
                 SwFormatLineNumber aLN;
@@ -1161,217 +1161,217 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                 aSet.Put( aLN );
             }
             break;
-        case RES_POOLCOLL_TOX_ILLUS1:
-        case RES_POOLCOLL_TOX_OBJECT1:
-        case RES_POOLCOLL_TOX_TABLES1:
-        case RES_POOLCOLL_TOX_AUTHORITIES1:
+        case SwPoolFormatId::COLL_TOX_ILLUS1:
+        case SwPoolFormatId::COLL_TOX_OBJECT1:
+        case SwPoolFormatId::COLL_TOX_TABLES1:
+        case SwPoolFormatId::COLL_TOX_AUTHORITIES1:
             lcl_SetRegister( m_rDoc, aSet, 0, false, true );
         break;
 
-        case RES_POOLCOLL_NUM_LEVEL1S:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
+        case SwPoolFormatId::COLL_NUM_LEVEL1S:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL1,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 0 
),
                             PT_12, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL1:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
+        case SwPoolFormatId::COLL_NUM_LEVEL1:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL1,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 0 
),
                             0, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL1E:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
+        case SwPoolFormatId::COLL_NUM_LEVEL1E:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL1,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 0 
),
                             0, PT_12 );
             break;
-        case RES_POOLCOLL_NUM_NONUM1:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM1,
+        case SwPoolFormatId::COLL_NUM_NONUM1:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_NONUM1,
                             0, SwNumRule::GetNumIndent( 0 ), 0, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL2S:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
+        case SwPoolFormatId::COLL_NUM_LEVEL2S:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL2,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 1 
),
                             PT_12, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL2:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
+        case SwPoolFormatId::COLL_NUM_LEVEL2:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL2,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 1 
),
                             0, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL2E:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
+        case SwPoolFormatId::COLL_NUM_LEVEL2E:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL2,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 1 
),
                             0, PT_12 );
             break;
-        case RES_POOLCOLL_NUM_NONUM2:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM2,
+        case SwPoolFormatId::COLL_NUM_NONUM2:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_NONUM2,
                             0, SwNumRule::GetNumIndent( 1 ), 0, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL3S:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
+        case SwPoolFormatId::COLL_NUM_LEVEL3S:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL3,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 2 
),
                             PT_12, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL3:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
+        case SwPoolFormatId::COLL_NUM_LEVEL3:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL3,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 2 
),
                             0, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL3E:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
+        case SwPoolFormatId::COLL_NUM_LEVEL3E:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL3,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 2 
),
                             0, PT_12 );
             break;
-        case RES_POOLCOLL_NUM_NONUM3:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM3,
+        case SwPoolFormatId::COLL_NUM_NONUM3:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_NONUM3,
                             0, SwNumRule::GetNumIndent( 2 ), 0, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL4S:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
+        case SwPoolFormatId::COLL_NUM_LEVEL4S:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL4,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 3 
),
                             PT_12, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL4:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
+        case SwPoolFormatId::COLL_NUM_LEVEL4:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL4,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 3 
),
                             0, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL4E:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
+        case SwPoolFormatId::COLL_NUM_LEVEL4E:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_LEVEL4,
                             lNumberFirstLineOffset, SwNumRule::GetNumIndent( 3 
),
                             0, PT_12 );
             break;
-        case RES_POOLCOLL_NUM_NONUM4:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM4,
+        case SwPoolFormatId::COLL_NUM_NONUM4:
+            lcl_SetNumBul( m_rDoc, pNewColl, aSet, 
SwPoolFormatId::COLL_NUM_NONUM4,
                             0, SwNumRule::GetNumIndent( 3 ), 0, PT_6 );
             break;
-        case RES_POOLCOLL_NUM_LEVEL5S:
-            lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
+        case SwPoolFormatId::COLL_NUM_LEVEL5S:
-e 
... etc. - the rest is truncated

Reply via email to