sw/inc/GrammarContact.hxx                             |    4 +-
 sw/inc/crsrsh.hxx                                     |    2 -
 sw/inc/doc.hxx                                        |    4 +-
 sw/inc/editsh.hxx                                     |    4 +-
 sw/inc/ndarr.hxx                                      |   14 ++++-----
 sw/inc/ndgrf.hxx                                      |    4 +-
 sw/inc/ndindex.hxx                                    |    6 ++--
 sw/inc/ndnotxt.hxx                                    |    2 -
 sw/inc/ndole.hxx                                      |    4 +-
 sw/inc/ndtxt.hxx                                      |    6 ++--
 sw/inc/node.hxx                                       |    2 -
 sw/inc/pam.hxx                                        |    4 +-
 sw/inc/reffld.hxx                                     |   10 +++---
 sw/inc/swtable.hxx                                    |    2 -
 sw/inc/unostyle.hxx                                   |    2 -
 sw/inc/unotextcursor.hxx                              |    2 -
 sw/inc/view.hxx                                       |    2 -
 sw/inc/viewsh.hxx                                     |    2 -
 sw/source/core/access/AccessibilityCheck.cxx          |    2 -
 sw/source/core/crsr/crstrvl.cxx                       |    2 -
 sw/source/core/crsr/pam.cxx                           |    4 +-
 sw/source/core/doc/DocumentRedlineManager.cxx         |   10 +++---
 sw/source/core/doc/doc.cxx                            |    2 -
 sw/source/core/doc/docedt.cxx                         |    2 -
 sw/source/core/doc/docnum.cxx                         |    2 -
 sw/source/core/doc/docredln.cxx                       |    2 -
 sw/source/core/doc/notxtfrm.cxx                       |    8 ++---
 sw/source/core/docnode/ndnotxt.cxx                    |    2 -
 sw/source/core/docnode/ndsect.cxx                     |    2 -
 sw/source/core/docnode/ndtbl.cxx                      |    2 -
 sw/source/core/docnode/nodes.cxx                      |    4 +-
 sw/source/core/edit/edfld.cxx                         |    4 +-
 sw/source/core/edit/ednumber.cxx                      |    2 -
 sw/source/core/fields/reffld.cxx                      |   14 ++++-----
 sw/source/core/frmedt/feshview.cxx                    |    2 -
 sw/source/core/graphic/ndgrf.cxx                      |    6 ++--
 sw/source/core/inc/DocumentRedlineManager.hxx         |    8 ++---
 sw/source/core/inc/UndoAttribute.hxx                  |    2 -
 sw/source/core/inc/flowfrm.hxx                        |    2 -
 sw/source/core/inc/frmtool.hxx                        |    3 --
 sw/source/core/inc/notxtfrm.hxx                       |    8 ++---
 sw/source/core/inc/sortedobjs.hxx                     |    2 -
 sw/source/core/layout/frmtool.cxx                     |    2 -
 sw/source/core/layout/sortedobjs.cxx                  |    2 -
 sw/source/core/layout/tabfrm.cxx                      |    2 -
 sw/source/core/layout/wsfrm.cxx                       |    4 +-
 sw/source/core/ole/ndole.cxx                          |    8 ++---
 sw/source/core/table/swtable.cxx                      |    2 -
 sw/source/core/text/pormulti.cxx                      |    6 ++--
 sw/source/core/text/redlnitr.cxx                      |    2 -
 sw/source/core/txtnode/GrammarContact.cxx             |    4 +-
 sw/source/core/txtnode/ndtxt.cxx                      |   10 +++---
 sw/source/core/txtnode/txtedt.cxx                     |    4 +-
 sw/source/core/undo/unattr.cxx                        |    2 -
 sw/source/core/undo/untbl.cxx                         |    2 -
 sw/source/core/unocore/unochart.cxx                   |    2 -
 sw/source/core/unocore/unoobj.cxx                     |    2 -
 sw/source/core/unocore/unoobj2.cxx                    |    4 +-
 sw/source/core/unocore/unostyle.cxx                   |    2 -
 sw/source/core/unocore/unotbl.cxx                     |    8 ++---
 sw/source/core/view/viewsh.cxx                        |    2 -
 sw/source/filter/html/htmlplug.cxx                    |    4 +-
 sw/source/filter/ww8/docxattributeoutput.cxx          |    2 -
 sw/source/filter/ww8/docxtableexport.cxx              |    2 -
 sw/source/filter/ww8/rtfattributeoutput.cxx           |    2 -
 sw/source/filter/ww8/rtfattributeoutput.hxx           |    2 -
 sw/source/filter/ww8/writerhelper.cxx                 |    2 -
 sw/source/filter/ww8/wrtww8.cxx                       |    2 -
 sw/source/filter/ww8/ww8attributeoutput.hxx           |    2 -
 sw/source/ui/utlui/swrenamexnameddlg.cxx              |    4 +-
 sw/source/uibase/dochdl/swdtflvr.cxx                  |    8 ++---
 sw/source/uibase/docvw/PostItMgr.cxx                  |    2 -
 sw/source/uibase/docvw/contentcontrolaliasbutton.cxx  |    4 +-
 sw/source/uibase/frmdlg/frmmgr.cxx                    |    2 -
 sw/source/uibase/inc/annotsh.hxx                      |    2 -
 sw/source/uibase/inc/contentcontrolaliasbutton.hxx    |    4 +-
 sw/source/uibase/inc/drwtxtsh.hxx                     |    4 +-
 sw/source/uibase/inc/frmmgr.hxx                       |    2 -
 sw/source/uibase/inc/langhelper.hxx                   |    2 -
 sw/source/uibase/inc/pview.hxx                        |    4 +-
 sw/source/uibase/inc/swdtflvr.hxx                     |    6 ++--
 sw/source/uibase/inc/swrenamexnameddlg.hxx            |    4 +-
 sw/source/uibase/inc/translatehelper.hxx              |    4 +-
 sw/source/uibase/misc/redlndlg.cxx                    |    2 -
 sw/source/uibase/shells/annotsh.cxx                   |    2 -
 sw/source/uibase/shells/basesh.cxx                    |    4 +-
 sw/source/uibase/shells/drwtxtex.cxx                  |    4 +-
 sw/source/uibase/shells/langhelper.cxx                |    2 -
 sw/source/uibase/shells/tabsh.cxx                     |    4 +-
 sw/source/uibase/shells/textsh1.cxx                   |   14 ++++-----
 sw/source/uibase/shells/translatehelper.cxx           |    4 +-
 sw/source/uibase/sidebar/CommentsPanel.cxx            |   27 +++++++++---------
 sw/source/uibase/sidebar/CommentsPanel.hxx            |   27 +++++++++---------
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |    4 +-
 sw/source/uibase/uiview/pview.cxx                     |    4 +-
 sw/source/uibase/uiview/viewport.cxx                  |    2 -
 sw/source/uibase/uno/loktxdoc.cxx                     |    8 ++---
 sw/source/uibase/utlui/content.cxx                    |    4 +-
 sw/source/uibase/utlui/navipi.cxx                     |    2 -
 sw/source/uibase/wrtsh/wrtsh2.cxx                     |    2 -
 sw/source/writerfilter/dmapper/NumberingManager.cxx   |    2 -
 sw/source/writerfilter/dmapper/NumberingManager.hxx   |    2 -
 sw/source/writerfilter/dmapper/PropertyMap.cxx        |    2 -
 sw/source/writerfilter/dmapper/PropertyMap.hxx        |    2 -
 sw/source/writerfilter/rtftok/rtfdocumentimpl.hxx     |    4 +-
 105 files changed, 221 insertions(+), 220 deletions(-)

New commits:
commit 0e9e0f720f1b6fd5692fb4556e5932877195ce43
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Mar 28 10:03:41 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Mar 28 10:47:46 2025 +0100

    loplugin:constparam in sw
    
    Change-Id: Ic169c3c090d5617fb22d9dbb6c09dc3ec69e57fc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183431
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/GrammarContact.hxx b/sw/inc/GrammarContact.hxx
index 9cc24121158b..4da73ed2353e 100644
--- a/sw/inc/GrammarContact.hxx
+++ b/sw/inc/GrammarContact.hxx
@@ -72,7 +72,7 @@ public:
         repaint will be triggered by a timer
     @returns void
     */
-    void finishGrammarCheck(SwTextNode& rTextNode);
+    void finishGrammarCheck(const SwTextNode& rTextNode);
 
     void CheckBroadcaster();
 };
@@ -87,7 +87,7 @@ GrammarContact* getGrammarContactFor(const SwTextNode&);
 /** finishGrammarCheck() calls the same function of the grammar contact of the 
document (for a given textnode)
 @returns void
 */
-void finishGrammarCheckFor(SwTextNode&);
+void finishGrammarCheckFor(const SwTextNode&);
 
 } // end sw
 
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index a9a2671c83c6..e0bfd7b5e487 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -662,7 +662,7 @@ public:
     // select the given range of OutlineNodes. Optionally including the 
children
     // the sal_uInt16s are the positions in OutlineNodes-Array (EditShell)
     void MakeOutlineSel(SwOutlineNodes::size_type nSttPos, 
SwOutlineNodes::size_type nEndPos,
-        bool bWithChildren, bool bKillPams = true, SwOutlineNodesInline* 
pOutlNdsInline = nullptr);
+        bool bWithChildren, bool bKillPams = true, const SwOutlineNodesInline* 
pOutlNdsInline = nullptr);
 
     bool GotoNextOutline();
     bool GotoPrevOutline();
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index cb98f4b532ec..a36490211855 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1054,7 +1054,7 @@ public:
     /// Outline - move up / move down.
     bool MoveOutlinePara( const SwPaM& rPam,
                     SwOutlineNodes::difference_type nOffset,
-                    SwOutlineNodesInline* pOutlNdsInline = nullptr);
+                    const SwOutlineNodesInline* pOutlNdsInline = nullptr);
 
     SW_DLLPUBLIC bool GotoOutline(SwPosition& rPos, const OUString& rName, 
SwRootFrame const* = nullptr) const;
 
@@ -1510,7 +1510,7 @@ public:
 
     // Replace fields by text - mailmerge support
     bool ConvertFieldsToText(SwRootFrame const& rLayout);
-    bool ConvertFieldToText(SwField& rField, SwRootFrame const& rLayout);
+    bool ConvertFieldToText(const SwField& rField, SwRootFrame const& rLayout);
 
     // Create sub-documents according to given collection.
     // If no collection is given, use chapter styles for 1st level.
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 2e2c6b1f3c65..fd768d85e078 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -408,7 +408,7 @@ public:
     bool InsertField(SwField const &, const bool bForceExpandHints);
 
     SW_DLLPUBLIC void UpdateOneField(SwField &);   ///< One single field.
-    SW_DLLPUBLIC void ConvertOneFieldToText(SwField& rField);
+    SW_DLLPUBLIC void ConvertOneFieldToText(const SwField& rField);
 
     SW_DLLPUBLIC size_t GetFieldTypeCount(SwFieldIds nResId = 
SwFieldIds::Unknown) const;
     SW_DLLPUBLIC SwFieldType* GetFieldType(size_t nField, SwFieldIds nResId = 
SwFieldIds::Unknown) const;
@@ -502,7 +502,7 @@ public:
     bool OutlineUpDown( short nOffset = 1 );
 
     bool MoveOutlinePara( SwOutlineNodes::difference_type nOffset,
-                        SwOutlineNodesInline* pOutlineNodesInline = nullptr );
+                        const SwOutlineNodesInline* pOutlineNodesInline = 
nullptr );
 
     bool IsProtectedOutlinePara() const;
 
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index fdf0eec7849b..21e8eb517cb5 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -159,7 +159,7 @@ public:
         ForEach( SwNodeOffset(0), Count(), fnForEach, pArgs );
     }
     void ForEach( SwNodeOffset nStt, SwNodeOffset nEnd, FnForEach_SwNodes 
fnForEach, void* pArgs );
-    void ForEach( SwNode& rStart, SwNode& rEnd,
+    void ForEach( const SwNode& rStart, const SwNode& rEnd,
                     FnForEach_SwNodes fnForEach, void* pArgs );
     void ForEach( const SwNodeIndex& rStart, const SwNodeIndex& rEnd,
                     FnForEach_SwNodes fnForEach, void* pArgs );
@@ -219,28 +219,28 @@ public:
     /** Create an empty section of Start- and EndNote. It may be called
        only if a new section with content is to be created,
        e.g. at filters/Undo/... */
-    static SwStartNode* MakeEmptySection( SwNode& rWhere,
+    static SwStartNode* MakeEmptySection( const SwNode& rWhere,
                                     SwStartNodeType = SwNormalStartNode );
 
     /// Implementations of "Make...Node" are in the given .cxx-files.
-    SW_DLLPUBLIC SwTextNode *MakeTextNode( SwNode& rWhere,
+    SW_DLLPUBLIC SwTextNode *MakeTextNode( const SwNode& rWhere,
                             SwTextFormatColl *pColl,
                             bool bNewFrames = true); ///< in ndtxt.cxx
     SW_DLLPUBLIC SwStartNode* MakeTextSection( const SwNode & rWhere,
                             SwStartNodeType eSttNdTyp,
                             SwTextFormatColl *pColl );
 
-    static SwGrfNode *MakeGrfNode( SwNode& rWhere,
+    static SwGrfNode *MakeGrfNode( const SwNode& rWhere,
                             const OUString& rGrfName,
                             const OUString& rFltName,
                             const Graphic* pGraphic,
                             SwGrfFormatColl *pColl,
                             SwAttrSet const * pAutoAttr = nullptr );    ///< 
in ndgrf.cxx
 
-    SwOLENode *MakeOLENode( SwNode& rWhere,
+    SwOLENode *MakeOLENode( const SwNode& rWhere,
                             const svt::EmbeddedObjectRef&,
                             SwGrfFormatColl *pColl ); ///< in ndole.cxx
-    SwOLENode *MakeOLENode( SwNode& rWhere,
+    SwOLENode *MakeOLENode( const SwNode& rWhere,
                             const OUString &rName,
                             sal_Int64 nAspect,
                             SwGrfFormatColl *pColl,
@@ -260,7 +260,7 @@ public:
        adjust in pContentTextColl or pHeadlineTextColl this adjust item
        overrides the item in pAttrSet. */
 
-    static SwTableNode* InsertTable( SwNode& rNd,
+    static SwTableNode* InsertTable( const SwNode& rNd,
                         sal_uInt16 nBoxes, SwTextFormatColl* pContentTextColl,
                         sal_uInt16 nLines, sal_uInt16 nRepeat,
                         SwTextFormatColl* pHeadlineTextColl,
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 872fc7feff92..8431a79011bc 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -52,13 +52,13 @@ class SAL_DLLPUBLIC_RTTI SwGrfNode final: public 
SwNoTextNode
     css::uno::Reference<css::io::XInputStream> mxInputStream;
     bool mbIsStreamReadOnly;
 
-    SwGrfNode( SwNode& rWhere,
+    SwGrfNode( const SwNode& rWhere,
                const OUString& rGrfName, const OUString& rFltName,
                const Graphic* pGraphic,
                SwGrfFormatColl* pGrfColl,
                SwAttrSet const * pAutoAttr );
     ///< Ctor for reading (SW/G) without graphics.
-    SwGrfNode( SwNode& rWhere,
+    SwGrfNode( const SwNode& rWhere,
                std::u16string_view rGrfName, const OUString& rFltName,
                SwGrfFormatColl* pGrfColl,
                SwAttrSet const * pAutoAttr );
diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx
index 0f0cdabccee9..9dc5c0a59db1 100644
--- a/sw/inc/ndindex.hxx
+++ b/sw/inc/ndindex.hxx
@@ -58,8 +58,8 @@ class SAL_WARN_UNUSED SW_DLLPUBLIC SwNodeIndex final : public 
sw::Ring<SwNodeInd
     SwNodeIndex(SwNode* pNode) : m_pNode(pNode) { RegisterIndex(); }
 
 public:
-    SwNodeIndex( SwNodes& rNds, sal_Int32 nIdx ) : SwNodeIndex(rNds, 
SwNodeOffset(nIdx)) {}
-    explicit SwNodeIndex( SwNodes& rNds, SwNodeOffset nIdx = SwNodeOffset(0) )
+    SwNodeIndex( const SwNodes& rNds, sal_Int32 nIdx ) : SwNodeIndex(rNds, 
SwNodeOffset(nIdx)) {}
+    explicit SwNodeIndex( const SwNodes& rNds, SwNodeOffset nIdx = 
SwNodeOffset(0) )
         : SwNodeIndex( rNds[ nIdx ] ) {}
 
     SwNodeIndex( const SwNodeIndex& rIdx, sal_Int32 nDiff ) : 
SwNodeIndex(rIdx, SwNodeOffset(nDiff)) {}
@@ -139,7 +139,7 @@ public:
         : aStart( rS ), aEnd( rE ) {}
     SwNodeRange( const SwNodeRange &rRange ) = default;
 
-    SwNodeRange( SwNodes& rNds, SwNodeOffset nSttIdx, SwNodeOffset nEndIdx = 
SwNodeOffset(0) )
+    SwNodeRange( const SwNodes& rNds, SwNodeOffset nSttIdx, SwNodeOffset 
nEndIdx = SwNodeOffset(0) )
         : aStart( rNds, nSttIdx ), aEnd( rNds, nEndIdx ) {}
 
     SwNodeRange( const SwNodeIndex& rS, SwNodeOffset nSttDiff, const 
SwNodeIndex& rE, SwNodeOffset nEndDiff = SwNodeOffset(0) )
diff --git a/sw/inc/ndnotxt.hxx b/sw/inc/ndnotxt.hxx
index 9829ce7d2375..9b969c7a75a9 100644
--- a/sw/inc/ndnotxt.hxx
+++ b/sw/inc/ndnotxt.hxx
@@ -46,7 +46,7 @@ class SAL_DLLPUBLIC_RTTI SwNoTextNode : public SwContentNode
     SwNoTextNode &operator=( const SwNoTextNode& ) = delete;
 
 protected:
-    SwNoTextNode( SwNode& rWhere, const SwNodeType nNdType,
+    SwNoTextNode( const SwNode& rWhere, const SwNodeType nNdType,
                 SwGrfFormatColl *pGrColl, SwAttrSet const * pAutoAttr );
 
 public:
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 6265160219f9..1354ebe30760 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -100,12 +100,12 @@ class SW_DLLPUBLIC SwOLENode final: public SwNoTextNode
     sfx2::SvBaseLink*  mpObjectLink;
     OUString maLinkURL;
 
-    SwOLENode(  SwNode& rWhere,
+    SwOLENode(  const SwNode& rWhere,
                 const svt::EmbeddedObjectRef&,
                 SwGrfFormatColl *pGrfColl,
                 SwAttrSet const * pAutoAttr );
 
-    SwOLENode(  SwNode& rWhere,
+    SwOLENode(  const SwNode& rWhere,
                 const OUString &rName,
                 sal_Int64 nAspect,
                 SwGrfFormatColl *pGrfColl,
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index f7ac6acb0350..d8cad0462c9e 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -164,13 +164,13 @@ class SW_DLLPUBLIC SwTextNode final
     // DrawingLayer FillAttributes in a preprocessed form for primitive usage
     drawinglayer::attribute::SdrAllFillAttributesHelperPtr  maFillAttributes;
 
-    SAL_DLLPRIVATE SwTextNode( SwNode& rWhere, SwTextFormatColl *pTextColl,
+    SAL_DLLPRIVATE SwTextNode( const SwNode& rWhere, SwTextFormatColl 
*pTextColl,
                              const SfxItemSet* pAutoAttr = nullptr );
     virtual void SwClientNotify( const SwModify&, const SfxHint& ) override;
     /// Copies the attributes at nStart to pDest.
     SAL_DLLPRIVATE void CopyAttr( SwTextNode *pDest, const sal_Int32 nStart, 
const sal_Int32 nOldPos);
 
-    SAL_DLLPRIVATE SwTextNode* MakeNewTextNode( SwNode&, bool bNext = true,
+    SAL_DLLPRIVATE SwTextNode* MakeNewTextNode( const SwNode&, bool bNext = 
true,
                                 bool bChgFollow = true );
 
     SAL_DLLPRIVATE void CutImpl(
@@ -405,7 +405,7 @@ public:
     /// the capacity of the node
     void ReplaceText( const SwContentIndex& rStart, const sal_Int32 nDelLen,
             const OUString & rText );
-    void ReplaceText( SwPosition& rStart, const sal_Int32 nDelLen,
+    void ReplaceText( const SwPosition& rStart, const sal_Int32 nDelLen,
             const OUString & rText );
     void ReplaceTextOnly( sal_Int32 nPos, sal_Int32 nLen,
             std::u16string_view aText,
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 6495b4e928a6..456dc8e8a1e9 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -600,7 +600,7 @@ public:
        On default the frames are created until the end of the range.
        When another NodeIndex pEnd is passed a MakeFrames is called up to it.
        Used by TableToText. */
-    void MakeOwnFrames(SwNodeIndex* pIdxBehind, SwNodeIndex* pEnd = nullptr);
+    void MakeOwnFrames(SwNodeIndex* pIdxBehind, const SwNodeIndex* pEnd = 
nullptr);
 
     /** Method deletes all views of document for the node. The
      content frames are removed from the respective layout. */
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 90d2f4679190..a53db1738a04 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -41,7 +41,7 @@ struct SAL_WARN_UNUSED SW_DLLPUBLIC SwPosition
 
     SwPosition( const SwNodeIndex &rNode, const SwContentIndex &rContent );
     SwPosition( const SwNode &rNode, const SwContentIndex &rContent );
-    explicit SwPosition( SwNodes& rNodes, SwNodeOffset nIndex = 
SwNodeOffset(0) );
+    explicit SwPosition( const SwNodes& rNodes, SwNodeOffset nIndex = 
SwNodeOffset(0) );
     explicit SwPosition( const SwNodeIndex &rNode, SwNodeOffset nDiff = 
SwNodeOffset(0) );
     explicit SwPosition( const SwNode& rNode, SwNodeOffset nDiff = 
SwNodeOffset(0) );
     explicit SwPosition( const SwContentNode& rNode, sal_Int32 nContentOffset 
= 0 );
@@ -209,7 +209,7 @@ public:
     SwPaM( const SwNode& rNd, SwNodeOffset nNdOffset, sal_Int32 nContent = 0, 
SwPaM* pRing = nullptr );
     explicit SwPaM( const SwNode& rNd, sal_Int32 nContent = 0, SwPaM* pRing = 
nullptr );
     explicit SwPaM( const SwNodeIndex& rNd, sal_Int32 nContent = 0, SwPaM* 
pRing = nullptr );
-    explicit SwPaM( SwNodes& rNds, SwNodeOffset nMkOffset = SwNodeOffset(0), 
SwPaM* pRing = nullptr );
+    explicit SwPaM( const SwNodes& rNds, SwNodeOffset nMkOffset = 
SwNodeOffset(0), SwPaM* pRing = nullptr );
     virtual ~SwPaM() override;
 
     /// this takes a second parameter, which indicates the Ring that
diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index f50219df9885..defa7f4f7dfe 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -98,7 +98,7 @@ public:
                                         sal_uInt16 nSubType, sal_uInt16 
nSeqNo, sal_uInt16 nFlags,
                                         sal_Int32* pStart, sal_Int32* pEnd = 
nullptr,
                                         SwRootFrame const* pLayout = nullptr,
-                                        SwTextNode* pSelf = nullptr, SwFrame* 
pFrame = nullptr);
+                                        const SwTextNode* pSelf = nullptr, 
SwFrame* pFrame = nullptr);
     void UpdateGetReferences();
     void UpdateStyleReferences();
 
@@ -107,15 +107,15 @@ private:
                                         sal_uInt16 nFlags,
                                         sal_Int32* pStart, sal_Int32* pEnd,
                                         SwRootFrame const* pLayout,
-                                        SwTextNode* pSelf, SwFrame* pFrame);
+                                        const SwTextNode* pSelf, SwFrame* 
pFrame);
     static SwTextNode* FindAnchorRefStyleMarginal( SwDoc* pDoc,
                                         sal_uInt16 nFlags,
                                         sal_Int32* pStart, sal_Int32* pEnd,
-                                        SwTextNode* pSelf, SwFrame* pFrame,
+                                        const SwTextNode* pSelf, SwFrame* 
pFrame,
                                         const SwTextNode* pReference, 
std::u16string_view styleName);
     static SwTextNode* FindAnchorRefStyleOther( SwDoc* pDoc,
                                         sal_Int32* pStart, sal_Int32* pEnd,
-                                        SwTextNode* pSelf,
+                                        const SwTextNode* pSelf,
                                         const SwTextNode* pReference, 
std::u16string_view styleName);
 };
 
@@ -163,7 +163,7 @@ public:
     // --> #i81002#
     SW_DLLPUBLIC bool IsRefToHeadingCrossRefBookmark() const;
     SW_DLLPUBLIC bool IsRefToNumItemCrossRefBookmark() const;
-    SW_DLLPUBLIC const SwTextNode* GetReferencedTextNode(SwTextNode* 
pTextNode, SwFrame* pFrame) const;
+    SW_DLLPUBLIC const SwTextNode* GetReferencedTextNode(const SwTextNode* 
pTextNode, SwFrame* pFrame) const;
     // #i85090#
     SW_DLLPUBLIC OUString GetExpandedTextOfReferencedTextNode(SwRootFrame 
const& rLayout) const;
 
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index eb02a95c0e30..7ad75e262c0a 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -365,7 +365,7 @@ public:
         { UpdateFields(TBL_RELBOXNAME); };
     void SwitchFormulasToInternalRepresentation()
         { UpdateFields(TBL_BOXPTR); }
-    void Merge(SwTable& rTable, SwHistory* pHistory);
+    void Merge(const SwTable& rTable, SwHistory* pHistory);
     void Split(const OUString& sNewTableName, sal_uInt16 nSplitLine, 
SwHistory* pHistory);
 
     static void GatherFormulas(SwDoc& rDoc, std::vector<SwTableBoxFormula*>& 
rvFormulas);
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 908797ffda12..875e4c9677fa 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -416,7 +416,7 @@ class SW_DLLPUBLIC SwXStyleFamily final : public 
cppu::WeakImplHelper
 
     SwXStyle* FindStyle(std::u16string_view rStyleName) const;
     sal_Int32 GetCountOrName(OUString* pString, sal_Int32 nIndex = 
SAL_MAX_INT32);
-    rtl::Reference<SwXBaseStyle> getStyle(SfxStyleSheetBase* pBase, const 
OUString& rStyleName);
+    rtl::Reference<SwXBaseStyle> getStyle(const SfxStyleSheetBase* pBase, 
const OUString& rStyleName);
     static const StyleFamilyEntry& InitEntry(SfxStyleFamily eFamily);
 public:
     SwXStyleFamily(SwDocShell* pDocShell, const SfxStyleFamily eFamily);
diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx
index 46df40089177..1462a9b28132 100644
--- a/sw/inc/unotextcursor.hxx
+++ b/sw/inc/unotextcursor.hxx
@@ -260,7 +260,7 @@ public:
 
 private:
     void gotoRangeImpl(
-            SwXTextRange* pRange,
+            const SwXTextRange* pRange,
             OTextCursorHelper* pCursor,
             bool bExpand);
 };
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index f07662ccb138..42da42cea7ee 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -320,7 +320,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
     SAL_DLLPRIVATE void           CreateScrollbar( bool bHori );
     DECL_DLLPRIVATE_LINK(HoriScrollHdl, weld::Scrollbar&, void);
     DECL_DLLPRIVATE_LINK(VertScrollHdl, weld::Scrollbar&, void);
-    SAL_DLLPRIVATE void EndScrollHdl(weld::Scrollbar& rScrollbar, bool 
bHorizontal);
+    SAL_DLLPRIVATE void EndScrollHdl(const weld::Scrollbar& rScrollbar, bool 
bHorizontal);
     SAL_DLLPRIVATE bool          UpdateScrollbars();
     DECL_DLLPRIVATE_LINK( WindowChildEventListener, VclWindowEvent&, void );
     SAL_DLLPRIVATE void          CalcVisArea( const Size &rPixelSz );
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 7717d8dac6f1..7fc852b75e6e 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -625,7 +625,7 @@ public:
     bool isOutputToWindow() const;
     void OnGraphicArrived(const SwRect&);
 
-    void GetFirstLastVisPageNumbers(SwVisiblePageNumbers& rVisiblePageNumbers, 
SwView& rView);
+    void GetFirstLastVisPageNumbers(SwVisiblePageNumbers& rVisiblePageNumbers, 
const SwView& rView);
 
     virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
 
diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index a5a940865d1d..c5d2cf0ff0e4 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -79,7 +79,7 @@ SwTextNode* lclSearchNextTextNode(SwNode* pCurrent)
     return pTextNode;
 }
 
-void lcl_SetHiddenIssues(std::shared_ptr<sw::AccessibilityIssue>& pIssue)
+void lcl_SetHiddenIssues(const std::shared_ptr<sw::AccessibilityIssue>& pIssue)
 {
     switch (pIssue->m_eIssueID)
     {
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 657c4d97a542..0420d799d4a0 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1364,7 +1364,7 @@ SwOutlineNodes::size_type 
SwCursorShell::GetOutlinePos(sal_uInt8 nLevel, SwPaM*
 }
 
 void SwCursorShell::MakeOutlineSel(SwOutlineNodes::size_type nSttPos, 
SwOutlineNodes::size_type nEndPos,
-                                  bool bWithChildren , bool bKillPams, 
SwOutlineNodesInline* pOutlNdsInline)
+                                  bool bWithChildren , bool bKillPams, const 
SwOutlineNodesInline* pOutlNdsInline)
 {
     const SwNodes& rNds = GetDoc()->GetNodes();
     const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 398a9eb6e117..d59b37d28e49 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -104,7 +104,7 @@ SwPosition::SwPosition( const SwNode& rNode, SwNodeOffset 
nDiff )
 {
 }
 
-SwPosition::SwPosition( SwNodes& rNodes, SwNodeOffset nIndex )
+SwPosition::SwPosition( const SwNodes& rNodes, SwNodeOffset nIndex )
     : nNode( rNodes, nIndex ), nContent( GetNode().GetContentNode() )
 {
 }
@@ -585,7 +585,7 @@ SwPaM::SwPaM( const SwNodeIndex& rNodeIdx, sal_Int32 
nContent, SwPaM* pRing )
     m_pPoint->nContent.Assign( rNodeIdx.GetNode().GetContentNode(), nContent );
 }
 
-SwPaM::SwPaM( SwNodes& rNodes, SwNodeOffset nNdOffset, SwPaM* pRing )
+SwPaM::SwPaM( const SwNodes& rNodes, SwNodeOffset nNdOffset, SwPaM* pRing )
     : Ring( pRing )
     , m_Bound1( rNodes, nNdOffset )
     , m_Bound2( rNodes ) // default initialize
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 9165688b112e..58f76bd4f0a1 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -997,7 +997,7 @@ namespace
         return bRet;
     }
 
-    bool lcl_AcceptInnerInsertRedline(SwRedlineTable& rArr, 
SwRedlineTable::size_type& rPos,
+    bool lcl_AcceptInnerInsertRedline(const SwRedlineTable& rArr, const 
SwRedlineTable::size_type& rPos,
                                       int nDepth)
     {
         SwRangeRedline* pRedl = rArr[rPos];
@@ -3133,8 +3133,8 @@ const SwRangeRedline* DocumentRedlineManager::GetRedline( 
const SwPosition& rPos
 }
 
 bool DocumentRedlineManager::AcceptRedlineRange(SwRedlineTable::size_type 
nPosOrigin,
-                                                SwRedlineTable::size_type& 
nPosStart,
-                                                SwRedlineTable::size_type& 
nPosEnd,
+                                                const 
SwRedlineTable::size_type& nPosStart,
+                                                const 
SwRedlineTable::size_type& nPosEnd,
                                                 bool bCallDelete)
 {
     bool bRet = false;
@@ -3409,8 +3409,8 @@ void 
DocumentRedlineManager::AcceptRedlineParagraphFormatting( const SwPaM &rPam
 }
 
 bool DocumentRedlineManager::RejectRedlineRange(SwRedlineTable::size_type 
nPosOrigin,
-                                                SwRedlineTable::size_type& 
nPosStart,
-                                                SwRedlineTable::size_type& 
nPosEnd,
+                                                const 
SwRedlineTable::size_type& nPosStart,
+                                                const 
SwRedlineTable::size_type& nPosEnd,
                                                 bool bCallDelete)
 {
     bool bRet = false;
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 2cd99f054eea..62ae23a07e46 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1998,7 +1998,7 @@ static bool IsMailMergeField(SwFieldIds fieldId)
     }
 }
 
-bool SwDoc::ConvertFieldToText(SwField& rField, SwRootFrame const& rLayout)
+bool SwDoc::ConvertFieldToText(const SwField& rField, SwRootFrame const& 
rLayout)
 {
     bool bRet = false;
     getIDocumentFieldsAccess().LockExpFields();
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 57896c9c0fd7..7f7cb232c6cc 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -719,7 +719,7 @@ public:
     SwHyphArgs( const SwPaM *pPam, const Point &rPoint,
                 sal_uInt16* pPageCount, sal_uInt16* pPageStart );
     void SetPam( SwPaM *pPam ) const;
-    void SetNode( SwNode& rNew ) { m_aNodeIdx.Assign(rNew); }
+    void SetNode( const SwNode& rNew ) { m_aNodeIdx.Assign(rNew); }
     inline void SetRange( const SwNode *pNew );
     void NextNode() { ++m_aNodeIdx; }
     sal_uInt16 *GetPageCnt() { return m_pPageCnt; }
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index c33c4fd77e49..6ff2afc11ebd 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -447,7 +447,7 @@ bool SwDoc::OutlineUpDown(const SwPaM& rPam, short nOffset,
 
 // Move up/down
 bool SwDoc::MoveOutlinePara( const SwPaM& rPam,
-                SwOutlineNodes::difference_type nOffset, SwOutlineNodesInline* 
pOutlineNodesInline )
+                SwOutlineNodes::difference_type nOffset, const 
SwOutlineNodesInline* pOutlineNodesInline )
 {
     // Do not move to special sections in the nodes array
     const SwPosition& rStt = *rPam.Start(),
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index ef8910e2179c..43f0a5c2b9d0 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -818,7 +818,7 @@ const SwRangeRedline* SwRedlineTable::FindAtPosition( const 
SwPosition& rSttPos,
 
 namespace
 {
-bool lcl_CanCombineWithRange(SwRangeRedline* pOrigin, SwRangeRedline* pActual,
+bool lcl_CanCombineWithRange(const SwRangeRedline* pOrigin, SwRangeRedline* 
pActual,
                              SwRangeRedline* pOther, bool bReverseDir, bool 
bCheckChilds)
 {
     if (pOrigin->IsVisible() != pOther->IsVisible())
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 6fee44775281..c4a64317e882 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1185,7 +1185,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* 
pOut, const SwRect &rGrfAr
 void SwNoTextFrame::ImplPaintPictureGraphic( vcl::RenderContext* pOut,
     SwGrfNode* pGrfNd, bool bPrn,
     const SwRect& rAlignedGrfArea, SwViewShell* pShell,
-    SwNoTextNode& rNoTNd ) const
+    const SwNoTextNode& rNoTNd ) const
 {
     bool bContinue = true;
     const GraphicObject& rGrfObj = pGrfNd->GetGrfObj(bPrn);
@@ -1322,7 +1322,7 @@ void SwNoTextFrame::ImplPaintPictureGraphic( 
vcl::RenderContext* pOut,
     }
 }
 
-void SwNoTextFrame::ImplPaintPictureAnimate(vcl::RenderContext* pOut, 
SwViewShell* pShell,
+void SwNoTextFrame::ImplPaintPictureAnimate(vcl::RenderContext* pOut, const 
SwViewShell* pShell,
         SwGrfNode* pGrfNd, const SwRect& rAlignedGrfArea) const
 {
     OutputDevice* pVout;
@@ -1348,8 +1348,8 @@ void 
SwNoTextFrame::ImplPaintPictureAnimate(vcl::RenderContext* pOut, SwViewShel
                         pVout );
 }
 
-void SwNoTextFrame::ImplPaintPictureReplacement(const GraphicObject& rGrfObj, 
SwGrfNode* pGrfNd,
-        const SwRect& rAlignedGrfArea, SwViewShell* pShell) const
+void SwNoTextFrame::ImplPaintPictureReplacement(const GraphicObject& rGrfObj, 
const SwGrfNode* pGrfNd,
+        const SwRect& rAlignedGrfArea, const SwViewShell* pShell) const
 {
     TranslateId pResId;
 
diff --git a/sw/source/core/docnode/ndnotxt.cxx 
b/sw/source/core/docnode/ndnotxt.cxx
index 1ca38f198b0c..0e2980ba530e 100644
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -35,7 +35,7 @@
 #include <frmfmt.hxx>
 #include <names.hxx>
 
-SwNoTextNode::SwNoTextNode( SwNode& rWhere,
+SwNoTextNode::SwNoTextNode( const SwNode& rWhere,
                   const SwNodeType nNdType,
                   SwGrfFormatColl *pGrfColl,
                   SwAttrSet const * pAutoAttr ) :
diff --git a/sw/source/core/docnode/ndsect.cxx 
b/sw/source/core/docnode/ndsect.cxx
index 72c4f40c7f21..f1e6828cd5cd 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -1151,7 +1151,7 @@ void 
SwSectionNode::MakeFramesForAdjacentContentNode(const SwNodeIndex & rIdx)
 
 // Create a new SectionFrame for every occurrence in the Layout and insert 
before
 // the corresponding ContentFrame
-void SwSectionNode::MakeOwnFrames(SwNodeIndex* pIdxBehind, SwNodeIndex* 
pEndIdx)
+void SwSectionNode::MakeOwnFrames(SwNodeIndex* pIdxBehind, const SwNodeIndex* 
pEndIdx)
 {
     assert(pIdxBehind && "no Index");
     SwNodes& rNds = GetNodes();
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 2c755a4371e9..5c3341820753 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -561,7 +561,7 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions& rInsTableOpts,
     return &rNdTable;
 }
 
-SwTableNode* SwNodes::InsertTable( SwNode& rNd,
+SwTableNode* SwNodes::InsertTable( const SwNode& rNd,
                                    sal_uInt16 nBoxes,
                                    SwTextFormatColl* pContentTextColl,
                                    sal_uInt16 nLines,
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index cbe6b8df11ec..fedef0c93836 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1936,7 +1936,7 @@ void SwNodes::DelDummyNodes( const SwNodeRange& rRg )
     }
 }
 
-SwStartNode* SwNodes::MakeEmptySection( SwNode& rWhere,
+SwStartNode* SwNodes::MakeEmptySection( const SwNode& rWhere,
                                         SwStartNodeType eSttNdTyp )
 {
     SwStartNode* pSttNd = new SwStartNode( rWhere, SwNodeType::Start, 
eSttNdTyp );
@@ -2310,7 +2310,7 @@ void SwNodes::ForEach( const SwNodeIndex& rStart, const 
SwNodeIndex& rEnd,
     ForEach( rStart.GetIndex(), rEnd.GetIndex(), fnForEach, pArgs );
 }
 
-void SwNodes::ForEach( SwNode& rStart, SwNode& rEnd,
+void SwNodes::ForEach( const SwNode& rStart, const SwNode& rEnd,
                     FnForEach_SwNodes fnForEach, void* pArgs )
 {
     ForEach( rStart.GetIndex(), rEnd.GetIndex(), fnForEach, pArgs );
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index e27caa9fad0b..9f476e53633b 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -161,7 +161,7 @@ bool SwEditShell::InsertField(SwField const & rField, const 
bool bForceExpandHin
 }
 
 /// Are the PaMs positioned on fields?
-static SwTextField* lcl_FindInputField( SwDoc* pDoc, const SwField& rField )
+static SwTextField* lcl_FindInputField( const SwDoc* pDoc, const SwField& 
rField )
 {
     // Search field via its address. For input fields this needs to be done in 
protected fields.
     SwTextField* pTField = nullptr;
@@ -291,7 +291,7 @@ void SwEditShell::UpdateOneField(SwField &rField)
     EndAllAction();
 }
 
-void SwEditShell::ConvertOneFieldToText(SwField& rField)
+void SwEditShell::ConvertOneFieldToText(const SwField& rField)
 {
     CurrShell aCurr( this );
     StartAllAction();
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index 56f2779b20e8..6d6b01950bc9 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -541,7 +541,7 @@ bool SwEditShell::OutlineUpDown( short nOffset )
 }
 
 bool SwEditShell::MoveOutlinePara( SwOutlineNodes::difference_type nOffset,
-                SwOutlineNodesInline* pOutlineNodesInline )
+                const SwOutlineNodesInline* pOutlineNodesInline )
 {
     StartAllAction();
     bool bRet = GetDoc()->MoveOutlinePara( *GetCursor(), nOffset, 
pOutlineNodesInline );
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 6499260aefd3..aa69195b6c2b 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -394,7 +394,7 @@ bool SwGetRefField::IsRefToNumItemCrossRefBookmark() const
         ::sw::mark::CrossRefNumItemBookmark::IsLegalName(m_sSetRefName);
 }
 
-const SwTextNode* SwGetRefField::GetReferencedTextNode(SwTextNode* pTextNode, 
SwFrame* pFrame) const
+const SwTextNode* SwGetRefField::GetReferencedTextNode(const SwTextNode* 
pTextNode, SwFrame* pFrame) const
 {
     SwGetRefFieldType *pTyp = dynamic_cast<SwGetRefFieldType*>(GetTyp());
     if (!pTyp)
@@ -1249,7 +1249,7 @@ namespace
         Marginal, /* headers, footers */
     };
 
-    SwTextNode* SearchForStyleAnchor(SwTextNode* pSelf, SwNode* pCurrent,
+    SwTextNode* SearchForStyleAnchor(const SwTextNode* pSelf, SwNode* pCurrent,
                                     std::u16string_view rStyleName,
                                     sal_Int32 *const pStart, sal_Int32 *const 
pEnd,
                                     bool bCaseSensitive = true)
@@ -1299,7 +1299,7 @@ namespace
         return nullptr;
     }
     /// Picks the first text node with a matching style from the specified 
node range
-    SwTextNode* SearchForStyleAnchor(SwTextNode* pSelf, const SwNodes& rNodes, 
SwNodeOffset nNodeStart, SwNodeOffset nNodeEnd, bool bSearchBackward,
+    SwTextNode* SearchForStyleAnchor(const SwTextNode* pSelf, const SwNodes& 
rNodes, SwNodeOffset nNodeStart, SwNodeOffset nNodeEnd, bool bSearchBackward,
                                     std::u16string_view rStyleName,
                                     sal_Int32 *const pStart, sal_Int32 *const 
pEnd,
                                     bool bCaseSensitive = true)
@@ -1331,7 +1331,7 @@ namespace
 SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& 
rRefMark,
                                           sal_uInt16 nSubType, sal_uInt16 
nSeqNo, sal_uInt16 nFlags,
                                           sal_Int32* pStart, sal_Int32* pEnd, 
SwRootFrame const* const pLayout,
-                                          SwTextNode* pSelf, SwFrame* 
pContentFrame)
+                                          const SwTextNode* pSelf, SwFrame* 
pContentFrame)
 {
     assert( pStart && "Why did no one check the StartPos?" );
 
@@ -1458,7 +1458,7 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, 
const OUString& rRefMark,
 SwTextNode* SwGetRefFieldType::FindAnchorRefStyle(SwDoc* pDoc, const OUString& 
rRefMark,
                                           sal_uInt16 nFlags,
                                           sal_Int32* pStart, sal_Int32* pEnd, 
SwRootFrame const* const pLayout,
-                                          SwTextNode* pSelf, SwFrame* 
pContentFrame)
+                                          const SwTextNode* pSelf, SwFrame* 
pContentFrame)
 {
     if (!pSelf)
         return nullptr;
@@ -1529,7 +1529,7 @@ SwTextNode* SwGetRefFieldType::FindAnchorRefStyle(SwDoc* 
pDoc, const OUString& r
 SwTextNode* SwGetRefFieldType::FindAnchorRefStyleMarginal(SwDoc* pDoc,
                                           sal_uInt16 nFlags,
                                           sal_Int32* pStart, sal_Int32* pEnd,
-                                          SwTextNode* pSelf, SwFrame* 
pContentFrame,
+                                          const SwTextNode* pSelf, SwFrame* 
pContentFrame,
                                           const SwTextNode* pReference, 
std::u16string_view styleName)
 {
     // For marginals, styleref tries to act on the current page first
@@ -1628,7 +1628,7 @@ SwTextNode* 
SwGetRefFieldType::FindAnchorRefStyleMarginal(SwDoc* pDoc,
 
 SwTextNode* SwGetRefFieldType::FindAnchorRefStyleOther(SwDoc* pDoc,
                                           sal_Int32* pStart, sal_Int32* pEnd,
-                                          SwTextNode* pSelf,
+                                          const SwTextNode* pSelf,
                                           const SwTextNode* pReference, 
std::u16string_view styleName)
 {
     // Normally, styleref does searches around the field position
diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index 8a498cce98c9..eb436f42e870 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -121,7 +121,7 @@ SwFlyFrame *GetFlyFromMarked( const SdrMarkList *pLst, 
SwViewShell *pSh )
     return nullptr;
 }
 
-static void lcl_GrabCursor( SwFEShell* pSh, SwFlyFrame* pOldSelFly, 
SwFrameFormat* pNewDrawFormat = nullptr)
+static void lcl_GrabCursor( SwFEShell* pSh, SwFlyFrame* pOldSelFly, const 
SwFrameFormat* pNewDrawFormat = nullptr)
 {
     const SwFrameFormat *pFlyFormat = pSh->SelFlyGrabCursor();
     if( pFlyFormat && !pSh->ActionPend() &&
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 66c5734a3da7..a4d45fd19d1e 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -58,7 +58,7 @@
 using namespace com::sun::star;
 
 SwGrfNode::SwGrfNode(
-        SwNode & rWhere,
+        const SwNode & rWhere,
         const OUString& rGrfName,
         const OUString& rFltName,
         const Graphic* pGraphic,
@@ -82,7 +82,7 @@ SwGrfNode::SwGrfNode(
  *
  * @note Does not read/open the image itself!
  */
-SwGrfNode::SwGrfNode( SwNode& rWhere,
+SwGrfNode::SwGrfNode( const SwNode& rWhere,
                       std::u16string_view rGrfName,
                       const OUString& rFltName,
                       SwGrfFormatColl *pGrfColl,
@@ -387,7 +387,7 @@ const GraphicObject* SwGrfNode::GetReplacementGrfObj() const
     return mpReplacementGraphic.get();
 }
 
-SwGrfNode * SwNodes::MakeGrfNode( SwNode & rWhere,
+SwGrfNode * SwNodes::MakeGrfNode( const SwNode & rWhere,
                                 const OUString& rGrfName,
                                 const OUString& rFltName,
                                 const Graphic* pGraphic,
diff --git a/sw/source/core/inc/DocumentRedlineManager.hxx 
b/sw/source/core/inc/DocumentRedlineManager.hxx
index 3651da858126..e55d9ca79e86 100644
--- a/sw/source/core/inc/DocumentRedlineManager.hxx
+++ b/sw/source/core/inc/DocumentRedlineManager.hxx
@@ -157,11 +157,11 @@ public:
 private:
 
     bool RejectRedlineRange(SwRedlineTable::size_type nPosOrigin,
-                            SwRedlineTable::size_type& nPosStart,
-                            SwRedlineTable::size_type& nPosEnd, bool 
bCallDelete);
+                            const SwRedlineTable::size_type& nPosStart,
+                            const SwRedlineTable::size_type& nPosEnd, bool 
bCallDelete);
     bool AcceptRedlineRange(SwRedlineTable::size_type nPosOrigin,
-                            SwRedlineTable::size_type& nPosStart,
-                            SwRedlineTable::size_type& nPosEnd, bool 
bCallDelete);
+                            const SwRedlineTable::size_type& nPosStart,
+                            const SwRedlineTable::size_type& nPosEnd, bool 
bCallDelete);
     bool AcceptMovedRedlines(sal_uInt32 nMovedID, bool bCallDelete);
     bool RejectMovedRedlines(sal_uInt32 nMovedID, bool bCallDelete);
 
diff --git a/sw/source/core/inc/UndoAttribute.hxx 
b/sw/source/core/inc/UndoAttribute.hxx
index f6905cafc6cf..64ef447ec0d2 100644
--- a/sw/source/core/inc/UndoAttribute.hxx
+++ b/sw/source/core/inc/UndoAttribute.hxx
@@ -45,7 +45,7 @@ class SwUndoAttr final : public SwUndo, private SwUndRng
     OUString m_aChrFormatName;
 
     void RemoveIdx( SwDoc& rDoc );
-    void redoAttribute(SwPaM& rPam, sw::UndoRedoContext& rContext);
+    void redoAttribute(SwPaM& rPam, const sw::UndoRedoContext& rContext);
 public:
     SwUndoAttr( const SwPaM&, SfxItemSet, const SetAttrMode nFlags );
     SwUndoAttr( const SwPaM&, const SfxPoolItem&, const SetAttrMode nFlags );
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index c8ca0b55cd06..16e457ab85db 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -70,7 +70,7 @@ class SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") 
SwFlowFrame
     // TableSel is allowed to reset the follow-bit
     friend inline void UnsetFollow( SwFlowFrame *pFlow );
 
-    friend void MakeFrames( SwDoc *, SwNode &, SwNode & );
+    friend void MakeFrames( SwDoc *, const SwNode &, const SwNode & );
 
     friend class SwNode2LayImpl;
 
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index f56b298938b3..5976dccf8ab0 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -144,8 +144,7 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, 
SwNodeOffset nIndex,
                  SwFrame *pPrv = nullptr, sw::FrameMode eMode = 
sw::FrameMode::New);
 
 // Creation of frames for a specific section (uses InsertCnt_)
-void MakeFrames( SwDoc *pDoc, SwNode &rSttIdx,
-                            SwNode &rEndIdx );
+void MakeFrames( SwDoc *pDoc, const SwNode &rSttIdx, const SwNode &rEndIdx );
 
 extern bool bObjsDirect;
 
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index dbd2d3cae1f6..846efe50fee4 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -62,14 +62,14 @@ private:
 
     void ImplPaintPictureGraphic( vcl::RenderContext* pOut,
             SwGrfNode* pGrfNd, bool bPrn,
-            const SwRect& rAlignedGrfArea, SwViewShell* pShell, SwNoTextNode& 
rNoTNd ) const;
+            const SwRect& rAlignedGrfArea, SwViewShell* pShell, const 
SwNoTextNode& rNoTNd ) const;
     void ImplPaintPictureBitmap( vcl::RenderContext* pOut,
             SwOLENode* pOLENd, bool bIsChart, bool bPrn,
             const SwRect& rAlignedGrfArea, SwViewShell* pShell ) const;
-    void ImplPaintPictureAnimate(vcl::RenderContext* pOut, SwViewShell* pShell,
+    void ImplPaintPictureAnimate(vcl::RenderContext* pOut, const SwViewShell* 
pShell,
             SwGrfNode* pGrfNd, const SwRect& rAlignedGrfArea) const;
-    void ImplPaintPictureReplacement(const GraphicObject& rGrfObj, SwGrfNode* 
pGrfNd,
-            const SwRect& rAlignedGrfArea, SwViewShell* pShell) const;
+    void ImplPaintPictureReplacement(const GraphicObject& rGrfObj, const 
SwGrfNode* pGrfNd,
+            const SwRect& rAlignedGrfArea, const SwViewShell* pShell) const;
 
 public:
     SwNoTextFrame( SwNoTextNode * const, SwFrame* );
diff --git a/sw/source/core/inc/sortedobjs.hxx 
b/sw/source/core/inc/sortedobjs.hxx
index 6d524f492802..4ffcd69b3a24 100644
--- a/sw/source/core/inc/sortedobjs.hxx
+++ b/sw/source/core/inc/sortedobjs.hxx
@@ -79,7 +79,7 @@ class SW_DLLPUBLIC SwSortedObjs
 
             @return boolean, indicating success of the update.
         */
-        void Update(SwAnchoredObject& _rAnchoredObj);
+        void Update(const SwAnchoredObject& _rAnchoredObj);
         void UpdateAll();
 
         /** Position of object <_rAnchoredObj> in sorted list
diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 0108678c7ef7..94311597f942 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2058,7 +2058,7 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
         pLayout->SetCallbackActionEnabled( bOldCallbackActionEnabled );
 }
 
-void MakeFrames( SwDoc *pDoc, SwNode &rSttIdx, SwNode &rEndIdx )
+void MakeFrames( SwDoc *pDoc, const SwNode &rSttIdx, const SwNode &rEndIdx )
 {
     bObjsDirect = false;
 
diff --git a/sw/source/core/layout/sortedobjs.cxx 
b/sw/source/core/layout/sortedobjs.cxx
index da3fba27598a..d15c4e79db2b 100644
--- a/sw/source/core/layout/sortedobjs.cxx
+++ b/sw/source/core/layout/sortedobjs.cxx
@@ -260,7 +260,7 @@ bool SwSortedObjs::Contains( const SwAnchoredObject& 
_rAnchoredObj ) const
     return aIter != maSortedObjLst.end();
 }
 
-void SwSortedObjs::Update( SwAnchoredObject& _rAnchoredObj )
+void SwSortedObjs::Update( const SwAnchoredObject& _rAnchoredObj )
 {
     if ( !Contains( _rAnchoredObj ) )
     {
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index ea350cba06d3..7b65b3b64f94 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1507,7 +1507,7 @@ bool SwTabFrame::Split(const SwTwips nCutPos, bool 
bTryToSplit,
 
 namespace
 {
-    bool CanDeleteFollow(SwTabFrame *pFoll)
+    bool CanDeleteFollow(const SwTabFrame *pFoll)
     {
         if (pFoll->IsJoinLocked())
             return false;
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 87ce9defeb8c..c58f09a4b85f 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -4537,7 +4537,7 @@ void AddRemoveFlysAnchoredToFrameStartingAtNode(
 } // namespace sw
 
 static void UnHideRedlines(SwRootFrame & rLayout,
-        SwNodes & rNodes, SwNode const& rEndOfSectionNode,
+        const SwNodes & rNodes, SwNode const& rEndOfSectionNode,
         std::set<SwNodeOffset> *const pSkipped)
 {
     assert(rEndOfSectionNode.IsEndNode());
@@ -4736,7 +4736,7 @@ static void UnHideRedlines(SwRootFrame & rLayout,
 }
 
 static void UnHideRedlinesExtras(SwRootFrame & rLayout,
-        SwNodes & rNodes, SwNode const& rEndOfExtraSectionNode,
+        const SwNodes & rNodes, SwNode const& rEndOfExtraSectionNode,
         std::set<SwNodeOffset> *const pSkipped)
 {
     assert(rEndOfExtraSectionNode.IsEndNode());
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 20cef31053a3..6efa8bbd7c33 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -254,7 +254,7 @@ public:
 
 }
 
-SwOLENode::SwOLENode( SwNode& rWhere,
+SwOLENode::SwOLENode( const SwNode& rWhere,
                     const svt::EmbeddedObjectRef& xObj,
                     SwGrfFormatColl *pGrfColl,
                     SwAttrSet const * pAutoAttr ) :
@@ -266,7 +266,7 @@ SwOLENode::SwOLENode( SwNode& rWhere,
     maOLEObj.SetNode( this );
 }
 
-SwOLENode::SwOLENode( SwNode& rWhere,
+SwOLENode::SwOLENode( const SwNode& rWhere,
                     const OUString &rString,
                     sal_Int64 nAspect,
                     SwGrfFormatColl *pGrfColl,
@@ -420,7 +420,7 @@ bool SwOLENode::SavePersistentData()
     return true;
 }
 
-SwOLENode * SwNodes::MakeOLENode( SwNode& rWhere,
+SwOLENode * SwNodes::MakeOLENode( const SwNode& rWhere,
                     const svt::EmbeddedObjectRef& xObj,
                                     SwGrfFormatColl* pGrfColl )
 {
@@ -442,7 +442,7 @@ SwOLENode * SwNodes::MakeOLENode( SwNode& rWhere,
     return pNode;
 }
 
-SwOLENode * SwNodes::MakeOLENode( SwNode& rWhere,
+SwOLENode * SwNodes::MakeOLENode( const SwNode& rWhere,
     const OUString &rName, sal_Int64 nAspect, SwGrfFormatColl* pGrfColl, 
SwAttrSet const * pAutoAttr )
 {
     OSL_ENSURE( pGrfColl,"SwNodes::MakeOLENode: Formatpointer is 0." );
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index a7e4359d1a43..b4ca4d7a5274 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1681,7 +1681,7 @@ void SwTable::Split(const OUString& sNewTableName, 
sal_uInt16 nSplitLine, SwHist
     }
 }
 
-void SwTable::Merge(SwTable& rTable, SwHistory* pHistory)
+void SwTable::Merge(const SwTable& rTable, SwHistory* pHistory)
 {
     SwTableFormulaUpdate aHint(this);
     aHint.m_eFlags = TBL_MERGETBL;
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 8724ff4b9c8c..d4495587d5f1 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1933,9 +1933,9 @@ enum class BidiTruncationType
     Underflow
 };
 
-BidiTruncationType lcl_BidiPortionNeedsTruncation(SwMultiPortion& rMulti,
-                                                  SwTextFormatInfo& 
rExternalInf,
-                                                  SwTextFormatInfo& rLocalInf,
+BidiTruncationType lcl_BidiPortionNeedsTruncation(const SwMultiPortion& rMulti,
+                                                  const SwTextFormatInfo& 
rExternalInf,
+                                                  const SwTextFormatInfo& 
rLocalInf,
                                                   TextFrameIndex const 
nStartIdx)
 {
     if (!rLocalInf.IsUnderflow())
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 36eedcf86134..2c2a30a8a396 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -84,7 +84,7 @@ public:
     SwPosition const* GetStartPos() const { return m_pStartPos; }
     SwPosition const* GetEndPos() const { return m_pEndPos; }
 
-    HideIterator(SwTextNode & rTextNode,
+    HideIterator(const SwTextNode & rTextNode,
             bool const isHideRedlines, sw::FieldmarkMode const eMode,
             sw::ParagraphBreakMode const ePBMode)
         : m_rIDRA(rTextNode.getIDocumentRedlineAccess())
diff --git a/sw/source/core/txtnode/GrammarContact.cxx 
b/sw/source/core/txtnode/GrammarContact.cxx
index 47e2fac264c0..969e54fc6159 100644
--- a/sw/source/core/txtnode/GrammarContact.cxx
+++ b/sw/source/core/txtnode/GrammarContact.cxx
@@ -124,7 +124,7 @@ SwGrammarMarkUp* GrammarContact::getGrammarCheck( 
SwTextNode& rTextNode, bool bC
     return pRet;
 }
 
-void GrammarContact::finishGrammarCheck( SwTextNode& rTextNode )
+void GrammarContact::finishGrammarCheck( const SwTextNode& rTextNode )
 {
     CheckBroadcaster();
     if( &rTextNode != m_pTextNode ) // not my paragraph
@@ -152,7 +152,7 @@ sw::GrammarContact* getGrammarContactFor(const SwTextNode& 
rTextNode)
     return rDoc.getGrammarContact().get();
 }
 
-void finishGrammarCheckFor(SwTextNode& rTextNode)
+void finishGrammarCheckFor(const SwTextNode& rTextNode)
 {
     sw::GrammarContact* pGrammarContact = getGrammarContactFor(rTextNode);
     if (pGrammarContact)
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 705afada3614..1e5be6350eea 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -126,7 +126,7 @@ namespace sw {
 #define CHECK_SWPHINTS_IF_FRM(pNd)
 #endif
 
-SwTextNode *SwNodes::MakeTextNode( SwNode& rWhere,
+SwTextNode *SwNodes::MakeTextNode( const SwNode& rWhere,
                                  SwTextFormatColl *pColl, bool const 
bNewFrames)
 {
     OSL_ENSURE( pColl, "Collection pointer is 0." );
@@ -208,7 +208,7 @@ SwTextNode *SwNodes::MakeTextNode( SwNode& rWhere,
     } while( true );
 }
 
-SwTextNode::SwTextNode( SwNode& rWhere, SwTextFormatColl *pTextColl, const 
SfxItemSet* pAutoAttr )
+SwTextNode::SwTextNode( const SwNode& rWhere, SwTextFormatColl *pTextColl, 
const SfxItemSet* pAutoAttr )
 :   SwContentNode( rWhere, SwNodeType::Text, pTextColl ),
     m_bContainsHiddenChars(false),
     m_bHiddenCharsHidePara(false),
@@ -3073,7 +3073,7 @@ bool SwTextNode::HasMarkedLabel() const
 namespace
 {
 /// Decides if a list level direct formatting on a paragraph needs copying to 
a next, new paragraph.
-bool CopyDirectListLevel(SwTextNode* pTextNode)
+bool CopyDirectListLevel(const SwTextNode* pTextNode)
 {
     SwTextFormatColl* pColl = pTextNode->GetTextColl();
     if (!pColl)
@@ -3100,7 +3100,7 @@ bool CopyDirectListLevel(SwTextNode* pTextNode)
 }
 }
 
-SwTextNode* SwTextNode::MakeNewTextNode( SwNode& rPosNd, bool bNext,
+SwTextNode* SwTextNode::MakeNewTextNode( const SwNode& rPosNd, bool bNext,
                                        bool bChgFollow )
 {
     // ignore hard PageBreak/PageDesc/ColumnBreak from Auto-Set
@@ -3989,7 +3989,7 @@ void SwTextNode::ReplaceText( const SwContentIndex& 
rStart, const sal_Int32 nDel
     }
 }
 
-void SwTextNode::ReplaceText( SwPosition& rStart, const sal_Int32 nDelLen,
+void SwTextNode::ReplaceText( const SwPosition& rStart, const sal_Int32 
nDelLen,
                              const OUString & rStr)
 {
     ReplaceText(rStart.nContent, nDelLen, rStr);
diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index 2e95ffe55425..fe9276e3b308 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -122,7 +122,7 @@ static bool lcl_IsDelim( const sal_Unicode c )
 
 // allow to check normal text with hyperlink by recognizing (parts of) URLs
 static bool lcl_IsURL(std::u16string_view rWord,
-    SwTextNode &rNode, sal_Int32 nBegin, sal_Int32 nLen)
+    const SwTextNode &rNode, sal_Int32 nBegin, sal_Int32 nLen)
 {
     // not a text with hyperlink
     if ( !rNode.GetTextAttrAt(nBegin, RES_TXTATR_INETFMT) )
@@ -801,7 +801,7 @@ namespace
 sal_Int32
 forceEachCJCodePointToWord(const OUString& rText, sal_Int32 nBegin, sal_Int32 
nLen,
                            const ModelToViewHelper* pModelToView,
-                           std::function<LanguageType(sal_Int32, sal_Int32, 
bool)>& fnGetLangOfChar)
+                           const std::function<LanguageType(sal_Int32, 
sal_Int32, bool)>& fnGetLangOfChar)
 {
     if (nLen > 1)
     {
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 8e00da622fa6..5720f9a06b04 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -856,7 +856,7 @@ void SwUndoAttr::RepeatImpl(::sw::RepeatContext & rContext)
     }
 }
 
-void SwUndoAttr::redoAttribute(SwPaM& rPam, sw::UndoRedoContext & rContext)
+void SwUndoAttr::redoAttribute(SwPaM& rPam, const sw::UndoRedoContext & 
rContext)
 {
     SwDoc & rDoc = rContext.GetDoc();
 
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 16c4c069036c..fb1a64a17a59 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1918,7 +1918,7 @@ void SwUndoTableMerge::UndoImpl(::sw::UndoRedoContext & 
rContext)
 
             if( !m_pSaveTable->IsNewModel() )
                 rDoc.GetNodes().MakeTextNode(
-                    
const_cast<SwEndNode&>(*pBox->GetSttNd()->EndOfSectionNode()), pColl );
+                    *pBox->GetSttNd()->EndOfSectionNode(), pColl );
 
             // this was the separator -> restore moved ones
             for (size_t i = m_vMoves.size(); i; )
diff --git a/sw/source/core/unocore/unochart.cxx 
b/sw/source/core/unocore/unochart.cxx
index 8b298df6f9c2..b8c25ec9f625 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -160,7 +160,7 @@ static std::mutex &    GetChartMutex()
 }
 
 static void LaunchModifiedEvent(
-        ::comphelper::OInterfaceContainerHelper4<util::XModifyListener> &rICH,
+        const ::comphelper::OInterfaceContainerHelper4<util::XModifyListener> 
&rICH,
         const uno::Reference< uno::XInterface > &rxI )
 {
     lang::EventObject aEvtObj( rxI );
diff --git a/sw/source/core/unocore/unoobj.cxx 
b/sw/source/core/unocore/unoobj.cxx
index 99bc9fd8e7bf..01d6b40b56fd 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1170,7 +1170,7 @@ SwXTextCursor::gotoRange(
 
 void
 SwXTextCursor::gotoRangeImpl(
-    SwXTextRange* pRange,
+    const SwXTextRange* pRange,
     OTextCursorHelper* pCursor,
     bool bExpand)
 {
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index bc704d8bb8a7..d831bb715250 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1152,7 +1152,7 @@ void SwXTextRange::GetStartPaM(std::optional<SwPaM>& 
roPaM)
 namespace sw {
 
 static bool XTextRangeToSwPaMImpl( SwUnoInternalPaM & rToFill,
-        SwDoc* pDoc,
+        const SwDoc* pDoc,
         const SwPaM* pUnoCursor);
 
 bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill,
@@ -1213,7 +1213,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill,
 }
 
 static bool XTextRangeToSwPaMImpl( SwUnoInternalPaM & rToFill,
-        SwDoc* pDoc,
+        const SwDoc* pDoc,
         const SwPaM* pUnoCursor)
 {
     bool bRet = false;
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index a42bcf4468c2..cfe1f9ead960 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -974,7 +974,7 @@ rtl::Reference<SwXBaseStyle> 
SwXStyleFamily::getStyleByName(const OUString& rPro
     return getStyle(pBase, sStyleName);
 }
 
-rtl::Reference<SwXBaseStyle> SwXStyleFamily::getStyle(SfxStyleSheetBase* 
pBase, const OUString& sStyleName)
+rtl::Reference<SwXBaseStyle> SwXStyleFamily::getStyle(const SfxStyleSheetBase* 
pBase, const OUString& sStyleName)
 {
     rtl::Reference<SwXBaseStyle> xStyle = FindStyle(sStyleName);
     if(!xStyle.is())
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 12d22961a795..ca5ff5df47e7 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -118,13 +118,13 @@ namespace
 {
     struct FindUnoCellInstanceHint final : SfxHint
     {
-        FindUnoCellInstanceHint(SwTableBox* pCore) : 
SfxHint(SfxHintId::SwFindUnoCellInstance), m_pCore(pCore) {};
+        FindUnoCellInstanceHint(const SwTableBox* pCore) : 
SfxHint(SfxHintId::SwFindUnoCellInstance), m_pCore(pCore) {};
         const SwTableBox* const m_pCore;
         mutable rtl::Reference<SwXCell> m_pResult;
     };
     struct FindUnoTextTableRowInstanceHint final : SfxHint
     {
-        FindUnoTextTableRowInstanceHint(SwTableLine* pCore) : 
SfxHint(SfxHintId::SwFindUnoTextTableRowInstance), m_pCore(pCore) {};
+        FindUnoTextTableRowInstanceHint(const SwTableLine* pCore) : 
SfxHint(SfxHintId::SwFindUnoTextTableRowInstance), m_pCore(pCore) {};
         const SwTableLine* const m_pCore;
         mutable rtl::Reference<SwXTextTableRow> m_pResult;
     };
@@ -156,7 +156,7 @@ namespace
 
     void lcl_SendChartEvent(std::unique_lock<std::mutex>& rGuard,
             uno::Reference<uno::XInterface> const& xSource,
-            
::comphelper::OInterfaceContainerHelper4<chart::XChartDataChangeEventListener> 
& rListeners)
+            const 
::comphelper::OInterfaceContainerHelper4<chart::XChartDataChangeEventListener> 
& rListeners)
     {
         if (rListeners.getLength(rGuard))
             rListeners.notifyEach(rGuard,
@@ -166,7 +166,7 @@ namespace
 
     void lcl_SendChartEvent(std::mutex& rMutex,
             uno::Reference<uno::XInterface> const& xSource,
-            
::comphelper::OInterfaceContainerHelper4<chart::XChartDataChangeEventListener> 
& rListeners)
+            const 
::comphelper::OInterfaceContainerHelper4<chart::XChartDataChangeEventListener> 
& rListeners)
     {
         std::unique_lock aGuard(rMutex);
         lcl_SendChartEvent(aGuard, xSource, rListeners);
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index c32a40d89b4c..c65dd6e53f5b 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -2928,7 +2928,7 @@ SwPostItMgr* SwViewShell::GetPostItMgr()
     return nullptr;
 }
 
-void SwViewShell::GetFirstLastVisPageNumbers(SwVisiblePageNumbers& 
rVisiblePageNumbers, SwView& rView)
+void SwViewShell::GetFirstLastVisPageNumbers(SwVisiblePageNumbers& 
rVisiblePageNumbers, const SwView& rView)
 {
     SwRect rViewVisArea(rView.GetVisArea());
     vcl::RenderContext* pRenderContext = GetOut();
diff --git a/sw/source/filter/html/htmlplug.cxx 
b/sw/source/filter/html/htmlplug.cxx
index 40ccc0c6cb66..7534794f7b17 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1476,7 +1476,7 @@ SwHTMLWriter& OutHTML_FrameFormatOLENode( SwHTMLWriter& 
rWrt, const SwFrameForma
     return rWrt;
 }
 
-static void OutHTMLGraphic(SwHTMLWriter& rWrt, const SwFrameFormat& 
rFrameFormat, SwOLENode* pOLENd,
+static void OutHTMLGraphic(SwHTMLWriter& rWrt, const SwFrameFormat& 
rFrameFormat, const SwOLENode* pOLENd,
                            const Graphic& rGraphic, bool bObjectOpened, bool 
bInCntnr)
 {
     OUString aGraphicURL;
@@ -1550,7 +1550,7 @@ static void OutHTMLEndObject(SwHTMLWriter& rWrt)
 }
 
 static bool TrySaveFormulaAsPDF(SwHTMLWriter& rWrt, const SwFrameFormat& 
rFrameFormat,
-                                SwOLENode* pOLENd, bool 
bWriteReplacementGraphic, bool bInCntnr)
+                                const SwOLENode* pOLENd, bool 
bWriteReplacementGraphic, bool bInCntnr)
 {
     if (!rWrt.mbReqIF)
         return false;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4818fb87ec95..7fa0692960a3 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4547,7 +4547,7 @@ static void impl_borders( FSHelperPtr const & pSerializer,
                           const OutputBorderOptions& rOptions,
                           std::map<SvxBoxItemLine,
                           css::table::BorderLine2> &rTableStyleConf,
-                          ww8::Frame* pFramePr = nullptr)
+                          const ww8::Frame* pFramePr = nullptr)
 {
     static const SvxBoxItemLine aBorders[] =
     {
diff --git a/sw/source/filter/ww8/docxtableexport.cxx 
b/sw/source/filter/ww8/docxtableexport.cxx
index b8ca4eb2ac99..d267960b64ae 100644
--- a/sw/source/filter/ww8/docxtableexport.cxx
+++ b/sw/source/filter/ww8/docxtableexport.cxx
@@ -66,7 +66,7 @@ OString lcl_padStartToLength(OString const& aString, 
sal_Int32 nLen, char cFill)
 
 void CollectFloatingTableAttributes(DocxExport& rExport, const ww8::Frame& 
rFrame,
                                     ww8::WW8TableNodeInfoInner::Pointer_t 
pTableTextNodeInfoInner,
-                                    rtl::Reference<FastAttributeList>& 
pAttributes)
+                                    const rtl::Reference<FastAttributeList>& 
pAttributes)
 {
     // we export the values of the surrounding Frame
     OString sOrientation;
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index cbb9fefb9b6f..2116951c5a2e 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -694,7 +694,7 @@ void RtfAttributeOutput::TableInfoRow(
     /* noop */
 }
 
-void RtfAttributeOutput::TablePositioning(SwFrameFormat* pFlyFormat)
+void RtfAttributeOutput::TablePositioning(const SwFrameFormat* pFlyFormat)
 {
     if (!pFlyFormat || !pFlyFormat->GetFlySplit().GetValue())
     {
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx 
b/sw/source/filter/ww8/rtfattributeoutput.hxx
index f6fc8c388dff..3fa9e2dbb8e1 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -130,7 +130,7 @@ public:
     TableInfoRow(const ww8::WW8TableNodeInfoInner::Pointer_t& 
pTableTextNodeInfoInner) override;
     void
     TableDefinition(const ww8::WW8TableNodeInfoInner::Pointer_t& 
pTableTextNodeInfoInner) override;
-    void TablePositioning(SwFrameFormat* pFlyFormat);
+    void TablePositioning(const SwFrameFormat* pFlyFormat);
     void TableDefaultBorders(
         const ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfoInner) 
override;
     void
diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index b8a47b329245..394216715efa 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -128,7 +128,7 @@ namespace
             {
                 // the anchor position will be invalidated by SetRedlineFlags
                 // so set a dummy position and fix it in UpdateFramePositions
-                SwPosition const 
dummy(const_cast<SwNodes&>(pAnchor->GetNodes()));
+                SwPosition const dummy(pAnchor->GetNodes());
                 aRet.emplace_back(rEntry, dummy);
             }
             else
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index eba20c9916fa..064f4ca043d5 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2325,7 +2325,7 @@ void WW8AttributeOutput::TableSpacing(const 
ww8::WW8TableNodeInfoInner::Pointer_
     }
 }
 
-void WW8AttributeOutput::TablePositioning(SwFrameFormat* pFlyFormat)
+void WW8AttributeOutput::TablePositioning(const SwFrameFormat* pFlyFormat)
 {
     if (!pFlyFormat || !pFlyFormat->GetFlySplit().GetValue())
     {
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx 
b/sw/source/filter/ww8/ww8attributeoutput.hxx
index 8f32ab9f1d7c..2464402676f3 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -102,7 +102,7 @@ public:
     virtual void TableInfoCell( const ww8::WW8TableNodeInfoInner::Pointer_t& 
pTableTextNodeInfo ) override;
     virtual void TableInfoRow( const ww8::WW8TableNodeInfoInner::Pointer_t& 
pTableTextNodeInfo ) override;
     virtual void TableDefinition( const ww8::WW8TableNodeInfoInner::Pointer_t& 
pTableTextNodeInfo ) override;
-    void TablePositioning(SwFrameFormat* pFlyFormat);
+    void TablePositioning(const SwFrameFormat* pFlyFormat);
     virtual void TableDefaultBorders( const 
ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfo ) override;
     virtual void TableBackgrounds( const 
ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfo ) override;
     virtual void TableRowRedline( const ww8::WW8TableNodeInfoInner::Pointer_t& 
pTableTextNodeInfo ) override;
diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx 
b/sw/source/ui/utlui/swrenamexnameddlg.cxx
index 28c1b89c89af..c527626bb0b9 100644
--- a/sw/source/ui/utlui/swrenamexnameddlg.cxx
+++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx
@@ -24,8 +24,8 @@
 using namespace ::com::sun::star;
 
 SwRenameXNamedDlg::SwRenameXNamedDlg(weld::Widget* pParent,
-            uno::Reference< container::XNamed > & xN,
-            uno::Reference< container::XNameAccess > & xNA )
+            const uno::Reference< container::XNamed > & xN,
+            const uno::Reference< container::XNameAccess > & xNA )
     : GenericDialogController(pParent, 
u"modules/swriter/ui/renameobjectdialog.ui"_ustr, u"RenameObjectDialog"_ustr)
     , m_xNamed(xN)
     , m_xNameAccess(xNA)
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index d5fa77cf5ab5..428b61d0ceff 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -1417,7 +1417,7 @@ bool SwTransferable::IsPaste( const SwWrtShell& rSh,
     return bIsPaste;
 }
 
-void SwTransferable::SelectPasteFormat(TransferableDataHelper& rData, 
sal_uInt8& nAction,
+void SwTransferable::SelectPasteFormat(const TransferableDataHelper& rData, 
sal_uInt8& nAction,
                                        SotClipboardFormatId& nFormat)
 {
     if (nFormat != SotClipboardFormatId::RICHTEXT)
@@ -1454,7 +1454,7 @@ void 
SwTransferable::SelectPasteFormat(TransferableDataHelper& rData, sal_uInt8&
 
 // get HTML indentation level by counting tabulator characters before the index
 // (also index value -1 returns with 0)
-static sal_Int32 lcl_getLevel(OUString& sText, sal_Int32 nIdx)
+static sal_Int32 lcl_getLevel(std::u16string_view sText, sal_Int32 nIdx)
 {
     sal_Int32 nRet = 0;
     while ( nIdx-- > 0 && sText[nIdx] == '     ' )
@@ -1464,7 +1464,7 @@ static sal_Int32 lcl_getLevel(OUString& sText, sal_Int32 
nIdx)
     return nRet;
 }
 
-bool SwTransferable::Paste(SwWrtShell& rSh, TransferableDataHelper& rData, 
RndStdIds nAnchorType, bool bIgnoreComments, PasteTableType ePasteTable)
+bool SwTransferable::Paste(SwWrtShell& rSh, const TransferableDataHelper& 
rData, RndStdIds nAnchorType, bool bIgnoreComments, PasteTableType ePasteTable)
 {
     SwPasteContext aPasteContext(rSh);
 
@@ -3506,7 +3506,7 @@ static SotClipboardFormatId aPasteSpecialIds[] =
     SotClipboardFormatId::NONE
 };
 
-bool SwTransferable::PasteUnformatted( SwWrtShell& rSh, 
TransferableDataHelper& rData )
+bool SwTransferable::PasteUnformatted( SwWrtShell& rSh, const 
TransferableDataHelper& rData )
 {
     // Plain text == unformatted
     return SwTransferable::PasteFormat( rSh, rData, 
SotClipboardFormatId::STRING );
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index 5e3ccb5857ef..7dbe84eea88a 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1586,7 +1586,7 @@ void SwPostItMgr::RemoveSidebarWin()
     PreparePageContainer();
 }
 
-static bool ConfirmDeleteAll(SwView& pView, const OUString& sText)
+static bool ConfirmDeleteAll(const SwView& pView, const OUString& sText)
 {
     const bool bAsk = 
officecfg::Office::Common::Misc::QueryDeleteAllComments::get();
     bool bConfirm = true;
diff --git a/sw/source/uibase/docvw/contentcontrolaliasbutton.cxx 
b/sw/source/uibase/docvw/contentcontrolaliasbutton.cxx
index 67d83ed35a29..41a23223c235 100644
--- a/sw/source/uibase/docvw/contentcontrolaliasbutton.cxx
+++ b/sw/source/uibase/docvw/contentcontrolaliasbutton.cxx
@@ -31,7 +31,7 @@
 #define BUTTON_WIDTH 12
 
 SwContentControlAliasButton::SwContentControlAliasButton(SwEditWin* pEditWin,
-                                                         SwContentControl* 
pContentControl)
+                                                         const 
SwContentControl* pContentControl)
     : SwFrameMenuButtonBase(pEditWin, nullptr,
                             
u"modules/swriter/ui/contentcontrolaliasbutton.ui"_ustr,
                             u"ContentControlAliasButton"_ustr)
@@ -143,7 +143,7 @@ bool SwContentControlAliasButton::Contains(const Point& 
rDocPt) const
 
 void SwContentControlAliasButton::SetReadonly(bool bReadonly) { m_bReadOnly = 
bReadonly; }
 
-void SwContentControlAliasButton::SetContentControl(SwContentControl* 
pContentControl)
+void SwContentControlAliasButton::SetContentControl(const SwContentControl* 
pContentControl)
 {
     m_sLabel = pContentControl->GetAlias();
 }
diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx 
b/sw/source/uibase/frmdlg/frmmgr.cxx
index d9213858eed3..5b0d546b3b4f 100644
--- a/sw/source/uibase/frmdlg/frmmgr.cxx
+++ b/sw/source/uibase/frmdlg/frmmgr.cxx
@@ -625,7 +625,7 @@ void SwFlyFrameAttrMgr::SetAttrSet(const SfxItemSet& rSet)
     m_aSet.Put( rSet );
 }
 
-const SwTableFormat* SwFlyFrameAttrMgr::SingleTableSelected(SwWrtShell& 
rWrtShell)
+const SwTableFormat* SwFlyFrameAttrMgr::SingleTableSelected(const SwWrtShell& 
rWrtShell)
 {
     if (!rWrtShell.IsTableMode())
     {
diff --git a/sw/source/uibase/inc/annotsh.hxx b/sw/source/uibase/inc/annotsh.hxx
index 5d25efecdb7f..21311fedb0a9 100644
--- a/sw/source/uibase/inc/annotsh.hxx
+++ b/sw/source/uibase/inc/annotsh.hxx
@@ -76,7 +76,7 @@ public:
     static SfxItemPool* GetAnnotationPool(SwView const & rV);
 
 private:
-    void        ExecPost(SfxRequest& rReq, sal_uInt16 nEEWhich, SfxItemSet& 
rNewAttr, OutlinerView* pOLV );
+    void        ExecPost(const SfxRequest& rReq, sal_uInt16 nEEWhich, 
SfxItemSet& rNewAttr, OutlinerView* pOLV );
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/contentcontrolaliasbutton.hxx 
b/sw/source/uibase/inc/contentcontrolaliasbutton.hxx
index 818a4415b937..0fe0e216dfe7 100644
--- a/sw/source/uibase/inc/contentcontrolaliasbutton.hxx
+++ b/sw/source/uibase/inc/contentcontrolaliasbutton.hxx
@@ -23,7 +23,7 @@ class SwContentControlAliasButton final : public 
SwFrameMenuButtonBase
     bool m_bReadOnly = false;
 
 public:
-    SwContentControlAliasButton(SwEditWin* pEditWin, SwContentControl* 
pContentControl);
+    SwContentControlAliasButton(SwEditWin* pEditWin, const SwContentControl* 
pContentControl);
     ~SwContentControlAliasButton() override;
 
     bool Contains(const Point& rDocPt) const override;
@@ -31,7 +31,7 @@ public:
     void ShowAll(bool bShow) override;
     void dispose() override;
 
-    void SetContentControl(SwContentControl* pContentControl);
+    void SetContentControl(const SwContentControl* pContentControl);
     void SetOffset(Point aTopLeftPixel);
 
 private:
diff --git a/sw/source/uibase/inc/drwtxtsh.hxx 
b/sw/source/uibase/inc/drwtxtsh.hxx
index 2d43fe0f1f09..3a819214d115 100644
--- a/sw/source/uibase/inc/drwtxtsh.hxx
+++ b/sw/source/uibase/inc/drwtxtsh.hxx
@@ -80,8 +80,8 @@ public:
     void        Init();
 
 private:
-    void        ExecutePost(SfxRequest& rReq, sal_uInt16 nEEWhich, SfxItemSet& 
rNewAttr,
-                    OutlinerView* pOLV, bool bRestoreSelection, const 
ESelection& rOldSelection);
+    void        ExecutePost(const SfxRequest& rReq, sal_uInt16 nEEWhich, 
SfxItemSet& rNewAttr,
+                    const OutlinerView* pOLV, bool bRestoreSelection, const 
ESelection& rOldSelection);
 };
 
 #endif
diff --git a/sw/source/uibase/inc/frmmgr.hxx b/sw/source/uibase/inc/frmmgr.hxx
index c574ac05009c..c21901a1d3e5 100644
--- a/sw/source/uibase/inc/frmmgr.hxx
+++ b/sw/source/uibase/inc/frmmgr.hxx
@@ -126,7 +126,7 @@ public:
     void                     SetAttrSet(const SfxItemSet& rSet);
     void SetFrameSizeFromTable();
     /// Checks if we have a table selection and that covers exactly 1 full 
table.
-    SW_DLLPUBLIC static const SwTableFormat* SingleTableSelected(SwWrtShell& 
rWrtShell);
+    SW_DLLPUBLIC static const SwTableFormat* SingleTableSelected(const 
SwWrtShell& rWrtShell);
 
     inline const SwFormatVertOrient &GetVertOrient() const;
     inline const SwFormatHoriOrient &GetHoriOrient() const;
diff --git a/sw/source/uibase/inc/langhelper.hxx 
b/sw/source/uibase/inc/langhelper.hxx
index e9e12f1d384f..075c05882468 100644
--- a/sw/source/uibase/inc/langhelper.hxx
+++ b/sw/source/uibase/inc/langhelper.hxx
@@ -36,7 +36,7 @@ enum class SvtScriptType : sal_uInt8;
 namespace SwLangHelper
 {
     extern void GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet );
-    extern bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, 
SwView const &rView, SwWrtShell &rSh );
+    extern bool SetLanguageStatus( const OutlinerView* pOLV, SfxRequest &rReq, 
SwView const &rView, SwWrtShell &rSh );
 
     extern void SetLanguage( SwWrtShell &rWrtSh, std::u16string_view 
rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
     extern void SetLanguage( SwWrtShell &rWrtSh, OutlinerView const * pOLV, 
const ESelection& rSelection, std::u16string_view rLangText, bool 
bIsForSelection, SfxItemSet &rCoreSet );
diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx
index 5fb6ee3e4c28..39359782746a 100644
--- a/sw/source/uibase/inc/pview.hxx
+++ b/sw/source/uibase/inc/pview.hxx
@@ -194,8 +194,8 @@ class SW_DLLPUBLIC SwPagePreview final : public SfxViewShell
     SAL_DLLPRIVATE void CreateScrollbar( bool bHori);
     DECL_DLLPRIVATE_LINK(HoriScrollHdl, weld::Scrollbar&, void);
     DECL_DLLPRIVATE_LINK(VertScrollHdl, weld::Scrollbar&, void);
-    SAL_DLLPRIVATE void ScrollHdl(weld::Scrollbar&, bool bHorizontal);
-    SAL_DLLPRIVATE void EndScrollHdl(weld::Scrollbar&, bool bHorizontal);
+    SAL_DLLPRIVATE void ScrollHdl(const weld::Scrollbar&, bool bHorizontal);
+    SAL_DLLPRIVATE void EndScrollHdl(const weld::Scrollbar&, bool bHorizontal);
     SAL_DLLPRIVATE bool ChgPage( int eMvMode, bool bUpdateScrollbar = true );
 
     SAL_DLLPRIVATE virtual SfxPrinter*     GetPrinter( bool bCreate = false ) 
override;
diff --git a/sw/source/uibase/inc/swdtflvr.hxx 
b/sw/source/uibase/inc/swdtflvr.hxx
index e301fa0d7540..4fd62f7093f2 100644
--- a/sw/source/uibase/inc/swdtflvr.hxx
+++ b/sw/source/uibase/inc/swdtflvr.hxx
@@ -192,7 +192,7 @@ public:
 
     // paste - methods and helper methods for the paste
     static bool IsPaste( const SwWrtShell&, const TransferableDataHelper& );
-    SW_DLLPUBLIC static bool Paste( SwWrtShell&, TransferableDataHelper&, 
RndStdIds nAnchorType = RndStdIds::FLY_AT_PARA,
+    SW_DLLPUBLIC static bool Paste( SwWrtShell&, const 
TransferableDataHelper&, RndStdIds nAnchorType = RndStdIds::FLY_AT_PARA,
                           bool bIgnoreComments = false, PasteTableType 
ePasteTable = PasteTableType::PASTE_DEFAULT );
     static bool PasteData( const TransferableDataHelper& rData,
                           SwWrtShell& rSh, sal_uInt8 nAction, 
SotExchangeActionFlags nActionFlags,
@@ -208,7 +208,7 @@ public:
     static bool IsPasteSpecial( const SwWrtShell& rWrtShell,
                                 const TransferableDataHelper& );
     static bool IsPasteOwnFormat( const TransferableDataHelper& );
-    static bool PasteUnformatted( SwWrtShell& rSh, TransferableDataHelper& );
+    static bool PasteUnformatted( SwWrtShell& rSh, const 
TransferableDataHelper& );
     /**
      * @brief PrePasteSpecial Prepares the given dialog without actually 
running it
      * @param rSh
@@ -242,7 +242,7 @@ public:
     // the related SwView is being closed and the SwTransferable is invalid now
     void    Invalidate() {m_pWrtShell = nullptr;}
 
-    SW_DLLPUBLIC static void SelectPasteFormat(TransferableDataHelper& rData, 
sal_uInt8& nAction,
+    SW_DLLPUBLIC static void SelectPasteFormat(const TransferableDataHelper& 
rData, sal_uInt8& nAction,
                                   SotClipboardFormatId& nFormat);
 };
 
diff --git a/sw/source/uibase/inc/swrenamexnameddlg.hxx 
b/sw/source/uibase/inc/swrenamexnameddlg.hxx
index 4702f1ac20bc..f656301514b2 100644
--- a/sw/source/uibase/inc/swrenamexnameddlg.hxx
+++ b/sw/source/uibase/inc/swrenamexnameddlg.hxx
@@ -41,8 +41,8 @@ class SwRenameXNamedDlg final : public 
weld::GenericDialogController
 
 public:
     SwRenameXNamedDlg(weld::Widget* pParent,
-                      css::uno::Reference< css::container::XNamed > & xNamed,
-                      css::uno::Reference< css::container::XNameAccess > & 
xNameAccess );
+                      const css::uno::Reference< css::container::XNamed > & 
xNamed,
+                      const css::uno::Reference< css::container::XNameAccess > 
& xNameAccess );
 
     void SetForbiddenChars(const OUString& rSet)
     {
diff --git a/sw/source/uibase/inc/translatehelper.hxx 
b/sw/source/uibase/inc/translatehelper.hxx
index 8c0be7af8c9d..833219054c6e 100644
--- a/sw/source/uibase/inc/translatehelper.hxx
+++ b/sw/source/uibase/inc/translatehelper.hxx
@@ -39,11 +39,11 @@ struct SW_DLLPUBLIC TranslateAPIConfig final
     const OString m_xTargetLanguage;
 };
 SW_DLLPUBLIC OString ExportPaMToHTML(SwPaM* pCursor);
-SW_DLLPUBLIC void PasteHTMLToPaM(SwWrtShell& rWrtSh, SwPaM* pCursor, const 
OString& rData);
+SW_DLLPUBLIC void PasteHTMLToPaM(SwWrtShell& rWrtSh, const SwPaM* pCursor, 
const OString& rData);
 #if HAVE_FEATURE_CURL
 SW_DLLPUBLIC void TranslateDocument(SwWrtShell& rWrtSh, const 
TranslateAPIConfig& rConfig);
 SW_DLLPUBLIC void TranslateDocumentCancellable(SwWrtShell& rWrtSh,
                                                const TranslateAPIConfig& 
rConfig,
-                                               bool& rCancelTranslation);
+                                               const bool& rCancelTranslation);
 #endif
 }
diff --git a/sw/source/uibase/misc/redlndlg.cxx 
b/sw/source/uibase/misc/redlndlg.cxx
index b2dd7fd8b4db..3340b4a0444e 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -146,7 +146,7 @@ SwModelessRedlineAcceptDlg::~SwModelessRedlineAcceptDlg()
 
 namespace
 {
-const SwRedlineData* lcl_get_selected_redlinedata(weld::TreeView& rTreeView)
+const SwRedlineData* lcl_get_selected_redlinedata(const weld::TreeView& 
rTreeView)
 {
     std::unique_ptr<weld::TreeIter> xEntry(rTreeView.make_iterator());
     if (rTreeView.get_selected(xEntry.get()))
diff --git a/sw/source/uibase/shells/annotsh.cxx 
b/sw/source/uibase/shells/annotsh.cxx
index cb358e164406..ea30d7534854 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -624,7 +624,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
     ExecPost(rReq, nEEWhich, aNewAttr, pOLV );
 }
 
-void SwAnnotationShell::ExecPost( SfxRequest& rReq, sal_uInt16 nEEWhich, 
SfxItemSet& rNewAttr, OutlinerView* pOLV )
+void SwAnnotationShell::ExecPost( const SfxRequest& rReq, sal_uInt16 nEEWhich, 
SfxItemSet& rNewAttr, OutlinerView* pOLV )
 {
     const SfxItemSet *pNewAttrs = rReq.GetArgs();
     const sal_uInt16 nSlot = rReq.GetSlot();
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 30e325677bd9..bac55e07b73b 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -785,7 +785,7 @@ namespace
 {
 /// Searches for the specified field type and field name prefix and update the 
matching fields to
 /// have the provided new name and content.
-bool UpdateFieldContents(SfxRequest& rReq, SwWrtShell& rWrtSh)
+bool UpdateFieldContents(const SfxRequest& rReq, SwWrtShell& rWrtSh)
 {
     const SfxStringItem* pTypeName = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
     if (!pTypeName || pTypeName->GetValue() != "SetRef")
@@ -852,7 +852,7 @@ bool UpdateFieldContents(SfxRequest& rReq, SwWrtShell& 
rWrtSh)
 
 /// Searches for the specified field type and field name prefix under cursor 
and update the matching
 /// field to have the provided new name and content.
-void UpdateFieldContent(SfxRequest& rReq, SwWrtShell& rWrtSh)
+void UpdateFieldContent(const SfxRequest& rReq, SwWrtShell& rWrtSh)
 {
     const SfxStringItem* pTypeName = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
     if (!pTypeName || pTypeName->GetValue() != "SetRef")
diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index 7ca27451c256..53be5fc7ef25 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -653,8 +653,8 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
     ExecutePost(rReq, nEEWhich, aNewAttr, pOLV, bRestoreSelection, 
aOldSelection);
 }
 
-void SwDrawTextShell::ExecutePost( SfxRequest& rReq, sal_uInt16 nEEWhich, 
SfxItemSet& rNewAttr,
-        OutlinerView* pOLV, bool bRestoreSelection, const ESelection& 
rOldSelection )
+void SwDrawTextShell::ExecutePost( const SfxRequest& rReq, sal_uInt16 
nEEWhich, SfxItemSet& rNewAttr,
+        const OutlinerView* pOLV, bool bRestoreSelection, const ESelection& 
rOldSelection )
 {
     SwWrtShell &rSh = GetShell();
     const SfxItemSet *pNewAttrs = rReq.GetArgs();
diff --git a/sw/source/uibase/shells/langhelper.cxx 
b/sw/source/uibase/shells/langhelper.cxx
index bb7d4d969668..d432a9820504 100644
--- a/sw/source/uibase/shells/langhelper.cxx
+++ b/sw/source/uibase/shells/langhelper.cxx
@@ -90,7 +90,7 @@ namespace SwLangHelper
         rSet.Put( aItem );
     }
 
-    bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, SwView const 
&rView, SwWrtShell &rSh )
+    bool SetLanguageStatus( const OutlinerView* pOLV, SfxRequest &rReq, SwView 
const &rView, SwWrtShell &rSh )
     {
         bool bRestoreSelection = false;
         ESelection   aSelection  = pOLV->GetSelection();
diff --git a/sw/source/uibase/shells/tabsh.cxx 
b/sw/source/uibase/shells/tabsh.cxx
index 6ebf4b9e1063..a8ad24a25e5f 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -448,7 +448,7 @@ static void lcl_TabGetMaxLineWidth(const SvxBorderLine* 
pBorderLine, SvxBorderLi
     rBorderLine.SetColor(pBorderLine->GetColor());
 }
 
-static bool lcl_BoxesInTrackedRows(SwWrtShell &rSh, const SwSelBoxes& rBoxes)
+static bool lcl_BoxesInTrackedRows(const SwWrtShell &rSh, const SwSelBoxes& 
rBoxes)
 {
     // cursor and selection are there only in tracked rows
     bool bRet = true;
@@ -471,7 +471,7 @@ static bool lcl_BoxesInTrackedRows(SwWrtShell &rSh, const 
SwSelBoxes& rBoxes)
     return bRet;
 }
 
-static bool lcl_CursorInDeletedTable(SwWrtShell &rSh)
+static bool lcl_CursorInDeletedTable(const SwWrtShell &rSh)
 {
     // cursor and selection are there only in deleted table in Show Changes 
mode
     if ( rSh.GetLayout()->IsHideRedlines() )
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 7d76b693e15d..d3b03345fb78 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -446,7 +446,7 @@ OUString GetLocalURL(const SwWrtShell& rSh)
     return rLocalURL;
 }
 
-void UpdateSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
+void UpdateSections(const SfxRequest& rReq, SwWrtShell& rWrtSh)
 {
     OUString aSectionNamePrefix;
     const SfxStringItem* pSectionNamePrefix = 
rReq.GetArg<SfxStringItem>(FN_PARAM_1);
@@ -513,7 +513,7 @@ void UpdateSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
     rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::UPDATE_SECTIONS, 
nullptr);
 }
 
-void DeleteSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
+void DeleteSections(const SfxRequest& rReq, SwWrtShell& rWrtSh)
 {
     OUString aSectionNamePrefix;
     const SfxStringItem* pSectionNamePrefix = 
rReq.GetArg<SfxStringItem>(FN_PARAM_1);
@@ -544,7 +544,7 @@ void DeleteSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
     }
 }
 
-void DeleteContentControl( SwWrtShell& rWrtSh )
+void DeleteContentControl( const SwWrtShell& rWrtSh )
 {
     SwTextContentControl* pTextContentControl = 
rWrtSh.CursorInsideContentControl();
     if (pTextContentControl) {
@@ -556,7 +556,7 @@ void DeleteContentControl( SwWrtShell& rWrtSh )
 }
 
 
-void UpdateBookmarks(SfxRequest& rReq, SwWrtShell& rWrtSh)
+void UpdateBookmarks(const SfxRequest& rReq, SwWrtShell& rWrtSh)
 {
     if 
(rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS))
     {
@@ -643,7 +643,7 @@ void UpdateBookmarks(SfxRequest& rReq, SwWrtShell& rWrtSh)
     
rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::UPDATE_BOOKMARKS, 
nullptr);
 }
 
-void UpdateBookmark(SfxRequest& rReq, SwWrtShell& rWrtSh)
+void UpdateBookmark(const SfxRequest& rReq, SwWrtShell& rWrtSh)
 {
     if 
(rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS))
     {
@@ -723,7 +723,7 @@ void UpdateBookmark(SfxRequest& rReq, SwWrtShell& rWrtSh)
     rIDMA.assureSortedMarkContainers();
 }
 
-void DeleteBookmarks(SfxRequest& rReq, SwWrtShell& rWrtSh)
+void DeleteBookmarks(const SfxRequest& rReq, SwWrtShell& rWrtSh)
 {
     if 
(rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS))
     {
@@ -770,7 +770,7 @@ void DeleteBookmarks(SfxRequest& rReq, SwWrtShell& rWrtSh)
     }
 }
 
-void DeleteFields(SfxRequest& rReq, SwWrtShell& rWrtSh)
+void DeleteFields(const SfxRequest& rReq, SwWrtShell& rWrtSh)
 {
     const SfxStringItem* pTypeName = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
     if (!pTypeName || pTypeName->GetValue() != "SetRef")
diff --git a/sw/source/uibase/shells/translatehelper.cxx 
b/sw/source/uibase/shells/translatehelper.cxx
index 79615f3b126e..fefa2fac5d14 100644
--- a/sw/source/uibase/shells/translatehelper.cxx
+++ b/sw/source/uibase/shells/translatehelper.cxx
@@ -76,7 +76,7 @@ OString ExportPaMToHTML(SwPaM* pCursor)
     return {};
 }
 
-void PasteHTMLToPaM(SwWrtShell& rWrtSh, SwPaM* pCursor, const OString& rData)
+void PasteHTMLToPaM(SwWrtShell& rWrtSh, const SwPaM* pCursor, const OString& 
rData)
 {
     SolarMutexGuard gMutex;
     rtl::Reference<vcl::unohelper::HtmlTransferable> pHtmlTransferable
@@ -102,7 +102,7 @@ void TranslateDocument(SwWrtShell& rWrtSh, const 
TranslateAPIConfig& rConfig)
 }
 
 void TranslateDocumentCancellable(SwWrtShell& rWrtSh, const 
TranslateAPIConfig& rConfig,
-                                  bool& rCancelTranslation)
+                                  const bool& rCancelTranslation)
 {
     auto m_pCurrentPam = rWrtSh.GetCursor();
     bool bHasSelection = rWrtSh.HasSelection();
diff --git a/sw/source/uibase/sidebar/CommentsPanel.cxx 
b/sw/source/uibase/sidebar/CommentsPanel.cxx
index b95596100c0d..b9d84508a569 100644
--- a/sw/source/uibase/sidebar/CommentsPanel.cxx
+++ b/sw/source/uibase/sidebar/CommentsPanel.cxx
@@ -113,7 +113,8 @@ IMPL_LINK(Comment, ContextMenuHdl, const MouseEvent&, 
rMEvt, bool)
     return false;
 }
 
-OUString CommentsPanel::getReferenceText(SwTextNode* pTextNode, 
sw::mark::AnnotationMark* pMark)
+OUString CommentsPanel::getReferenceText(const SwTextNode* pTextNode,
+                                         const sw::mark::AnnotationMark* pMark)
 {
     if (!pMark)
         return OUString();
@@ -273,7 +274,7 @@ void CommentsPanel::Notify(SfxBroadcaster& rBC, const 
SfxHint& rHint)
     }
 }
 
-OUString CommentsPanel::FormatDate(Date& rDate)
+OUString CommentsPanel::FormatDate(const Date& rDate)
 {
     const SvtSysLocale aSysLocale;
     const LocaleDataWrapper& rLocalData = aSysLocale.GetLocaleData();
@@ -289,7 +290,7 @@ OUString CommentsPanel::FormatDate(Date& rDate)
     return sMeta;
 }
 
-OUString CommentsPanel::FormatTime(tools::Time& rTime)
+OUString CommentsPanel::FormatTime(const tools::Time& rTime)
 {
     const SvtSysLocale aSysLocale;
     const LocaleDataWrapper& rLocalData = aSysLocale.GetLocaleData();
@@ -313,13 +314,13 @@ sw::annotation::SwAnnotationWin* 
CommentsPanel::getRootCommentWin(const SwFormat
     return pRootNote;
 }
 
-sal_uInt32 CommentsPanel::getPostItId(sw::annotation::SwAnnotationWin* 
pAnnotationWin)
+sal_uInt32 CommentsPanel::getPostItId(const sw::annotation::SwAnnotationWin* 
pAnnotationWin)
 {
     const SwPostItField* pField = pAnnotationWin->GetPostItField();
     return pField->GetPostItId();
 }
 
-sw::annotation::SwAnnotationWin* CommentsPanel::getAnnotationWin(Comment* 
pComment)
+sw::annotation::SwAnnotationWin* CommentsPanel::getAnnotationWin(const 
Comment* pComment)
 {
     sal_uInt32 nPostItId = 0;
     for (auto & [ rId, rComment ] : mpCommentsMap)
@@ -567,7 +568,7 @@ void CommentsPanel::deleteComment(sal_uInt32 nId)
     }
 }
 
-void CommentsPanel::setResolvedStatus(sw::annotation::SwAnnotationWin* 
pAnnotationWin)
+void CommentsPanel::setResolvedStatus(const sw::annotation::SwAnnotationWin* 
pAnnotationWin)
 {
     sal_uInt32 nId = getPostItId(pAnnotationWin);
     if (mpCommentsMap.find(nId) == mpCommentsMap.end())
@@ -585,7 +586,7 @@ void 
CommentsPanel::setResolvedStatus(sw::annotation::SwAnnotationWin* pAnnotati
     pComment->mxResolve->set_active(pComment->mbResolved);
 }
 
-void CommentsPanel::editComment(SwPostItField* pPostItField, Comment* pComment)
+void CommentsPanel::editComment(const SwPostItField* pPostItField, Comment* 
pComment)
 {
     const OUString& sText = pPostItField->GetText();
     pComment->SetCommentText(sText);
@@ -607,7 +608,7 @@ void CommentsPanel::setReferenceText(sal_uInt32 nRootId)
     pThread->getExpander()->set_label(sText);
 }
 
-void CommentsPanel::EditComment(Comment* pComment)
+void CommentsPanel::EditComment(const Comment* pComment)
 {
     if (!pComment)
         return;
@@ -622,7 +623,7 @@ void CommentsPanel::EditComment(Comment* pComment)
     pComment->mxTextView->set_editable(false);
 }
 
-void CommentsPanel::ToggleResolved(Comment* pComment)
+void CommentsPanel::ToggleResolved(const Comment* pComment)
 {
     if (!pComment)
         return;
@@ -630,7 +631,7 @@ void CommentsPanel::ToggleResolved(Comment* pComment)
     pWin->ToggleResolved();
 }
 
-void CommentsPanel::ReplyComment(Comment* pComment)
+void CommentsPanel::ReplyComment(const Comment* pComment)
 {
     if (!pComment)
         return;
@@ -638,7 +639,7 @@ void CommentsPanel::ReplyComment(Comment* pComment)
     pWin->ExecuteCommand(FN_REPLY);
 }
 
-void CommentsPanel::DeleteComment(Comment* pComment)
+void CommentsPanel::DeleteComment(const Comment* pComment)
 {
     if (!pComment)
         return;
@@ -646,7 +647,7 @@ void CommentsPanel::DeleteComment(Comment* pComment)
     pWin->ExecuteCommand(FN_DELETE_COMMENT);
 }
 
-void CommentsPanel::DeleteThread(Comment* pComment)
+void CommentsPanel::DeleteThread(const Comment* pComment)
 {
     if (!pComment)
         return;
@@ -654,7 +655,7 @@ void CommentsPanel::DeleteThread(Comment* pComment)
     pWin->ExecuteCommand(FN_DELETE_COMMENT_THREAD);
 }
 
-void CommentsPanel::ResolveThread(Comment* pComment)
+void CommentsPanel::ResolveThread(const Comment* pComment)
 {
     if (!pComment)
         return;
diff --git a/sw/source/uibase/sidebar/CommentsPanel.hxx 
b/sw/source/uibase/sidebar/CommentsPanel.hxx
index 34814e63fd78..456ddb8aa2cc 100644
--- a/sw/source/uibase/sidebar/CommentsPanel.hxx
+++ b/sw/source/uibase/sidebar/CommentsPanel.hxx
@@ -130,12 +130,12 @@ public:
 
     void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
 
-    void EditComment(Comment* pComment);
-    void ToggleResolved(Comment* pComment);
-    void ReplyComment(Comment* pComment);
-    void DeleteComment(Comment* pComment);
-    void DeleteThread(Comment* pComment);
-    void ResolveThread(Comment* pComment);
+    void EditComment(const Comment* pComment);
+    void ToggleResolved(const Comment* pComment);
+    void ReplyComment(const Comment* pComment);
+    void DeleteComment(const Comment* pComment);
+    void DeleteThread(const Comment* pComment);
+    void ResolveThread(const Comment* pComment);
 
     DECL_LINK(FilterByAuthor, weld::ComboBox&, void);
     DECL_LINK(FilterByDate, SvtCalendarBox&, void);
@@ -145,8 +145,8 @@ public:
     DECL_LINK(SortHdl, weld::Toggleable&, void);
 
     // utility functions
-    static OUString FormatDate(Date& rDate);
-    static OUString FormatTime(tools::Time& rTime);
+    static OUString FormatDate(const Date& rDate);
+    static OUString FormatTime(const tools::Time& rTime);
 
     weld::Toggleable& getShowResolved() { return *mxShowResolved; }
 
@@ -173,8 +173,8 @@ private:
 
     // utility functions
     sw::annotation::SwAnnotationWin* getRootCommentWin(const SwFormatField* 
pField);
-    static sal_uInt32 getPostItId(sw::annotation::SwAnnotationWin* 
pAnnotationWin);
-    sw::annotation::SwAnnotationWin* getAnnotationWin(Comment* pComment);
+    static sal_uInt32 getPostItId(const sw::annotation::SwAnnotationWin* 
pAnnotationWin);
+    sw::annotation::SwAnnotationWin* getAnnotationWin(const Comment* pComment);
     static bool comp_dateTime(SwFormatField* a, SwFormatField* b);
     static SwPosition getAnchorPosition(SwFormatField* pField);
     static bool comp_position(SwFormatField* a, SwFormatField* b);
@@ -183,9 +183,10 @@ private:
     void populateComments();
     void addComment(const SwFormatField* pField);
     void deleteComment(sal_uInt32 nId);
-    void setResolvedStatus(sw::annotation::SwAnnotationWin* pAnnotationWin);
-    static void editComment(SwPostItField* pPostItField, Comment* pComment);
-    static OUString getReferenceText(SwTextNode* pTextNode, 
sw::mark::AnnotationMark* pMark);
+    void setResolvedStatus(const sw::annotation::SwAnnotationWin* 
pAnnotationWin);
+    static void editComment(const SwPostItField* pPostItField, Comment* 
pComment);
+    static OUString getReferenceText(const SwTextNode* pTextNode,
+                                     const sw::mark::AnnotationMark* pMark);
     void setReferenceText(sal_uInt32 nRootId);
 
     void populateAuthorComboBox();
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index 289520cbcb50..858b60e492ba 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -50,7 +50,7 @@
 
 namespace sw::sidebar
 {
-static void UpdateTree(SwDocShell& rDocSh, SwEditShell& rEditSh,
+static void UpdateTree(SwDocShell& rDocSh, const SwEditShell& rEditSh,
                        std::vector<svx::sidebar::TreeNode>& aStore, sal_Int32& 
rParIdx);
 
 std::unique_ptr<PanelLayout> WriterInspectorTextPanel::Create(weld::Widget* 
pParent)
@@ -530,7 +530,7 @@ static void InsertValues(const 
css::uno::Reference<css::uno::XInterface>& rSourc
         });
 }
 
-static void UpdateTree(SwDocShell& rDocSh, SwEditShell& rEditSh,
+static void UpdateTree(SwDocShell& rDocSh, const SwEditShell& rEditSh,
                        std::vector<svx::sidebar::TreeNode>& aStore, sal_Int32& 
rParIdx)
 {
     SwDoc* pDoc = rDocSh.GetDoc();
diff --git a/sw/source/uibase/uiview/pview.cxx 
b/sw/source/uibase/uiview/pview.cxx
index 9811b027f586..45b5274fe083 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1414,7 +1414,7 @@ IMPL_LINK(SwPagePreview, VertScrollHdl, weld::Scrollbar&, 
rScrollbar, void)
     ScrollHdl(rScrollbar, false);
 }
 
-void SwPagePreview::ScrollHdl(weld::Scrollbar& rScrollbar, bool bHori)
+void SwPagePreview::ScrollHdl(const weld::Scrollbar& rScrollbar, bool bHori)
 {
     if(!GetViewShell())
         return;
@@ -1447,7 +1447,7 @@ void SwPagePreview::ScrollHdl(weld::Scrollbar& 
rScrollbar, bool bHori)
     }
 }
 
-void SwPagePreview::EndScrollHdl(weld::Scrollbar& rScrollbar, bool bHori)
+void SwPagePreview::EndScrollHdl(const weld::Scrollbar& rScrollbar, bool bHori)
 {
     if(!GetViewShell())
         return;
diff --git a/sw/source/uibase/uiview/viewport.cxx 
b/sw/source/uibase/uiview/viewport.cxx
index 4fab16ff7755..84e6f383341a 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -756,7 +756,7 @@ IMPL_LINK(SwView, VertScrollHdl, weld::Scrollbar&, 
rScrollbar, void)
 }
 
 // Handler of the scrollbars
-void SwView::EndScrollHdl(weld::Scrollbar& rScrollbar, bool bHorizontal)
+void SwView::EndScrollHdl(const weld::Scrollbar& rScrollbar, bool bHorizontal)
 {
     if ( GetWrtShell().ActionPend() )
         return;
diff --git a/sw/source/uibase/uno/loktxdoc.cxx 
b/sw/source/uibase/uno/loktxdoc.cxx
index 3ee1e40b561a..2821590d0d03 100644
--- a/sw/source/uibase/uno/loktxdoc.cxx
+++ b/sw/source/uibase/uno/loktxdoc.cxx
@@ -179,7 +179,7 @@ void GetTextFormField(tools::JsonWriter& rJsonWriter, 
SwDocShell* pDocShell,
 /// Parameters:
 ///
 /// - namePrefix: field name prefix to not return all user-defined properties
-void GetDocumentProperties(tools::JsonWriter& rJsonWriter, SwDocShell* 
pDocShell,
+void GetDocumentProperties(tools::JsonWriter& rJsonWriter, const SwDocShell* 
pDocShell,
                            const std::map<OUString, OUString>& rArguments)
 {
     OUString aNamePrefix;
@@ -422,7 +422,7 @@ void GetField(tools::JsonWriter& rJsonWriter, SwDocShell* 
pDocShell,
 ///   now, only contentcontrol is supported.
 void GetDocStructure(tools::JsonWriter& rJsonWriter, SwDocShell* /*pDocShell*/,
                      const std::map<OUString, OUString>& rArguments,
-                     uno::Reference<container::XIndexAccess>& xContentControls)
+                     const uno::Reference<container::XIndexAccess>& 
xContentControls)
 {
     auto it = rArguments.find(u"filter"_ustr);
     if (it != rArguments.end())
@@ -532,7 +532,7 @@ void GetDocStructure(tools::JsonWriter& rJsonWriter, 
SwDocShell* /*pDocShell*/,
 
 void GetDocStructureCharts(tools::JsonWriter& rJsonWriter, SwDocShell* 
/*pDocShell*/,
                            const std::map<OUString, OUString>& rArguments,
-                           uno::Reference<container::XIndexAccess>& xEmbeddeds)
+                           const uno::Reference<container::XIndexAccess>& 
xEmbeddeds)
 {
     auto it = rArguments.find(u"filter"_ustr);
     if (it != rArguments.end())
@@ -648,7 +648,7 @@ void GetDocStructureCharts(tools::JsonWriter& rJsonWriter, 
SwDocShell* /*pDocShe
     }
 }
 
-void GetDocStructureDocProps(tools::JsonWriter& rJsonWriter, SwDocShell* 
pDocShell,
+void GetDocStructureDocProps(tools::JsonWriter& rJsonWriter, const SwDocShell* 
pDocShell,
                              const std::map<OUString, OUString>& rArguments)
 {
     auto it = rArguments.find(u"filter"_ustr);
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index b5cdecac0543..5c99c1bf9026 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -4858,7 +4858,7 @@ void SwContentTree::UpdateTracking()
 }
 
 static bool lcl_IsSelectedCompareByContentTypeAndAddress(const weld::TreeIter& 
rEntry,
-                                                         weld::TreeView& 
rContentTree,
+                                                         const weld::TreeView& 
rContentTree,
                                                          ContentTypeId 
eContentType,
                                                          const void* ptr)
 {
@@ -4935,7 +4935,7 @@ static bool 
lcl_IsSelectedCompareByContentTypeAndAddress(const weld::TreeIter& r
 }
 
 static bool lcl_IsSelectedCompareByContentTypeAndName(const weld::TreeIter& 
rEntry,
-                                                      weld::TreeView& 
rContentTree,
+                                                      const weld::TreeView& 
rContentTree,
                                                       ContentTypeId 
eContentType,
                                                       std::u16string_view 
rName)
 {
-e 
... etc. - the rest is truncated

Reply via email to