basctl/source/basicide/objectbrowser.cxx                |    6 ++--
 chart2/source/controller/main/ChartController_Tools.cxx |    2 -
 codemaker/source/pythonmaker/pythontype.cxx             |   23 ++++++++--------
 codemaker/source/pythonmaker/pythontype.hxx             |   22 +++++++--------
 comphelper/source/misc/markdown.cxx                     |    2 -
 compilerplugins/clang/constparams.cxx                   |    4 ++
 editeng/qa/unit/core-test.cxx                           |    4 +-
 editeng/source/editeng/impedit.hxx                      |    2 -
 editeng/source/editeng/impedit3.cxx                     |    2 -
 extensions/source/propctrlr/browserlistbox.cxx          |    2 -
 extensions/source/propctrlr/browserlistbox.hxx          |    2 -
 include/comphelper/markdown.hxx                         |    2 -
 include/oox/drawingml/chart/chartconverter.hxx          |    4 +-
 include/oox/drawingml/diagram/diagramhelper_oox.hxx     |    2 -
 include/sfx2/charmapcontainer.hxx                       |    4 +-
 include/sfx2/docfile.hxx                                |    2 -
 include/sfx2/lokhelper.hxx                              |    2 -
 include/svx/TableStylesParser.hxx                       |    8 ++---
 include/svx/diagram/DiagramHelper_svx.hxx               |    2 -
 include/svx/diagram/datamodel_svx.hxx                   |    6 ++--
 include/svx/dialog/ThemeColorsPaneBase.hxx              |    2 -
 include/vcl/headbar.hxx                                 |    2 -
 include/vcl/outdev.hxx                                  |    2 -
 include/vcl/toolkit/treelistbox.hxx                     |    4 +-
 o3tl/qa/cow_wrapper_clients.hxx                         |    2 -
 oox/inc/drawingml/chart/stylemodel.hxx                  |    2 -
 oox/source/drawingml/chart/chartconverter.cxx           |    4 +-
 oox/source/drawingml/chart/stylemodel.cxx               |    2 -
 oox/source/drawingml/diagram/datamodel_oox.cxx          |    4 +-
 oox/source/drawingml/diagram/datamodel_oox.hxx          |    4 +-
 oox/source/drawingml/diagram/diagramhelper_oox.cxx      |    2 -
 oox/source/drawingml/scene3dhelper.cxx                  |    2 -
 reportdesign/qa/unit/ReportDesignBasicTests.cxx         |    8 ++---
 sc/inc/dbdata.hxx                                       |    2 -
 sc/inc/tablestyle.hxx                                   |    2 -
 sc/qa/unit/PivotTableFormatsImportExport.cxx            |   14 ++++-----
 sc/qa/unit/ThemeImportExportTest.cxx                    |    6 ++--
 sc/qa/unit/cond_format.cxx                              |    2 -
 sc/qa/unit/copy_paste_test.cxx                          |    2 -
 sc/qa/unit/helper/qahelper.cxx                          |    6 ++--
 sc/qa/unit/helper/qahelper.hxx                          |    6 ++--
 sc/qa/unit/subsequent_export_test.cxx                   |    2 -
 sc/qa/unit/subsequent_export_test3.cxx                  |   10 +++---
 sc/qa/unit/subsequent_export_test5.cxx                  |    2 -
 sc/qa/unit/subsequent_filters_test2.cxx                 |    2 -
 sc/source/core/data/tablestyle.cxx                      |    2 -
 sc/source/core/tool/dbdata.cxx                          |    2 -
 sc/source/filter/excel/xeescher.cxx                     |    2 -
 sc/source/filter/excel/xepivotxml.cxx                   |    2 -
 sc/source/filter/inc/xeescher.hxx                       |    2 -
 sc/source/filter/xml/xmlexprt.cxx                       |    2 -
 sc/source/filter/xml/xmlexprt.hxx                       |    2 -
 sc/source/ui/docshell/docsh4.cxx                        |    2 -
 sc/source/ui/inc/conflictsdlg.hxx                       |    2 -
 sc/source/ui/inc/dbfunc.hxx                             |    2 -
 sc/source/ui/inc/notemark.hxx                           |    2 -
 sc/source/ui/inc/sharedocdlg.hxx                        |    2 -
 sc/source/ui/inc/tableshell.hxx                         |    2 -
 sc/source/ui/inc/viewfunc.hxx                           |    2 -
 sc/source/ui/miscdlgs/conflictsdlg.cxx                  |    2 -
 sc/source/ui/miscdlgs/sharedocdlg.cxx                   |    2 -
 sc/source/ui/view/dbfunc.cxx                            |    2 -
 sc/source/ui/view/notemark.cxx                          |    2 -
 sc/source/ui/view/tableshell.cxx                        |    2 -
 sc/source/ui/view/viewfunc.cxx                          |    4 +-
 sd/inc/drawdoc.hxx                                      |    4 +-
 sd/inc/sdfilter.hxx                                     |    2 -
 sd/qa/unit/import-tests2.cxx                            |    2 -
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx           |    2 -
 sd/source/console/PresenterScreen.cxx                   |    2 -
 sd/source/console/PresenterScreen.hxx                   |    2 -
 sd/source/core/drawdoc2.cxx                             |    2 -
 sd/source/core/drawdoc3.cxx                             |    2 -
 sd/source/core/sdpage.cxx                               |    2 -
 sd/source/filter/eppt/pptx-epptooxml.cxx                |    4 +-
 sd/source/filter/html/a11yex.cxx                        |    2 -
 sd/source/filter/xml/sdxmlwrp.cxx                       |    2 -
 sd/source/ui/inc/DrawViewShell.hxx                      |    2 -
 sd/source/ui/inc/MediaObjectBar.hxx                     |    2 -
 sd/source/ui/inc/TextObjectBar.hxx                      |    4 +-
 sd/source/ui/tools/SlideshowLayerRenderer.cxx           |    4 +-
 sd/source/ui/view/MediaObjectBar.cxx                    |    2 -
 sd/source/ui/view/drtxtob.cxx                           |    4 +-
 sd/source/ui/view/drviews1.cxx                          |    2 -
 sd/source/ui/view/drviews2.cxx                          |    2 -
 sfx2/source/control/charmapcontainer.cxx                |    2 -
 sfx2/source/doc/docfile.cxx                             |    2 -
 sfx2/source/view/lokhelper.cxx                          |    2 -
 store/source/lockbyte.cxx                               |    2 -
 svx/source/diagram/DiagramHelper_svx.cxx                |    2 -
 svx/source/diagram/datamodel_svx.cxx                    |    6 ++--
 svx/source/dialog/ThemeColorsPaneBase.cxx               |    2 -
 svx/source/inc/StylesPreviewWindow.hxx                  |    4 +-
 svx/source/table/tablestylesparser.cxx                  |    8 ++---
 svx/source/tbxctrls/StylesPreviewWindow.cxx             |    4 +-
 sw/inc/undobj.hxx                                       |    2 -
 sw/inc/view.hxx                                         |    2 -
 sw/qa/extras/layout/layout4.cxx                         |    2 -
 sw/qa/extras/pagelinespacing/pagelinespacing.cxx        |    5 ++-
 sw/source/core/doc/DocumentRedlineManager.cxx           |    8 ++---
 sw/source/core/doc/docftn.cxx                           |    2 -
 sw/source/core/docnode/ndtbl.cxx                        |    2 -
 sw/source/core/layout/fly.cxx                           |    2 -
 sw/source/core/undo/untblk.cxx                          |    6 ++--
 sw/source/filter/md/mdcallbcks.cxx                      |    2 -
 sw/source/filter/md/swmd.cxx                            |    2 -
 sw/source/filter/md/swmd.hxx                            |    2 -
 sw/source/filter/xml/XMLRedlineImportHelper.cxx         |    4 +-
 sw/source/ui/dbui/mmlayoutpage.cxx                      |    2 -
 sw/source/ui/dbui/mmlayoutpage.hxx                      |    2 -
 sw/source/uibase/dbui/dbmgr.cxx                         |    2 -
 sw/source/uibase/docvw/PostItMgr.cxx                    |    2 -
 sw/source/uibase/docvw/edtwin2.cxx                      |    2 -
 sw/source/uibase/shells/basesh.cxx                      |    2 -
 sw/source/uibase/uiview/view0.cxx                       |    2 -
 sw/source/writerfilter/dmapper/DomainMapper.cxx         |    2 -
 sw/source/writerfilter/dmapper/DomainMapper.hxx         |    2 -
 vcl/inc/qt5/QtBuilder.hxx                               |    2 -
 vcl/inc/qt5/QtInstanceItemView.hxx                      |    2 -
 vcl/inc/qt5/QtInstanceTreeView.hxx                      |    2 -
 vcl/inc/qt5/QtTools.hxx                                 |    4 +-
 vcl/inc/salvtables.hxx                                  |    2 -
 vcl/qa/cppunit/GraphicTest.cxx                          |    2 -
 vcl/qa/cppunit/cjktext.cxx                              |    4 +-
 vcl/qa/cppunit/gradient.cxx                             |    6 ++--
 vcl/qa/cppunit/outdev.cxx                               |    2 -
 vcl/qa/cppunit/svm/svmtest.cxx                          |   10 +++---
 vcl/qa/cppunit/text.cxx                                 |    6 ++--
 vcl/qt5/QtBuilder.cxx                                   |    2 -
 vcl/qt5/QtInstanceItemView.cxx                          |    2 -
 vcl/qt5/QtInstanceTreeView.cxx                          |    2 -
 vcl/qt5/QtTools.cxx                                     |    4 +-
 vcl/source/app/salvtables.cxx                           |    2 -
 vcl/source/font/EOTConverter.cxx                        |    2 -
 vcl/source/outdev/eps.cxx                               |    2 -
 vcl/source/treelist/headbar.cxx                         |    2 -
 vcl/source/treelist/treelistbox.cxx                     |    4 +-
 xmloff/qa/unit/draw.cxx                                 |    6 ++--
 138 files changed, 230 insertions(+), 224 deletions(-)

New commits:
commit 5505d3bc4dd1e7350f5d935ead1ea5161d276ad9
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Mar 4 10:48:02 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Mar 4 11:29:39 2026 +0100

    loplugin:constparams
    
    Change-Id: I33c701be5a441c1121b797f1eb5a8bda6fc3f89b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200927
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins

diff --git a/basctl/source/basicide/objectbrowser.cxx 
b/basctl/source/basicide/objectbrowser.cxx
index 03a03c55cc23..7afeadc6c614 100644
--- a/basctl/source/basicide/objectbrowser.cxx
+++ b/basctl/source/basicide/objectbrowser.cxx
@@ -107,7 +107,7 @@ bool IsExpandable(const IdeSymbolInfo& rSymbol)
 }
 
 std::shared_ptr<const IdeSymbolInfo>
-GetSymbolForIter(const weld::TreeIter& rIter, weld::TreeView& rTree,
+GetSymbolForIter(const weld::TreeIter& rIter, const weld::TreeView& rTree,
                  const std::map<OUString, std::shared_ptr<IdeSymbolInfo>>& 
rIndex)
 {
     const OUString sId = rTree.get_id(rIter);
@@ -555,7 +555,7 @@ OUString BuildDoxygenUrl(const IdeSymbolInfo& rSymbol)
            + u".html"_ustr + sAnchor;
 }
 
-void ShowDocsError(vcl::Window* pParent, const OUString& sPrimaryText,
+void ShowDocsError(const vcl::Window* pParent, const OUString& sPrimaryText,
                    const OUString& sSecondaryText = OUString())
 {
     if (!pParent)
@@ -572,7 +572,7 @@ void ShowDocsError(vcl::Window* pParent, const OUString& 
sPrimaryText,
     xBox->run();
 }
 
-void OpenDoxygenDocumentation(vcl::Window* pParent, const IdeSymbolInfo& 
rSymbol)
+void OpenDoxygenDocumentation(const vcl::Window* pParent, const IdeSymbolInfo& 
rSymbol)
 {
     OUString sUrl = BuildDoxygenUrl(rSymbol);
     SAL_INFO("basctl", "OpenDoxygenDocumentation: Built URL='" << sUrl << "' 
for symbol '"
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx 
b/chart2/source/controller/main/ChartController_Tools.cxx
index 9a77a6860210..f7dd24d39a72 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -161,7 +161,7 @@ bool lcl_deleteDataCurve(
 }
 
 bool lcl_arePropertiesSame(const std::vector<Reference<beans::XPropertySet>>& 
xProperties,
-                           OUString& aPropName)
+                           const OUString& aPropName)
 {
     if (xProperties.size() == 1)
         return true;
diff --git a/codemaker/source/pythonmaker/pythontype.cxx 
b/codemaker/source/pythonmaker/pythontype.cxx
index 2ebb04280ce8..b7c6a9fccf13 100644
--- a/codemaker/source/pythonmaker/pythontype.cxx
+++ b/codemaker/source/pythonmaker/pythontype.cxx
@@ -473,7 +473,7 @@ void PythonStubGenerator::addImportLine(const OString& 
importLine)
 }
 
 std::vector<unoidl::PlainStructTypeEntity::Member>
-PythonStubGenerator::getAllStructMembers(unoidl::PlainStructTypeEntity* entity)
+PythonStubGenerator::getAllStructMembers(const unoidl::PlainStructTypeEntity* 
entity)
 {
     std::vector<unoidl::PlainStructTypeEntity::Member> members;
 
@@ -498,7 +498,8 @@ 
PythonStubGenerator::getAllStructMembers(unoidl::PlainStructTypeEntity* entity)
     return members;
 }
 
-void 
PythonStubGenerator::generatePolyStruct(unoidl::PolymorphicStructTypeTemplateEntity*
 entity)
+void PythonStubGenerator::generatePolyStruct(
+    const unoidl::PolymorphicStructTypeTemplateEntity* entity)
 {
     addImportLine("from typing import TypeVar, Generic"_ostr); //imports to 
handle generic types
     OStringBuffer typeVarBuffer;
@@ -593,7 +594,7 @@ void 
PythonStubGenerator::generatePolyStruct(unoidl::PolymorphicStructTypeTempla
 }
 
 std::vector<unoidl::ExceptionTypeEntity::Member>
-PythonStubGenerator::getAllExceptionMembers(unoidl::ExceptionTypeEntity* 
entity)
+PythonStubGenerator::getAllExceptionMembers(const unoidl::ExceptionTypeEntity* 
entity)
 {
     std::vector<unoidl::ExceptionTypeEntity::Member> members;
 
@@ -622,7 +623,7 @@ 
PythonStubGenerator::getAllExceptionMembers(unoidl::ExceptionTypeEntity* entity)
     return members;
 }
 
-void PythonStubGenerator::generateEnum(unoidl::EnumTypeEntity* entity)
+void PythonStubGenerator::generateEnum(const unoidl::EnumTypeEntity* entity)
 {
     //just using the enum package provided in python itself
     addImportLine("import enum"_ostr);
@@ -652,7 +653,7 @@ void 
PythonStubGenerator::generateEnum(unoidl::EnumTypeEntity* entity)
     dedent();
 }
 
-void PythonStubGenerator::generateConstantGroup(unoidl::ConstantGroupEntity* 
entity)
+void PythonStubGenerator::generateConstantGroup(const 
unoidl::ConstantGroupEntity* entity)
 {
     m_buffer.append("class ");
     m_buffer.append(m_pySafeClassName);
@@ -738,7 +739,7 @@ void 
PythonStubGenerator::generateConstantGroup(unoidl::ConstantGroupEntity* ent
     dedent();
 }
 
-void PythonStubGenerator::generateTypedef(unoidl::TypedefEntity* entity)
+void PythonStubGenerator::generateTypedef(const unoidl::TypedefEntity* entity)
 {
     OUString originalUnoType = entity->getType();
     OString pythonTypeHintForOriginal = mapUnoTypeToPythonHint(
@@ -754,7 +755,7 @@ void 
PythonStubGenerator::generateTypedef(unoidl::TypedefEntity* entity)
     m_buffer.append("
");
 }
 
-void PythonStubGenerator::generateStruct(unoidl::PlainStructTypeEntity* entity)
+void PythonStubGenerator::generateStruct(const unoidl::PlainStructTypeEntity* 
entity)
 {
     // Handle the base class (inheritance)
     OString baseClass = "object"_ostr; // Default base for Python classes
@@ -822,7 +823,7 @@ void 
PythonStubGenerator::generateStruct(unoidl::PlainStructTypeEntity* entity)
     dedent();
 }
 
-void PythonStubGenerator::generateException(unoidl::ExceptionTypeEntity* 
entity)
+void PythonStubGenerator::generateException(const unoidl::ExceptionTypeEntity* 
entity)
 {
     // Determine the base class for Python stub
     OString baseClass;
@@ -899,7 +900,7 @@ void 
PythonStubGenerator::generateException(unoidl::ExceptionTypeEntity* entity)
     dedent();
 }
 
-void PythonStubGenerator::generateInterface(unoidl::InterfaceTypeEntity* 
entity)
+void PythonStubGenerator::generateInterface(const unoidl::InterfaceTypeEntity* 
entity)
 {
     // Determine and generate the list of base classes.
     OStringBuffer baseClassesStr;
@@ -1060,7 +1061,7 @@ void 
PythonStubGenerator::generateInterface(unoidl::InterfaceTypeEntity* entity)
     dedent();
 }
 
-void 
PythonStubGenerator::generateService(unoidl::SingleInterfaceBasedServiceEntity* 
entity)
+void PythonStubGenerator::generateService(const 
unoidl::SingleInterfaceBasedServiceEntity* entity)
 {
     m_buffer.append("class ");
     m_buffer.append(m_pySafeClassName);
@@ -1164,7 +1165,7 @@ void 
PythonStubGenerator::generateService(unoidl::SingleInterfaceBasedServiceEnt
     dedent();
 }
 
-void 
PythonStubGenerator::generateSingleton(unoidl::InterfaceBasedSingletonEntity* 
entity)
+void PythonStubGenerator::generateSingleton(const 
unoidl::InterfaceBasedSingletonEntity* entity)
 {
     // A singleton is represented as a class with a static 'get' method.
     // The class itself is just a namespace for this method.
diff --git a/codemaker/source/pythonmaker/pythontype.hxx 
b/codemaker/source/pythonmaker/pythontype.hxx
index d5b9f21ccb2e..29cb35cca0f8 100644
--- a/codemaker/source/pythonmaker/pythontype.hxx
+++ b/codemaker/source/pythonmaker/pythontype.hxx
@@ -62,18 +62,18 @@ public:
 private:
     void addImportLine(const rtl::OString& importLine);
     std::vector<unoidl::PlainStructTypeEntity::Member>
-    getAllStructMembers(unoidl::PlainStructTypeEntity* entity);
+    getAllStructMembers(const unoidl::PlainStructTypeEntity* entity);
     std::vector<unoidl::ExceptionTypeEntity::Member>
-    getAllExceptionMembers(unoidl::ExceptionTypeEntity* entity);
-    void generateEnum(unoidl::EnumTypeEntity* entity);
-    void generateConstantGroup(unoidl::ConstantGroupEntity* entity);
-    void generateTypedef(unoidl::TypedefEntity* entity);
-    void generateStruct(unoidl::PlainStructTypeEntity* entity);
-    void generatePolyStruct(unoidl::PolymorphicStructTypeTemplateEntity* 
entity);
-    void generateException(unoidl::ExceptionTypeEntity* entity);
-    void generateInterface(unoidl::InterfaceTypeEntity* entity);
-    void generateService(unoidl::SingleInterfaceBasedServiceEntity* entity);
-    void generateSingleton(unoidl::InterfaceBasedSingletonEntity* entity);
+    getAllExceptionMembers(const unoidl::ExceptionTypeEntity* entity);
+    void generateEnum(const unoidl::EnumTypeEntity* entity);
+    void generateConstantGroup(const unoidl::ConstantGroupEntity* entity);
+    void generateTypedef(const unoidl::TypedefEntity* entity);
+    void generateStruct(const unoidl::PlainStructTypeEntity* entity);
+    void generatePolyStruct(const unoidl::PolymorphicStructTypeTemplateEntity* 
entity);
+    void generateException(const unoidl::ExceptionTypeEntity* entity);
+    void generateInterface(const unoidl::InterfaceTypeEntity* entity);
+    void generateService(const unoidl::SingleInterfaceBasedServiceEntity* 
entity);
+    void generateSingleton(const unoidl::InterfaceBasedSingletonEntity* 
entity);
     void indent();
     void dedent();
     rtl::OString getIndent() const;
diff --git a/comphelper/source/misc/markdown.cxx 
b/comphelper/source/misc/markdown.cxx
index b074b2a3daee..b2d1bbdc491c 100644
--- a/comphelper/source/misc/markdown.cxx
+++ b/comphelper/source/misc/markdown.cxx
@@ -15,7 +15,7 @@ constexpr sal_Int32 MAX_SEARCH_CHARS = 2000;
 
 namespace comphelper
 {
-bool IsMarkdownData(OUString& rData)
+bool IsMarkdownData(const OUString& rData)
 {
     icu::UnicodeString ustr(rData.getStr(), std::min(rData.getLength(), 
MAX_SEARCH_CHARS));
 
diff --git a/compilerplugins/clang/constparams.cxx 
b/compilerplugins/clang/constparams.cxx
index c1a60366cffc..b29ebdeef860 100644
--- a/compilerplugins/clang/constparams.cxx
+++ b/compilerplugins/clang/constparams.cxx
@@ -243,7 +243,9 @@ bool ConstParams::CheckTraverseFunctionDecl(FunctionDecl * 
functionDecl)
       || fqn == "static_txtattr_cast"
       || fqn == "ScFormatShell::ExecuteStyle"
       || fqn == "SwContentIndexReg::MoveTo"
-      || fqn == 
"svt::OGenericUnoAsyncDialog::UnoAsyncDialogEntryGuard::UnoAsyncDialogEntryGuard")
+      || fqn == 
"svt::OGenericUnoAsyncDialog::UnoAsyncDialogEntryGuard::UnoAsyncDialogEntryGuard"
+      || fqn == "SwMarkdownParser::enter_block_callback"
+      || fqn == "SwMarkdownParser::enter_span_callback")
         return false;
 
     // calculate the ones we want to check
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 93aea9a83149..94853eb0030c 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -596,13 +596,13 @@ class TestTransferable : public 
cppu::WeakImplHelper<datatransfer::XTransferable
     std::vector<OUString> m_aMimeType;
 
 public:
-    TestTransferable(std::vector<OString>& rContent, std::vector<OUString>& 
rMimeType);
+    TestTransferable(const std::vector<OString>& rContent, const 
std::vector<OUString>& rMimeType);
     uno::Any SAL_CALL getTransferData(const datatransfer::DataFlavor& rFlavor) 
override;
     uno::Sequence<datatransfer::DataFlavor> SAL_CALL getTransferDataFlavors() 
override;
     sal_Bool SAL_CALL isDataFlavorSupported(const datatransfer::DataFlavor& 
rFlavor) override;
 };
 
-TestTransferable::TestTransferable(std::vector<OString>& rContent, 
std::vector<OUString>& rMimeType)
+TestTransferable::TestTransferable(const std::vector<OString>& rContent, const 
std::vector<OUString>& rMimeType)
     : m_aContent(rContent)
     , m_aMimeType(rMimeType)
 {
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index cd381cadc6f9..df2ac3ef133a 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -1002,7 +1002,7 @@ public:
     void                    DrawText_ToPosition( OutputDevice& rOutDev, const 
Point& rStartPos, Degree10 nOrientation );
     void                    DrawText_ToRectangle( OutputDevice& rOutDev, const 
tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bHardClip );
     void                    UpdateViews( EditView* pCurView = nullptr );
-    Point CalculateTextPaintStartPosition(ImpEditView& rView) const;
+    Point CalculateTextPaintStartPosition(const ImpEditView& rView) const;
     void                    DrawText_ToEditView( TextHierarchyBreakup& 
rHelper, ImpEditView* pView, const tools::Rectangle& rRect, OutputDevice* 
pTargetDevice );
     void StripAllPortions( OutputDevice& rOutDev, tools::Rectangle aClipRect, 
StripPortionsHelper& rStripPortionsHelper);
 
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index dca12d95ba4f..d0154bd15b66 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4055,7 +4055,7 @@ void ImpEditEngine::StripAllPortions( OutputDevice& 
rOutDev, tools::Rectangle aC
     }
 }
 
-Point ImpEditEngine::CalculateTextPaintStartPosition(ImpEditView& rView) const
+Point ImpEditEngine::CalculateTextPaintStartPosition(const ImpEditView& rView) 
const
 {
     Point aStartPos;
 
diff --git a/extensions/source/propctrlr/browserlistbox.cxx 
b/extensions/source/propctrlr/browserlistbox.cxx
index 3a60d53dc451..2f512e60621f 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -532,7 +532,7 @@ void OBrowserListBox::ShowEntry(sal_uInt16 nPos)
     m_xScrolledWindow->vadjustment_set_value(nThumbPos);
 }
 
-void OBrowserListBox::buttonClicked(OBrowserLine* _pLine, bool _bPrimary)
+void OBrowserListBox::buttonClicked(const OBrowserLine* _pLine, bool _bPrimary)
 {
     DBG_ASSERT(_pLine, "OBrowserListBox::buttonClicked: invalid browser 
line!");
     if (_pLine && m_pLineListener)
diff --git a/extensions/source/propctrlr/browserlistbox.hxx 
b/extensions/source/propctrlr/browserlistbox.hxx
index b4d38e449bcf..9f65c8136d78 100644
--- a/extensions/source/propctrlr/browserlistbox.hxx
+++ b/extensions/source/propctrlr/browserlistbox.hxx
@@ -116,7 +116,7 @@ public:
     void activateNextControl(
         const css::uno::Reference<css::inspection::XPropertyControl>& 
CurrentControl);
 
-    void buttonClicked(OBrowserLine* _pLine, bool _bPrimary);
+    void buttonClicked(const OBrowserLine* _pLine, bool _bPrimary);
 
 private:
     /** retrieves the index of a given control in our line list
diff --git a/include/comphelper/markdown.hxx b/include/comphelper/markdown.hxx
index 8de674d3a1b8..308423c9085e 100644
--- a/include/comphelper/markdown.hxx
+++ b/include/comphelper/markdown.hxx
@@ -14,7 +14,7 @@
 
 namespace comphelper
 {
-COMPHELPER_DLLPUBLIC bool IsMarkdownData(OUString& rData);
+COMPHELPER_DLLPUBLIC bool IsMarkdownData(const OUString& rData);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/oox/drawingml/chart/chartconverter.hxx 
b/include/oox/drawingml/chart/chartconverter.hxx
index fdf227453d57..90cc31fbf2e8 100644
--- a/include/oox/drawingml/chart/chartconverter.hxx
+++ b/include/oox/drawingml/chart/chartconverter.hxx
@@ -112,8 +112,8 @@ public:
 
      */
     static void convertFromModel(
-                    oox::core::XmlFilterBase& rFilter,
-                    StyleModel& rChartStyleModel,
+                    const oox::core::XmlFilterBase& rFilter,
+                    const StyleModel& rChartStyleModel,
                     const css::uno::Reference< css::chart2::XChartStyle >& 
rxChartStyle);
 
 private:
diff --git a/include/oox/drawingml/diagram/diagramhelper_oox.hxx 
b/include/oox/drawingml/diagram/diagramhelper_oox.hxx
index 9a7004a58fad..3c911981d473 100644
--- a/include/oox/drawingml/diagram/diagramhelper_oox.hxx
+++ b/include/oox/drawingml/diagram/diagramhelper_oox.hxx
@@ -91,7 +91,7 @@ public:
     virtual std::shared_ptr< svx::diagram::DiagramDataState > 
extractDiagramDataState() const override;
     virtual void applyDiagramDataState(const std::shared_ptr< 
svx::diagram::DiagramDataState >& rState) override;
 
-    void doAnchor(css::uno::Reference<css::drawing::XShape>& rTarget);
+    void doAnchor(const css::uno::Reference<css::drawing::XShape>& rTarget);
     const std::shared_ptr< ::oox::drawingml::Theme >& getOrCreateThemePtr(
         const rtl::Reference< oox::shape::ShapeFilterBase>& rxFilter ) const;
 
diff --git a/include/sfx2/charmapcontainer.hxx 
b/include/sfx2/charmapcontainer.hxx
index e9b366777f3f..b3d0eaefc9a3 100644
--- a/include/sfx2/charmapcontainer.hxx
+++ b/include/sfx2/charmapcontainer.hxx
@@ -92,8 +92,8 @@ public:
               const Link<void*, void>& rUpdateFavHdl, const Link<void*, void>& 
rUpdateRecentHdl,
               const Link<const CharAndFont&, void>& rCharSelectedHdl);
 
-    static ScopedVclPtr<VirtualDevice> CreateIcon(weld::IconView& rIconView, 
const OUString& rFont,
-                                                  const OUString& rText);
+    static ScopedVclPtr<VirtualDevice> CreateIcon(const weld::IconView& 
rIconView,
+                                                  const OUString& rFont, const 
OUString& rText);
 
     void getFavCharacterList();
     void updateFavCharControl();
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 88b68e9513a9..564b3be837a8 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -112,7 +112,7 @@ public:
     void SetOriginallyReadOnly(bool val);
     void AddEmbeddedFonts(const css::uno::Sequence<css::beans::StringPair>& 
fonts);
     // Transfers the embedded font list to another medium (passing ownership)
-    void TransferEmbeddedFontsTo(SfxMedium& target);
+    void TransferEmbeddedFontsTo(const SfxMedium& target);
     void AddToCheckEditableWorkerList();
     void SetWorkerReloadEvent(ImplSVEvent* pEvent);
     ImplSVEvent* GetWorkerReloadEvent() const;
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 74e2992bef07..5379e4114f98 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -188,7 +188,7 @@ public:
     /// Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same 
document - if @bInvalidateAll - first invalidates all parts
     static void notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc, 
bool bInvalidateAll = true);
     /// Emits a LOK_CALLBACK_STATE_CHANGED for all views of the same document 
- with payload ".uno:CurrentPageResize"
-    static void notifyCurrentPageSizeChangedAllViews(vcl::ITiledRenderable* 
pDoc);
+    static void notifyCurrentPageSizeChangedAllViews(const 
vcl::ITiledRenderable* pDoc);
     /// Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same 
document with the same part
     static void notifyPartSizeChangedAllViews(vcl::ITiledRenderable* pDoc, int 
nPart);
     /// Emits a LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR
diff --git a/include/svx/TableStylesParser.hxx 
b/include/svx/TableStylesParser.hxx
index cf01fd446c49..8405c2caae19 100644
--- a/include/svx/TableStylesParser.hxx
+++ b/include/svx/TableStylesParser.hxx
@@ -59,7 +59,7 @@ public:
                       std::unique_ptr<SvxAutoFormatDataField> pField);
     const TableStyle* getCellStyle(const OUString& rName);
     void addTableTemplate(const OUString& rsStyleName, const XMLTableTemplate& 
xTableTemplate,
-                          std::bitset<6>& rUseSet);
+                          const std::bitset<6>& rUseSet);
     SvxAutoFormat& GetFormat() { return mpAutoFormat; }
     void finishStyles();
 };
@@ -120,7 +120,7 @@ public:
 
     virtual void Finish(bool bOverwrite) override;
 
-    void setPropertyValue(OUString& rPropName, const css::uno::Any& aValue);
+    void setPropertyValue(const OUString& rPropName, const css::uno::Any& 
aValue);
 };
 
 class SVX_DLLPUBLIC SvxTableStylesExport : public SvXMLExport
@@ -129,8 +129,8 @@ private:
     SvxAutoFormat& mpAutoFormat;
 
     void exportTableTemplate(const SvxAutoFormatData& rData);
-    void exportCellStyle(const SvxAutoFormatDataField& rField, OUString& 
rStyleName,
-                         OUString& rParentName);
+    void exportCellStyle(const SvxAutoFormatDataField& rField, const OUString& 
rStyleName,
+                         const OUString& rParentName);
     void exportCellProperties(const SvxAutoFormatDataField& rField,
                               const SvxAutoFormatDataField& rParent);
     void exportParaProperties(const SvxAutoFormatDataField& rField,
diff --git a/include/svx/diagram/DiagramHelper_svx.hxx 
b/include/svx/diagram/DiagramHelper_svx.hxx
index 580e1597ffe5..b1cf20441266 100644
--- a/include/svx/diagram/DiagramHelper_svx.hxx
+++ b/include/svx/diagram/DiagramHelper_svx.hxx
@@ -118,7 +118,7 @@ public:
     bool ForceThemePtrRecreation() const { return mbForceThemePtrRecreation; };
 
     // connect/disconnect to/from Group
-    void connectToSdrObjGroup(css::uno::Reference< css::drawing::XShape >& 
rTarget);
+    void connectToSdrObjGroup(const css::uno::Reference< css::drawing::XShape 
>& rTarget);
     void disconnectFromSdrObjGroup();
 
     static void AddAdditionalVisualization(const SdrObjGroup& rTarget, 
SdrHdlList& rHdlList);
diff --git a/include/svx/diagram/datamodel_svx.hxx 
b/include/svx/diagram/datamodel_svx.hxx
index 3ae95d7ac54a..85eed09b99ec 100644
--- a/include/svx/diagram/datamodel_svx.hxx
+++ b/include/svx/diagram/datamodel_svx.hxx
@@ -73,7 +73,7 @@ struct SVXCORE_DLLPUBLIC Connection
     /* 0         */ sal_Int32       mnSourceOrder; // XML_srcOrd
     /* 0         */ sal_Int32       mnDestOrder; // XML_destOrd
 
-    void writeDiagramData(sax_fastparser::FSHelperPtr& rTarget);
+    void writeDiagramData(const sax_fastparser::FSHelperPtr& rTarget);
     void addDiagramModelData(boost::property_tree::ptree& rTarget) const;
 };
 
@@ -133,13 +133,13 @@ struct SVXCORE_DLLPUBLIC Point
     /* PRS (false)  */ bool         mbCustomText : 1; // XML_custT
     /* PRS (false)  */ bool         mbIsPlaceholder : 1; // XML_phldr
 
-    void writeDiagramData_data(sax_fastparser::FSHelperPtr& rTarget);
+    void writeDiagramData_data(const sax_fastparser::FSHelperPtr& rTarget);
     void addDiagramModelData(boost::property_tree::ptree& rTarget) const;
 };
 
 TypeConstant SVXCORE_DLLPUBLIC getTypeConstantForName(std::u16string_view 
aName);
 std::u16string_view SVXCORE_DLLPUBLIC getNameForTypeConstant(TypeConstant 
aTypeConstant);
-void SVXCORE_DLLPUBLIC addTypeConstantToFastAttributeList(TypeConstant 
aTypeConstant, rtl::Reference<sax_fastparser::FastAttributeList>& 
rAttributeList, bool bPoint);
+void SVXCORE_DLLPUBLIC addTypeConstantToFastAttributeList(TypeConstant 
aTypeConstant, const rtl::Reference<sax_fastparser::FastAttributeList>& 
rAttributeList, bool bPoint);
 void SVXCORE_DLLPUBLIC addTypeConstantToDiagramModelData(TypeConstant 
aTypeConstant, boost::property_tree::ptree& rTarget, bool bPoint);
 
 typedef std::vector< Point >        Points;
diff --git a/include/svx/dialog/ThemeColorsPaneBase.hxx 
b/include/svx/dialog/ThemeColorsPaneBase.hxx
index 0b4deeda42e8..4a45dbd02030 100644
--- a/include/svx/dialog/ThemeColorsPaneBase.hxx
+++ b/include/svx/dialog/ThemeColorsPaneBase.hxx
@@ -33,7 +33,7 @@ protected:
     std::vector<model::ColorSet> maColorSets;
     std::shared_ptr<model::ColorSet> mpCurrentColorSet;
 
-    void initColorSets(model::Theme* pTheme = nullptr);
+    void initColorSets(const model::Theme* pTheme = nullptr);
     static VclPtr<VirtualDevice> CreateColorSetPreview(const model::ColorSet& 
rColorSet);
 
 public:
diff --git a/include/vcl/headbar.hxx b/include/vcl/headbar.hxx
index 52ad396d460d..80db48c56913 100644
--- a/include/vcl/headbar.hxx
+++ b/include/vcl/headbar.hxx
@@ -312,7 +312,7 @@ public:
 
     /** Creates and returns the accessible object of the header bar. */
     virtual rtl::Reference<comphelper::OAccessible> CreateAccessible() 
override;
-    void SetAccessible(rtl::Reference<comphelper::OAccessible>& rAccessible);
+    void SetAccessible(const rtl::Reference<comphelper::OAccessible>& 
rAccessible);
 };
 
 #endif // INCLUDED_VCL_HEADBAR_HXX
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 1e8fb5b7a1a6..606dd002d397 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1918,7 +1918,7 @@ public:
         that's too much for now, wrote \#i107046# for this */
     bool                        DrawEPS(
                                     const Point& rPt, const Size& rSz,
-                                    const GfxLink& rGfxLink, GDIMetaFile* 
pSubst = nullptr );
+                                    const GfxLink& rGfxLink, const 
GDIMetaFile* pSubst = nullptr );
     ///@}
 
 public:
diff --git a/include/vcl/toolkit/treelistbox.hxx 
b/include/vcl/toolkit/treelistbox.hxx
index 61241ef89398..1474a5e0b869 100644
--- a/include/vcl/toolkit/treelistbox.hxx
+++ b/include/vcl/toolkit/treelistbox.hxx
@@ -373,7 +373,7 @@ public:
 
     using Window::GetChildCount;
     sal_uInt32          GetChildCount( SvTreeListEntry const * pParent ) const;
-    sal_uInt32          GetLevelChildCount( SvTreeListEntry* pParent ) const;
+    sal_uInt32          GetLevelChildCount( const SvTreeListEntry* pParent ) 
const;
 
     SvViewDataEntry* GetViewDataEntry( SvTreeListEntry const * pEntry ) const;
     SvViewDataItem*  GetViewDataItem(SvTreeListEntry const *, SvLBoxItem const 
*);
@@ -616,7 +616,7 @@ public:
     bool            Expand( SvTreeListEntry* pParent );
     bool            Collapse( SvTreeListEntry* pParent );
     bool            Select( SvTreeListEntry* pEntry, bool bSelect=true );
-    sal_uInt32      SelectChildren( SvTreeListEntry* pParent, bool bSelect );
+    sal_uInt32      SelectChildren( const SvTreeListEntry* pParent, bool 
bSelect );
     void            SelectAll( bool bSelect );
 
     void SetCurEntry( SvTreeListEntry* _pEntry );
diff --git a/o3tl/qa/cow_wrapper_clients.hxx b/o3tl/qa/cow_wrapper_clients.hxx
index dac1a3da0311..0c0f4aeb7b5c 100644
--- a/o3tl/qa/cow_wrapper_clients.hxx
+++ b/o3tl/qa/cow_wrapper_clients.hxx
@@ -173,7 +173,7 @@ struct BogusRefCountPolicy
         }
         return rCount != 0;
     }
-    static std::size_t getCount( ref_count_t& rCount) { return rCount; }
+    static std::size_t getCount( const ref_count_t& rCount) { return rCount; }
 };
 
 class cow_wrapper_client5
diff --git a/oox/inc/drawingml/chart/stylemodel.hxx 
b/oox/inc/drawingml/chart/stylemodel.hxx
index 55427a2b1c0c..ba93b63abbc9 100644
--- a/oox/inc/drawingml/chart/stylemodel.hxx
+++ b/oox/inc/drawingml/chart/stylemodel.hxx
@@ -43,7 +43,7 @@ struct StyleEntryModel
     TextCharacterPropsRef mrTextCharacterProperties;
     TextBodyPropsRef mxBodyPr;
 
-    model::StyleEntry toStyleEntry(oox::core::XmlFilterBase& rFilter);
+    model::StyleEntry toStyleEntry(const oox::core::XmlFilterBase& rFilter);
 };
 
 // Holds the contents of a cs:CT_ChartStyle
diff --git a/oox/source/drawingml/chart/chartconverter.cxx 
b/oox/source/drawingml/chart/chartconverter.cxx
index db4291acb929..3315336d8ad6 100644
--- a/oox/source/drawingml/chart/chartconverter.cxx
+++ b/oox/source/drawingml/chart/chartconverter.cxx
@@ -156,8 +156,8 @@ Reference< XDataSequence > 
ChartConverter::createDataSequence(
 // ===========
 // ChartStyleConverter
 // ===========
-void ChartStyleConverter::convertFromModel(XmlFilterBase& rFilter,
-        StyleModel& rChartStyleModel,
+void ChartStyleConverter::convertFromModel(const XmlFilterBase& rFilter,
+        const StyleModel& rChartStyleModel,
         const Reference< XChartStyle >& rxChartStyle)
 {
     OSL_ENSURE( rxChartStyle.is(), "ChartStyleConverter::convertFromModel - 
missing chart style" );
diff --git a/oox/source/drawingml/chart/stylemodel.cxx 
b/oox/source/drawingml/chart/stylemodel.cxx
index ccb8f2634832..45acbeb558fb 100644
--- a/oox/source/drawingml/chart/stylemodel.cxx
+++ b/oox/source/drawingml/chart/stylemodel.cxx
@@ -22,7 +22,7 @@
 
 namespace oox::drawingml::chart
 {
-model::StyleEntry StyleEntryModel::toStyleEntry(oox::core::XmlFilterBase& 
rFilter)
+model::StyleEntry StyleEntryModel::toStyleEntry(const 
oox::core::XmlFilterBase& rFilter)
 {
     std::shared_ptr<PropertyMap> aCharMap = std::make_shared<PropertyMap>();
     if (mrTextCharacterProperties)
diff --git a/oox/source/drawingml/diagram/datamodel_oox.cxx 
b/oox/source/drawingml/diagram/datamodel_oox.cxx
index fe1e45c0a95f..26d1d168adc7 100644
--- a/oox/source/drawingml/diagram/datamodel_oox.cxx
+++ b/oox/source/drawingml/diagram/datamodel_oox.cxx
@@ -61,7 +61,7 @@ Shape* DiagramData_oox::getOrCreateAssociatedShape(const 
svx::diagram::Point& rP
     return rShapePtr.get();
 }
 
-void DiagramData_oox::writeDiagramReplacement(DrawingML& rOriginalDrawingML, 
sax_fastparser::FSHelperPtr& rTarget)
+void DiagramData_oox::writeDiagramReplacement(DrawingML& rOriginalDrawingML, 
const sax_fastparser::FSHelperPtr& rTarget)
 {
     if (!rTarget)
         return;
@@ -110,7 +110,7 @@ void DiagramData_oox::writeDiagramReplacement(DrawingML& 
rOriginalDrawingML, sax
     rTarget->endDocument();
 }
 
-void DiagramData_oox::writeDiagramData(DrawingML& rOriginalDrawingML, 
sax_fastparser::FSHelperPtr& rTarget, std::u16string_view rDrawingRelId)
+void DiagramData_oox::writeDiagramData(DrawingML& rOriginalDrawingML, const 
sax_fastparser::FSHelperPtr& rTarget, std::u16string_view rDrawingRelId)
 {
     if (!rTarget)
         return;
diff --git a/oox/source/drawingml/diagram/datamodel_oox.hxx 
b/oox/source/drawingml/diagram/datamodel_oox.hxx
index 0ad26fc605dc..1a0cfbb79758 100644
--- a/oox/source/drawingml/diagram/datamodel_oox.hxx
+++ b/oox/source/drawingml/diagram/datamodel_oox.hxx
@@ -57,8 +57,8 @@ public:
     Shape* getOrCreateAssociatedShape(const svx::diagram::Point& rPoint, bool 
bCreateOnDemand = false) const;
 
     // helpers to write some specific DiagramDoms
-    void writeDiagramReplacement(DrawingML& rOriginalDrawingML, 
sax_fastparser::FSHelperPtr& rTarget);
-    void writeDiagramData(DrawingML& rOriginalDrawingML, 
sax_fastparser::FSHelperPtr& rTarget, std::u16string_view rDrawingRelId);
+    void writeDiagramReplacement(DrawingML& rOriginalDrawingML, const 
sax_fastparser::FSHelperPtr& rTarget);
+    void writeDiagramData(DrawingML& rOriginalDrawingML, const 
sax_fastparser::FSHelperPtr& rTarget, std::u16string_view rDrawingRelId);
 
 private:
     // The model definition, the parts *only* available in oox. Also look for 
already
diff --git a/oox/source/drawingml/diagram/diagramhelper_oox.cxx 
b/oox/source/drawingml/diagram/diagramhelper_oox.cxx
index 29294a3313bb..479e5472db73 100644
--- a/oox/source/drawingml/diagram/diagramhelper_oox.cxx
+++ b/oox/source/drawingml/diagram/diagramhelper_oox.cxx
@@ -441,7 +441,7 @@ void DiagramHelper_oox::applyDiagramDataState(const 
DiagramDataStatePtr& rState)
     mpDiagramPtr->getData()->applyDiagramDataState(rState);
 }
 
-void DiagramHelper_oox::doAnchor(uno::Reference<drawing::XShape>& rTarget)
+void DiagramHelper_oox::doAnchor(const uno::Reference<drawing::XShape>& 
rTarget)
 {
     if (!mpDiagramPtr || !rTarget)
     {
diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index 534f07d47152..5764ed1a0b53 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -719,7 +719,7 @@ void 
lcl_AdaptAndNormalizeLightDirections(std::vector<basegfx::B3DVector>& rLigh
     Does nothing if property does not exist.
     @param [in] rPropertyMap should contain valid value in RotateAngle property
     @param [out] fX, fY rotation angle in unit rad with orientation as in 
API.*/
-void lcl_getXYAnglesFromMap(oox::PropertyMap& rPropertyMap, double& rfX, 
double& rfY)
+void lcl_getXYAnglesFromMap(const oox::PropertyMap& rPropertyMap, double& rfX, 
double& rfY)
 {
     if (!rPropertyMap.hasProperty(oox::PROP_RotateAngle))
         return;
diff --git a/reportdesign/qa/unit/ReportDesignBasicTests.cxx 
b/reportdesign/qa/unit/ReportDesignBasicTests.cxx
index 875aca028be9..8ea734552f66 100644
--- a/reportdesign/qa/unit/ReportDesignBasicTests.cxx
+++ b/reportdesign/qa/unit/ReportDesignBasicTests.cxx
@@ -31,8 +31,8 @@ class RptBasicTest : public ReportDesignTestBase
 {
 public:
     void testLoadingAndSaving(const OUString& rFilterName, const OUString& 
rReportName,
-                              Reference<frame::XComponentLoader>& 
xComponentLoader,
-                              Reference<XConnection>& xActiveConnection);
+                              const Reference<frame::XComponentLoader>& 
xComponentLoader,
+                              const Reference<XConnection>& xActiveConnection);
 };
 
 CPPUNIT_TEST_FIXTURE(RptBasicTest, roundTripTest)
@@ -116,8 +116,8 @@ CPPUNIT_TEST_FIXTURE(RptBasicTest, 
multiGroupingSameFieldIntervals)
 }
 
 void RptBasicTest::testLoadingAndSaving(const OUString& rFilterName, const 
OUString& rReportName,
-                                        Reference<frame::XComponentLoader>& 
xComponentLoader,
-                                        Reference<XConnection>& 
xActiveConnection)
+                                        const 
Reference<frame::XComponentLoader>& xComponentLoader,
+                                        const Reference<XConnection>& 
xActiveConnection)
 {
     ::comphelper::NamedValueCollection aLoadArgs;
     aLoadArgs.put(u"ActiveConnection"_ustr, xActiveConnection);
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index b6eb797658bb..2bbd83f90553 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -227,7 +227,7 @@ public:
     void        SetKeepFmt(bool bSet)           { bKeepFmt = bSet; }
     bool        IsStripData() const             { return bStripData; }
     void        SetStripData(bool bSet)         { bStripData = bSet; }
-    void        SetTableType(OUString& sTableType) { aTableType = sTableType; }
+    void        SetTableType(const OUString& sTableType) { aTableType = 
sTableType; }
     const OUString& GetTableType() const           { return aTableType; }
 
     void        SetContainer( ScDBDataContainerBase* pContainer ) { 
mpContainer = pContainer; }
diff --git a/sc/inc/tablestyle.hxx b/sc/inc/tablestyle.hxx
index 57fbd8046b14..81e0f9d661b7 100644
--- a/sc/inc/tablestyle.hxx
+++ b/sc/inc/tablestyle.hxx
@@ -71,7 +71,7 @@ private:
 public:
     ScTableStyle(const OUString& rName, const std::optional<OUString>& 
rUIName);
 
-    static bool HasFontAttrSet(ScPatternAttr* pPattern);
+    static bool HasFontAttrSet(const ScPatternAttr* pPattern);
     const SfxItemSet* GetFontItemSet(const ScDBData& rDBData, SCCOL nCol, 
SCROW nRow,
                                      SCROW nRowIndex) const;
     const SvxBrushItem* GetFillItem(const ScDBData& rDBData, SCCOL nCol, SCROW 
nRow,
diff --git a/sc/qa/unit/PivotTableFormatsImportExport.cxx 
b/sc/qa/unit/PivotTableFormatsImportExport.cxx
index ca58c0f8002d..a39fb9430ec7 100644
--- a/sc/qa/unit/PivotTableFormatsImportExport.cxx
+++ b/sc/qa/unit/PivotTableFormatsImportExport.cxx
@@ -36,28 +36,28 @@ 
ScPivotTableFormatsImportExport::ScPivotTableFormatsImportExport()
 {
 }
 
-ScAddress parseAddress(ScDocument& rDoc, OUString const& rAddressString)
+ScAddress parseAddress(const ScDocument& rDoc, OUString const& rAddressString)
 {
     ScAddress aAddress;
     aAddress.Parse(rAddressString, rDoc);
     return aAddress;
 }
 
-Color getBackgroundColor(ScDocument& rDoc, OUString const& rAddressString)
+Color getBackgroundColor(const ScDocument& rDoc, OUString const& 
rAddressString)
 {
     const ScPatternAttr* pPattern = rDoc.GetPattern(parseAddress(rDoc, 
rAddressString));
     const SvxBrushItem& rItem = pPattern->GetItem(ATTR_BACKGROUND);
     return rItem.GetColor();
 }
 
-Color getFontColor(ScDocument& rDoc, OUString const& rAddressString)
+Color getFontColor(const ScDocument& rDoc, OUString const& rAddressString)
 {
     const ScPatternAttr* pPattern = rDoc.GetPattern(parseAddress(rDoc, 
rAddressString));
     const SvxColorItem& rItem = pPattern->GetItem(ATTR_FONT_COLOR);
     return rItem.getColor();
 }
 
-bool getCellProtection(ScDocument& rDoc, OUString const& rAddressString)
+bool getCellProtection(const ScDocument& rDoc, OUString const& rAddressString)
 {
     const ScPatternAttr* pPattern = rDoc.GetPattern(parseAddress(rDoc, 
rAddressString));
     const ScProtectionAttr& rItem = pPattern->GetItem(ATTR_PROTECTION);
@@ -197,7 +197,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
     assertDataFieldInColumnAndTwoRowFields_DataColor(*getScDoc());
 }
 
-void assertSingleDataFieldInColumn_DataColor(ScDocument& rDoc)
+void assertSingleDataFieldInColumn_DataColor(const ScDocument& rDoc)
 {
     CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"J8"_ustr));
     CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getBackgroundColor(rDoc, u"J12"_ustr));
@@ -213,7 +213,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
     assertSingleDataFieldInColumn_DataColor(*getScDoc());
 }
 
-void assertTwoRowTwoColumnFields_DataColor(ScDocument& rDoc)
+void assertTwoRowTwoColumnFields_DataColor(const ScDocument& rDoc)
 {
     CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"I7"_ustr));
     CPPUNIT_ASSERT_EQUAL(Color(0xFFC000), getBackgroundColor(rDoc, 
u"J8"_ustr));
@@ -255,7 +255,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
     assertDataFieldInRow_DataColor(*getScDoc());
 }
 
-void assertMultipleSelections(ScDocument& rDoc)
+void assertMultipleSelections(const ScDocument& rDoc)
 {
     CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"I5"_ustr));
     CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"I6"_ustr));
diff --git a/sc/qa/unit/ThemeImportExportTest.cxx 
b/sc/qa/unit/ThemeImportExportTest.cxx
index ef91380650fd..b33e4e07c2aa 100644
--- a/sc/qa/unit/ThemeImportExportTest.cxx
+++ b/sc/qa/unit/ThemeImportExportTest.cxx
@@ -163,7 +163,7 @@ sal_Int32 roundToPercent(sal_Int16 n100Percent)
     return sal_Int32(std::round(double(n100Percent) / 100.0));
 }
 
-void checkCellBackgroundThemeColor(ScDocument* pDoc)
+void checkCellBackgroundThemeColor(const ScDocument* pDoc)
 {
     // A1
     {
@@ -234,7 +234,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, 
testCellBackgroundThemeColorODF)
     checkCellBackgroundThemeColor(getScDoc());
 }
 
-void checkCellTextThemeColor(ScDocument* pDoc)
+void checkCellTextThemeColor(const ScDocument* pDoc)
 {
     // B1
     {
@@ -305,7 +305,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, 
testCellTextThemeColorODF)
     checkCellTextThemeColor(getScDoc());
 }
 
-void checkCellBorderThemeColor(ScDocument* pDoc)
+void checkCellBorderThemeColor(const ScDocument* pDoc)
 {
     // C1
     {
diff --git a/sc/qa/unit/cond_format.cxx b/sc/qa/unit/cond_format.cxx
index 26881a54a2bd..b2d09b715a06 100644
--- a/sc/qa/unit/cond_format.cxx
+++ b/sc/qa/unit/cond_format.cxx
@@ -31,7 +31,7 @@ public:
 
 namespace
 {
-void checkConditionalFormatList(ScDocument& rDoc,
+void checkConditionalFormatList(const ScDocument& rDoc,
                                 std::unordered_map<OUString, OUString>& 
rExpectedValues)
 {
     ScConditionalFormatList* pList = rDoc.GetCondFormList(0);
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index 5cdf27482087..759f65f71f9d 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -111,7 +111,7 @@ ScMarkData::MarkedTabsType TabsInRange(const ScRange& r)
     return aResult;
 }
 
-void lcl_copy( const OUString& rSrcRange, const OUString& rDstRange, 
ScDocument& rDoc, ScTabViewShell* pViewShell)
+void lcl_copy( const OUString& rSrcRange, const OUString& rDstRange, const 
ScDocument& rDoc, ScTabViewShell* pViewShell)
 {
     ScDocument aClipDoc(SCDOCMODE_CLIP);
 
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 6e513ba7ff65..f00e31e1081b 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -336,7 +336,7 @@ void ScModelTestBase::insertArrayToCell(const OUString& 
rCell, std::u16string_vi
     Scheduler::ProcessEventsToIdle();
 }
 
-void ScModelTestBase::insertNewSheet(ScDocument& rDoc)
+void ScModelTestBase::insertNewSheet(const ScDocument& rDoc)
 {
     sal_Int16 nTabs = rDoc.GetTableCount();
 
@@ -486,7 +486,7 @@ static std::vector<OUString> 
getChartRangeRepresentations(const SdrOle2Obj& rCha
     return aRangeReps;
 }
 
-ScRangeList ScModelTestBase::getChartRanges(ScDocument& rDoc, const 
SdrOle2Obj& rChartObj)
+ScRangeList ScModelTestBase::getChartRanges(const ScDocument& rDoc, const 
SdrOle2Obj& rChartObj)
 {
     std::vector<OUString> aRangeReps = getChartRangeRepresentations(rChartObj);
     ScRangeList aRanges;
@@ -950,7 +950,7 @@ bool ScUcalcTestBase::insertRangeNames(
     return true;
 }
 
-OUString ScUcalcTestBase::getRangeByName(ScDocument* pDoc, const OUString& 
aRangeName)
+OUString ScUcalcTestBase::getRangeByName(const ScDocument* pDoc, const 
OUString& aRangeName)
 {
     ScRangeData* pName = 
pDoc->GetRangeName()->findByUpperName(aRangeName.toAsciiUpperCase());
     CPPUNIT_ASSERT(pName);
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 6e3584aa230f..2c73bee0f1e1 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -123,7 +123,7 @@ public:
                                         bool bCreateUndo);
     bool insertRangeNames(ScDocument* pDoc, ScRangeName* pNames, const 
RangeNameDef* p,
                                        const RangeNameDef* pEnd);
-    OUString getRangeByName(ScDocument* pDoc, const OUString& aRangeName);
+    OUString getRangeByName(const ScDocument* pDoc, const OUString& 
aRangeName);
     void printFormula(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab,
                                            const char* pCaption = nullptr);
     void printRange(ScDocument* pDoc, const ScRange& rRange, const char* 
pCaption,
@@ -173,7 +173,7 @@ public:
 
     const SdrOle2Obj* getSingleChartObject(ScDocument& rDoc, sal_uInt16 nPage);
 
-    ScRangeList getChartRanges(ScDocument& rDoc, const SdrOle2Obj& rChartObj);
+    ScRangeList getChartRanges(const ScDocument& rDoc, const SdrOle2Obj& 
rChartObj);
 
     void testFormats(ScDocument* pDoc,std::u16string_view sFormat);
 
@@ -181,7 +181,7 @@ public:
     void typeString(std::u16string_view rStr);
     void insertStringToCell(const OUString& rCell, std::u16string_view rStr);
     void insertArrayToCell(const OUString& rCell, std::u16string_view rStr);
-    void insertNewSheet(ScDocument& rDoc);
+    void insertNewSheet(const ScDocument& rDoc);
     void executeAutoSum();
     void selectObjectByName(std::u16string_view rObjName);
     void checkCurrentCursorPosition(ScDocShell& rDocSh, std::u16string_view 
rStr);
diff --git a/sc/qa/unit/subsequent_export_test.cxx 
b/sc/qa/unit/subsequent_export_test.cxx
index 03a7a742648f..98832904122d 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -619,7 +619,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testXfDefaultValuesXLSX)
     assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf", 14);
 }
 
-static auto verifySpreadsheet13(char const* const pTestName, ScDocument& rDoc) 
-> void
+static auto verifySpreadsheet13(char const* const pTestName, const ScDocument& 
rDoc) -> void
 {
     // OFFICE-2173 table:tab-color
     CPPUNIT_ASSERT_EQUAL_MESSAGE(pTestName, Color(0xff3838), 
rDoc.GetTabBgColor(0));
diff --git a/sc/qa/unit/subsequent_export_test3.cxx 
b/sc/qa/unit/subsequent_export_test3.cxx
index 45d09cf373bb..97cfcb0143e5 100644
--- a/sc/qa/unit/subsequent_export_test3.cxx
+++ b/sc/qa/unit/subsequent_export_test3.cxx
@@ -311,7 +311,7 @@ bool checkRange(ScChangeActionType eType, const ScBigRange& 
rExpected, const ScB
     return aExpected == aActual;
 }
 
-bool check(ScDocument& rDoc)
+bool check(const ScDocument& rDoc)
 {
     static const CheckItem aChecks[] = {
         { 1, SC_CAT_CONTENT, 1, 1, 0, 1, 1, 0, false },
@@ -502,7 +502,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetTabColorsXLSX)
 {
     struct
     {
-        bool checkContent(ScDocument& rDoc)
+        bool checkContent(const ScDocument& rDoc)
         {
             std::vector<OUString> aTabNames = rDoc.GetAllTableNames();
 
@@ -721,7 +721,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, 
testSharedFormulaExportXLSX)
 {
     struct
     {
-        bool checkContent(ScDocument& rDoc)
+        bool checkContent(const ScDocument& rDoc)
         {
             SCTAB nTabCount = rDoc.GetTableCount();
             if (nTabCount != 2)
@@ -815,7 +815,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, 
testSharedFormulaStringResultExportXLSX)
 {
     struct
     {
-        bool checkContent(ScDocument& rDoc)
+        bool checkContent(const ScDocument& rDoc)
         {
             {
                 // B2:B7 should show A,B,...,F.
@@ -1090,7 +1090,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testRelativePathsODS)
 
 namespace
 {
-void testSheetProtection_Impl(ScDocument& rDoc)
+void testSheetProtection_Impl(const ScDocument& rDoc)
 {
     CPPUNIT_ASSERT(rDoc.IsTabProtected(0));
     const ScTableProtection* pTabProtection = rDoc.GetTabProtection(0);
diff --git a/sc/qa/unit/subsequent_export_test5.cxx 
b/sc/qa/unit/subsequent_export_test5.cxx
index 9d65ce41bf07..60c525a8ffeb 100644
--- a/sc/qa/unit/subsequent_export_test5.cxx
+++ b/sc/qa/unit/subsequent_export_test5.cxx
@@ -535,7 +535,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest5, testTdf148820)
 
 namespace
 {
-void lcl_TestNumberFormat(ScDocument& rDoc, const OUString& rFormatStrOK)
+void lcl_TestNumberFormat(const ScDocument& rDoc, const OUString& rFormatStrOK)
 {
     sal_uInt32 nNumberFormat = rDoc.GetNumberFormat(0, 0, 0);
     const SvNumberformat* pNumberFormat = 
rDoc.GetFormatTable()->GetEntry(nNumberFormat);
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index 1f591c73cd67..f6d82f780c14 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -1675,7 +1675,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testNamedTableRef)
 
 namespace
 {
-void testCells(ScDocument* pDoc)
+void testCells(const ScDocument* pDoc)
 {
     {
         const EditTextObject* pObj = pDoc->GetEditText(ScAddress(0, 0, 0));
diff --git a/sc/source/core/data/tablestyle.cxx 
b/sc/source/core/data/tablestyle.cxx
index 806d75765e2c..929c0a46001d 100644
--- a/sc/source/core/data/tablestyle.cxx
+++ b/sc/source/core/data/tablestyle.cxx
@@ -20,7 +20,7 @@ ScTableStyle::ScTableStyle(const OUString& rName, const 
std::optional<OUString>&
 {
 }
 
-bool ScTableStyle::HasFontAttrSet(ScPatternAttr* pPattern)
+bool ScTableStyle::HasFontAttrSet(const ScPatternAttr* pPattern)
 {
     // TODO: maybe different pPatterns can have different font attributes, and
     // now we only check if any font attribute is set on a pattern.
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index ba290f9eefb4..759c57f6e502 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -2282,7 +2282,7 @@ ScDBData* ScDBCollection::GetDBAtArea(SCTAB nTab, SCCOL 
nCol1, SCROW nRow1, SCCO
 
 namespace {
 
-bool intersectsRange(const ScDBData* pDBData, ScRange& rRange)
+bool intersectsRange(const ScDBData* pDBData, const ScRange& rRange)
 {
     ScRange aRange;
     pDBData->GetArea(aRange);
diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index b2ce7ac4f7e7..08eceeccfea4 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1238,7 +1238,7 @@ void XclExpTbxControlObj::SaveVml(XclExpXmlStream& rStrm)
                                       /*pWrapAttrList=*/nullptr, 
/*bOOxmlExport=*/true, mnShapeId);
 }
 
-void XclExpTbxControlObj::WriteAnchor(sax_fastparser::FSHelperPtr& rTarget, 
bool bIsDrawing) const
+void XclExpTbxControlObj::WriteAnchor(const sax_fastparser::FSHelperPtr& 
rTarget, bool bIsDrawing) const
 {
     tools::Rectangle aAreaFrom;
     tools::Rectangle aAreaTo;
diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index 1de3b0f06830..7072f3429c52 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -875,7 +875,7 @@ public:
 };
 
 /** Combines all the data in RowOrColumnMemberResultData and writes the 
row/column items */
-void writeRowColumnItems(sal_Int32 nItemElement, RowOrColumnMemberResultData& 
rMemberResultData, sax_fastparser::FSHelperPtr& pStream)
+void writeRowColumnItems(sal_Int32 nItemElement, RowOrColumnMemberResultData& 
rMemberResultData, const sax_fastparser::FSHelperPtr& pStream)
 {
     if (rMemberResultData.maItemsData.empty() || 
rMemberResultData.maFieldOrder.empty())
     {
diff --git a/sc/source/filter/inc/xeescher.hxx 
b/sc/source/filter/inc/xeescher.hxx
index bca4b8801ef2..e0753f333536 100644
--- a/sc/source/filter/inc/xeescher.hxx
+++ b/sc/source/filter/inc/xeescher.hxx
@@ -277,7 +277,7 @@ private:
     /** Writes the ftSbs sub structure containing scrollbar data. */
     void                WriteSbs( XclExpStream& rStrm );
     /** Writes an anchor, if empty calculates one form XShape */
-    void                WriteAnchor( sax_fastparser::FSHelperPtr& rTarget, 
bool bIsDrawing ) const;
+    void                WriteAnchor( const sax_fastparser::FSHelperPtr& 
rTarget, bool bIsDrawing ) const;
 
 private:
     const css::uno::Reference< css::drawing::XShape > mxShape;
diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 5e6bd34fb5fd..fd3e66b53895 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -4208,7 +4208,7 @@ void ScXMLExport::WriteExternalDataMapping(ScDocument& 
rDoc)
     }
 }
 
-void ScXMLExport::WriteExternalDataTransformations(ScDocument& rDoc, const 
std::vector<std::shared_ptr<sc::DataTransformation>>& aDataTransformations)
+void ScXMLExport::WriteExternalDataTransformations(const ScDocument& rDoc, 
const std::vector<std::shared_ptr<sc::DataTransformation>>& 
aDataTransformations)
 {
     SvXMLElementExport aTransformations(*this, XML_NAMESPACE_CALC_EXT, 
XML_DATA_TRANSFORMATIONS, true, true);
     for (auto& itr : aDataTransformations)
diff --git a/sc/source/filter/xml/xmlexprt.hxx 
b/sc/source/filter/xml/xmlexprt.hxx
index 6c4c7bea4656..3c75397135b7 100644
--- a/sc/source/filter/xml/xmlexprt.hxx
+++ b/sc/source/filter/xml/xmlexprt.hxx
@@ -194,7 +194,7 @@ class ScXMLExport : public SvXMLExport
     void WriteLabelRanges(const ScDocument& rDoc, const css::uno::Reference< 
css::container::XIndexAccess >& xRangesIAccess, bool bColumn);
     void WriteNamedExpressions(const ScDocument& rDoc);
     void WriteExternalDataMapping(ScDocument& rDoc);
-    void WriteExternalDataTransformations(ScDocument& rDoc, const 
std::vector<std::shared_ptr<sc::DataTransformation>>& rDataTransformations);
+    void WriteExternalDataTransformations(const ScDocument& rDoc, const 
std::vector<std::shared_ptr<sc::DataTransformation>>& rDataTransformations);
     void WriteDataStream(ScDocument& rDoc);
     void WriteNamedRange(const ScDocument& rDoc, ScRangeName* pRangeName);
     void exportSparklineGroups(ScDocument& rDoc, SCTAB nTab);
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index b66041a96212..b3db4c8b19e8 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -248,7 +248,7 @@ public:
     DECL_STATIC_LINK(LinkHelp, DispatchHelpLinksHdl, weld::Button&, void);
 };
 
-void lcl_setLOKLocale(ScTabViewShell& rViewShell, const LanguageType eLang)
+void lcl_setLOKLocale(const ScTabViewShell& rViewShell, const LanguageType 
eLang)
 {
     OUString aLang = LanguageTag(eLang).getBcp47();
     /// This is only used for building the lok calendar as of date.
diff --git a/sc/source/ui/inc/conflictsdlg.hxx 
b/sc/source/ui/inc/conflictsdlg.hxx
index 8972bc43d3e3..b33de7bda53d 100644
--- a/sc/source/ui/inc/conflictsdlg.hxx
+++ b/sc/source/ui/inc/conflictsdlg.hxx
@@ -123,7 +123,7 @@ private:
     std::unique_ptr<SvxRedlineTable> m_xLbConflicts;
 
     OUString            GetConflictString( const ScConflictsListEntry& 
rConflictEntry );
-    void                SetActionString(ScChangeAction& rAction, ScDocument& 
rDoc, const weld::TreeIter& rEntry);
+    void                SetActionString(const ScChangeAction& rAction, 
ScDocument& rDoc, const weld::TreeIter& rEntry);
     void                HandleListBoxSelection();
 
     void                SetConflictAction(const weld::TreeIter& rRootEntry, 
ScConflictAction eConflictAction);
diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx
index 8fc61982788b..6965b5980683 100644
--- a/sc/source/ui/inc/dbfunc.hxx
+++ b/sc/source/ui/inc/dbfunc.hxx
@@ -36,7 +36,7 @@ class SAL_DLLPUBLIC_RTTI ScDBFunc : public ScViewFunc
 private:
     void GetSelectedMemberList(ScDPUniqueStringSet& rEntries, tools::Long& 
rDimension);
     static void ModifiedAutoFilter(ScDocShell& rDocSh);
-    static void ApplyAutoFilter(ScDocShell& rDocSh, ScViewData& rViewData, 
ScDBData* pDBData,
+    static void ApplyAutoFilter(ScDocShell& rDocSh, const ScViewData& 
rViewData, ScDBData* pDBData,
                                 SCROW nRow, SCTAB nTab, const ScQueryParam& 
aParam);
 
     DECL_STATIC_LINK(ScDBFunc, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
diff --git a/sc/source/ui/inc/notemark.hxx b/sc/source/ui/inc/notemark.hxx
index e66f10f326e7..97a2d2c3f94b 100644
--- a/sc/source/ui/inc/notemark.hxx
+++ b/sc/source/ui/inc/notemark.hxx
@@ -50,7 +50,7 @@ class ScNoteOverlay : public Timer
 public:
     ScNoteOverlay(
         ScGridWindow& rScGridWindow,
-        ScAddress& aPos,
+        const ScAddress& aPos,
         OUString aUser,
         bool bLeftEdge,
         bool bForce,
diff --git a/sc/source/ui/inc/sharedocdlg.hxx b/sc/source/ui/inc/sharedocdlg.hxx
index 14da5c13a8fb..56b6fedec201 100644
--- a/sc/source/ui/inc/sharedocdlg.hxx
+++ b/sc/source/ui/inc/sharedocdlg.hxx
@@ -44,7 +44,7 @@ private:
     DECL_LINK(SizeAllocated, const Size&, void);
 
 public:
-    ScShareDocumentDlg(weld::Window* pParent, ScViewData& rViewData);
+    ScShareDocumentDlg(weld::Window* pParent, const ScViewData& rViewData);
     virtual ~ScShareDocumentDlg() override;
 
     bool                IsShareDocumentChecked() const;
diff --git a/sc/source/ui/inc/tableshell.hxx b/sc/source/ui/inc/tableshell.hxx
index 9d3cc5629b46..1e2969ebdadd 100644
--- a/sc/source/ui/inc/tableshell.hxx
+++ b/sc/source/ui/inc/tableshell.hxx
@@ -32,7 +32,7 @@ public:
     ScTableShell(ScTabViewShell* pView);
     virtual ~ScTableShell() override;
 
-    void ExecuteDatabaseSettings(SfxRequest& rReq);
+    void ExecuteDatabaseSettings(const SfxRequest& rReq);
     void GetDatabaseSettings(SfxItemSet& rSet);
 
 private:
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 075653246171..aed89a5aad94 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -354,7 +354,7 @@ public:
                                     SCROW nEndRow , SCCOL nEndCol ,
                                     
std::vector<std::unique_ptr<ScDataFormFragment>>& rEdits,
                                     sal_uInt16 aColLength);
-    void UpdateSelectionArea(const ScMarkData& rSel, ScPatternAttr* pAttr = 
nullptr,
+    void UpdateSelectionArea(const ScMarkData& rSel, const ScPatternAttr* 
pAttr = nullptr,
                              bool adjustHeight = true);
 
     void            OnLOKInsertDeleteColumn(SCCOL nStartCol, tools::Long 
nOffset);
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx 
b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 026414b191c9..a8513e0a36c7 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -385,7 +385,7 @@ OUString ScConflictsDlg::GetConflictString( const 
ScConflictsListEntry& rConflic
     return aString;
 }
 
-void ScConflictsDlg::SetActionString(ScChangeAction& rAction, ScDocument& 
rDoc, const weld::TreeIter& rEntry)
+void ScConflictsDlg::SetActionString(const ScChangeAction& rAction, 
ScDocument& rDoc, const weld::TreeIter& rEntry)
 {
 
     weld::TreeView& rTreeView = m_xLbConflicts->GetWidget();
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx 
b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 54b0ab6897cc..0a5b9b405d8f 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -51,7 +51,7 @@ IMPL_LINK(ScShareDocumentDlg, SizeAllocated, const Size&, 
rSize, void)
 }
 
 
-ScShareDocumentDlg::ScShareDocumentDlg(weld::Window* pParent, ScViewData& 
rViewData)
+ScShareDocumentDlg::ScShareDocumentDlg(weld::Window* pParent, const 
ScViewData& rViewData)
     : GenericDialogController(pParent, 
u"modules/scalc/ui/sharedocumentdlg.ui"_ustr,
                               u"ShareDocumentDialog"_ustr)
     , m_aStrNoUserData(ScResId(STR_NO_USER_DATA_AVAILABLE))
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index dbe500a0c8d8..3317075096ad 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -379,7 +379,7 @@ IMPL_STATIC_LINK_NOARG(ScDBFunc, InstallLOKNotifierHdl, 
void*, vcl::ILibreOffice
     return GetpApp();
 }
 
-void ScDBFunc::ApplyAutoFilter(ScDocShell& rDocSh, ScViewData& rViewData, 
ScDBData* pDBData,
+void ScDBFunc::ApplyAutoFilter(ScDocShell& rDocSh, const ScViewData& 
rViewData, ScDBData* pDBData,
                                SCROW nRow, SCTAB nTab, const ScQueryParam& 
aParam)
 {
     ScDocument& rDoc = rViewData.GetDocument();
diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index e7fe6376c61f..f25e5bd70611 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -35,7 +35,7 @@
 
 ScNoteOverlay::ScNoteOverlay(
     ScGridWindow& rScGridWindow,
-    ScAddress& aPos,
+    const ScAddress& aPos,
     OUString aUser,
     bool bLeftEdge,
     bool bForce,
diff --git a/sc/source/ui/view/tableshell.cxx b/sc/source/ui/view/tableshell.cxx
index 19d3152ecfc8..01884910d276 100644
--- a/sc/source/ui/view/tableshell.cxx
+++ b/sc/source/ui/view/tableshell.cxx
@@ -58,7 +58,7 @@ const ScDBData* ScTableShell::GetTableDBDataAtCursor()
                                                       ScDBDataPortion::AREA);
 }
 
-void ScTableShell::ExecuteDatabaseSettings(SfxRequest& rReq)
+void ScTableShell::ExecuteDatabaseSettings(const SfxRequest& rReq)
 {
     const SfxItemSet* pSet = rReq.GetArgs();
     sal_uInt16 nSlot = rReq.GetSlot();
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 1802e75285f6..0c29af5fbabd 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -674,7 +674,7 @@ void ScViewFunc::EnterDataToCurrentCell(const OUString& 
rString, const EditTextO
 
 namespace
 {
-bool checkFormula(ScDocument& rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const 
OUString& rString)
+bool checkFormula(const ScDocument& rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, 
const OUString& rString)
 {
     // do not check formula if it is a text cell
     sal_uInt32 format = rDoc.GetNumberFormat(nCol, nRow, nTab );
@@ -3365,7 +3365,7 @@ void ScViewFunc::InsertNameList()
         pDocSh->UpdateOle(GetViewData());
 }
 
-void ScViewFunc::UpdateSelectionArea(const ScMarkData& rSel, ScPatternAttr* 
pAttr,
+void ScViewFunc::UpdateSelectionArea(const ScMarkData& rSel, const 
ScPatternAttr* pAttr,
                                      bool adjustHeight)
 {
     ScDocShell* pDocShell = GetViewData().GetDocShell();
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 6a5c088e011e..31c6691f8747 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -1072,7 +1072,7 @@ public:
      *  @return The newly created master page.
      */
     SdPage* AddNewMasterPageFromExisting(
-        SdPage* pSourceMasterPage,
+        const SdPage* pSourceMasterPage,
         SdDrawDocument* pBookmarkDoc = nullptr,
         bool bUndo = true,
         const OUString& sNewName = OUString());
@@ -1156,7 +1156,7 @@ private:
         bool bIsPageObj);
 
     SAL_DLLPRIVATE void populatePagePreviewsGrid();
-    SAL_DLLPRIVATE void updatePagePreviewsGrid(SdPage* pPage);
+    SAL_DLLPRIVATE void updatePagePreviewsGrid(const SdPage* pPage);
     SAL_DLLPRIVATE void connectPagePreviews();
 
     SAL_DLLPRIVATE virtual void PageListChanged() override;
diff --git a/sd/inc/sdfilter.hxx b/sd/inc/sdfilter.hxx
index 103e88f502a6..cd67d46e50e7 100644
--- a/sd/inc/sdfilter.hxx
+++ b/sd/inc/sdfilter.hxx
@@ -70,6 +70,6 @@ SD_DLLPUBLIC bool ImportPPT(
 
 SD_DLLPUBLIC bool SaveVBA( SfxObjectShell& rDocShell, SvMemoryStream*& pBas );
 
-SD_DLLPUBLIC bool IsSlideSorterPaste(::sd::DrawDocShell& rDocSh);
+SD_DLLPUBLIC bool IsSlideSorterPaste(const ::sd::DrawDocShell& rDocSh);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index b9fb2939cf0a..ac15f7d5561a 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -800,7 +800,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf104445)
 
 namespace
 {
-bool checkPatternValues(std::vector<sal_uInt8>& rExpected, Bitmap& rBitmap)
+bool checkPatternValues(std::vector<sal_uInt8>& rExpected, const Bitmap& 
rBitmap)
 {
     bool bResult = true;
 
diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 130aafc2d1b6..b0cf899425e4 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -71,7 +71,7 @@ void LOKitSearchTest::lcl_replace(const OUString& rKey, const 
OUString& rReplace
 
 namespace
 {
-SdrObject* lclGetSelectedObject(sd::ViewShell* pViewShell)
+SdrObject* lclGetSelectedObject(const sd::ViewShell* pViewShell)
 {
     SdrView* pSdrView = pViewShell->GetView();
     const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
diff --git a/sd/source/console/PresenterScreen.cxx 
b/sd/source/console/PresenterScreen.cxx
index a23a63faadc9..c9f080a308a6 100644
--- a/sd/source/console/PresenterScreen.cxx
+++ b/sd/source/console/PresenterScreen.cxx
@@ -707,7 +707,7 @@ void PresenterScreen::ProcessLayout (
 }
 
 void PresenterScreen::ProcessViewDescriptions (
-    PresenterConfigurationAccess& rConfiguration)
+    const PresenterConfigurationAccess& rConfiguration)
 {
     try
     {
diff --git a/sd/source/console/PresenterScreen.hxx 
b/sd/source/console/PresenterScreen.hxx
index 8fc81bca2e0e..a96099734191 100644
--- a/sd/source/console/PresenterScreen.hxx
+++ b/sd/source/console/PresenterScreen.hxx
@@ -195,7 +195,7 @@ private:
     /** Read the view descriptions from the configuration.
     */
     void ProcessViewDescriptions (
-        PresenterConfigurationAccess& rConfiguration);
+        const PresenterConfigurationAccess& rConfiguration);
 
     /** Called by ProcessViewDescriptions for a single entry.
     */
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index c0c29e383ec4..3f1d556ba902 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -1733,7 +1733,7 @@ void SdDrawDocument::populatePagePreviewsGrid()
     }
 }
 
-void SdDrawDocument::updatePagePreviewsGrid(SdPage* pPage)
+void SdDrawDocument::updatePagePreviewsGrid(const SdPage* pPage)
 {
     if (mbSkipCanvasPreviewUpdates)
         return;
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index ea7d49fce206..ed141037ab70 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -2049,7 +2049,7 @@ void SdDrawDocument::Merge(SdrModel& rSourceModel,
 }
 
 SdPage* SdDrawDocument::AddNewMasterPageFromExisting(
-    SdPage* pSourceMasterPage,
+    const SdPage* pSourceMasterPage,
     SdDrawDocument* pBookmarkDoc,
     bool bUndo,
     const OUString& sNewName)
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 4f993d992c8f..f32241bbb298 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -1514,7 +1514,7 @@ static void CalcAutoLayoutRectangles( SdPage const & 
rPage,::tools::Rectangle* r
     }
 }
 
-static void GetAutoLayoutCustomPromptTexts( SdPage& rPage, const 
LayoutDescriptor& rDescriptor, std::array<OUString, MAX_PRESOBJS>& 
rCustomPrompts )
+static void GetAutoLayoutCustomPromptTexts( const SdPage& rPage, const 
LayoutDescriptor& rDescriptor, std::array<OUString, MAX_PRESOBJS>& 
rCustomPrompts )
 {
     // init layout shapes with their corresponding prompt text (if they have)
     // for each presentation shape kind
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 1ad8035ead0c..7f2375951e5e 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -130,7 +130,7 @@ using namespace oox;
 
 namespace
 {
-rtl::Reference<FastAttributeList> 
presentationNamespaces(oox::core::XmlFilterBase& rFilter)
+rtl::Reference<FastAttributeList> presentationNamespaces(const 
oox::core::XmlFilterBase& rFilter)
 {
     rtl::Reference<FastAttributeList> pAttributes = 
FastSerializerHelper::createAttrList();
     pAttributes->add(FSNS(XML_xmlns, XML_a), 
OUStringToOString(rFilter.getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8));
@@ -142,7 +142,7 @@ rtl::Reference<FastAttributeList> 
presentationNamespaces(oox::core::XmlFilterBas
     return pAttributes;
 }
 
-rtl::Reference<FastAttributeList> 
presentationPrNamespaces(oox::core::XmlFilterBase& rFilter)
+rtl::Reference<FastAttributeList> presentationPrNamespaces(const 
oox::core::XmlFilterBase& rFilter)
 {
     rtl::Reference<FastAttributeList> pAttributes = 
FastSerializerHelper::createAttrList();
     pAttributes->add(FSNS(XML_xmlns, XML_a), 
OUStringToOString(rFilter.getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8));
diff --git a/sd/source/filter/html/a11yex.cxx b/sd/source/filter/html/a11yex.cxx
index 0a330a1e41bc..da3c2c35ae7a 100644
--- a/sd/source/filter/html/a11yex.cxx
+++ b/sd/source/filter/html/a11yex.cxx
@@ -40,7 +40,7 @@ using namespace sdr::table;
 
 namespace
 {
-void CreateTitleDescription(SdrObject* pObject, OUStringBuffer& rHtml)
+void CreateTitleDescription(const SdrObject* pObject, OUStringBuffer& rHtml)
 {
     rHtml.append("<h2>");
     rHtml.append(pObject->GetTitle());
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx 
b/sd/source/filter/xml/sdxmlwrp.cxx
index 22fe0626ee4f..6df5e6a02c10 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -735,7 +735,7 @@ bool SdXMLFilter::Import( ErrCode& nError )
     return nRet == ERRCODE_NONE;
 }
 
-bool IsSlideSorterPaste(::sd::DrawDocShell& rDocSh)
+bool IsSlideSorterPaste(const ::sd::DrawDocShell& rDocSh)
 {
     uno::Reference<document::XDocumentProperties> xSource = 
rDocSh.getDocProperties();
     uno::Reference<beans::XPropertyContainer> xSourcePropertyContainer = 
xSource->getUserDefinedProperties();
diff --git a/sd/source/ui/inc/DrawViewShell.hxx 
b/sd/source/ui/inc/DrawViewShell.hxx
index 0130432afb2c..cf23e2a9d59c 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -205,7 +205,7 @@ public:
     void            ExecIMap( SfxRequest const & rReq );
     void            GetIMapState( SfxItemSet& rSet );
 
-    void            FuTransformDocumentStructure(SfxRequest& rReq);
+    void            FuTransformDocumentStructure(const SfxRequest& rReq);
     void            FuTemporary(SfxRequest& rReq);
     void            FuPermanent(SfxRequest& rReq);
     void            FuSupport(SfxRequest& rReq);
diff --git a/sd/source/ui/inc/MediaObjectBar.hxx 
b/sd/source/ui/inc/MediaObjectBar.hxx
index 2813a0be1dce..6d0473d4dddd 100644
--- a/sd/source/ui/inc/MediaObjectBar.hxx
+++ b/sd/source/ui/inc/MediaObjectBar.hxx
@@ -38,7 +38,7 @@ class MediaObjectBar final
 public:
     SFX_DECL_INTERFACE( SD_IF_SDDRAWMEDIAOBJECTBAR )
 
-    MediaObjectBar (ViewShell& rSdViewShell, ::sd::View* pSdView);
+    MediaObjectBar (const ViewShell& rSdViewShell, ::sd::View* pSdView);
     virtual ~MediaObjectBar() override;
 
     void            GetState( SfxItemSet& rSet );
diff --git a/sd/source/ui/inc/TextObjectBar.hxx 
b/sd/source/ui/inc/TextObjectBar.hxx
index ec1ecaced40c..0db669d853a2 100644
--- a/sd/source/ui/inc/TextObjectBar.hxx
+++ b/sd/source/ui/inc/TextObjectBar.hxx
@@ -45,9 +45,9 @@ public:
     virtual ~TextObjectBar() override;
 
     void GetAttrState( SfxItemSet& rSet );
-    static void GetAttrStateImpl(ViewShell& rViewShell, ::sd::View* pView, 
SfxItemSet& rSet, SfxShell* pTextObjectBar);
+    static void GetAttrStateImpl(const ViewShell& rViewShell, ::sd::View* 
pView, SfxItemSet& rSet, SfxShell* pTextObjectBar);
     void GetCharState( SfxItemSet& rSet );
-    static void GetCharStateImpl(ViewShell& rViewShell, const ::sd::View* 
pView, SfxItemSet& rSet);
+    static void GetCharStateImpl(const ViewShell& rViewShell, const 
::sd::View* pView, SfxItemSet& rSet);
     void Execute( SfxRequest &rReq );
 
 private:
diff --git a/sd/source/ui/tools/SlideshowLayerRenderer.cxx 
b/sd/source/ui/tools/SlideshowLayerRenderer.cxx
index 8675630ced5f..47c23302f357 100644
--- a/sd/source/ui/tools/SlideshowLayerRenderer.cxx
+++ b/sd/source/ui/tools/SlideshowLayerRenderer.cxx
@@ -196,7 +196,7 @@ OUString getMasterTextFieldType(SdrObject* pObject)
     return aType;
 }
 
-bool isGroup(SdrObject* pObject) { return pObject->getChildrenOfSdrObject() != 
nullptr; }
+bool isGroup(const SdrObject* pObject) { return 
pObject->getChildrenOfSdrObject() != nullptr; }
 
 /// Sets visible for all kinds of polypolys in the container
 void changePolyPolys(
@@ -898,7 +898,7 @@ void writeBoundingBox(::tools::JsonWriter& aJsonWriter, 
const SdrObject* pObject
 }
 
 void writeAnimated(::tools::JsonWriter& aJsonWriter, AnimationLayerInfo const& 
rLayerInfo,
-                   SdrObject* pObject, sal_Int32 nParagraph = -1,
+                   const SdrObject* pObject, sal_Int32 nParagraph = -1,
                    const Color& rFontColor = COL_AUTO)
 {
     aJsonWriter.put("type", "animated");
diff --git a/sd/source/ui/view/MediaObjectBar.cxx 
b/sd/source/ui/view/MediaObjectBar.cxx
index 4901c07e29b3..5646fe2b7215 100644
--- a/sd/source/ui/view/MediaObjectBar.cxx
+++ b/sd/source/ui/view/MediaObjectBar.cxx
@@ -41,7 +41,7 @@ SFX_IMPL_INTERFACE(MediaObjectBar, SfxShell)
 
 void MediaObjectBar::InitInterface_Impl() {}
 
-MediaObjectBar::MediaObjectBar(ViewShell& rSdViewShell, ::sd::View* pSdView)
+MediaObjectBar::MediaObjectBar(const ViewShell& rSdViewShell, ::sd::View* 
pSdView)
     : SfxShell(rSdViewShell.GetViewShell())
     , mpView(pSdView)
 {
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 3efb4d996046..be3bcad2b85b 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -126,7 +126,7 @@ void TextObjectBar::GetCharState( SfxItemSet& rSet )
     GetCharStateImpl(mrViewShell, mpView, rSet);
 }
 
-void TextObjectBar::GetCharStateImpl(ViewShell& rViewShell, const ::sd::View* 
pView, SfxItemSet& rSet)
+void TextObjectBar::GetCharStateImpl(const ViewShell& rViewShell, const 
::sd::View* pView, SfxItemSet& rSet)
 {
     SfxItemSet  aCharAttrSet( pView->GetDoc().GetPool() );
     pView->GetAttributes( aCharAttrSet );
@@ -155,7 +155,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
 /**
  * Status of attribute items.
  */
-void TextObjectBar::GetAttrStateImpl(ViewShell& rViewShell, ::sd::View* pView, 
SfxItemSet& rSet, SfxShell* pTextObjectBar)
+void TextObjectBar::GetAttrStateImpl(const ViewShell& rViewShell, ::sd::View* 
pView, SfxItemSet& rSet, SfxShell* pTextObjectBar)
 {
     SfxWhichIter        aIter( rSet );
     sal_uInt16              nWhich = aIter.FirstWhich();
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index dbf8c9c82de5..fa9aa352c524 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -805,7 +805,7 @@ bool DrawViewShell::IsSelected(sal_uInt16 nPage)
 
 namespace
 {
-void notifyLinkAnnotations(SfxViewShell* pViewShell, SdPage* pPage)
+void notifyLinkAnnotations(const SfxViewShell* pViewShell, const SdPage* pPage)
 {
     if (!pViewShell || !pPage)
         return;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index ef087289f901..7a135e5e12f8 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -671,7 +671,7 @@ public:
     }
 }
 
-void DrawViewShell::FuTransformDocumentStructure(SfxRequest& rReq)
+void DrawViewShell::FuTransformDocumentStructure(const SfxRequest& rReq)
 {
     // get the parameter, what to transform
     OUString aDataJson;
diff --git a/sfx2/source/control/charmapcontainer.cxx 
b/sfx2/source/control/charmapcontainer.cxx
index efbdc5dc88ea..f3346e239679 100644
--- a/sfx2/source/control/charmapcontainer.cxx
+++ b/sfx2/source/control/charmapcontainer.cxx
@@ -73,7 +73,7 @@ void SfxCharmapContainer::init(const Link<const CharAndFont&, 
void>& rActivateHd
     m_xFavIconView->connect_command(LINK(this, SfxCharmapContainer, 
FavContextMenuHdl));
 }
 
-ScopedVclPtr<VirtualDevice> SfxCharmapContainer::CreateIcon(weld::IconView& 
rIconView,
+ScopedVclPtr<VirtualDevice> SfxCharmapContainer::CreateIcon(const 
weld::IconView& rIconView,
                                                       const OUString& rFont, 
const OUString& rText)
 {
     const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index bd21f83984f0..992cbbc79fb2 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -4024,7 +4024,7 @@ bool SfxMedium::IsOriginallyLoadedReadOnly() const
 
 bool SfxMedium::HasRestrictedFonts() const { return pImpl->hasRestrictedFonts; 
}
 
-void SfxMedium::TransferEmbeddedFontsTo(SfxMedium& target)
+void SfxMedium::TransferEmbeddedFontsTo(const SfxMedium& target)
 {
     target.pImpl->hasRestrictedFonts = target.pImpl->hasRestrictedFonts || 
pImpl->hasRestrictedFonts;
     target.pImpl->m_aEmbeddedFonts.insert(target.pImpl->m_aEmbeddedFonts.end(),
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index e4084220e4bd..4509c4dff3aa 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -806,7 +806,7 @@ void 
SfxLokHelper::notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc
     }
 }
 
-void SfxLokHelper::notifyCurrentPageSizeChangedAllViews(vcl::ITiledRenderable 
*pDoc)
+void SfxLokHelper::notifyCurrentPageSizeChangedAllViews(const 
vcl::ITiledRenderable *pDoc)
 {
     if (!pDoc || pDoc->isDisposed() || DisableCallbacks::disabled())
         return;
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index a907c0f8ddc3..01767bd4e0ce 100644
--- a/store/source/lockbyte.cxx
+++ b/store/source/lockbyte.cxx
@@ -828,7 +828,7 @@ template< class T > struct ResourceHolder
         return tmp;
     }
 
-    ResourceHolder & operator= (ResourceHolder & rhs)
+    ResourceHolder & operator= (const ResourceHolder & rhs)
     {
         reset (rhs.release());
         return *this;
diff --git a/svx/source/diagram/DiagramHelper_svx.cxx 
b/svx/source/diagram/DiagramHelper_svx.cxx
index 185e6bf4c77e..016a1722807c 100644
--- a/svx/source/diagram/DiagramHelper_svx.cxx
+++ b/svx/source/diagram/DiagramHelper_svx.cxx
@@ -432,7 +432,7 @@ void DiagramHelper_svx::disconnectFromSdrObjGroup()
     }
 }
 
-void DiagramHelper_svx::connectToSdrObjGroup(css::uno::Reference< 
css::drawing::XShape >& rTarget)
+void DiagramHelper_svx::connectToSdrObjGroup(const css::uno::Reference< 
css::drawing::XShape >& rTarget)
 {
     SdrObjGroup* pGroupObject(nullptr);
     uno::Reference< drawing::XShape >& rxRootShape(accessRootShape());
diff --git a/svx/source/diagram/datamodel_svx.cxx 
b/svx/source/diagram/datamodel_svx.cxx
index 1f8fb44b1599..738403b3f5f0 100644
--- a/svx/source/diagram/datamodel_svx.cxx
+++ b/svx/source/diagram/datamodel_svx.cxx
@@ -75,7 +75,7 @@ std::u16string_view getNameForTypeConstant(TypeConstant 
aTypeConstant)
     return u"";
 }
 
-void addTypeConstantToFastAttributeList(TypeConstant aTypeConstant, 
rtl::Reference<sax_fastparser::FastAttributeList>& rAttributeList, bool bPoint)
+void addTypeConstantToFastAttributeList(TypeConstant aTypeConstant, const 
rtl::Reference<sax_fastparser::FastAttributeList>& rAttributeList, bool bPoint)
 {
     if (TypeConstant::XML_none == aTypeConstant)
         return;
@@ -134,7 +134,7 @@ Connection::Connection(const boost::property_tree::ptree& 
rConnectionData)
         mnXMLType = getTypeConstantForName(aXMLType);
 }
 
-void Connection::writeDiagramData(sax_fastparser::FSHelperPtr& rTarget)
+void Connection::writeDiagramData(const sax_fastparser::FSHelperPtr& rTarget)
 {
     if (!rTarget)
         return;
@@ -250,7 +250,7 @@ Point::Point(const boost::property_tree::ptree& rPointData)
         moHierarchyBranch = aBranch.value();
 }
 
-void Point::writeDiagramData_data(sax_fastparser::FSHelperPtr& rTarget)
+void Point::writeDiagramData_data(const sax_fastparser::FSHelperPtr& rTarget)
 {
     rtl::Reference<sax_fastparser::FastAttributeList> 
pAttributeList(sax_fastparser::FastSerializerHelper::createAttrList());
 
diff --git a/svx/source/dialog/ThemeColorsPaneBase.cxx 
b/svx/source/dialog/ThemeColorsPaneBase.cxx
index 8f44d18bc719..141df041fe27 100644
--- a/svx/source/dialog/ThemeColorsPaneBase.cxx
+++ b/svx/source/dialog/ThemeColorsPaneBase.cxx
@@ -31,7 +31,7 @@ 
ThemeColorsPaneBase::ThemeColorsPaneBase(std::unique_ptr<weld::IconView> xIconVi
 
 ThemeColorsPaneBase::~ThemeColorsPaneBase() = default;
 
-void ThemeColorsPaneBase::initColorSets(model::Theme* pTheme)
+void ThemeColorsPaneBase::initColorSets(const model::Theme* pTheme)
 {
     maColorSets.clear();
     if (mxIconViewThemeColors)
diff --git a/svx/source/inc/StylesPreviewWindow.hxx 
b/svx/source/inc/StylesPreviewWindow.hxx
index b03b385c086c..0210d10a9369 100644
--- a/svx/source/inc/StylesPreviewWindow.hxx
+++ b/svx/source/inc/StylesPreviewWindow.hxx
@@ -125,7 +125,7 @@ protected:
     DECL_LINK(GetPreviewImage, const weld::encoded_image_query&, bool);
 
 public:
-    StylesPreviewWindow_Base(weld::Builder& xBuilder, StylePreviewList& 
rDefaultStyles,
+    StylesPreviewWindow_Base(weld::Builder& xBuilder, const StylePreviewList& 
rDefaultStyles,
                              const css::uno::Reference<css::frame::XFrame>& 
xFrame);
     ~StylesPreviewWindow_Base();
 
@@ -143,7 +143,7 @@ private:
 class StylesPreviewWindow_Impl final : public InterimItemWindow, public 
StylesPreviewWindow_Base
 {
 public:
-    StylesPreviewWindow_Impl(vcl::Window* pParent, StylePreviewList& 
rDefaultStyles,
+    StylesPreviewWindow_Impl(vcl::Window* pParent, const StylePreviewList& 
rDefaultStyles,
                              const css::uno::Reference<css::frame::XFrame>& 
xFrame);
     ~StylesPreviewWindow_Impl();
 
diff --git a/svx/source/table/tablestylesparser.cxx 
b/svx/source/table/tablestylesparser.cxx
index 7c5e8471325d..21bfaf783e58 100644
--- a/svx/source/table/tablestylesparser.cxx
+++ b/svx/source/table/tablestylesparser.cxx
@@ -128,7 +128,7 @@ const TableStyle* SvxTableStylesImport::getCellStyle(const 
OUString& rName)
 
 void SvxTableStylesImport::addTableTemplate(const OUString& rsStyleName,
                                             const XMLTableTemplate& 
xTableTemplate,
-                                            std::bitset<6>& rUseSet)
+                                            const std::bitset<6>& rUseSet)
 {
     auto xPtr = std::make_shared<XMLTableTemplate>(xTableTemplate);
     maTableTemplates.emplace_back(rsStyleName, xPtr);
@@ -272,7 +272,7 @@ void SvxCellStyleContext::Finish(bool)
     mpImport->addCellStyle(GetName(), GetParentName(), std::move(mpField));
 }
 
-void SvxCellStyleContext::setPropertyValue(OUString& rPropName, const 
css::uno::Any& aValue)
+void SvxCellStyleContext::setPropertyValue(const OUString& rPropName, const 
css::uno::Any& aValue)
 {
     try
     {
@@ -659,7 +659,7 @@ void SvxTableStylesExport::exportTableTemplate(const 
SvxAutoFormatData& rData)
 }
 
 void SvxTableStylesExport::exportCellStyle(const SvxAutoFormatDataField& 
rField,
-                                           OUString& rStyleName, OUString& 
rParentName)
+                                           const OUString& rStyleName, const 
OUString& rParentName)
 {
     AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, rStyleName);
     AddAttribute(XML_NAMESPACE_STYLE, XML_FAMILY, "table-cell");
@@ -720,7 +720,7 @@ static OUString lcl_getBorderLineStyle(SvxBorderLineStyle 
rLineStyle)
     }
 }
 
-static OUString lcl_getBorderStyle(editeng::SvxBorderLine& rBorder)
+static OUString lcl_getBorderStyle(const editeng::SvxBorderLine& rBorder)
 {
     OUStringBuffer strBuffer;
     sax::Converter::convertMeasure(strBuffer, rBorder.GetWidth(),
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx 
b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index 0b05b8f13d4a..77445fddbcf9 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -426,7 +426,7 @@ void StyleItemController::DrawText(vcl::RenderContext& 
rRenderContext)
 }
 
 StylesPreviewWindow_Base::StylesPreviewWindow_Base(
-    weld::Builder& xBuilder, StylePreviewList& rDefaultStyles,
+    weld::Builder& xBuilder, const StylePreviewList& rDefaultStyles,
     const css::uno::Reference<css::frame::XFrame>& xFrame)
     : m_xFrame(xFrame)
     , m_xStylesView(xBuilder.weld_icon_view(u"stylesview"_ustr))
@@ -664,7 +664,7 @@ void StylesPreviewWindow_Base::UpdateStylesList()
 }
 
 StylesPreviewWindow_Impl::StylesPreviewWindow_Impl(
-    vcl::Window* pParent, StylePreviewList& rDefaultStyles,
+    vcl::Window* pParent, const StylePreviewList& rDefaultStyles,
     const css::uno::Reference<css::frame::XFrame>& xFrame)
     : InterimItemWindow(pParent, u"svx/ui/stylespreview.ui"_ustr, 
u"ApplyStyleBox"_ustr, true,
                         reinterpret_cast<sal_uInt64>(SfxViewShell::Current()))
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 93de6b198a87..5b113f38a57a 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -311,7 +311,7 @@ class SwUndoCopyHeaderFooter final : public SwUndo, private 
SwUndoSaveSection
     bool m_bIsFirstLeft;
 
 public:
-    SwUndoCopyHeaderFooter(SwDoc& rDoc, SwNode& rSttNd, const UIName& 
rFmtName);
+    SwUndoCopyHeaderFooter(const SwDoc& rDoc, const SwNode& rSttNd, const 
UIName& rFmtName);
 
     virtual void UndoImpl(::sw::UndoRedoContext & rContext) override;
     virtual void RedoImpl(::sw::UndoRedoContext & rContext) override;
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 629dec9c0bc2..84eb90c69d56 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -534,7 +534,7 @@ public:
     DECL_DLLPRIVATE_LINK( ExecRulerClick, Ruler *, void );
     void            ExecSearch(SfxRequest&);
     void            ExecViewOptions(SfxRequest &);
-    void            ExecNavigatorWin(SfxRequest &);
+    void            ExecNavigatorWin(const SfxRequest &);
 
     virtual bool    IsConditionalFastCall( const SfxRequest &rReq ) override;
 
diff --git a/sw/qa/extras/layout/layout4.cxx b/sw/qa/extras/layout/layout4.cxx
index cb6c831cbd4a..dd7256d1c800 100644
--- a/sw/qa/extras/layout/layout4.cxx
+++ b/sw/qa/extras/layout/layout4.cxx
@@ -567,7 +567,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter4, 
testWriterImageNoCapture)
     CPPUNIT_ASSERT_LESS(nPageLeft, nImageLeft);
 }
 
-SwRect lcl_getVisibleFlyObjRect(SwWrtShell* pWrtShell)
+SwRect lcl_getVisibleFlyObjRect(const SwWrtShell* pWrtShell)
 {
     SwRootFrame* pRoot = pWrtShell->GetLayout();
     SwPageFrame* pPage = static_cast<SwPageFrame*>(pRoot->GetLower());
diff --git a/sw/qa/extras/pagelinespacing/pagelinespacing.cxx 
b/sw/qa/extras/pagelinespacing/pagelinespacing.cxx
index 93d693679291..2846d94747e5 100644
--- a/sw/qa/extras/pagelinespacing/pagelinespacing.cxx
+++ b/sw/qa/extras/pagelinespacing/pagelinespacing.cxx
@@ -53,7 +53,7 @@ protected:
     void setLineHeightForReferenceStyle(const uint16_t nPage, const sal_uInt16 
nLineHeight);
 
     void moveObject(SdrObject* pObject, const sal_uInt16 nKey);
-    void resizeObjectUpward(SdrObject* pObject, const SwTwips nDragDistance);
+    void resizeObjectUpward(const SdrObject* pObject, const SwTwips 
nDragDistance);
 
     SdrObject* findObject(const uint16_t nPage, const uint16_t nFlyFrame);
 };
@@ -442,7 +442,8 @@ void SwPageLineSpacingTest::moveObject(SdrObject* pObject, 
const sal_uInt16 nKey
     }
 }
 
-void SwPageLineSpacingTest::resizeObjectUpward(SdrObject* pObject, const 
SwTwips nDragDistance)
+void SwPageLineSpacingTest::resizeObjectUpward(const SdrObject* pObject,
+                                               const SwTwips nDragDistance)
 {
     CPPUNIT_ASSERT(pObject);
 
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index a4779aa6073e..c4c4018ae4c0 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1019,7 +1019,7 @@ namespace
 
     /// Given a redline that has an other underlying redline, drop the redline 
on top.
     /// Used to accept a format on top of insert/delete, no changes to the 
text node string.
-    bool lcl_AcceptOuterFormat(SwRedlineTable& rArr, 
SwRedlineTable::size_type& rPos)
+    bool lcl_AcceptOuterFormat(const SwRedlineTable& rArr, const 
SwRedlineTable::size_type& rPos)
     {
         SwRangeRedline* pRedl = rArr[rPos];
         return pRedl->PopData();
@@ -1027,7 +1027,7 @@ namespace
 
     /// Given a redline that has an other underlying redline, drop the redline 
on top & restore the
     /// old doc model. Used to reject a format on top of insert/delete.
-    bool lcl_RejectOuterFormat(SwRedlineTable& rArr, 
SwRedlineTable::size_type& rPos)
+    bool lcl_RejectOuterFormat(const SwRedlineTable& rArr, const 
SwRedlineTable::size_type& rPos)
     {
         SwRangeRedline* pRedl = rArr[rPos];
         SwDoc& rDoc = pRedl->GetDoc();
@@ -1182,7 +1182,7 @@ namespace
 
 /// Decides if it's OK to combine two types of redlines next to each other, 
e.g. insert and
 /// delete-on-insert can be combined if accepting an insert.
-bool CanCombineTypesForAcceptReject(SwRedlineData& rInnerData, SwRangeRedline& 
rOuterRedline)
+bool CanCombineTypesForAcceptReject(const SwRedlineData& rInnerData, const 
SwRangeRedline& rOuterRedline)
 {
     if (rInnerData.GetType() == RedlineType::Delete)
     {
@@ -1222,7 +1222,7 @@ bool CanCombineTypesForAcceptReject(SwRedlineData& 
rInnerData, SwRangeRedline& r
 /// Decides if it's OK to combine this rInnerData having 2 types with an outer 
rOuterRedline for
 /// accept or reject purposes. E.g. format-on-delete and delete can be 
combined if accepting a
 /// delete.
-bool CanReverseCombineTypesForAcceptReject(SwRangeRedline& rOuterRedline, 
SwRedlineData& rInnerData)
+bool CanReverseCombineTypesForAcceptReject(const SwRangeRedline& 
rOuterRedline, const SwRedlineData& rInnerData)
 {
     switch (rOuterRedline.GetType())
     {
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index b0c4d4911468..78fb9027c656 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -449,7 +449,7 @@ namespace
 {
 // Change style of all text nodes between start and end node for the 
SwTextFootnote to the
 // style of the type of note it is.
-void lcl_ChgFormatColl(SwDoc* pDoc, SwTextFootnote* pTextFootnote, 
SwUndoChangeFootNote* pUndo)
+void lcl_ChgFormatColl(SwDoc* pDoc, const SwTextFootnote* pTextFootnote, 
SwUndoChangeFootNote* pUndo)
 {
     SwTextFormatColl* pChangeToTextFormatColl
         = pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool(
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 7e95a24fa8f5..d33271133333 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1776,7 +1776,7 @@ void SwDoc::InsertCol( const SwCursor& rCursor, 
sal_uInt16 nCnt, bool bBehind )
         InsertCol( aBoxes, nCnt, bBehind );
 }
 
-static void lcl_ResetTableFormat(SwTableBox* rBox, SwTableAutoFormat& rFormat, 
size_t nRow,
+static void lcl_ResetTableFormat(SwTableBox* rBox, const SwTableAutoFormat& 
rFormat, size_t nRow,
                                  size_t nCol, size_t nRows, size_t nCols)
 {
     SwNodeOffset nSttNd = rBox->GetSttIdx() + 1;
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 94994423fa07..418208bf1906 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -110,7 +110,7 @@ bool isLegacyBehavior(const SwFlyFrame& rFly, const 
SwFrame& rAnchor)
 }
 
 /// Gets the bottom position which is a deadline for a split fly.
-SwTwips GetFlyAnchorBottom(SwFlyFrame& rFly, const SwFrame& rAnchor)
+SwTwips GetFlyAnchorBottom(const SwFlyFrame& rFly, const SwFrame& rAnchor)
 {
     SwRectFnSet aRectFnSet(rFly);
 
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index d17b744a0973..023f5a73469b 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -488,7 +488,7 @@ SwUndoCpyDoc::SwUndoCpyDoc( const SwPaM& rPam )
 {
 }
 
-SwUndoCopyHeaderFooter::SwUndoCopyHeaderFooter(SwDoc& rDoc, SwNode& rSttNd, 
const UIName& rFmtName)
+SwUndoCopyHeaderFooter::SwUndoCopyHeaderFooter(const SwDoc& rDoc, const 
SwNode& rSttNd, const UIName& rFmtName)
     : SwUndo(SwUndoId::COPY_HEADER_FOOTER, rDoc)
     , m_aOff(rSttNd.GetIndex())
     , m_aFmtName(rFmtName)
@@ -500,7 +500,7 @@ SwUndoCopyHeaderFooter::SwUndoCopyHeaderFooter(SwDoc& rDoc, 
SwNode& rSttNd, cons
 {
 }
 
-static const SfxPoolItem* lcl_itemForFormat(SwFrameFormat& rFmt, bool 
bIsHeader)
+static const SfxPoolItem* lcl_itemForFormat(const SwFrameFormat& rFmt, bool 
bIsHeader)
 {
     sal_uInt16 nAttr = bIsHeader ? sal_uInt16(RES_HEADER) : 
sal_uInt16(RES_FOOTER);
     const SfxPoolItem* pItem;
@@ -510,7 +510,7 @@ static const SfxPoolItem* lcl_itemForFormat(SwFrameFormat& 
rFmt, bool bIsHeader)
     return pItem;
 }
 
-static bool lcl_checkMatchesFormat(SwFrameFormat& rFmt, bool bIsHeader, 
SwNodeOffset aOff)
+static bool lcl_checkMatchesFormat(const SwFrameFormat& rFmt, bool bIsHeader, 
SwNodeOffset aOff)
 {
     const SfxPoolItem* pItem = lcl_itemForFormat(rFmt, bIsHeader);
     if (!pItem)
diff --git a/sw/source/filter/md/mdcallbcks.cxx 
b/sw/source/filter/md/mdcallbcks.cxx
index 09c3e26bfc98..8589579e1254 100644
--- a/sw/source/filter/md/mdcallbcks.cxx
+++ b/sw/source/filter/md/mdcallbcks.cxx
@@ -54,7 +54,7 @@ int SwMarkdownParser::enter_block_callback(MD_BLOCKTYPE type, 
void* detail, void
             parser->StartNumberedBulletList(type);
             break;
         case MD_BLOCK_LI:
-            
parser->StartNumberedBulletListItem(*static_cast<MD_BLOCK_LI_DETAIL*>(detail));
+            parser->StartNumberedBulletListItem(*static_cast<const 
MD_BLOCK_LI_DETAIL*>(detail));
             break;
         case MD_BLOCK_HR:
             parser->AddHR();
diff --git a/sw/source/filter/md/swmd.cxx b/sw/source/filter/md/swmd.cxx
index ae6bd7757e8d..d9192865e914 100644
--- a/sw/source/filter/md/swmd.cxx
+++ b/sw/source/filter/md/swmd.cxx
@@ -604,7 +604,7 @@ void SwMarkdownParser::EndCodeBlock()
     ClearAttrs();
 }
 
-void SwMarkdownParser::InsertText(OUString& aStr)
+void SwMarkdownParser::InsertText(const OUString& aStr)
 {
     SwContentNode* pCnd = m_pPam->GetPointContentNode();
     sal_Int32 nStartPos = m_pPam->GetPoint()->GetContentIndex();
diff --git a/sw/source/filter/md/swmd.hxx b/sw/source/filter/md/swmd.hxx
index 31c754a1be29..dd88bd4024ea 100644
--- a/sw/source/filter/md/swmd.hxx
+++ b/sw/source/filter/md/swmd.hxx
@@ -131,7 +131,7 @@ class SwMarkdownParser
     void BeginCodeBlock();
     void EndCodeBlock();
 
-    void InsertText(OUString& aStr);
+    void InsertText(const OUString& aStr);
     void SetAttrs(SwPaM& rRange);
     void ClearAttrs();
 
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 1cdcbe326b2d..aa64055f2b8f 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -651,7 +651,7 @@ static auto RecursiveContains(SwStartNode const& 
rRedlineSection, SwNode const&
 namespace
 {
 /// Similar to GetRedlineTypeIgnoringAdditonalFormat(), but for import 
purposes.
-RedlineType GetRedlineTypeIgnoringAdditonalFormatForImport(RedlineInfo& 
rRedlineInfo)
+RedlineType GetRedlineTypeIgnoringAdditonalFormatForImport(const RedlineInfo& 
rRedlineInfo)
 {
     RedlineType eType = rRedlineInfo.eType;
 
@@ -848,7 +848,7 @@ void 
XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
 namespace
 {
 /// Similar to CanCombineTypesForAcceptReject(), but for import purposes.
-bool CanCombineTypesForImport(RedlineInfo* pRedlineInfo)
+bool CanCombineTypesForImport(const RedlineInfo* pRedlineInfo)
 {
     if (!pRedlineInfo->pNextRedline)
     {
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx 
b/sw/source/ui/dbui/mmlayoutpage.cxx
index 0dc6e35b2413..f79527901b44 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -220,7 +220,7 @@ bool 
SwMailMergeLayoutPage::commitPage(::vcl::WizardTypes::CommitPageReason eRea
     return true;
 }
 
-SwFrameFormat*  SwMailMergeLayoutPage::InsertAddressAndGreeting(SwView& rView,
+SwFrameFormat*  SwMailMergeLayoutPage::InsertAddressAndGreeting(const SwView& 
rView,
         SwMailMergeConfigItem& rConfigItem,
         const Point& rAddressPosition,
         bool bAlignToBody)
diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx 
b/sw/source/ui/dbui/mmlayoutpage.hxx
index c6bc571ba4e4..ac1a87665059 100644
--- a/sw/source/ui/dbui/mmlayoutpage.hxx
+++ b/sw/source/ui/dbui/mmlayoutpage.hxx
@@ -78,7 +78,7 @@ public:
     SwMailMergeLayoutPage(weld::Container* pPage, SwMailMergeWizard* pWizard);
     virtual ~SwMailMergeLayoutPage() override;
 
-    static SwFrameFormat*        InsertAddressAndGreeting(SwView& rView,
+    static SwFrameFormat*        InsertAddressAndGreeting(const SwView& rView,
                                             SwMailMergeConfigItem& rConfigItem,
                                             const Point& rAddressPos,
                                             bool bAlignToBody);
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 0ece02476fa8..63018844025f 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -356,7 +356,7 @@ static void lcl_InitNumberFormatter(SwDSParam& rParam, 
uno::Reference<sdbc::XDat
     }
 }
 
-static bool lcl_MoveAbsolute(SwDSParam* pParam, tools::Long nAbsPos)
+static bool lcl_MoveAbsolute(const SwDSParam* pParam, tools::Long nAbsPos)
 {
     bool bRet = false;
     try
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index dd2a5fc4f8e1..9a437c36412b 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -403,7 +403,7 @@ private:
     RedlineFlags m_eRestreFlags;
 };
 
-bool isOwnFileFormat(SfxMedium* pMedium)
+bool isOwnFileFormat(const SfxMedium* pMedium)
 {
     // Assume that unsaved documents are own format
     return !pMedium || !pMedium->GetFilter() || 
pMedium->GetFilter()->IsOwnFormat();
diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index e408a48fb54a..611cc8be7192 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -316,7 +316,7 @@ OUString SwEditWin::ClipLongToolTip(const OUString& rText)
 }
 
 static OString getTooltipPayload(const OUString& tooltip, const SwRect& rect,
-                                 SwWrtShell& rSh,
+                                 const SwWrtShell& rSh,
                                  const SwRangeRedline* pRedline = nullptr)
 {
     tools::JsonWriter writer;
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 6c59a6656df2..1bcfac0fb6c2 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -213,7 +213,7 @@ static bool lcl_UpdateContourDlg( SwWrtShell &rSh, 
SelectionType nSel )
 
 /// See SubSoftFixed definition.
 /// It may only be unlocked on explicit user action (e.g. "Update All" button 
click).
-static void lcl_UnlockSoftFixed( SwWrtShell &rSh )
+static void lcl_UnlockSoftFixed( const SwWrtShell &rSh )
 {
     SwFieldType* pType = 
rSh.GetDoc()->getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::DocInfo);
     std::vector<SwFormatField*> vFields;
diff --git a/sw/source/uibase/uiview/view0.cxx 
b/sw/source/uibase/uiview/view0.cxx
index ef870cb84b2d..834cf810fd25 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -928,7 +928,7 @@ void SwView::ExecNumberingOutline(SfxItemPool & rPool)
     );
 }
 
-void SwView::ExecNavigatorWin(SfxRequest& rReq)
+void SwView::ExecNavigatorWin(const SfxRequest& rReq)
 {
     const SfxItemSet *pArgs = rReq.GetArgs();
     sal_uInt16 nSlot = rReq.GetSlot();
diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index c302f76b8546..acd55f530116 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -5287,7 +5287,7 @@ uno::Reference< text::XTextRange > 
DomainMapper::GetCurrentTextRange()
     return m_pImpl->m_xInsertTextRange;
 }
 
-OUString DomainMapper::getOrCreateCharStyle( PropertyValueVector_t& 
rCharProperties, bool bAlwaysCreate )
+OUString DomainMapper::getOrCreateCharStyle( const PropertyValueVector_t& 
rCharProperties, bool bAlwaysCreate )
 {
     StyleSheetTablePtr pStyleSheets = m_pImpl->GetStyleSheetTable();
     return pStyleSheets->getOrCreateCharStyle( rCharProperties, bAlwaysCreate 
);
diff --git a/sw/source/writerfilter/dmapper/DomainMapper.hxx 
b/sw/source/writerfilter/dmapper/DomainMapper.hxx
index 5711713a1964..a9c482a55a12 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.hxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.hxx
@@ -108,7 +108,7 @@ public:
     rtl::Reference<SwXTextDocument> const & GetTextDocument() const;
     css::uno::Reference<css::text::XTextRange> GetCurrentTextRange();
 
-    OUString getOrCreateCharStyle( PropertyValueVector_t& rCharProperties, 
bool bAlwaysCreate );
+    OUString getOrCreateCharStyle( const PropertyValueVector_t& 
rCharProperties, bool bAlwaysCreate );
     StyleSheetTablePtr const & GetStyleSheetTable( );
     SettingsTablePtr const & GetSettingsTable();
     GraphicZOrderHelper& graphicZOrderHelper();
diff --git a/vcl/inc/qt5/QtBuilder.hxx b/vcl/inc/qt5/QtBuilder.hxx
index aa8337469875..342d9f74dadf 100644
--- a/vcl/inc/qt5/QtBuilder.hxx
+++ b/vcl/inc/qt5/QtBuilder.hxx
@@ -95,7 +95,7 @@ private:
                                   QWidget* pParentWidget);
     static void setDialogProperties(QDialog& rDialog, stringmap& rProps);
     static void setEntryProperties(QLineEdit& rLineEdit, stringmap& rProps);
-    static void setItemViewProperties(QAbstractItemView& rIconView, stringmap& 
rProps);
+    static void setItemViewProperties(const QAbstractItemView& rIconView, 
stringmap& rProps);
     static void setLabelProperties(QLabel& rLabel, stringmap& rProps);
     static void setMessageDialogProperties(QMessageBox& rMessageBox, 
stringmap& rProps);
     static void setMenuActionGroup(QMenu* pMenu, QAction* pAction, const 
OUString& rRadioGroupId);
diff --git a/vcl/inc/qt5/QtInstanceItemView.hxx 
b/vcl/inc/qt5/QtInstanceItemView.hxx
index 59b0442640b9..ce85fdfc1161 100644
--- a/vcl/inc/qt5/QtInstanceItemView.hxx
+++ b/vcl/inc/qt5/QtInstanceItemView.hxx
@@ -66,7 +66,7 @@ public:
 
     virtual void selected_foreach(const std::function<bool(weld::TreeIter&)>& 
func) override;
 
-    static void enableActivateOnSingleClick(QAbstractItemView& rItemView);
+    static void enableActivateOnSingleClick(const QAbstractItemView& 
rItemView);
 
 protected:
     QModelIndex modelIndex(int nRow, int nCol = 0,
diff --git a/vcl/inc/qt5/QtInstanceTreeView.hxx 
b/vcl/inc/qt5/QtInstanceTreeView.hxx
index fc83fbcd97ba..f92327a0e4fb 100644
-e 
... etc. - the rest is truncated

Reply via email to