sw/inc/IDocumentMarkAccess.hxx                          |   32 +++----
 sw/inc/IMark.hxx                                        |   52 ++---------
 sw/inc/contentindex.hxx                                 |    8 -
 sw/inc/crsrsh.hxx                                       |    8 -
 sw/inc/pam.hxx                                          |    2 
 sw/inc/postithelper.hxx                                 |    4 
 sw/inc/shellio.hxx                                      |    4 
 sw/inc/swserv.hxx                                       |    8 -
 sw/inc/txtannotationfld.hxx                             |    4 
 sw/inc/unocrsrhelper.hxx                                |    4 
 sw/inc/unotextrange.hxx                                 |    4 
 sw/qa/core/macros-test.cxx                              |    4 
 sw/qa/core/uwriter.cxx                                  |    6 -
 sw/qa/extras/uiwriter/uiwriter4.cxx                     |   14 +--
 sw/qa/extras/uiwriter/uiwriter5.cxx                     |    2 
 sw/qa/extras/uiwriter/uiwriter7.cxx                     |    4 
 sw/qa/uibase/shells/shells.cxx                          |    2 
 sw/source/core/bastyp/index.cxx                         |    2 
 sw/source/core/crsr/crbm.cxx                            |   26 ++---
 sw/source/core/crsr/swcrsr.cxx                          |    2 
 sw/source/core/doc/CntntIdxStore.cxx                    |    4 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   14 +--
 sw/source/core/doc/docbm.cxx                            |   73 +++++++---------
 sw/source/core/doc/docnew.cxx                           |    6 -
 sw/source/core/doc/docredln.cxx                         |    2 
 sw/source/core/doc/swserv.cxx                           |    2 
 sw/source/core/fields/postithelper.cxx                  |    6 -
 sw/source/core/fields/reffld.cxx                        |    2 
 sw/source/core/inc/MarkManager.hxx                      |   18 +--
 sw/source/core/inc/UndoBookmark.hxx                     |    6 -
 sw/source/core/inc/mvsave.hxx                           |    4 
 sw/source/core/inc/rolbck.hxx                           |    6 -
 sw/source/core/inc/txtfrm.hxx                           |    4 
 sw/source/core/inc/unobookmark.hxx                      |   12 +-
 sw/source/core/layout/ssfrm.cxx                         |    2 
 sw/source/core/text/EnhancedPDFExportHelper.cxx         |    2 
 sw/source/core/text/inftxt.cxx                          |    2 
 sw/source/core/text/porlay.cxx                          |    4 
 sw/source/core/text/porrst.cxx                          |    2 
 sw/source/core/tox/txmsrt.cxx                           |    2 
 sw/source/core/txtnode/atrfld.cxx                       |    2 
 sw/source/core/txtnode/ndtxt.cxx                        |    4 
 sw/source/core/undo/rolbck.cxx                          |    8 -
 sw/source/core/undo/unbkmk.cxx                          |    6 -
 sw/source/core/undo/undobj.cxx                          |    2 
 sw/source/core/unocore/unobkm.cxx                       |   41 +++-----
 sw/source/core/unocore/unocrsrhelper.cxx                |    4 
 sw/source/core/unocore/unoobj2.cxx                      |   10 +-
 sw/source/core/unocore/unoportenum.cxx                  |    8 -
 sw/source/filter/html/htmlgrin.cxx                      |    4 
 sw/source/filter/html/swhtml.cxx                        |    2 
 sw/source/filter/html/wrthtml.cxx                       |    2 
 sw/source/filter/writer/writer.cxx                      |   10 +-
 sw/source/filter/ww8/docxexport.cxx                     |    6 -
 sw/source/filter/ww8/wrtw8nds.cxx                       |   18 +--
 sw/source/filter/ww8/wrtww8.cxx                         |    8 -
 sw/source/filter/ww8/wrtww8.hxx                         |    2 
 sw/source/filter/ww8/ww8par.cxx                         |    2 
 sw/source/ui/dbui/dbinsdlg.cxx                          |    2 
 sw/source/ui/dialog/uiregionsw.cxx                      |    2 
 sw/source/ui/fldui/fldref.cxx                           |    6 -
 sw/source/ui/inc/bookmark.hxx                           |    6 -
 sw/source/ui/misc/bookmark.cxx                          |   37 ++++----
 sw/source/uibase/dochdl/swdtflvr.cxx                    |   14 +--
 sw/source/uibase/docvw/PostItMgr.cxx                    |    2 
 sw/source/uibase/inc/mmconfigitem.hxx                   |    4 
 sw/source/uibase/inc/wrtsh.hxx                          |    6 -
 sw/source/uibase/shells/textfld.cxx                     |    2 
 sw/source/uibase/shells/textsh1.cxx                     |    2 
 sw/source/uibase/uno/loktxdoc.cxx                       |    4 
 sw/source/uibase/uno/unotxvw.cxx                        |    2 
 sw/source/uibase/utlui/content.cxx                      |    6 -
 sw/source/uibase/wrtsh/move.cxx                         |    2 
 sw/source/uibase/wrtsh/wrtsh3.cxx                       |    4 
 74 files changed, 283 insertions(+), 322 deletions(-)

New commits:
commit f7197e574cdbd7410fcadab1632bcce2626dca5a
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sun Aug 4 16:42:30 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Aug 4 22:40:48 2024 +0200

    simplify IMark hierarchy (6)
    
    merge IMark into MarkBase
    
    Change-Id: I5d3c648c950f97497c96912c25081906de434056
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171464
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx
index 438c94a6b704..e170f5a19eb3 100644
--- a/sw/inc/IDocumentMarkAccess.hxx
+++ b/sw/inc/IDocumentMarkAccess.hxx
@@ -55,7 +55,7 @@ class IDocumentMarkAccess
         };
 
         /** wrapper iterator: wraps iterator of implementation while hiding
-            MarkBase class; only IMark instances can be retrieved directly.
+            MarkBase class; only MarkBase instances can be retrieved directly.
          */
         class SW_DLLPUBLIC iterator
         {
@@ -67,9 +67,9 @@ class IDocumentMarkAccess
                 std::vector<::sw::mark::MarkBase*>::const_iterator const& 
get() const;
 
                 typedef std::ptrdiff_t difference_type;
-                typedef ::sw::mark::IMark* value_type;
-                typedef ::sw::mark::IMark* const* pointer;
-                typedef ::sw::mark::IMark* const& reference;
+                typedef ::sw::mark::MarkBase* value_type;
+                typedef ::sw::mark::MarkBase* const* pointer;
+                typedef ::sw::mark::MarkBase* const& reference;
                 typedef std::random_access_iterator_tag iterator_category;
 
                 iterator();
@@ -84,9 +84,9 @@ class IDocumentMarkAccess
                 // possible because we have to return a temp value;
                 // let's try value_type instead, perhaps it's sufficient,
                 // for a const_iterator...
-                ::sw::mark::IMark* /*const&*/ operator*() const;
+                ::sw::mark::MarkBase* /*const&*/ operator*() const;
                 // nope can't do that :(
-                //::sw::mark::IMark* /* const* */ operator->() const;
+                //::sw::mark::MarkBase* /* const* */ operator->() const;
                 iterator& operator++();
                 iterator operator++(int);
                 bool operator==(iterator const& rOther) const;
@@ -129,7 +129,7 @@ class IDocumentMarkAccess
            @returns
            a pointer to the new mark (name might have changed).
         */
-        virtual ::sw::mark::IMark* makeMark(const SwPaM& rPaM,
+        virtual ::sw::mark::MarkBase* makeMark(const SwPaM& rPaM,
             const OUString& rProposedName,
             MarkType eMark, ::sw::mark::InsertMode eMode,
             SwPosition const* pSepPos = nullptr) = 0;
@@ -142,7 +142,7 @@ class IDocumentMarkAccess
             const OUString& rName,
             const OUString& rType) = 0;
 
-        virtual sw::mark::IMark* makeAnnotationMark(
+        virtual sw::mark::MarkBase* makeAnnotationMark(
             const SwPaM& rPaM,
             const OUString& rName ) = 0;
 
@@ -158,7 +158,7 @@ class IDocumentMarkAccess
            @returns
            a pointer to the new mark (name might have changed).
         */
-        virtual ::sw::mark::IMark* getMarkForTextNode(const SwTextNode& 
rTextNode,
+        virtual ::sw::mark::MarkBase* getMarkForTextNode(const SwTextNode& 
rTextNode,
             MarkType eMark) =0;
 
         /** Moves an existing mark to a new selection and performs needed 
updates.
@@ -169,7 +169,7 @@ class IDocumentMarkAccess
             [in] new selection to be marked
         */
 
-        virtual void repositionMark(::sw::mark::IMark* io_pMark,
+        virtual void repositionMark(::sw::mark::MarkBase* io_pMark,
             const SwPaM& rPaM) =0;
 
         /** Renames an existing Mark, if possible.
@@ -181,7 +181,7 @@ class IDocumentMarkAccess
 
             @returns false, if renaming failed (because the name is already in 
use)
         */
-        virtual bool renameMark(::sw::mark::IMark* io_pMark,
+        virtual bool renameMark(::sw::mark::MarkBase* io_pMark,
                 const OUString& rNewName) =0;
 
         /** Corrects marks (absolute)
@@ -247,7 +247,7 @@ class IDocumentMarkAccess
             @param ppMark
             [in] the name of the mark to be deleted.
         */
-        virtual void deleteMark(const ::sw::mark::IMark* const pMark) =0;
+        virtual void deleteMark(const ::sw::mark::MarkBase* const pMark) =0;
 
         /** Clear (deletes) all marks.
         */
@@ -321,7 +321,7 @@ class IDocumentMarkAccess
         virtual const_iterator_t findFirstBookmarkStartsAfter(const 
SwPosition& rPos) const =0;
 
         /// Get the innermost bookmark that contains rPos.
-        virtual sw::mark::IMark* getOneInnermostBookmarkFor(const SwPosition& 
rPos) const = 0;
+        virtual sw::mark::MarkBase* getOneInnermostBookmarkFor(const 
SwPosition& rPos) const = 0;
 
         // Fieldmarks
         /** returns a STL-like random access iterator to the begin of the 
sequence of fieldmarks.
@@ -355,10 +355,10 @@ class IDocumentMarkAccess
         virtual const_iterator_t getAnnotationMarksEnd() const = 0;
         virtual sal_Int32 getAnnotationMarksCount() const = 0;
         virtual const_iterator_t findAnnotationMark( const OUString& rName ) 
const = 0;
-        virtual sw::mark::IMark* getAnnotationMarkFor(const SwPosition& 
rPosition) const = 0;
+        virtual sw::mark::MarkBase* getAnnotationMarkFor(const SwPosition& 
rPosition) const = 0;
         // handle and restore text ranges of annotations of tracked deletions
         // based on the helper bookmarks (which can survive I/O and hiding 
redlines)
-        virtual ::sw::mark::IMark* makeAnnotationBookmark(const SwPaM& rPaM,
+        virtual ::sw::mark::MarkBase* makeAnnotationBookmark(const SwPaM& rPaM,
             const OUString& rProposedName,
             MarkType eMark, ::sw::mark::InsertMode eMode,
             SwPosition const* pSepPos = nullptr) = 0;
@@ -373,7 +373,7 @@ class IDocumentMarkAccess
 
         /** Returns the MarkType used to create the mark
         */
-        static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark& rMark);
+        static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::MarkBase& 
rMark);
 
         static SW_DLLPUBLIC OUString GetCrossRefHeadingBookmarkNamePrefix();
         static SW_DLLPUBLIC bool IsLegalPaMForCrossRefHeadingBookmark( const 
SwPaM& rPaM );
diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index 2fba11ead502..8aea5ea991f0 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -51,51 +51,23 @@ namespace sw::mark
         CopyText,
     };
 
-    class SW_DLLPUBLIC IMark
-        : virtual public sw::BroadcastingModify // inherited as interface
-    {
-        protected:
-            IMark() = default;
-
-        public:
-            //getters
-            virtual const SwPosition& GetMarkPos() const =0;
-            // GetOtherMarkPos() is only guaranteed to return a valid
-            // reference if IsExpanded() returned true
-            virtual const SwPosition& GetOtherMarkPos() const =0;
-            virtual const SwPosition& GetMarkStart() const =0;
-            virtual const SwPosition& GetMarkEnd() const =0;
-            virtual const OUString& GetName() const =0;
-            virtual bool IsExpanded() const =0;
-            virtual bool IsCoveringPosition(const SwPosition& rPos) const =0;
-
-            //setters
-            // not available in IMark
-            // inside core, you can cast to MarkBase and use its setters,
-            // make sure to update the sorting in Markmanager in this case
-
-            virtual OUString ToString( ) const =0;
-            virtual void dumpAsXml(xmlTextWriterPtr pWriter) const = 0;
-        private:
-            IMark(IMark const &) = delete;
-            IMark &operator =(IMark const&) = delete;
-    };
-
     class SW_DLLPUBLIC MarkBase
-        : virtual public IMark
+        : virtual public sw::BroadcastingModify // inherited as interface
     {
     public:
         //getters
-        SwPosition& GetMarkPos() const override
+        SwPosition& GetMarkPos() const
             { return const_cast<SwPosition&>(*m_oPos1); }
-        const OUString& GetName() const override
+        const OUString& GetName() const
             { return m_aName; }
-        SwPosition& GetOtherMarkPos() const override
+        // GetOtherMarkPos() is only guaranteed to return a valid
+        // reference if IsExpanded() returned true
+        virtual SwPosition& GetOtherMarkPos() const
         {
             OSL_PRECOND(IsExpanded(), "<SwPosition::GetOtherMarkPos(..)> - I 
have no other Pos set." );
             return const_cast<SwPosition&>(*m_oPos2);
         }
-        SwPosition& GetMarkStart() const override
+        virtual SwPosition& GetMarkStart() const
         {
             if( !IsExpanded() ) return GetMarkPos( );
             if ( GetMarkPos( ) < GetOtherMarkPos( ) )
@@ -103,7 +75,7 @@ namespace sw::mark
             else
                 return GetOtherMarkPos( );
         }
-        SwPosition& GetMarkEnd() const override
+        virtual SwPosition& GetMarkEnd() const
         {
             if( !IsExpanded() ) return GetMarkPos();
             if ( GetMarkPos( ) >= GetOtherMarkPos( ) )
@@ -112,8 +84,8 @@ namespace sw::mark
                 return GetOtherMarkPos( );
         }
 
-        bool IsCoveringPosition(const SwPosition& rPos) const override;
-        bool IsExpanded() const override
+        bool IsCoveringPosition(const SwPosition& rPos) const;
+        virtual bool IsExpanded() const
             { return m_oPos2.has_value(); }
 
         void SetName(const OUString& rName)
@@ -125,8 +97,8 @@ namespace sw::mark
 
         virtual auto InvalidateFrames() -> void;
 
-        OUString ToString( ) const override;
-        void dumpAsXml(xmlTextWriterPtr pWriter) const override;
+        virtual OUString ToString( ) const;
+        virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
 
         void Swap()
         {
diff --git a/sw/inc/contentindex.hxx b/sw/inc/contentindex.hxx
index ea54b1c052a2..c433782d7e38 100644
--- a/sw/inc/contentindex.hxx
+++ b/sw/inc/contentindex.hxx
@@ -30,7 +30,7 @@ class SwContentIndexReg;
 struct SwPosition;
 class SwRangeRedline;
 
-namespace sw::mark { class IMark; }
+namespace sw::mark { class MarkBase; }
 
 /// Marks a character position inside a document model content node 
(SwContentNode)
 class SAL_WARN_UNUSED SW_DLLPUBLIC SwContentIndex
@@ -48,7 +48,7 @@ private:
     SwRangeRedline * m_pRangeRedline = nullptr;
 
     /// Pointer to a mark that owns this position to allow fast lookup of 
marks of an SwContentIndexReg.
-    const sw::mark::IMark* m_pMark;
+    const sw::mark::MarkBase* m_pMark;
 
     SwContentIndex& ChgValue( const SwContentIndex& rIdx, sal_Int32 nNewValue 
);
     void Init(sal_Int32 const nIdx);
@@ -103,8 +103,8 @@ public:
     const SwContentNode* GetContentNode() const { return m_pContentNode; }
     const SwContentIndex* GetNext() const { return m_pNext; }
 
-    const sw::mark::IMark* GetMark() const { return m_pMark; }
-    void SetMark(const sw::mark::IMark* pMark);
+    const sw::mark::MarkBase* GetMark() const { return m_pMark; }
+    void SetMark(const sw::mark::MarkBase* pMark);
 
     SwRangeRedline* GetRedline() const { return m_pRangeRedline; }
     void SetRedline(SwRangeRedline* pRangeRedline) { m_pRangeRedline = 
pRangeRedline; }
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 25f8b549a18d..8b9f138506aa 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -588,17 +588,17 @@ public:
     void GoNextPrevCursorSetSearchLabel(const bool bNext);
 
     // at CurrentCursor.SPoint
-    SW_DLLPUBLIC ::sw::mark::IMark* SetBookmark(
+    SW_DLLPUBLIC ::sw::mark::MarkBase* SetBookmark(
         const vcl::KeyCode&,
         const OUString& rName,
         IDocumentMarkAccess::MarkType eMark = 
IDocumentMarkAccess::MarkType::BOOKMARK);
-    SW_DLLPUBLIC ::sw::mark::IMark* SetBookmark2(
+    SW_DLLPUBLIC ::sw::mark::MarkBase* SetBookmark2(
         const vcl::KeyCode&,
         const OUString& rName,
         bool bHide,
         const OUString& rCondition);
-    SW_DLLPUBLIC bool GotoMark( const ::sw::mark::IMark* const pMark );    // 
sets CurrentCursor.SPoint
-    bool GotoMark( const ::sw::mark::IMark* const pMark, bool bAtStart );
+    SW_DLLPUBLIC bool GotoMark( const ::sw::mark::MarkBase* const pMark );    
// sets CurrentCursor.SPoint
+    bool GotoMark( const ::sw::mark::MarkBase* const pMark, bool bAtStart );
     bool GoNextBookmark(); // true, if there was one
     bool GoPrevBookmark();
 
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 62721beb0c4c..c9bffacb2d65 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -83,7 +83,7 @@ struct SAL_WARN_UNUSED SW_DLLPUBLIC SwPosition
 
     const SwContentNode* GetContentNode() const { return 
nContent.GetContentNode(); }
     sal_Int32 GetContentIndex() const { return nContent.GetIndex(); }
-    void SetMark(const sw::mark::IMark* pMark) { nContent.SetMark(pMark); }
+    void SetMark(const sw::mark::MarkBase* pMark) { nContent.SetMark(pMark); }
     void SetRedline(SwRangeRedline* pRangeRedline) { 
nContent.SetRedline(pRangeRedline); }
 
     /// These all set both nNode and nContent
diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx
index f55d64d39a99..e9d30a3d854d 100644
--- a/sw/inc/postithelper.hxx
+++ b/sw/inc/postithelper.hxx
@@ -33,7 +33,7 @@ class SwEditWin;
 class SwFrame;
 class IDocumentRedlineAccess;
 namespace sw::annotation { class SwAnnotationWin; }
-namespace sw::mark { class IMark; }
+namespace sw::mark { class MarkBase; }
 
 struct SwPosition;
 
@@ -84,7 +84,7 @@ namespace SwPostItHelper
     SwLayoutStatus getLayoutInfos(
         SwLayoutInfo& o_rInfo,
         const SwPosition& rAnchorPos,
-        const sw::mark::IMark* pAnnotationMark = nullptr );
+        const sw::mark::MarkBase* pAnnotationMark = nullptr );
 
     tools::Long getLayoutHeight( const SwRootFrame* pRoot );
     void setSidebarChanged( SwRootFrame* pRoot, bool bBrowseMode );
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 370f6f6daa68..5121d5371181 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -48,7 +48,7 @@ class SwPaM;
 class SwTextBlocks;
 struct SwPosition;
 struct Writer_Impl;
-namespace sw::mark { class IMark; }
+namespace sw::mark { class MarkBase; }
 namespace com::sun::star::embed { class XStorage; }
 
 // Defines the count of chars at which a paragraph read via ASCII/W4W-Reader
@@ -458,7 +458,7 @@ public:
     // Search all Bookmarks in the range and return it in the Array.
     bool GetBookmarks( const SwContentNode& rNd,
                         sal_Int32 nStt, sal_Int32 nEnd,
-                        std::vector< const ::sw::mark::IMark* >& rArr );
+                        std::vector< const ::sw::mark::MarkBase* >& rArr );
 
     // Create new PaM at position.
     static std::shared_ptr<SwUnoCursor> NewUnoCursor(SwDoc & rDoc,
diff --git a/sw/inc/swserv.hxx b/sw/inc/swserv.hxx
index c80c0e7de928..6063feb1c3b2 100644
--- a/sw/inc/swserv.hxx
+++ b/sw/inc/swserv.hxx
@@ -26,7 +26,7 @@ class SwBaseLink;
 class SwTableNode;
 struct SwPosition;
 class SwPaM;
-namespace sw::mark { class IMark; }
+namespace sw::mark { class MarkBase; }
 
 class SwServerObject final : public ::sfx2::SvLinkSource
 {
@@ -34,13 +34,13 @@ class SwServerObject final : public ::sfx2::SvLinkSource
 
     enum ServerModes { BOOKMARK_SERVER, TABLE_SERVER, SECTION_SERVER, 
NONE_SERVER } m_eType;
     union {
-        ::sw::mark::IMark* pBkmk;
+        ::sw::mark::MarkBase* pBkmk;
         SwTableNode* pTableNd;
         SwSectionNode* pSectNd;
     } m_CNTNT_TYPE;
 
 public:
-    SwServerObject( ::sw::mark::IMark& rBookmark )
+    SwServerObject( ::sw::mark::MarkBase& rBookmark )
         : m_eType( BOOKMARK_SERVER )
     {
         m_CNTNT_TYPE.pBkmk = &rBookmark;
@@ -67,7 +67,7 @@ public:
     bool IsLinkInServer( const SwBaseLink* ) const;
 
     void SetNoServer();
-    void SetDdeBookmark( ::sw::mark::IMark& rBookmark);
+    void SetDdeBookmark( ::sw::mark::MarkBase& rBookmark);
 };
 
 #endif // INCLUDED_SW_INC_SWSERV_HXX
diff --git a/sw/inc/txtannotationfld.hxx b/sw/inc/txtannotationfld.hxx
index b1d35b33ea25..a8acb2940e79 100644
--- a/sw/inc/txtannotationfld.hxx
+++ b/sw/inc/txtannotationfld.hxx
@@ -22,7 +22,7 @@
 
 #include "txtfld.hxx"
 
-namespace sw::mark { class IMark; }
+namespace sw::mark { class MarkBase; }
 
 class SwTextAnnotationField final : public SwTextField
 {
@@ -34,7 +34,7 @@ public:
 
     virtual ~SwTextAnnotationField() override;
 
-    ::sw::mark::IMark* GetAnnotationMark() const;
+    ::sw::mark::MarkBase* GetAnnotationMark() const;
 };
 
 #endif
diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx
index 036ec451aafd..a510216641f8 100644
--- a/sw/inc/unocrsrhelper.hxx
+++ b/sw/inc/unocrsrhelper.hxx
@@ -40,7 +40,7 @@ struct SwSortOptions;
 class SwDoc;
 class SwRootFrame;
 
-namespace sw::mark { class IMark; }
+namespace sw::mark { class MarkBase; }
 
 namespace com::sun::star{
     namespace beans{
@@ -235,7 +235,7 @@ namespace SwUnoCursorHelper
         SwDoc & rTargetDoc,
         std::optional<SwPaM>& o_rpPaM, std::pair<OUString, FlyCntType> & 
o_rFrame,
         OUString & o_rTableName, SwUnoTableCursor const*& o_rpTableCursor,
-        ::sw::mark::IMark const*& o_rpMark,
+        ::sw::mark::MarkBase const*& o_rpMark,
         std::vector<SdrObject *> & o_rSdrObjects);
 
     css::uno::Reference<css::text::XFlatParagraphIterator>
diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx
index fa58a0410e08..7e43d72c2f30 100644
--- a/sw/inc/unotextrange.hxx
+++ b/sw/inc/unotextrange.hxx
@@ -103,7 +103,7 @@ private:
                 std::u16string_view aText, ::sw::DeleteAndInsertMode eMode);
     void    Invalidate();
     void    GetStartPaM(std::optional<SwPaM>& roPaM);
-    void    SetMark(::sw::mark::IMark& rMark);
+    void    SetMark(::sw::mark::MarkBase& rMark);
     void    InvalidateImpl();
 
     virtual ~SwXTextRange() override;
@@ -211,7 +211,7 @@ private:
     SwDoc& m_rDoc;
     css::uno::Reference<css::text::XText> m_xParentText;
     const SwFrameFormat* m_pTableOrSectionFormat;
-    const ::sw::mark::IMark* m_pMark;
+    const ::sw::mark::MarkBase* m_pMark;
     struct MySvtListener : public SvtListener
     {
         SwXTextRange& mrTextRange;
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index 21798735cd09..b5b3ec02828e 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -190,7 +190,7 @@ void SwMacrosTest::testBookmarkDeleteAndJoin()
     aPaM.SetMark();
     aPaM.Move(fnMoveForward, GoInDoc);
     IDocumentMarkAccess & rIDMA = *pDoc->getIDocumentMarkAccess();
-    sw::mark::IMark *pMark =
+    sw::mark::MarkBase *pMark =
         rIDMA.makeMark(aPaM, u"test"_ustr, 
IDocumentMarkAccess::MarkType::BOOKMARK,
             ::sw::mark::InsertMode::New);
     CPPUNIT_ASSERT(pMark);
@@ -225,7 +225,7 @@ void SwMacrosTest::testBookmarkDeleteTdf90816()
     aPaM.SetMark();
     aPaM.Move(fnMoveBackward, GoInContent);
     IDocumentMarkAccess & rIDMA = *pDoc->getIDocumentMarkAccess();
-    sw::mark::IMark *pMark =
+    sw::mark::MarkBase *pMark =
         rIDMA.makeMark(aPaM, u"test"_ustr, 
IDocumentMarkAccess::MarkType::BOOKMARK,
             ::sw::mark::InsertMode::New);
     CPPUNIT_ASSERT(pMark);
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 8206934d9011..63f417464be6 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -1474,9 +1474,9 @@ void SwDocTest::testMarkMove()
         SwTextNode& rParaNode2 = dynamic_cast<SwTextNode&>(aIdx.GetNode());
         rParaNode2.JoinNext();
     }
-    ::sw::mark::IMark* pBM1 = *pMarksAccess->findMark(u"Para1"_ustr);
-    ::sw::mark::IMark* pBM2 = *pMarksAccess->findMark(u"Para2"_ustr);
-    ::sw::mark::IMark* pBM3 = *pMarksAccess->findMark(u"Para3"_ustr);
+    ::sw::mark::MarkBase* pBM1 = *pMarksAccess->findMark(u"Para1"_ustr);
+    ::sw::mark::MarkBase* pBM2 = *pMarksAccess->findMark(u"Para2"_ustr);
+    ::sw::mark::MarkBase* pBM3 = *pMarksAccess->findMark(u"Para3"_ustr);
 
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0) , 
pBM1->GetMarkStart().GetContentIndex());
     CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM1->GetMarkEnd().GetContentIndex());
diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx 
b/sw/qa/extras/uiwriter/uiwriter4.cxx
index 408bbea89384..8a0938486416 100644
--- a/sw/qa/extras/uiwriter/uiwriter4.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter4.cxx
@@ -547,7 +547,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96479)
         SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
         SwPaM aPaM(aIdx);
         IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess();
-        sw::mark::IMark* pMark
+        sw::mark::MarkBase* pMark
             = rIDMA.makeMark(aPaM, u"original"_ustr, 
IDocumentMarkAccess::MarkType::BOOKMARK,
                              ::sw::mark::InsertMode::New);
         CPPUNIT_ASSERT(!pMark->IsExpanded());
@@ -704,9 +704,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, 
testRemoveBookmarkText)
 
             lcl_selectCharacters(aPaM, 0, 3);
             IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess();
-            sw::mark::IMark* pMark = rIDMA.makeMark(aPaM, u"testBookmark"_ustr,
-                                                    
IDocumentMarkAccess::MarkType::BOOKMARK,
-                                                    
::sw::mark::InsertMode::New);
+            sw::mark::MarkBase* pMark = rIDMA.makeMark(aPaM, 
u"testBookmark"_ustr,
+                                                       
IDocumentMarkAccess::MarkType::BOOKMARK,
+                                                       
::sw::mark::InsertMode::New);
 
             // verify
             CPPUNIT_ASSERT(pMark->IsExpanded());
@@ -782,9 +782,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, 
testRemoveBookmarkTextAndAddNew)
 
             lcl_selectCharacters(aPaM, 0, 3);
             IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess();
-            sw::mark::IMark* pMark = rIDMA.makeMark(aPaM, u"testBookmark"_ustr,
-                                                    
IDocumentMarkAccess::MarkType::BOOKMARK,
-                                                    
::sw::mark::InsertMode::New);
+            sw::mark::MarkBase* pMark = rIDMA.makeMark(aPaM, 
u"testBookmark"_ustr,
+                                                       
IDocumentMarkAccess::MarkType::BOOKMARK,
+                                                       
::sw::mark::InsertMode::New);
 
             // verify
             CPPUNIT_ASSERT(pMark->IsExpanded());
diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx 
b/sw/qa/extras/uiwriter/uiwriter5.cxx
index 45629761d907..3a6608e9a508 100644
--- a/sw/qa/extras/uiwriter/uiwriter5.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter5.cxx
@@ -1313,7 +1313,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, 
testImageCommentAtChar)
     // Get the annotation mark doc model start.
     auto it = pDoc->getIDocumentMarkAccess()->getAnnotationMarksBegin();
     CPPUNIT_ASSERT(it != 
pDoc->getIDocumentMarkAccess()->getAnnotationMarksEnd());
-    const sw::mark::IMark* pMark = *it;
+    const sw::mark::MarkBase* pMark = *it;
     const SwPosition& rAnnotationMarkStart = pMark->GetMarkPos();
 
     // Without the accompanying fix in place, this test would have failed with:
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 587045a8ce64..4cdfbc3e7a0c 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -2365,7 +2365,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf94804)
     SwPaM* pCrsr = pShell->GetCursor();
     IDocumentMarkAccess* pIDMAccess(pDoc->getIDocumentMarkAccess());
     //make first bookmark, CROSSREF_HEADING, with *empty* name
-    sw::mark::IMark* pMark1(pIDMAccess->makeMark(
+    sw::mark::MarkBase* pMark1(pIDMAccess->makeMark(
         *pCrsr, u""_ustr, 
IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK,
         ::sw::mark::InsertMode::New));
     //get the new(autogenerated) bookmark name
@@ -2373,7 +2373,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf94804)
     //match the bookmark name, it should be like "__RefHeading__**"
     CPPUNIT_ASSERT(bookmark1name.match("__RefHeading__"));
     //make second bookmark, CROSSREF_NUMITEM, with *empty* name
-    sw::mark::IMark* pMark2(pIDMAccess->makeMark(
+    sw::mark::MarkBase* pMark2(pIDMAccess->makeMark(
         *pCrsr, u""_ustr, 
IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK,
         ::sw::mark::InsertMode::New));
     //get the new(autogenerated) bookmark name
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index 97341709e458..59720ff244df 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testInsertBookmark)
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), rIDMA.getBookmarksCount());
     for (auto it = rIDMA.getBookmarksBegin(); it != rIDMA.getBookmarksEnd(); 
++it)
     {
-        sw::mark::IMark* pMark = *it;
+        sw::mark::MarkBase* pMark = *it;
         CPPUNIT_ASSERT_EQUAL(aExpectedBookmarkName, pMark->GetName());
         SwPaM aPam(pMark->GetMarkStart(), pMark->GetMarkEnd());
         OUString aActualResult = aPam.GetText();
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx
index c7ded156ea26..4deeea8a7eb6 100644
--- a/sw/source/core/bastyp/index.cxx
+++ b/sw/source/core/bastyp/index.cxx
@@ -219,7 +219,7 @@ SwContentIndex& SwContentIndex::Assign( const 
SwContentNode* pArr, sal_Int32 nId
     return *this;
 }
 
-void SwContentIndex::SetMark(const sw::mark::IMark* pMark)
+void SwContentIndex::SetMark(const sw::mark::MarkBase* pMark)
 {
     m_pMark = pMark;
 }
diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx
index 551f390fc89b..bf9cc7e9c805 100644
--- a/sw/source/core/crsr/crbm.cxx
+++ b/sw/source/core/crsr/crbm.cxx
@@ -35,7 +35,7 @@ namespace
             , m_aSaveState(*m_pCursor)
         { }
 
-        void SetCursorToMark(::sw::mark::IMark const * const pMark)
+        void SetCursorToMark(::sw::mark::MarkBase const * const pMark)
         {
             *(m_pCursor->GetPoint()) = pMark->GetMarkStart();
             if(pMark->IsExpanded())
@@ -62,26 +62,26 @@ namespace
         SwCursorSaveState m_aSaveState;
     };
 
-    bool lcl_ReverseMarkOrderingByEnd(const ::sw::mark::IMark* pFirst,
-                                      const ::sw::mark::IMark* pSecond)
+    bool lcl_ReverseMarkOrderingByEnd(const ::sw::mark::MarkBase* pFirst,
+                                      const ::sw::mark::MarkBase* pSecond)
     {
         return pFirst->GetMarkEnd() > pSecond->GetMarkEnd();
     }
 
-    bool lcl_IsInvisibleBookmark(const ::sw::mark::IMark* pMark)
+    bool lcl_IsInvisibleBookmark(const ::sw::mark::MarkBase* pMark)
     {
         return IDocumentMarkAccess::GetType(*pMark) != 
IDocumentMarkAccess::MarkType::BOOKMARK;
     }
 }
 
 // at CurrentCursor.SPoint
-::sw::mark::IMark* SwCursorShell::SetBookmark(
+::sw::mark::MarkBase* SwCursorShell::SetBookmark(
     const vcl::KeyCode& rCode,
     const OUString& rName,
     IDocumentMarkAccess::MarkType eMark)
 {
     StartAction();
-    ::sw::mark::IMark* pMark = getIDocumentMarkAccess()->makeMark(
+    ::sw::mark::MarkBase* pMark = getIDocumentMarkAccess()->makeMark(
         *GetCursor(),
         rName,
         eMark, sw::mark::InsertMode::New);
@@ -97,14 +97,14 @@ namespace
 // set CurrentCursor.SPoint
 
 // at CurrentCursor.SPoint
-::sw::mark::IMark* SwCursorShell::SetBookmark2(
+::sw::mark::MarkBase* SwCursorShell::SetBookmark2(
     const vcl::KeyCode& rCode,
     const OUString& rName,
     bool bHide,
     const OUString& rCondition)
 {
     StartAction();
-    ::sw::mark::IMark* pMark = getIDocumentMarkAccess()->makeMark(
+    ::sw::mark::MarkBase* pMark = getIDocumentMarkAccess()->makeMark(
         *GetCursor(),
         rName,
         IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New);
@@ -122,7 +122,7 @@ namespace
 
 namespace sw {
 
-bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::IMark const& rMark)
+bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::MarkBase const& 
rMark)
 {
     if (!rLayout.HasMergedParas())
     {
@@ -165,7 +165,7 @@ bool IsMarkHidden(SwRootFrame const& rLayout, 
::sw::mark::IMark const& rMark)
 } // namespace sw
 
 // set CurrentCursor.SPoint
-bool SwCursorShell::GotoMark(const ::sw::mark::IMark* const pMark, bool 
bAtStart)
+bool SwCursorShell::GotoMark(const ::sw::mark::MarkBase* const pMark, bool 
bAtStart)
 {
     if (sw::IsMarkHidden(*GetLayout(), *pMark))
     {
@@ -184,7 +184,7 @@ bool SwCursorShell::GotoMark(const ::sw::mark::IMark* const 
pMark, bool bAtStart
     return true;
 }
 
-bool SwCursorShell::GotoMark(const ::sw::mark::IMark* const pMark)
+bool SwCursorShell::GotoMark(const ::sw::mark::MarkBase* const pMark)
 {
     if (sw::IsMarkHidden(*GetLayout(), *pMark))
     {
@@ -203,7 +203,7 @@ bool SwCursorShell::GotoMark(const ::sw::mark::IMark* const 
pMark)
 bool SwCursorShell::GoNextBookmark()
 {
     IDocumentMarkAccess* pMarkAccess = getIDocumentMarkAccess();
-    std::vector<::sw::mark::IMark*> vCandidates;
+    std::vector<::sw::mark::MarkBase*> vCandidates;
     remove_copy_if(
         pMarkAccess->findFirstBookmarkStartsAfter(*GetCursor()->GetPoint()),
         pMarkAccess->getBookmarksEnd(),
@@ -238,7 +238,7 @@ bool SwCursorShell::GoPrevBookmark()
     IDocumentMarkAccess* pMarkAccess = getIDocumentMarkAccess();
     // candidates from which to choose the mark before
     // no need to consider marks starting after rPos
-    std::vector<::sw::mark::IMark*> vCandidates;
+    std::vector<::sw::mark::MarkBase*> vCandidates;
     remove_copy_if(
         pMarkAccess->getBookmarksBegin(),
         pMarkAccess->findFirstBookmarkStartsAfter(*GetCursor()->GetPoint()),
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index b86d2e70d319..9f01cb239bf1 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1494,7 +1494,7 @@ bool SwCursor::SelectWordWT( SwViewShell const * 
pViewShell, sal_Int16 nWordType
                 {
                     SetMark();
                     GetMark()->Assign(*pStartNode, nStartIndex);
-                    if (sw::mark::IMark* pAnnotationMark = 
pMarksAccess->getAnnotationMarkFor(*GetPoint()))
+                    if (sw::mark::MarkBase* pAnnotationMark = 
pMarksAccess->getAnnotationMarkFor(*GetPoint()))
                     {
                         // An annotation mark covers the selected word. Check
                         // if it covers only the word: in that case we select
diff --git a/sw/source/core/doc/CntntIdxStore.cxx 
b/sw/source/core/doc/CntntIdxStore.cxx
index 6b82ebc20cd3..73f4c0b9a74e 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -184,7 +184,7 @@ namespace
             void RestoreUnoCursors(updater_t const & rUpdater);
             void SaveShellCursors(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 
nContent);
             void RestoreShellCursors(updater_t const & rUpdater);
-            static const SwPosition& GetRightMarkPos(::sw::mark::IMark const * 
pMark, bool bOther)
+            static const SwPosition& GetRightMarkPos(::sw::mark::MarkBase 
const * pMark, bool bOther)
                 { return bOther ? pMark->GetOtherMarkPos() : 
pMark->GetMarkPos(); };
             static void SetRightMarkPos(MarkBase* pMark, bool bOther, const 
SwPosition* const pPos)
                 { bOther ? pMark->SetOtherMarkPos(*pPos) : 
pMark->SetMarkPos(*pPos); };
@@ -227,7 +227,7 @@ void ContentIdxStoreImpl::SaveBkmks(SwDoc& rDoc, 
SwNodeOffset nNode, sal_Int32 n
         ppBkmk != ppBkmkEnd;
         ++ppBkmk)
     {
-        const ::sw::mark::IMark* pBkmk = *ppBkmk;
+        const ::sw::mark::MarkBase* pBkmk = *ppBkmk;
         bool bMarkPosEqual = false;
         if(pBkmk->GetMarkPos().GetNodeIndex() == nNode
             && pBkmk->GetMarkPos().GetContentIndex() <= nContent)
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index f8389404627d..3828312176d3 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -245,12 +245,12 @@ namespace sw
         const SwPosition &rStt = *rPam.Start(), &rEnd = *rPam.End();
         SwPosition const*const pCpyStt = &rCpyPam;
 
-        std::vector< const ::sw::mark::IMark* > vMarksToCopy;
+        std::vector< const ::sw::mark::MarkBase* > vMarksToCopy;
         for ( IDocumentMarkAccess::const_iterator_t ppMark = 
pSrcMarkAccess->getAllMarksBegin();
               ppMark != pSrcMarkAccess->getAllMarksEnd();
               ++ppMark )
         {
-            const ::sw::mark::IMark* const pMark = *ppMark;
+            const ::sw::mark::MarkBase* const pMark = *ppMark;
 
             const SwPosition& rMarkStart = pMark->GetMarkStart();
             const SwPosition& rMarkEnd = pMark->GetMarkEnd();
@@ -286,7 +286,7 @@ namespace sw
         // We have to count the "non-copied" nodes...
         SwNodeOffset nDelCount;
         SwNodeIndex aCorrIdx(InitDelCount(rPam, nDelCount));
-        for(const sw::mark::IMark* const pMark : vMarksToCopy)
+        for(const sw::mark::MarkBase* const pMark : vMarksToCopy)
         {
             SwPaM aTmpPam(*pCpyStt);
             lcl_NonCopyCount(rPam, aCorrIdx, 
pMark->GetMarkPos().GetNodeIndex(), nDelCount);
@@ -303,12 +303,12 @@ namespace sw
             {
                 assert(&rSrcDoc == &rDestDoc);
                 // Ensure the name can be given to NewMark, since this is 
ultimately a move
-                auto pSoonToBeDeletedMark = 
const_cast<sw::mark::IMark*>(pMark);
+                auto pSoonToBeDeletedMark = 
const_cast<sw::mark::MarkBase*>(pMark);
                 
rDestDoc.getIDocumentMarkAccess()->renameMark(pSoonToBeDeletedMark,
                                                               sRequestedName + 
"COPY_IS_MOVE");
             }
 
-            ::sw::mark::IMark* const pNewMark = 
rDestDoc.getIDocumentMarkAccess()->makeMark(
+            ::sw::mark::MarkBase* const pNewMark = 
rDestDoc.getIDocumentMarkAccess()->makeMark(
                 aTmpPam,
                 sRequestedName,
                 IDocumentMarkAccess::GetType(*pMark),
@@ -4677,7 +4677,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( 
SwPaM& rPam, const OUSt
                 m_rDoc.GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, 
nullptr);
 
                 // If any Redline will change (split!) the node
-                const ::sw::mark::IMark* pBkmk =
+                const ::sw::mark::MarkBase* pBkmk =
                     m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam,
                         OUString(), 
IDocumentMarkAccess::MarkType::UNO_BOOKMARK,
                         ::sw::mark::InsertMode::New);
@@ -4779,7 +4779,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( 
SwPaM& rPam, const OUSt
                 m_rDoc.GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, 
nullptr);
 
                 // If any Redline will change (split!) the node
-                const ::sw::mark::IMark* pBkmk =
+                const ::sw::mark::MarkBase* pBkmk =
                     m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam,
                         OUString(), 
IDocumentMarkAccess::MarkType::UNO_BOOKMARK,
                         ::sw::mark::InsertMode::New);
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 3cdd43d24aa8..bc9f9db6828e 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -88,10 +88,10 @@ auto IDocumentMarkAccess::iterator::operator=(iterator && 
rOther) noexcept -> it
 }
 
 // ARGH why does it *need* to return const& ?
-::sw::mark::IMark* /*const&*/
+::sw::mark::MarkBase* /*const&*/
 IDocumentMarkAccess::iterator::operator*() const
 {
-    return static_cast<sw::mark::IMark*>(**m_pIter);
+    return **m_pIter;
 }
 
 auto IDocumentMarkAccess::iterator::operator++() -> iterator&
@@ -163,7 +163,7 @@ auto IDocumentMarkAccess::iterator::operator-(iterator 
const& rOther) const -> d
 
 auto IDocumentMarkAccess::iterator::operator[](difference_type const n) const 
-> value_type
 {
-    return static_cast<sw::mark::IMark*>((*m_pIter)[n]);
+    return (*m_pIter)[n];
 }
 
 bool IDocumentMarkAccess::iterator::operator<(iterator const& rOther) const
@@ -302,11 +302,11 @@ namespace
     struct CompareIMarkStartsBefore
     {
         bool operator()(SwPosition const& rPos,
-                        const sw::mark::IMark* pMark)
+                        const sw::mark::MarkBase* pMark)
         {
             return rPos < pMark->GetMarkStart();
         }
-        bool operator()(const sw::mark::IMark* pMark,
+        bool operator()(const sw::mark::MarkBase* pMark,
                         SwPosition const& rPos)
         {
             return pMark->GetMarkStart() < rPos;
@@ -318,7 +318,7 @@ namespace
     struct CompareIMarkStartsAfter
     {
         bool operator()(SwPosition const& rPos,
-                        const sw::mark::IMark* pMark)
+                        const sw::mark::MarkBase* pMark)
         {
             return pMark->GetMarkStart() > rPos;
         }
@@ -326,13 +326,13 @@ namespace
 
     struct CompareIMarkStartsAfterReverse
     {
-        bool operator()(const sw::mark::IMark* pMark, SwPosition const& rPos)
+        bool operator()(const sw::mark::MarkBase* pMark, SwPosition const& 
rPos)
         {
             return pMark->GetMarkStart() > rPos;
         }
     };
 
-    IMark* lcl_getMarkAfter(const MarkManager::container_t& rMarks, const 
SwPosition& rPos,
+    MarkBase* lcl_getMarkAfter(const MarkManager::container_t& rMarks, const 
SwPosition& rPos,
                             bool bLoop)
     {
         auto const pMarkAfter = upper_bound(
@@ -350,7 +350,7 @@ namespace
         return *pMarkAfter;
     };
 
-    IMark* lcl_getMarkBefore(const MarkManager::container_t& rMarks, const 
SwPosition& rPos,
+    MarkBase* lcl_getMarkBefore(const MarkManager::container_t& rMarks, const 
SwPosition& rPos,
                              bool bLoop)
     {
         // candidates from which to choose the mark before
@@ -488,7 +488,7 @@ namespace
              ppMark != rMarks.end();
              ++ppMark)
         {
-            IMark* pMark = *ppMark;
+            MarkBase* pMark = *ppMark;
             const SwPosition* const pStPos = &pMark->GetMarkStart();
             const SwPosition* const pEndPos = &pMark->GetMarkEnd();
             SAL_INFO("sw.core",
@@ -506,7 +506,7 @@ namespace
     };
 }
 
-IDocumentMarkAccess::MarkType IDocumentMarkAccess::GetType(const IMark& rBkmk)
+IDocumentMarkAccess::MarkType IDocumentMarkAccess::GetType(const MarkBase& 
rBkmk)
 {
     const std::type_info* const pMarkTypeInfo = &typeid(rBkmk);
     // not using dynamic_cast<> here for performance
@@ -572,7 +572,7 @@ namespace sw::mark
         , m_pLastActiveFieldmark(nullptr)
     { }
 
-    ::sw::mark::IMark* MarkManager::makeMark(const SwPaM& rPaM,
+    ::sw::mark::MarkBase* MarkManager::makeMark(const SwPaM& rPaM,
         const OUString& rName,
         const IDocumentMarkAccess::MarkType eType,
         sw::mark::InsertMode const eMode,
@@ -755,7 +755,7 @@ namespace sw::mark
         bool bUndoIsEnabled = m_rDoc.GetIDocumentUndoRedo().DoesUndo();
         m_rDoc.GetIDocumentUndoRedo().DoUndo(false);
 
-        sw::mark::IMark* pMark = nullptr;
+        sw::mark::MarkBase* pMark = nullptr;
         if(rType == ODF_FORMDATE)
         {
             pMark = makeMark(rPaM, rName,
@@ -796,7 +796,7 @@ namespace sw::mark
         bool bEnableSetModified = 
m_rDoc.getIDocumentState().IsEnableSetModified();
         m_rDoc.getIDocumentState().SetEnableSetModified(false);
 
-        sw::mark::IMark* pMark = nullptr;
+        sw::mark::MarkBase* pMark = nullptr;
         if(rType == ODF_FORMCHECKBOX)
         {
             pMark = makeMark( rPaM, rName,
@@ -833,7 +833,7 @@ namespace sw::mark
         return pFieldMark;
     }
 
-    ::sw::mark::IMark* MarkManager::getMarkForTextNode(
+    ::sw::mark::MarkBase* MarkManager::getMarkForTextNode(
         const SwTextNode& rTextNode,
         const IDocumentMarkAccess::MarkType eType )
     {
@@ -845,7 +845,7 @@ namespace sw::mark
         return makeMark(aPaM, OUString(), eType, sw::mark::InsertMode::New);
     }
 
-    sw::mark::IMark* MarkManager::makeAnnotationMark(
+    sw::mark::MarkBase* MarkManager::makeAnnotationMark(
         const SwPaM& rPaM,
         const OUString& rName )
     {
@@ -854,13 +854,13 @@ namespace sw::mark
     }
 
     void MarkManager::repositionMark(
-        ::sw::mark::IMark* const io_pMark,
+        ::sw::mark::MarkBase* const io_pMark,
         const SwPaM& rPaM)
     {
         assert(&io_pMark->GetMarkPos().GetDoc() == &m_rDoc &&
             "<MarkManager::repositionMark(..)>"
             " - Mark is not in my doc.");
-        MarkBase* const pMarkBase = dynamic_cast< MarkBase* >(io_pMark);
+        MarkBase* const pMarkBase = io_pMark;
         if (!pMarkBase)
             return;
 
@@ -881,7 +881,7 @@ namespace sw::mark
     }
 
     bool MarkManager::renameMark(
-        ::sw::mark::IMark* io_pMark,
+        ::sw::mark::MarkBase* io_pMark,
         const OUString& rNewName )
     {
         assert(&io_pMark->GetMarkPos().GetDoc() == &m_rDoc &&
@@ -891,20 +891,17 @@ namespace sw::mark
             return true;
         if (lcl_FindMarkByName(rNewName, m_vAllMarks.begin(), 
m_vAllMarks.end()) != m_vAllMarks.end())
             return false;
-        if (::sw::mark::MarkBase* pMarkBase = dynamic_cast< 
::sw::mark::MarkBase* >(io_pMark))
-        {
-            const OUString sOldName(pMarkBase->GetName());
-            pMarkBase->SetName(rNewName);
+        const OUString sOldName(io_pMark->GetName());
+        io_pMark->SetName(rNewName);
 
-            if (dynamic_cast< ::sw::mark::Bookmark* >(io_pMark))
+        if (dynamic_cast< ::sw::mark::Bookmark* >(io_pMark))
+        {
+            if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
             {
-                if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
-                {
-                    m_rDoc.GetIDocumentUndoRedo().AppendUndo(
-                            std::make_unique<SwUndoRenameBookmark>(sOldName, 
rNewName, m_rDoc));
-                }
-                m_rDoc.getIDocumentState().SetModified();
+                m_rDoc.GetIDocumentUndoRedo().AppendUndo(
+                        std::make_unique<SwUndoRenameBookmark>(sOldName, 
rNewName, m_rDoc));
             }
+            m_rDoc.getIDocumentState().SetModified();
         }
         return true;
     }
@@ -1279,7 +1276,7 @@ namespace sw::mark
         std::unique_ptr<ILazyDeleter> ret;
         if (ppMark.get() == m_vAllMarks.end())
             return ret;
-        IMark* pMark = *ppMark;
+        MarkBase* pMark = *ppMark;
 
         switch(IDocumentMarkAccess::GetType(*pMark))
         {
@@ -1374,7 +1371,7 @@ namespace sw::mark
         return ret;
     }
 
-    void MarkManager::deleteMark(const IMark* const pMark)
+    void MarkManager::deleteMark(const MarkBase* const pMark)
     {
         assert(&pMark->GetMarkPos().GetDoc() == &m_rDoc &&
             "<MarkManager::deleteMark(..)>"
@@ -1522,7 +1519,7 @@ namespace sw::mark
         return dynamic_cast<Fieldmark*>(pMark);
     }
 
-    IMark* MarkManager::getOneInnermostBookmarkFor(const SwPosition& rPos) 
const
+    MarkBase* MarkManager::getOneInnermostBookmarkFor(const SwPosition& rPos) 
const
     {
         auto it = std::find_if(m_vBookmarks.begin(), m_vBookmarks.end(),
                                [&rPos](const sw::mark::MarkBase* pMark)
@@ -1531,7 +1528,7 @@ namespace sw::mark
         {
             return nullptr;
         }
-        sw::mark::IMark* pBookmark = *it;
+        sw::mark::MarkBase* pBookmark = *it;
 
         // See if any bookmarks after the first hit are closer to rPos.
         ++it;
@@ -1707,7 +1704,7 @@ namespace sw::mark
         for (auto aI = m_vFieldmarks.begin(),
             aEnd = m_vFieldmarks.end(); aI != aEnd; ++aI)
         {
-            ::sw::mark::IMark* pI = *aI;
+            ::sw::mark::MarkBase* pI = *aI;
             const SwPosition &rStart = pI->GetMarkPos();
             if (!rPaM.ContainsPosition(rStart))
                 continue;
@@ -1752,7 +1749,7 @@ namespace sw::mark
         return IDocumentMarkAccess::iterator(ret);
     }
 
-    IMark* MarkManager::getAnnotationMarkFor(const SwPosition& rPos) const
+    MarkBase* MarkManager::getAnnotationMarkFor(const SwPosition& rPos) const
     {
         auto const pAnnotationMark = find_if(
             m_vAnnotationMarks.begin(),
@@ -1774,7 +1771,7 @@ namespace sw::mark
     }
 
     // create helper bookmark for annotations on tracked deletions
-    ::sw::mark::IMark* MarkManager::makeAnnotationBookmark(const SwPaM& rPaM,
+    ::sw::mark::MarkBase* MarkManager::makeAnnotationBookmark(const SwPaM& 
rPaM,
         const OUString& rName,
         const IDocumentMarkAccess::MarkType eType,
         sw::mark::InsertMode const eMode,
@@ -1930,7 +1927,7 @@ const IDocumentMarkAccess* 
SwDoc::getIDocumentMarkAccess() const
     { return static_cast< IDocumentMarkAccess* >(mpMarkManager.get()); }
 
 SaveBookmark::SaveBookmark(
-    const IMark& rBkmk,
+    const MarkBase& rBkmk,
     const SwNode& rMvPos,
     std::optional<sal_Int32> oContentIdx)
     : m_aName(rBkmk.GetName())
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 9ad444666b5f..02bce7f64017 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1135,18 +1135,18 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, 
sal_uInt16 const nStartPageNu
                 --aNodeIndex;
                 SwPaM aPaM(aNodeIndex);
                 // Collect the marks starting or ending at this text node.
-                o3tl::sorted_vector<sw::mark::IMark*> aSeenMarks;
+                o3tl::sorted_vector<sw::mark::MarkBase*> aSeenMarks;
                 IDocumentMarkAccess* pMarkAccess = getIDocumentMarkAccess();
                 for (const SwContentIndex* pIndex = 
pTextNode->GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
                 {
-                    sw::mark::IMark* pMark = 
const_cast<sw::mark::IMark*>(pIndex->GetMark());
+                    sw::mark::MarkBase* pMark = 
const_cast<sw::mark::MarkBase*>(pIndex->GetMark());
                     if (!pMark)
                         continue;
                     if (!aSeenMarks.insert(pMark).second)
                         continue;
                 }
                 // And move them back.
-                for (sw::mark::IMark* pMark : aSeenMarks)
+                for (sw::mark::MarkBase* pMark : aSeenMarks)
                     pMarkAccess->repositionMark(pMark, aPaM);
             }
 
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 5d347cdb34d9..5744700d0fdc 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1804,7 +1804,7 @@ static void lcl_storeAnnotationMarks(SwDoc& rDoc, const 
SwPosition* pStt, const
                 sal_Int32 nLen = (*pStt == rStartPos) ? 1 : 0;
                 SwPaM aPam( rStartPos.GetNode(), rStartPos.GetContentIndex(),
                                 rStartPos.GetNode(), 
rStartPos.GetContentIndex() + nLen);
-                ::sw::mark::IMark* pMark = rDMA.makeAnnotationBookmark(
+                ::sw::mark::MarkBase* pMark = rDMA.makeAnnotationBookmark(
                     aPam,
                     (**iter).GetName(),
                     IDocumentMarkAccess::MarkType::BOOKMARK, 
sw::mark::InsertMode::New);
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index 582a3564b0d8..904c05d6317c 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -261,7 +261,7 @@ void SwServerObject::SetNoServer()
     }
 }
 
-void SwServerObject::SetDdeBookmark( ::sw::mark::IMark& rBookmark)
+void SwServerObject::SetDdeBookmark( ::sw::mark::MarkBase& rBookmark)
 {
     ::sw::mark::DdeBookmark* const pDdeBookmark = dynamic_cast< 
::sw::mark::DdeBookmark* >(&rBookmark);
     if(pDdeBookmark)
diff --git a/sw/source/core/fields/postithelper.cxx 
b/sw/source/core/fields/postithelper.cxx
index 06fb3db7ef06..c28de860e729 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -43,7 +43,7 @@ class Point;
 namespace
 {
 /// Checks if pAnnotationMark covers exactly rAnchorPos (the comment anchor).
-bool AnnotationMarkCoversCommentAnchor(const sw::mark::IMark* pAnnotationMark,
+bool AnnotationMarkCoversCommentAnchor(const sw::mark::MarkBase* 
pAnnotationMark,
                                        const SwPosition& rAnchorPos)
 {
     if (!pAnnotationMark)
@@ -86,7 +86,7 @@ bool AnnotationMarkCoversCommentAnchor(const sw::mark::IMark* 
pAnnotationMark,
  * Finds the first draw object of rTextFrame which has the same anchor 
position as the start of
  * rAnnotationMark.
  */
-SwAnchoredObject* GetAnchoredObjectOfAnnotationMark(const sw::mark::IMark& 
rAnnotationMark,
+SwAnchoredObject* GetAnchoredObjectOfAnnotationMark(const sw::mark::MarkBase& 
rAnnotationMark,
                                                     const SwTextFrame& 
rTextFrame)
 {
     const SwSortedObjs* pAnchored = rTextFrame.GetDrawObjs();
@@ -128,7 +128,7 @@ SwSidebarItem::~SwSidebarItem() {}
 SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos(
     SwLayoutInfo& o_rInfo,
     const SwPosition& rAnchorPos,
-    const sw::mark::IMark* pAnnotationMark )
+    const sw::mark::MarkBase* pAnnotationMark )
 {
     SwLayoutStatus aRet = INVISIBLE;
     SwTextNode* pTextNode = rAnchorPos.GetNode().GetTextNode();
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 6b7cd10cc4fb..28ca54166a95 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1335,7 +1335,7 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, 
const OUString& rRefMark,
                 && (!pLayout || !pLayout->IsHideRedlines()
                     || !sw::IsMarkHidden(*pLayout, **ppMark)))
             {
-                const ::sw::mark::IMark* pBkmk = *ppMark;
+                const ::sw::mark::MarkBase* pBkmk = *ppMark;
                 const SwPosition* pPos = &pBkmk->GetMarkStart();
 
                 pTextNd = pPos->GetNode().GetTextNode();
diff --git a/sw/source/core/inc/MarkManager.hxx 
b/sw/source/core/inc/MarkManager.hxx
index 048f7735f65d..7bae3a21c372 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -39,7 +39,7 @@ namespace sw::mark {
         public:
             MarkManager(/*[in/out]*/ SwDoc& rDoc);
             // IDocumentMarkAccess
-            virtual ::sw::mark::IMark* makeMark(const SwPaM& rPaM,
+            virtual ::sw::mark::MarkBase* makeMark(const SwPaM& rPaM,
                 const OUString& rName, IDocumentMarkAccess::MarkType eMark,
                 sw::mark::InsertMode eMode,
                 SwPosition const* pSepPos = nullptr) override;
@@ -52,14 +52,14 @@ namespace sw::mark {
                 const OUString& rName,
                 const OUString& rType) override;
 
-            virtual ::sw::mark::IMark* getMarkForTextNode(const SwTextNode& 
rTextNode, IDocumentMarkAccess::MarkType eMark) override;
+            virtual ::sw::mark::MarkBase* getMarkForTextNode(const SwTextNode& 
rTextNode, IDocumentMarkAccess::MarkType eMark) override;
 
-            virtual sw::mark::IMark* makeAnnotationMark(
+            virtual sw::mark::MarkBase* makeAnnotationMark(
                 const SwPaM& rPaM,
                 const OUString& rName ) override;
 
-            virtual void repositionMark(::sw::mark::IMark* io_pMark, const 
SwPaM& rPaM) override;
-            virtual bool renameMark(::sw::mark::IMark* io_pMark, const 
OUString& rNewName) override;
+            virtual void repositionMark(::sw::mark::MarkBase* io_pMark, const 
SwPaM& rPaM) override;
+            virtual bool renameMark(::sw::mark::MarkBase* io_pMark, const 
OUString& rNewName) override;
             virtual void correctMarksAbsolute(const SwNode& rOldNode, const 
SwPosition& rNewPos, const sal_Int32 nOffset) override;
             virtual void correctMarksRelative(const SwNode& rOldNode, const 
SwPosition& rNewPos, const sal_Int32 nOffset) override;
 
@@ -73,7 +73,7 @@ namespace sw::mark {
             // deleters
             virtual std::unique_ptr<ILazyDeleter>
                 deleteMark(const const_iterator_t& ppMark, bool isMoveNodes) 
override;
-            virtual void deleteMark(const ::sw::mark::IMark* const pMark) 
override;
+            virtual void deleteMark(const ::sw::mark::MarkBase* const pMark) 
override;
             virtual void clearAllMarks() override;
 
             // marks
@@ -90,7 +90,7 @@ namespace sw::mark {
             virtual sal_Int32 getBookmarksCount() const override;
             virtual const_iterator_t findBookmark(const OUString& rName) const 
override;
             virtual const_iterator_t findFirstBookmarkStartsAfter(const 
SwPosition& rPos) const override;
-            virtual ::sw::mark::IMark* getOneInnermostBookmarkFor(const 
SwPosition& rPos) const override;
+            virtual ::sw::mark::MarkBase* getOneInnermostBookmarkFor(const 
SwPosition& rPos) const override;
 
             // Fieldmarks
             virtual const_iterator_t getFieldmarksBegin() const override;
@@ -118,7 +118,7 @@ namespace sw::mark {
             virtual const_iterator_t getAnnotationMarksEnd() const override;
             virtual sal_Int32 getAnnotationMarksCount() const override;
             virtual const_iterator_t findAnnotationMark( const OUString& rName 
) const override;
-            virtual sw::mark::IMark* getAnnotationMarkFor(const SwPosition& 
rPos) const override;
+            virtual sw::mark::MarkBase* getAnnotationMarkFor(const SwPosition& 
rPos) const override;
             virtual const_iterator_t findFirstAnnotationStartsAfter(const 
SwPosition& rPos) const override;
 
             virtual void assureSortedMarkContainers() const override;
@@ -126,7 +126,7 @@ namespace sw::mark {
             typedef std::vector<sw::mark::MarkBase*> container_t;
 
             // helper bookmark to store annotation range of redlines
-            virtual ::sw::mark::IMark* makeAnnotationBookmark(const SwPaM& 
rPaM,
+            virtual ::sw::mark::MarkBase* makeAnnotationBookmark(const SwPaM& 
rPaM,
                 const OUString& rName, IDocumentMarkAccess::MarkType eMark,
                 sw::mark::InsertMode eMode,
                 SwPosition const* pSepPos = nullptr) override;
diff --git a/sw/source/core/inc/UndoBookmark.hxx 
b/sw/source/core/inc/UndoBookmark.hxx
index 3c014bb315b8..75b1a2b0f5c7 100644
--- a/sw/source/core/inc/UndoBookmark.hxx
+++ b/sw/source/core/inc/UndoBookmark.hxx
@@ -41,7 +41,7 @@ class SwUndoBookmark : public SwUndo
     const std::unique_ptr<SwHistoryBookmark> m_pHistoryBookmark;
 
 protected:
-    SwUndoBookmark(SwUndoId nUndoId, const ::sw::mark::IMark&);
+    SwUndoBookmark(SwUndoId nUndoId, const ::sw::mark::MarkBase&);
 
     void SetInDoc(SwDoc*);
     void ResetInDoc(SwDoc&);
@@ -67,7 +67,7 @@ public:
 class SwUndoInsBookmark final : public SwUndoBookmark
 {
 public:
-    SwUndoInsBookmark(const ::sw::mark::IMark&);
+    SwUndoInsBookmark(const ::sw::mark::MarkBase&);
 
     virtual void UndoImpl(::sw::UndoRedoContext&) override;
     virtual void RedoImpl(::sw::UndoRedoContext&) override;
@@ -76,7 +76,7 @@ public:
 class SwUndoDeleteBookmark final : public SwUndoBookmark
 {
 public:
-    SwUndoDeleteBookmark(const ::sw::mark::IMark&);
+    SwUndoDeleteBookmark(const ::sw::mark::MarkBase&);
 
     virtual void UndoImpl(::sw::UndoRedoContext&) override;
     virtual void RedoImpl(::sw::UndoRedoContext&) override;
diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx
index 7491718191e4..ee2ca0c97287 100644
--- a/sw/source/core/inc/mvsave.hxx
+++ b/sw/source/core/inc/mvsave.hxx
@@ -43,13 +43,13 @@ struct SwPosition;
 
 namespace sw::mark
 {
-    class IMark;
+    class MarkBase;
 
     class SaveBookmark
     {
     public:
             SaveBookmark(
-                const ::sw::mark::IMark& rBkmk,
+                const ::sw::mark::MarkBase& rBkmk,
                 const SwNode& rMvPos,
                 std::optional<sal_Int32> oContentIdx);
             void SetInDoc(SwDoc* pDoc,
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index eb6ccf4fb9bf..a8877bdc400c 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -246,11 +246,11 @@ public:
 class SwHistoryBookmark final : public SwHistoryHint
 {
     public:
-        SwHistoryBookmark(const ::sw::mark::IMark& rBkmk,
+        SwHistoryBookmark(const ::sw::mark::MarkBase& rBkmk,
                         bool bSavePos, bool bSaveOtherPos);
         virtual void SetInDoc(SwDoc * pDoc, bool) override;
 
-        bool IsEqualBookmark(const ::sw::mark::IMark& rBkmk);
+        bool IsEqualBookmark(const ::sw::mark::MarkBase& rBkmk);
         const OUString& GetName() const { return m_aName;}
 
     private:
@@ -372,7 +372,7 @@ public:
               SwNodeOffset nNodeIdx );
     void AddTextAttr(SwTextAttr* pTextHt, SwNodeOffset nNodeIdx, bool 
bNewAttr);
     void AddColl(SwFormatColl*, SwNodeOffset nNodeIdx, SwNodeType nWhichNd);
-    void AddIMark(const ::sw::mark::IMark&, bool bSavePos, bool bSaveOtherPos);
+    void AddIMark(const ::sw::mark::MarkBase&, bool bSavePos, bool 
bSaveOtherPos);
     void AddChangeFlyAnchor(sw::SpzFrameFormat& rFormat);
     void AddDeleteFly( SwFrameFormat&, sal_uInt16& rSetPos );
     void AddFootnote( const SwTextFootnote& );
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 4aa924c26084..4bd6bc0cd58c 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -31,7 +31,7 @@
 
 namespace com::sun::star::linguistic2 { class XHyphenatedWord; }
 
-namespace sw::mark { class IMark; }
+namespace sw::mark { class MarkBase; }
 class SwCharRange;
 class SwTextNode;
 class SwTextAttrEnd;
@@ -146,7 +146,7 @@ OUString GetExpandTextMerged(SwRootFrame const* pLayout,
         SwTextNode const& rNode, bool bWithNumber,
         bool bWithSpacesForLevel, ExpandMode i_mode);
 
-bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::IMark const& rMark);
+bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::MarkBase const& 
rMark);
 bool IsMarkHintHidden(SwRootFrame const& rLayout,
         SwTextNode const& rNode, SwTextAttrEnd const& rHint);
 
diff --git a/sw/source/core/inc/unobookmark.hxx 
b/sw/source/core/inc/unobookmark.hxx
index 11710fdd6d0b..292645fd8f85 100644
--- a/sw/source/core/inc/unobookmark.hxx
+++ b/sw/source/core/inc/unobookmark.hxx
@@ -45,7 +45,7 @@ typedef ::cppu::ImplInheritanceHelper
 ,   css::text::XTextContent
 > SwXBookmark_Base;
 
-/// UNO API wrapper around an internal sw::mark::IMark.
+/// UNO API wrapper around an internal sw::mark::MarkBase.
 class SAL_DLLPUBLIC_RTTI SwXBookmark
     : public SwXBookmark_Base
 {
@@ -67,13 +67,13 @@ protected:
     virtual void attachToRange(
             const css::uno::Reference< css::text::XTextRange > & xTextRange);
 
-    ::sw::mark::IMark* GetBookmark() const;
+    ::sw::mark::MarkBase* GetBookmark() const;
 
     IDocumentMarkAccess* GetIDocumentMarkAccess();
 
     SwDoc * GetDoc();
 
-    void registerInMark( SwXBookmark& rXMark, ::sw::mark::IMark* const 
pMarkBase );
+    void registerInMark( SwXBookmark& rXMark, ::sw::mark::MarkBase* const 
pMarkBase );
 
     virtual ~SwXBookmark() override;
 
@@ -85,10 +85,10 @@ protected:
 public:
 
     static rtl::Reference<SwXBookmark>
-        CreateXBookmark(SwDoc & rDoc, ::sw::mark::IMark * pBookmark);
+        CreateXBookmark(SwDoc & rDoc, ::sw::mark::MarkBase * pBookmark);
 
     /// @return IMark for this, but only if it lives in pDoc
-    static ::sw::mark::IMark const* GetBookmarkInDoc(SwDoc const*const pDoc,
+    static ::sw::mark::MarkBase const* GetBookmarkInDoc(SwDoc const*const pDoc,
             const css::uno::Reference<css::uno::XInterface> & xUT);
 
     // MetadatableMixin
@@ -195,7 +195,7 @@ class SwXFieldmark final
 
 public:
     static rtl::Reference<SwXBookmark>
-        CreateXFieldmark(SwDoc & rDoc, ::sw::mark::IMark * pMark,
+        CreateXFieldmark(SwDoc & rDoc, ::sw::mark::MarkBase * pMark,
                 bool isReplacementObject = false);
 
     virtual void attachToRange(
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 3e2df0054299..27bb20c376fc 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -463,7 +463,7 @@ void SwTextFrame::RegisterToNode(SwTextNode & rNode, bool 
const isForceNodeAsFir
         assert(std::find_if(
             rNode.GetDoc().getIDocumentMarkAccess()->getFieldmarksBegin(),
             rNode.GetDoc().getIDocumentMarkAccess()->getFieldmarksEnd(),
-            [this](::sw::mark::IMark const*const pMark) {
+            [this](::sw::mark::MarkBase const*const pMark) {
                 return pMark->GetMarkStart().GetNode() == 
*m_pMergedPara->pFirstNode
                     && pMark->GetMarkEnd().GetNode() != 
*m_pMergedPara->pFirstNode;
             }) == rNode.GetDoc().getIDocumentMarkAccess()->getFieldmarksEnd());
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 46581f3c1c49..db8b8654e96e 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -2718,7 +2718,7 @@ void 
SwEnhancedPDFExportHelper::EnhancedPDFExport(LanguageType const eLanguageDe
                 ++ppMark)
             {
                 //get the name
-                const ::sw::mark::IMark* pBkmk = *ppMark;
+                const ::sw::mark::MarkBase* pBkmk = *ppMark;
                 mrSh.SwCursorShell::ClearMark();
                 const OUString& sBkName = pBkmk->GetName();
 
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 5f9ac5597934..5ceabd3a4b4b 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1176,7 +1176,7 @@ void SwTextPaintInfo::DrawBackBrush( const SwLinePortion 
&rPor ) const
         if(aIntersect.HasArea())
         {
             SwPosition const aPosition(m_pFrame->MapViewToModelPos(GetIdx()));
-            const ::sw::mark::IMark* pFieldmark =
+            const ::sw::mark::MarkBase* pFieldmark =
                 
m_pFrame->GetDoc().getIDocumentMarkAccess()->getInnerFieldmarkFor(aPosition);
             bool bIsStartMark = (TextFrameIndex(1) == GetLen()
                     && CH_TXT_ATR_FIELDSTART == 
GetText()[sal_Int32(GetIdx())]);
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index a496bff4636a..2aec8f3b697f 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -971,7 +971,7 @@ static Color getBookmarkColor(const SwTextNode& rNode, 
const sw::mark::Bookmark*
     {
         SwDoc& rDoc = const_cast<SwDoc&>(rNode.GetDoc());
         const rtl::Reference< SwXBookmark > xRef = 
SwXBookmark::CreateXBookmark(rDoc,
-                const_cast<sw::mark::IMark*>(static_cast<const 
sw::mark::IMark*>(pBookmark)));
+                const_cast<sw::mark::MarkBase*>(static_cast<const 
sw::mark::MarkBase*>(pBookmark)));
         const css::uno::Reference<css::rdf::XResource> xSubject(xRef);
         uno::Reference<frame::XModel> xModel = 
rDoc.GetDocShell()->GetBaseModel();
 
@@ -2898,7 +2898,7 @@ void SwScriptInfo::selectHiddenTextProperty(const 
SwTextNode& rNode,
 
     for (const SwContentIndex* pIndex = rNode.GetFirstIndex(); pIndex; pIndex 
= pIndex->GetNext())
     {
-        const sw::mark::IMark* pMark = pIndex->GetMark();
+        const sw::mark::MarkBase* pMark = pIndex->GetMark();
         const sw::mark::Bookmark* pBookmark = dynamic_cast<const 
sw::mark::Bookmark*>(pMark);
         if (pBookmarks && pBookmark)
         {
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index c5df18fb0155..ba1cafce975d 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -471,7 +471,7 @@ bool SwTextFrame::FormatEmpty()
     for (SwContentIndex const* pIndex = GetTextNodeFirst()->GetFirstIndex();
          pIndex; pIndex = pIndex->GetNext())
     {
-        sw::mark::IMark const*const pMark = pIndex->GetMark();
+        sw::mark::MarkBase const*const pMark = pIndex->GetMark();
         if (dynamic_cast<const sw::mark::Bookmark*>(pMark) != nullptr)
         {   // need bookmark portions!
             return false;
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index d47581d44e80..127dfb34dd2d 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -688,7 +688,7 @@ std::pair<OUString, bool> SwTOXPara::GetURL(SwRootFrame 
const*const) const
             SwDoc& rDoc = const_cast<SwDoc&>( pTextNd->GetDoc() );
             // tdf#123313: this *must not* create a bookmark, its Undo would
             // be screwed! create it as preparatory step, in ctor!
-            ::sw::mark::IMark const * const pMark = 
rDoc.getIDocumentMarkAccess()->getMarkForTextNode(
+            ::sw::mark::MarkBase const * const pMark = 
rDoc.getIDocumentMarkAccess()->getMarkForTextNode(
                                 *pTextNd,
                                 
IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK);
             aText = "#" + pMark->GetName();
diff --git a/sw/source/core/txtnode/atrfld.cxx 
b/sw/source/core/txtnode/atrfld.cxx
index 8993aa4c2df0..1652786f6588 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -782,7 +782,7 @@ SwTextAnnotationField::~SwTextAnnotationField()
 {
 }
 
-::sw::mark::IMark* SwTextAnnotationField::GetAnnotationMark() const
+::sw::mark::MarkBase* SwTextAnnotationField::GetAnnotationMark() const
 {
     auto pPostItField = dynamic_cast<const 
SwPostItField*>(GetFormatField().GetField());
     assert(pPostItField);
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 0b82252b5e41..65fc7a9539c2 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1501,12 +1501,12 @@ void SwTextNode::Update(
             bool bAtLeastOneBookmarkMoved = false;
             bool bAtLeastOneExpandedBookmarkAtInsertionPosition = false;
             // A text node already knows its marks via its SwContentIndexes.
-            o3tl::sorted_vector<const sw::mark::IMark*> aSeenMarks;
+            o3tl::sorted_vector<const sw::mark::MarkBase*> aSeenMarks;
             const SwContentIndex* next;
             for (const SwContentIndex* pIndex = GetFirstIndex(); pIndex; 
pIndex = next )
             {
                 next = pIndex->GetNext();
-                const sw::mark::IMark* pMark = pIndex->GetMark();
+                const sw::mark::MarkBase* pMark = pIndex->GetMark();
                 if (!pMark)
                     continue;
                 // filter out ones that cannot match to reduce the max size of 
aSeenMarks
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 1def481cd552..fdf3dc8f10d6 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -603,7 +603,7 @@ void SwHistoryTextFlyCnt::dumpAsXml(xmlTextWriterPtr 
pWriter) const
 }
 
 SwHistoryBookmark::SwHistoryBookmark(
-    const ::sw::mark::IMark& rBkmk,
+    const ::sw::mark::MarkBase& rBkmk,
     bool bSavePos,
     bool bSaveOtherPos)
     : SwHistoryHint(HSTRY_BOOKMARK)
@@ -640,7 +640,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
     SwNodes& rNds = pDoc->GetNodes();
     IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess();
     std::optional<SwPaM> oPam;
-    ::sw::mark::IMark* pMark = nullptr;
+    ::sw::mark::MarkBase* pMark = nullptr;
 
     // now the situation is that m_bSavePos and m_bSaveOtherPos don't determine
     // whether the mark was deleted
@@ -695,7 +695,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
         pBookmark->RestoreMetadata(m_pMetadataUndo);
 }
 
-bool SwHistoryBookmark::IsEqualBookmark(const ::sw::mark::IMark& rBkmk)
+bool SwHistoryBookmark::IsEqualBookmark(const ::sw::mark::MarkBase& rBkmk)
 {
     return m_nNode == rBkmk.GetMarkPos().GetNodeIndex()
         && m_nContent == rBkmk.GetMarkPos().GetContentIndex()
@@ -1122,7 +1122,7 @@ void SwHistory::AddColl(SwFormatColl *const pColl, 
SwNodeOffset const nNodeIdx,
     m_SwpHstry.push_back( std::move(pHt) );
 }
 
-void SwHistory::AddIMark(const ::sw::mark::IMark& rBkmk,
+void SwHistory::AddIMark(const ::sw::mark::MarkBase& rBkmk,
         bool const bSavePos, bool const bSaveOtherPos)
 {
     OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx
index db36026f4c67..c9f3fe46ffa1 100644
--- a/sw/source/core/undo/unbkmk.cxx
+++ b/sw/source/core/undo/unbkmk.cxx
@@ -36,7 +36,7 @@
 #include <utility>
 
 SwUndoBookmark::SwUndoBookmark( SwUndoId nUndoId,
-            const ::sw::mark::IMark& rBkmk )
+            const ::sw::mark::MarkBase& rBkmk )
     : SwUndo( nUndoId, &rBkmk.GetMarkPos().GetDoc() )
     , m_pHistoryBookmark(new SwHistoryBookmark(rBkmk, true, 
rBkmk.IsExpanded()))
 {
@@ -75,7 +75,7 @@ SwRewriter SwUndoBookmark::GetRewriter() const
     return aResult;
 }
 
-SwUndoInsBookmark::SwUndoInsBookmark( const ::sw::mark::IMark& rBkmk )
+SwUndoInsBookmark::SwUndoInsBookmark( const ::sw::mark::MarkBase& rBkmk )
     : SwUndoBookmark( SwUndoId::INSBOOKMARK, rBkmk )
 {
 }
@@ -90,7 +90,7 @@ void SwUndoInsBookmark::RedoImpl(::sw::UndoRedoContext & 
rContext)
     SetInDoc( &rContext.GetDoc() );
 }
 
-SwUndoDeleteBookmark::SwUndoDeleteBookmark( const ::sw::mark::IMark& rBkmk )
+SwUndoDeleteBookmark::SwUndoDeleteBookmark( const ::sw::mark::MarkBase& rBkmk )
     : SwUndoBookmark( SwUndoId::DELBOOKMARK, rBkmk )
 {
 }
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 429fb2fc2ff6..55f25bd238d6 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1124,7 +1124,7 @@ void SwUndoSaveContent::DelContentIndex( const 
SwPosition& rMark,
         bool bSavePos = false;
         bool bSaveOtherPos = false;
         bool bDelete = false;
-        const ::sw::mark::IMark *const pBkmk = 
pMarkAccess->getAllMarksBegin()[n];
+        const ::sw::mark::MarkBase *const pBkmk = 
pMarkAccess->getAllMarksBegin()[n];
         auto const type(IDocumentMarkAccess::GetType(*pBkmk));
 
         if( DelContentType::CheckNoCntnt & nDelContentType )
diff --git a/sw/source/core/unocore/unobkm.cxx 
b/sw/source/core/unocore/unobkm.cxx
index 5790e4eba1cb..0420d50e2925 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -48,7 +48,7 @@ public:
     std::mutex m_Mutex; // just for OInterfaceContainerHelper3
     ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> 
m_EventListeners;
     SwDoc* m_pDoc;
-    ::sw::mark::IMark* m_pRegisteredBookmark;
+    ::sw::mark::MarkBase* m_pRegisteredBookmark;
     OUString m_sMarkName;
     bool m_bHidden;
     OUString m_HideCondition;
@@ -61,7 +61,7 @@ public:
         // DO NOT registerInMark here! (because SetXBookmark would delete 
rThis)
     }
 
-    void registerInMark(SwXBookmark & rThis, ::sw::mark::IMark *const pBkmk);
+    void registerInMark(SwXBookmark & rThis, ::sw::mark::MarkBase *const 
pBkmk);
 protected:
     virtual void Notify(const SfxHint&) override;
 
@@ -85,19 +85,14 @@ void SwXBookmark::Impl::Notify(const SfxHint& rHint)
 }
 
 void SwXBookmark::Impl::registerInMark(SwXBookmark& rThis,
-        ::sw::mark::IMark* const pBkmk)
+        ::sw::mark::MarkBase* const pBkmk)
 {
     const rtl::Reference<SwXBookmark> xBookmark(&rThis);
     if (pBkmk)
     {
         EndListeningAll();
         StartListening(pBkmk->GetNotifier());
-        ::sw::mark::MarkBase *const pMarkBase(dynamic_cast< 
::sw::mark::MarkBase * >(pBkmk));
-        OSL_ENSURE(pMarkBase, "registerInMark: no MarkBase?");
-        if (pMarkBase)
-        {
-            pMarkBase->SetXBookmark(xBookmark);
-        }
+        pBkmk->SetXBookmark(xBookmark);
         assert(m_pDoc == nullptr || m_pDoc == &pBkmk->GetMarkPos().GetDoc());
         m_pDoc = &pBkmk->GetMarkPos().GetDoc();
     }
@@ -120,12 +115,12 @@ void SwXBookmark::Impl::registerInMark(SwXBookmark& rThis,
 }
 
 void SwXBookmark::registerInMark(SwXBookmark & rThis,
-        ::sw::mark::IMark *const pBkmk)
+        ::sw::mark::MarkBase *const pBkmk)
 {
     m_pImpl->registerInMark( rThis, pBkmk );
 }
 
-::sw::mark::IMark* SwXBookmark::GetBookmark() const
+::sw::mark::MarkBase* SwXBookmark::GetBookmark() const
 {
     return m_pImpl->m_pRegisteredBookmark;
 }
@@ -156,15 +151,14 @@ SwXBookmark::~SwXBookmark()
 
 rtl::Reference<SwXBookmark> SwXBookmark::CreateXBookmark(
     SwDoc & rDoc,
-    ::sw::mark::IMark *const pBookmark)
+    ::sw::mark::MarkBase *const pBookmark)
 {
     // #i105557#: do not iterate over the registered clients: race condition
-    ::sw::mark::MarkBase *const pMarkBase(dynamic_cast< ::sw::mark::MarkBase * 
>(pBookmark));
-    OSL_ENSURE(!pBookmark || pMarkBase, "CreateXBookmark: no MarkBase?");
+    OSL_ENSURE(pBookmark, "CreateXBookmark: no MarkBase?");
     rtl::Reference<SwXBookmark> xBookmark;
-    if (pMarkBase)
+    if (pBookmark)
     {
-        xBookmark = pMarkBase->GetXBookmark();
+        xBookmark = pBookmark->GetXBookmark();
     }
     if (!xBookmark.is())
     {
@@ -176,12 +170,12 @@ rtl::Reference<SwXBookmark> SwXBookmark::CreateXBookmark(
         SwXBookmark *const pXBookmark =
             pBookmark ? new SwXBookmark(&rDoc) : new SwXBookmark;
         xBookmark.set(pXBookmark);
-        pXBookmark->m_pImpl->registerInMark(*pXBookmark, pMarkBase);
+        pXBookmark->m_pImpl->registerInMark(*pXBookmark, pBookmark);
     }
     return xBookmark;
 }
 
-::sw::mark::IMark const* SwXBookmark::GetBookmarkInDoc(SwDoc const*const pDoc,
+::sw::mark::MarkBase const* SwXBookmark::GetBookmarkInDoc(SwDoc const*const 
pDoc,
         const uno::Reference<uno::XInterface> & xUT)
 {
     SwXBookmark *const pXBkm = dynamic_cast<SwXBookmark*>(xUT.get());
@@ -671,17 +665,14 @@ uno::Reference<container::XNameContainer> 
SwXFieldmark::getParameters()
 }
 
 rtl::Reference<SwXBookmark>
-SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, ::sw::mark::IMark *const pMark,
+SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, ::sw::mark::MarkBase *const pMark,
         bool const isReplacementObject)
 {
     // #i105557#: do not iterate over the registered clients: race condition
-    ::sw::mark::MarkBase *const pMarkBase(
-        dynamic_cast< ::sw::mark::MarkBase * >(pMark));
-    assert(!pMark || pMarkBase);
     rtl::Reference<SwXBookmark> xMark;
-    if (pMarkBase)
+    if (pMark)
     {
-        xMark = pMarkBase->GetXBookmark();
+        xMark = pMark->GetXBookmark();
     }
     if (!xMark.is())
     {
@@ -699,7 +690,7 @@ SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, 
::sw::mark::IMark *const pMark,
             pXBkmk = new SwXFieldmark(isReplacementObject, &rDoc);
 
         xMark = pXBkmk.get();
-        pXBkmk->registerInMark(*pXBkmk, pMarkBase);
+        pXBkmk->registerInMark(*pXBkmk, pMark);
     }
     return xMark;
 }
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index cf2e54d42e5d..fa6b6ef60fb2 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -115,7 +115,7 @@ void GetSelectableFromAny(uno::Reference<uno::XInterface> 
const& xIfc,
         SwDoc & rTargetDoc,
         std::optional<SwPaM>& o_rpPaM, std::pair<OUString, FlyCntType> & 
o_rFrame,
         OUString & o_rTableName, SwUnoTableCursor const*& o_rpTableCursor,
-        ::sw::mark::IMark const*& o_rpMark,
+        ::sw::mark::MarkBase const*& o_rpMark,
         std::vector<SdrObject *> & o_rSdrObjects)
 {
     uno::Reference<drawing::XShapes> const xShapes(xIfc, UNO_QUERY);
@@ -249,7 +249,7 @@ void GetSelectableFromAny(uno::Reference<uno::XInterface> 
const& xIfc,
         return;
     }
 
-    ::sw::mark::IMark const*const pMark =
+    ::sw::mark::MarkBase const*const pMark =
             SwXBookmark::GetBookmarkInDoc(& rTargetDoc, xIfc);
     if (pMark)
     {
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index 5a18842f6feb..620c1b50a1b1 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -681,7 +681,7 @@ void SwXTextRange::InvalidateImpl()
     moSvtListener->EndListeningAll();
 }
 
-void SwXTextRange::SetMark(::sw::mark::IMark& rMark)
+void SwXTextRange::SetMark(::sw::mark::MarkBase& rMark)
 {
     moSvtListener->EndListeningAll();
     m_pTableOrSectionFormat = nullptr;
@@ -937,7 +937,7 @@ SwXTextRange::getStart()
     SolarMutexGuard aGuard;
 
     uno::Reference< text::XTextRange >  xRet;
-    ::sw::mark::IMark const * const pBkmk = m_pMark;
+    ::sw::mark::MarkBase const * const pBkmk = m_pMark;
     if (!m_xParentText.is())
     {
         getText();
@@ -974,7 +974,7 @@ SwXTextRange::getEnd()
     SolarMutexGuard aGuard;
 
     uno::Reference< text::XTextRange >  xRet;
-    ::sw::mark::IMark const * const pBkmk = m_pMark;
+    ::sw::mark::MarkBase const * const pBkmk = m_pMark;
     if (!m_xParentText.is())
     {
         getText();
@@ -1065,7 +1065,7 @@ bool SwXTextRange::GetPositions(SwPaM& rToFill, 
::sw::TextRangeMode const eMode)
             }
         }
     }
-    ::sw::mark::IMark const * const pBkmk = m_pMark;
+    ::sw::mark::MarkBase const * const pBkmk = m_pMark;
     if(pBkmk)
     {
         *rToFill.GetPoint() = pBkmk->GetMarkPos();
@@ -1112,7 +1112,7 @@ sal_Int16 SwXTextRange::compareRegionStarts(SwXTextRange& 
rhs)
 
 void SwXTextRange::GetStartPaM(std::optional<SwPaM>& roPaM)
 {
-    ::sw::mark::IMark const * const pBkmk = m_pMark;
+    ::sw::mark::MarkBase const * const pBkmk = m_pMark;
     if (!m_xParentText.is())
     {
         getText();
diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index 285ecd4b9c76..8ace7be1e60c 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -141,7 +141,7 @@ namespace
     typedef std::multiset < SwXBookmarkPortion_ImplSharedPtr, 
BookmarkCompareStruct > SwXBookmarkPortion_ImplList;
 
     /// Inserts pBkmk to rBkmArr in case it starts or ends at rOwnNode
-    void lcl_FillBookmark(sw::mark::IMark* const pBkmk, const SwNode& 
rOwnNode, SwDoc& rDoc, SwXBookmarkPortion_ImplList& rBkmArr)
+    void lcl_FillBookmark(sw::mark::MarkBase* const pBkmk, const SwNode& 
rOwnNode, SwDoc& rDoc, SwXBookmarkPortion_ImplList& rBkmArr)
     {
         bool const isExpanded = pBkmk->IsExpanded();
         const SwPosition& rStartPos = pBkmk->GetMarkStart();
@@ -201,11 +201,11 @@ namespace
         SwTextNode* pTextNode = rUnoCursor.GetPoint()->GetNode().GetTextNode();
         assert(pTextNode);
         // A text node already knows its marks via its SwContentIndexes.
-        o3tl::sorted_vector<const sw::mark::IMark*> aSeenMarks;
+        o3tl::sorted_vector<const sw::mark::MarkBase*> aSeenMarks;
         for (const SwContentIndex* pIndex = pTextNode->GetFirstIndex(); 
pIndex; pIndex = pIndex->GetNext())
         {
             // Need a non-cost mark here, as we'll create a UNO wrapper around 
it.
-            sw::mark::IMark* pBkmk = 
const_cast<sw::mark::IMark*>(pIndex->GetMark());
+            sw::mark::MarkBase* pBkmk = 
const_cast<sw::mark::MarkBase*>(pIndex->GetMark());
             if (!pBkmk)
                 continue;
             IDocumentMarkAccess::MarkType eType = 
IDocumentMarkAccess::GetType(*pBkmk);
@@ -894,7 +894,7 @@ lcl_ExportHints(
                             break;
 
                         const SwTextAnnotationField* pTextAnnotationField = 
dynamic_cast<const SwTextAnnotationField*>( pAttr );
-                        ::sw::mark::IMark* pAnnotationMark = 
pTextAnnotationField ? pTextAnnotationField->GetAnnotationMark() : nullptr;
+                        ::sw::mark::MarkBase* pAnnotationMark = 
pTextAnnotationField ? pTextAnnotationField->GetAnnotationMark() : nullptr;
                         if ( pAnnotationMark != nullptr )
                         {
                             pPortion = new SwXTextPortion( pUnoCursor, 
xParent, PORTION_ANNOTATION_END );
diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index c8c15997ab78..90cd96895a88 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1434,7 +1434,7 @@ bool SwHTMLParser::HasCurrentParaBookmarks( bool 
bIgnoreStack ) const
             ppMark != pMarkAccess->getAllMarksEnd();
             ++ppMark)
         {
-            const ::sw::mark::IMark* pBookmark = *ppMark;
+            const ::sw::mark::MarkBase* pBookmark = *ppMark;
 
             const SwNodeOffset nBookNdIdx = 
pBookmark->GetMarkPos().GetNodeIndex();
             if( nBookNdIdx==nNodeIdx )
@@ -1498,7 +1498,7 @@ void SwHTMLParser::StripTrailingPara()
                 ppMark != pMarkAccess->getAllMarksEnd();
                 ++ppMark)
             {
-                ::sw::mark::IMark* pMark = *ppMark;
+                ::sw::mark::MarkBase* pMark = *ppMark;
 
                 SwNodeOffset nBookNdIdx = pMark->GetMarkPos().GetNodeIndex();
                 if(nBookNdIdx==nNodeIdx)
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 345d934ada25..9808e8c8e0a9 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2915,7 +2915,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool 
bBeforeTable,
                             (*ppBkmk)->GetMarkStart() == *aAttrPam.GetPoint() )
                             break; // do not generate duplicates on this 
position
                         aAttrPam.DeleteMark();
-                        const ::sw::mark::IMark* const pNewMark = 
pMarkAccess->makeMark(
+                        const ::sw::mark::MarkBase* const pNewMark = 
pMarkAccess->makeMark(
                             aAttrPam,
                             sName,
                             IDocumentMarkAccess::MarkType::BOOKMARK,
diff --git a/sw/source/filter/html/wrthtml.cxx 
b/sw/source/filter/html/wrthtml.cxx
index a6c1d06e7e6d..cc2935540361 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1270,7 +1270,7 @@ void SwHTMLWriter::OutAnchor( const OUString& rName )
 void SwHTMLWriter::OutBookmarks()
 {
     // fetch current bookmark
-    const ::sw::mark::IMark* pBookmark = nullptr;
+    const ::sw::mark::MarkBase* pBookmark = nullptr;
     IDocumentMarkAccess* const pMarkAccess = m_pDoc->getIDocumentMarkAccess();
     if(m_nBkmkTabPos != -1)
         pBookmark = pMarkAccess->getAllMarksBegin()[m_nBkmkTabPos];
diff --git a/sw/source/filter/writer/writer.cxx 
b/sw/source/filter/writer/writer.cxx
index 3f63f4d3eb5b..1775819253ae 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -38,7 +38,7 @@
 
 using namespace css;
 
-typedef std::multimap<SwNodeOffset, const ::sw::mark::IMark*> 
SwBookmarkNodeTable;
+typedef std::multimap<SwNodeOffset, const ::sw::mark::MarkBase*> 
SwBookmarkNodeTable;
 
 struct Writer_Impl
 {
@@ -51,7 +51,7 @@ struct Writer_Impl
     Writer_Impl();
 
     void RemoveFontList();
-    void InsertBkmk( const ::sw::mark::IMark& rBkmk );
+    void InsertBkmk( const ::sw::mark::MarkBase& rBkmk );
 };
 
 Writer_Impl::Writer_Impl()
@@ -64,7 +64,7 @@ void Writer_Impl::RemoveFontList()
     aFontRemoveLst.clear();
 }
 
-void Writer_Impl::InsertBkmk(const ::sw::mark::IMark& rBkmk)
+void Writer_Impl::InsertBkmk(const ::sw::mark::MarkBase& rBkmk)
 {
     SwNodeOffset nNd = rBkmk.GetMarkPos().GetNodeIndex();
 
@@ -409,7 +409,7 @@ void Writer::CreateBookmarkTable()
 
 // search all Bookmarks in the range and return it in the Array
 bool Writer::GetBookmarks(const SwContentNode& rNd, sal_Int32 nStt,
-    sal_Int32 nEnd, std::vector< const ::sw::mark::IMark* >& rArr)
+    sal_Int32 nEnd, std::vector< const ::sw::mark::MarkBase* >& rArr)
 {
     OSL_ENSURE( rArr.empty(), "there are still entries available" );
 
@@ -427,7 +427,7 @@ bool Writer::GetBookmarks(const SwContentNode& rNd, 
sal_Int32 nStt,
         {
             for( SwBookmarkNodeTable::const_iterator it = aIterPair.first; it 
!= aIterPair.second; ++it )
             {
-                const ::sw::mark::IMark& rBkmk = *(it->second);
+                const ::sw::mark::MarkBase& rBkmk = *(it->second);
                 sal_Int32 nContent;
                 if( rBkmk.GetMarkPos().GetNode() == rNd &&
                     (nContent = rBkmk.GetMarkPos().GetContentIndex() ) >= nStt 
&&
diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index 5ac28047ce88..e63b6ed0daf5 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -108,7 +108,7 @@ using namespace ::oox;
 
 using oox::vml::VMLExport;
 
-using sw::mark::IMark;
+using sw::mark::MarkBase;
 
 AttributeOutputBase& DocxExport::AttrOutput() const
 {
@@ -167,7 +167,7 @@ void DocxExport::AppendBookmarks( const SwTextNode& rNode, 
sal_Int32 nCurrentPos
     IMarkVector aMarks;
     if ( GetBookmarks( rNode, nCurrentPos, nCurrentPos + nLen, aMarks ) )
     {
-        for ( IMark* pMark : aMarks )
+        for ( MarkBase* pMark : aMarks )
         {
             const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
             const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex();
@@ -205,7 +205,7 @@ void DocxExport::AppendAnnotationMarks( const 
SwWW8AttrIter& rAttrs, sal_Int32 n
     IMarkVector aMarks;
     if (GetAnnotationMarks(rAttrs, nCurrentPos, nCurrentPos + nLen, aMarks))
     {
-        for ( IMark* pMark : aMarks )
+        for ( MarkBase* pMark : aMarks )
         {
             const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
             const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex();
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index d08c49432cd7..4c0d273502ad 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2020,7 +2020,7 @@ bool MSWordExportBase::GetBookmarks( const SwTextNode& 
rNd, sal_Int32 nStt,
     const sal_Int32 nMarks = pMarkAccess->getAllMarksCount();
     for ( sal_Int32 i = 0; i < nMarks; i++ )
     {
-        IMark* pMark = pMarkAccess->getAllMarksBegin()[i];
+        MarkBase* pMark = pMarkAccess->getAllMarksBegin()[i];
 
         switch (IDocumentMarkAccess::GetType( *pMark ))
         {
@@ -2068,7 +2068,7 @@ bool MSWordExportBase::GetAnnotationMarks( const 
SwWW8AttrIter& rAttrs, sal_Int3
     const sal_Int32 nMarks = pMarkAccess->getAnnotationMarksCount();
     for ( sal_Int32 i = 0; i < nMarks; i++ )
     {
-        IMark* pMark = pMarkAccess->getAnnotationMarksBegin()[i];
+        MarkBase* pMark = pMarkAccess->getAnnotationMarksBegin()[i];
 
         // Only keep the bookmarks starting or ending in this node
         if ( pMark->GetMarkStart().GetNode() == rNd ||
@@ -2110,7 +2110,7 @@ namespace {
 class CompareMarksEnd
 {
 public:
-    bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const
+    bool operator() ( const MarkBase * pOneB, const MarkBase * pTwoB ) const
     {
         const sal_Int32 nOEnd = pOneB->GetMarkEnd().GetContentIndex();
         const sal_Int32 nTEnd = pTwoB->GetMarkEnd().GetContentIndex();
@@ -2127,7 +2127,7 @@ bool MSWordExportBase::NearestBookmark( sal_Int32& 
rNearest, const sal_Int32 nCu
 
     if ( !m_rSortedBookmarksStart.empty() )
     {
-        IMark* pMarkStart = m_rSortedBookmarksStart.front();
+        MarkBase* pMarkStart = m_rSortedBookmarksStart.front();
         const sal_Int32 nNext = pMarkStart->GetMarkStart().GetContentIndex();
         if( !bNextPositionOnly || (nNext > nCurrentPos ))
         {
@@ -2138,7 +2138,7 @@ bool MSWordExportBase::NearestBookmark( sal_Int32& 
rNearest, const sal_Int32 nCu
 
     if ( !m_rSortedBookmarksEnd.empty() )
     {
-        IMark* pMarkEnd = m_rSortedBookmarksEnd[0];
+        MarkBase* pMarkEnd = m_rSortedBookmarksEnd[0];
         const sal_Int32 nNext = pMarkEnd->GetMarkEnd().GetContentIndex();
         if( !bNextPositionOnly || nNext > nCurrentPos )
         {
@@ -2159,7 +2159,7 @@ void MSWordExportBase::NearestAnnotationMark( sal_Int32& 
rNearest, const sal_Int
 
     if ( !m_rSortedAnnotationMarksStart.empty() )
     {
-        IMark* pMarkStart = m_rSortedAnnotationMarksStart.front();
+        MarkBase* pMarkStart = m_rSortedAnnotationMarksStart.front();
         const sal_Int32 nNext = pMarkStart->GetMarkStart().GetContentIndex();
         if( !bNextPositionOnly || (nNext > nCurrentPos ))
         {
@@ -2170,7 +2170,7 @@ void MSWordExportBase::NearestAnnotationMark( sal_Int32& 
rNearest, const sal_Int
 
     if ( !m_rSortedAnnotationMarksEnd.empty() )
     {
-        IMark* pMarkEnd = m_rSortedAnnotationMarksEnd[0];
+        MarkBase* pMarkEnd = m_rSortedAnnotationMarksEnd[0];
         const sal_Int32 nNext = pMarkEnd->GetMarkEnd().GetContentIndex();
         if( !bNextPositionOnly || nNext > nCurrentPos )
         {
@@ -2189,7 +2189,7 @@ void MSWordExportBase::GetSortedAnnotationMarks( const 
SwWW8AttrIter& rAttrs, sa
     {
         IMarkVector aSortedEnd;
         IMarkVector aSortedStart;
-        for ( IMark* pMark : aMarksStart )
+        for ( MarkBase* pMark : aMarksStart )
         {
             // Remove the positions equal to the current pos
             const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
@@ -2223,7 +2223,7 @@ void MSWordExportBase::GetSortedBookmarks( const 
SwTextNode& rNode, sal_Int32 nC
     {
         IMarkVector aSortedEnd;
         IMarkVector aSortedStart;
-        for ( IMark* pMark : aMarksStart )
+        for ( MarkBase* pMark : aMarksStart )
         {
             // Remove the positions equal to the current pos
             const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c4b53c6a9c81..390cf2f0b226 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1437,7 +1437,7 @@ WW8_CP WW8_WrPct::Fc2Cp( sal_uLong nFc ) const
 
 void WW8Export::AppendBookmarks( const SwTextNode& rNd, sal_Int32 nCurrentPos, 
sal_Int32 nLen, const SwRedlineData* /*pRedlineData*/ )
 {
-    std::vector< const ::sw::mark::IMark* > aArr;
+    std::vector< const ::sw::mark::MarkBase* > aArr;
     sal_Int32 nContent;
     const sal_Int32 nCurrentEnd = nCurrentPos + nLen;
     if( !GetWriter().GetBookmarks( rNd, nCurrentPos, nCurrentEnd, aArr ))
@@ -1445,9 +1445,9 @@ void WW8Export::AppendBookmarks( const SwTextNode& rNd, 
sal_Int32 nCurrentPos, s
 
     SwNodeOffset nNd = rNd.GetIndex();
     sal_uLong nSttCP = Fc2Cp( Strm().Tell() );
-    for(const ::sw::mark::IMark* p : aArr)
+    for(const ::sw::mark::MarkBase* p : aArr)
     {
-        const ::sw::mark::IMark& rBkmk = *p;
+        const ::sw::mark::MarkBase& rBkmk = *p;
         if(dynamic_cast< const ::sw::mark::Fieldmark *>(&rBkmk))
             continue;
 
@@ -1484,7 +1484,7 @@ void WW8Export::AppendAnnotationMarks(const 
SwWW8AttrIter& rAttrs, sal_Int32 nCu
     IMarkVector aMarks;
     if (GetAnnotationMarks(rAttrs, nCurrentPos, nCurrentPos + nLen, aMarks))
     {
-        for (const sw::mark::IMark* pMark : aMarks)
+        for (const sw::mark::MarkBase* pMark : aMarks)
         {
             const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
             if (nStart == nCurrentPos)
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index c6f99189da68..fb90c8a464e1 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -584,7 +584,7 @@ public:
     std::stack< MSWordSaveData > m_aSaveData;
 
     /// Used to split the runs according to the bookmarks start and ends
-    typedef std::vector< ::sw::mark::IMark* > IMarkVector;
+    typedef std::vector< ::sw::mark::MarkBase* > IMarkVector;
     IMarkVector m_rSortedBookmarksStart;
     IMarkVector m_rSortedBookmarksEnd;
     IMarkVector m_rSortedAnnotationMarksStart;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index b752e5c31316..85ec351496af 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1618,7 +1618,7 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& 
rTmpPos,
                 sal_uInt16 nBkmNo;
                 if( IsFootnoteEdnBkmField(rFormatField, nBkmNo) )
                 {
-                    ::sw::mark::IMark const * const pMark = 
m_rDoc.getIDocumentMarkAccess()->getAllMarksBegin()[nBkmNo];
+                    ::sw::mark::MarkBase const * const pMark = 
m_rDoc.getIDocumentMarkAccess()->getAllMarksBegin()[nBkmNo];
 
                     const SwPosition& rBkMrkPos = pMark->GetMarkPos();
 
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index ac5be46fe4cb..296b8b4b6b15 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1221,7 +1221,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const 
Sequence<Any>& rSelection,
 
             bool bSetCursor = true;
             const size_t nCols = aColArr.size();
-            ::sw::mark::IMark* pMark = nullptr;
+            ::sw::mark::MarkBase* pMark = nullptr;
             for( sal_Int32 i = 0 ; ; ++i )
             {
                 bool bBreak = false;
diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index 9b786215e419..6549901a0566 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -151,7 +151,7 @@ static void lcl_FillSubRegionList( SwWrtShell& rSh, 
weld::ComboBox& rSubRegions,
         ppMark != pMarkAccess->getBookmarksEnd();
         ++ppMark)
     {
-        const ::sw::mark::IMark* pBkmk = *ppMark;
+        const ::sw::mark::MarkBase* pBkmk = *ppMark;
         if( pBkmk->IsExpanded() )
             rSubRegions.append_text( pBkmk->GetName() );
     }
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 334f392f476f..dea60485a001 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -588,7 +588,7 @@ void SwFieldRefPage::UpdateSubType(const OUString& 
filterString)
                 ppMark != pMarkAccess->getBookmarksEnd();
                 ++ppMark)
             {
-                const ::sw::mark::IMark* pBkmk = *ppMark;
+                const ::sw::mark::MarkBase* pBkmk = *ppMark;
                 if(IDocumentMarkAccess::MarkType::BOOKMARK == 
IDocumentMarkAccess::GetType(*pBkmk))
                 {
                     bool isSubstring = MatchSubstring(pBkmk->GetName(), 
filterString);
@@ -1108,7 +1108,7 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* )
                 pSh->getIDocumentOutlineNodesAccess()->getOutlineNodes( 
maOutlineNodes );
                 if ( nOutlIdx < maOutlineNodes.size() )
                 {
-                    ::sw::mark::IMark const * const pMark = 
pSh->getIDocumentMarkAccess()->getMarkForTextNode(
+                    ::sw::mark::MarkBase const * const pMark = 
pSh->getIDocumentMarkAccess()->getMarkForTextNode(
                         *(maOutlineNodes[nOutlIdx]),
                         
IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK);
                     aName = pMark->GetName();
@@ -1128,7 +1128,7 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* )
                 pSh->getIDocumentListItemsAccess()->getNumItems(maNumItems);
                 if ( nNumItemIdx < maNumItems.size() )
                 {
-                    ::sw::mark::IMark const * const pMark = 
pSh->getIDocumentMarkAccess()->getMarkForTextNode(
+                    ::sw::mark::MarkBase const * const pMark = 
pSh->getIDocumentMarkAccess()->getMarkForTextNode(
                         *(maNumItems[nNumItemIdx]->GetTextNode()),
                         
IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK);
                     aName = pMark->GetName();
diff --git a/sw/source/ui/inc/bookmark.hxx b/sw/source/ui/inc/bookmark.hxx
index 064408e66763..f66fec0d91de 100644
--- a/sw/source/ui/inc/bookmark.hxx
+++ b/sw/source/ui/inc/bookmark.hxx
@@ -33,9 +33,9 @@ class BookmarkTable
 
 public:
     BookmarkTable(std::unique_ptr<weld::TreeView> xControl);
-    void InsertBookmark(SwWrtShell& rSh, sw::mark::IMark* pMark);
+    void InsertBookmark(SwWrtShell& rSh, sw::mark::MarkBase* pMark);
     bool SelectByName(const OUString& sName);
-    sw::mark::IMark* GetBookmarkByName(const OUString& sName);
+    sw::mark::MarkBase* GetBookmarkByName(const OUString& sName);
     OUString GetNameProposal() const;
 
     void unselect_all() { m_xControl->unselect_all(); }
@@ -90,7 +90,7 @@ public:
 class SwInsertBookmarkDlg final : public SfxDialogController
 {
     SwWrtShell& m_rSh;
-    std::vector<std::pair<sw::mark::IMark*, OUString>> m_aTableBookmarks;
+    std::vector<std::pair<sw::mark::MarkBase*, OUString>> m_aTableBookmarks;
     sal_Int32 m_nLastBookmarksCount;
     bool m_bSorted;
     bool m_bAreProtected;
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index f9619f4e40e2..6bd3ed243671 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -102,8 +102,8 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, DeleteHdl, 
weld::Button&, void)
 
     m_xBookmarksBox->selected_foreach([this, &nSelectedRows](weld::TreeIter& 
rEntry) {
         // remove from model
-        sw::mark::IMark* pBookmark
-            = weld::fromId<sw::mark::IMark*>(m_xBookmarksBox->get_id(rEntry));
+        sw::mark::MarkBase* pBookmark
+            = 
weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(rEntry));
         OUString sRemoved = pBookmark->GetName();
         IDocumentMarkAccess* const pMarkAccess = 
m_rSh.getIDocumentMarkAccess();
         pMarkAccess->deleteMark(pMarkAccess->findMark(sRemoved), false);
@@ -158,8 +158,8 @@ void SwInsertBookmarkDlg::SelectionChanged()
     int nSelectedRows = 0;
     m_xBookmarksBox->selected_foreach(
         [this, &sEditBoxText, &nSelectedRows](weld::TreeIter& rEntry) {
-            sw::mark::IMark* pBookmark
-                = 
weld::fromId<sw::mark::IMark*>(m_xBookmarksBox->get_id(rEntry));
+            sw::mark::MarkBase* pBookmark
+                = 
weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(rEntry));
             const OUString& sEntryName = pBookmark->GetName();
             if (!sEditBoxText.isEmpty())
                 sEditBoxText.append(";");
@@ -205,8 +205,8 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, RenameHdl, 
weld::Button&, void)
     if (!xSelected)
         return;
 
-    sw::mark::IMark* pBookmark
-        = weld::fromId<sw::mark::IMark*>(m_xBookmarksBox->get_id(*xSelected));
+    sw::mark::MarkBase* pBookmark
+        = 
weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(*xSelected));
     uno::Reference<frame::XModel> xModel = 
m_rSh.GetView().GetDocShell()->GetBaseModel();
     uno::Reference<text::XBookmarksSupplier> xBkms(xModel, uno::UNO_QUERY);
     uno::Reference<container::XNameAccess> xNameAccess = xBkms->getBookmarks();
-e 
... etc. - the rest is truncated

Reply via email to