include/oox/drawingml/connectorshapecontext.hxx      |    2 +-
 include/oox/ppt/presentationfragmenthandler.hxx      |    2 +-
 include/oox/ppt/slidepersist.hxx                     |    2 +-
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx |    2 +-
 include/sfx2/lokhelper.hxx                           |    2 +-
 include/sfx2/objsh.hxx                               |    2 +-
 oox/inc/drawingml/connectorhelper.hxx                |    3 ++-
 oox/inc/drawingml/fontworkhelpers.hxx                |    4 ++--
 oox/source/drawingml/connectorhelper.cxx             |    2 +-
 oox/source/drawingml/connectorshapecontext.cxx       |    2 +-
 oox/source/drawingml/diagram/diagram.hxx             |    2 +-
 oox/source/drawingml/diagram/diagramhelper.cxx       |    2 +-
 oox/source/drawingml/diagram/diagramhelper.hxx       |    2 +-
 oox/source/drawingml/fontworkhelpers.cxx             |   10 ++++++----
 oox/source/export/drawingml.cxx                      |    8 ++++----
 oox/source/ppt/presentationfragmenthandler.cxx       |    2 +-
 oox/source/ppt/slidepersist.cxx                      |    8 ++++----
 oox/source/shape/WordprocessingCanvasContext.cxx     |    2 +-
 oox/source/shape/WordprocessingCanvasContext.hxx     |    2 +-
 oox/source/shape/WpsContext.cxx                      |    2 +-
 sfx2/inc/guisaveas.hxx                               |    2 +-
 sfx2/source/appl/appserv.cxx                         |    2 +-
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx  |    2 +-
 sfx2/source/dialog/StyleList.cxx                     |    2 +-
 sfx2/source/doc/guisaveas.cxx                        |    2 +-
 sfx2/source/doc/objserv.cxx                          |    2 +-
 sfx2/source/doc/objstor.cxx                          |    2 +-
 sfx2/source/view/lokhelper.cxx                       |    2 +-
 sfx2/source/view/viewsh.cxx                          |   18 +++++++++---------
 29 files changed, 50 insertions(+), 47 deletions(-)

New commits:
commit 5e42599f91fc98d7f31c03e45378b95c756964d4
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Mar 20 08:18:10 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Mar 20 16:44:05 2025 +0100

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

diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index f4d460a2bf99..0a16d442a251 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -44,7 +44,7 @@ private:
     // treeview sort and compare
     comphelper::string::NaturalStringSorter mxSorter;
     void setSortFunction(std::unique_ptr<weld::TreeView>& pTreeView);
-    sal_Int32 compare(std::unique_ptr<weld::TreeView>& pTreeView, const 
weld::TreeIter& rLeft,
+    sal_Int32 compare(const std::unique_ptr<weld::TreeView>& pTreeView, const 
weld::TreeIter& rLeft,
                       const weld::TreeIter& rRight);
 
     // treeview manipulation
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 2f87faf82e78..c0d8efb6eb0d 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -284,7 +284,7 @@ class SfxLokLanguageGuard
     const SfxViewShell* m_pOldShell;
 
 public:
-    SfxLokLanguageGuard(SfxViewShell* pNewShell);
+    SfxLokLanguageGuard(const SfxViewShell* pNewShell);
     ~SfxLokLanguageGuard();
 };
 
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index c59b2b1e7084..badeddf332b7 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -449,7 +449,7 @@ public:
     bool                        SetModifyPasswordInfo( const 
css::uno::Sequence< css::beans::PropertyValue >& aInfo );
 
     static void                 DetectCharSet(SvStream& stream, 
rtl_TextEncoding& eCharSet, SvStreamEndian& endian);
-    static void                 DetectCsvSeparators(SvStream& stream, 
rtl_TextEncoding& eCharSet, OUString& separators, sal_Unicode cStringDelimiter);
+    static void                 DetectCsvSeparators(SvStream& stream, 
rtl_TextEncoding eCharSet, OUString& separators, sal_Unicode cStringDelimiter);
     static void                 DetectCsvFilterOptions(SvStream& stream, 
OUString& aFilterOptions);
     static void                 DetectFilterOptions(SfxMedium* pMedium);
     static ErrCode              HandleFilter( SfxMedium* pMedium, 
SfxObjectShell const * pDoc );
diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index d6a037f4ed26..af12ba7ba4a8 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -70,7 +70,7 @@ private:
 
     static bool 
FinishGUIStoreModel(::comphelper::SequenceAsHashMap::const_iterator& 
aFileNameIter,
                              ModelData_Impl& aModelData, bool bRemote, 
sal_Int16 nStoreMode,
-                             css::uno::Sequence< css::beans::PropertyValue >& 
aFilterProps,
+                             const css::uno::Sequence< 
css::beans::PropertyValue >& aFilterProps,
                              bool bSetStandardName, bool bPreselectPassword, 
bool bDialogUsed,
                              std::u16string_view aFilterFromMediaDescr, 
std::u16string_view aOldFilterName,
                              css::uno::Sequence< css::beans::PropertyValue >& 
aArgsSequence,
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index d9e158e37c48..040fe15a4357 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -204,7 +204,7 @@ namespace
             TOOLS_INFO_EXCEPTION( "sfx.appl", "trying to load bibliography 
database");
         }
     }
-    void lcl_disableActiveEmbeddedObjects(SfxObjectShell* pObjSh)
+    void lcl_disableActiveEmbeddedObjects(const SfxObjectShell* pObjSh)
     {
         if (!pObjSh)
             return;
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index bd403d84c5a3..b037d746f5a5 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -1003,7 +1003,7 @@ void 
ObjectInspectorTreeHandler::setSortFunction(std::unique_ptr<weld::TreeView>
         });
 }
 
-sal_Int32 ObjectInspectorTreeHandler::compare(std::unique_ptr<weld::TreeView>& 
pTreeView,
+sal_Int32 ObjectInspectorTreeHandler::compare(const 
std::unique_ptr<weld::TreeView>& pTreeView,
                                               const weld::TreeIter& rLeft,
                                               const weld::TreeIter& rRight)
 {
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 846dee4089de..a51a9e0e0a0d 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -709,7 +709,7 @@ static bool IsExpanded_Impl(const std::vector<OUString>& 
rEntries, std::u16strin
     return false;
 }
 
-static void lcl_Update(weld::TreeView& rTreeView, weld::TreeIter& rIter,
+static void lcl_Update(weld::TreeView& rTreeView, const weld::TreeIter& rIter,
                        const StyleTree_Impl& rEntry, SfxStyleFamily eFam, 
SfxViewShell* pViewSh)
 {
     const OUString& rName = rEntry.getName();
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 2ddaff5955bb..784865a6a7ca 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1635,7 +1635,7 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
 
 bool 
SfxStoringHelper::FinishGUIStoreModel(::comphelper::SequenceAsHashMap::const_iterator&
 aFileNameIter,
                                           ModelData_Impl& aModelData, bool 
bRemote, sal_Int16 nStoreMode,
-                                          uno::Sequence< beans::PropertyValue 
>& aFilterProps,
+                                          const uno::Sequence< 
beans::PropertyValue >& aFilterProps,
                                           bool bSetStandardName, bool 
bPreselectPassword, bool bDialogUsed,
                                           std::u16string_view 
aFilterFromMediaDescr,
                                           std::u16string_view aOldFilterName,
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 1e3a0d9a4972..c800c68f83ed 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -532,7 +532,7 @@ void ResetSignatureSelection(SfxObjectShell& rObjectShell, 
SfxViewShell& rViewSh
 }
 }
 
-static weld::Window* GetReqDialogParent(SfxRequest &rReq, SfxObjectShell& 
rShell)
+static weld::Window* GetReqDialogParent(const SfxRequest &rReq, const 
SfxObjectShell& rShell)
 {
     weld::Window* pDialogParent = rReq.GetFrameWeld();
     if (!pDialogParent)
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 1a039d669c6a..0a52c32eab6b 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -949,7 +949,7 @@ void SfxObjectShell::DetectCharSet(SvStream& stream, 
rtl_TextEncoding& eCharSet,
     ucsdet_close(ucd);
 }
 
-void SfxObjectShell::DetectCsvSeparators(SvStream& stream, rtl_TextEncoding& 
eCharSet, OUString& separators, sal_Unicode cStringDelimiter)
+void SfxObjectShell::DetectCsvSeparators(SvStream& stream, rtl_TextEncoding 
eCharSet, OUString& separators, sal_Unicode cStringDelimiter)
 {
     OUString sLine;
     std::vector<std::unordered_map<sal_Unicode, sal_uInt32>> aLinesCharsCount;
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index f025e2598411..ba4a80e12947 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -1398,7 +1398,7 @@ void 
SfxLokHelper::sendNetworkAccessError(std::string_view rAction)
     }
 }
 
-SfxLokLanguageGuard::SfxLokLanguageGuard(SfxViewShell* pNewShell)
+SfxLokLanguageGuard::SfxLokLanguageGuard(const SfxViewShell* pNewShell)
     : m_bSetLanguage(false)
     , m_pOldShell(nullptr)
 {
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 8a276a5927ac..49568571ac62 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -421,15 +421,15 @@ void lookForParentTable(const 
uno::Reference<accessibility::XAccessibleContext>&
     }
 }
 
-OUString truncateText(OUString& sText, sal_Int32 nNewLength)
+OUString truncateText(std::u16string_view sText, sal_Int32 nNewLength)
 {
     // truncate test to given length
-    OUString sNewText = sText.copy(0, nNewLength);
+    std::u16string_view sNewText = sText.substr(0, nNewLength);
     // try to truncate at a word
-    nNewLength = sNewText.lastIndexOf(" ");
-    if (nNewLength > 0)
-        sNewText = sNewText.copy(0, nNewLength);
-    return sNewText;
+    size_t nLastPos = sNewText.rfind(u" ");
+    if (nLastPos != 0 && nLastPos != std::u16string_view::npos)
+        sNewText = sNewText.substr(0, nLastPos);
+    return OUString(sNewText);
 }
 
 std::string stateSetToString(::sal_Int64 stateSet)
@@ -834,7 +834,7 @@ private:
                                   bool force, const std::string& msg = "");
     void resetParagraphInfo();
     void onFocusedParagraphInWriterTable(const 
uno::Reference<accessibility::XAccessibleTable>& xTable,
-                                         sal_Int64& nChildIndex,
+                                         sal_Int64 nChildIndex,
                                          const 
uno::Reference<accessibility::XAccessibleText>& xAccText);
     uno::Reference< accessibility::XAccessible >
     getSelectedObject(const accessibility::AccessibleEventObject& aEvent) 
const;
@@ -1270,7 +1270,7 @@ void LOKDocumentFocusListener::onShapeSelectionChanged(
 
 void LOKDocumentFocusListener::onFocusedParagraphInWriterTable(
     const uno::Reference<accessibility::XAccessibleTable>& xTable,
-    sal_Int64& nChildIndex,
+    sal_Int64 nChildIndex,
     const uno::Reference<accessibility::XAccessibleText>& xAccText
 )
 {
@@ -1399,7 +1399,7 @@ void LOKDocumentFocusListener::notifyEvent(const 
accessibility::AccessibleEventO
                                 // check if we are inside a table: in case 
notify table and current cell info
                                 bool isInsideTable = false;
                                 uno::Reference<XAccessibleTable> xTable;
-                                sal_Int64 nChildIndex;
+                                sal_Int64 nChildIndex = 0;
                                 lookForParentTable(xContext, xTable, 
nChildIndex);
                                 if (xTable.is())
                                 {
commit dfe21d378722e90218f2b97cea5c7a449d00b48c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Mar 20 08:14:33 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Mar 20 16:43:56 2025 +0100

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

diff --git a/include/oox/drawingml/connectorshapecontext.hxx 
b/include/oox/drawingml/connectorshapecontext.hxx
index 9130d9091db5..c5f2470fd61f 100644
--- a/include/oox/drawingml/connectorshapecontext.hxx
+++ b/include/oox/drawingml/connectorshapecontext.hxx
@@ -44,7 +44,7 @@ class ConnectorShapePropertiesContext : public 
::oox::core::ContextHandler2
 
 public:
     ConnectorShapePropertiesContext(
-        ::oox::core::ContextHandler2Helper const& rParent, ShapePtr& pShapePtr,
+        ::oox::core::ContextHandler2Helper const& rParent, const ShapePtr& 
pShapePtr,
         std::vector<ConnectorShapeProperties>& rConnectorShapePropertiesList);
 
     virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 
aElementToken,
diff --git a/include/oox/ppt/presentationfragmenthandler.hxx 
b/include/oox/ppt/presentationfragmenthandler.hxx
index 9a7937e2a4d2..0e46d86a7399 100644
--- a/include/oox/ppt/presentationfragmenthandler.hxx
+++ b/include/oox/ppt/presentationfragmenthandler.hxx
@@ -58,7 +58,7 @@ private:
     void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, 
sal_Int32 nThemeIdx);
     void saveColorMapToGrabBag(const oox::drawingml::ClrMapPtr& pClrMapPtr);
     void importCustomSlideShow(std::vector<CustomShow>& rCustomShowList);
-    static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const 
std::vector<SlidePersistPtr>& rSlidePersist);
+    static void importSlideNames(const ::oox::core::XmlFilterBase& rFilter, 
const std::vector<SlidePersistPtr>& rSlidePersist);
 
     std::vector< OUString > maSlideMasterVector;
     std::vector< OUString > maSlidesVector;
diff --git a/include/oox/ppt/slidepersist.hxx b/include/oox/ppt/slidepersist.hxx
index c8cd4cc7647f..d5b07909c3d7 100644
--- a/include/oox/ppt/slidepersist.hxx
+++ b/include/oox/ppt/slidepersist.hxx
@@ -125,7 +125,7 @@ public:
     CommentList& getCommentsList() { return maCommentsList; }
     CommentAuthorList& getCommentAuthors() { return maCommentAuthors; }
 
-    void createConnectorShapeConnection(oox::drawingml::ShapePtr& pConnector);
+    void createConnectorShapeConnection(const oox::drawingml::ShapePtr& 
pConnector);
 
 private:
     OUString                                                                
maPath;
diff --git a/oox/inc/drawingml/connectorhelper.hxx 
b/oox/inc/drawingml/connectorhelper.hxx
index 16544007abc7..f4d223026091 100644
--- a/oox/inc/drawingml/connectorhelper.hxx
+++ b/oox/inc/drawingml/connectorhelper.hxx
@@ -96,7 +96,8 @@ void getLOCurvedHandlePositionsHmm(const 
oox::drawingml::ShapePtr& pConnector,
  * @param pConnector is pointer to a oox::drawing::Shape that represents a 
connector shape.
  * @param [in] A flat map of target shape candidates, indexed by their msId.
 */
-void applyConnections(oox::drawingml::ShapePtr& pConnector, 
oox::drawingml::ShapeIdMap& rShapeMap);
+void applyConnections(const oox::drawingml::ShapePtr& pConnector,
+                      oox::drawingml::ShapeIdMap& rShapeMap);
 
 /**
  * Calculates the difference between handle positions in OOXML and the default 
handle positions in
diff --git a/oox/inc/drawingml/fontworkhelpers.hxx 
b/oox/inc/drawingml/fontworkhelpers.hxx
index 9a550b00904c..6dcea821717a 100644
--- a/oox/inc/drawingml/fontworkhelpers.hxx
+++ b/oox/inc/drawingml/fontworkhelpers.hxx
@@ -61,7 +61,7 @@ void collectCharColorProps(const 
css::uno::Reference<css::text::XText>& rXText,
 /** Applies all properties in rTextPropVec excluding "CharInteropGrabBag" to 
all non-empty runs in
     rXText.*/
 void applyPropsToRuns(const std::vector<css::beans::PropertyValue>& 
rTextPropVec,
-                      css::uno::Reference<css::text::XText>& rXText);
+                      const css::uno::Reference<css::text::XText>& rXText);
 
 /** Generates the properties "CharColor", "CharLumMod", "CharLumOff", 
"CharColorTheme",
     "CharComplexColor" and "CharTransparence" from the shape properties 
"FillColor",
@@ -80,7 +80,7 @@ void createCharInteropGrabBagUpdatesFromShapeProps(
 /** Puts all properties in rUpdatePropVec into the "CharInteropGrabBag" of all 
non-empty runs in rXText.
     Existing properties are overwritten.*/
 void applyUpdatesToCharInteropGrabBag(const 
std::vector<css::beans::PropertyValue>& rUpdatePropVec,
-                                      css::uno::Reference<css::text::XText>& 
rXText);
+                                      const 
css::uno::Reference<css::text::XText>& rXText);
 
 // ToDo: This is essentially the same as contained in method 
DrawingML::WriteOutline. Change it
 // there to use this method too, perhaps move this method to a common location.
diff --git a/oox/source/drawingml/connectorhelper.cxx 
b/oox/source/drawingml/connectorhelper.cxx
index 0a529b56a03c..e2f30e787c21 100644
--- a/oox/source/drawingml/connectorhelper.cxx
+++ b/oox/source/drawingml/connectorhelper.cxx
@@ -290,7 +290,7 @@ void ConnectorHelper::getLOCurvedHandlePositionsHmm(
     }
 }
 
-void ConnectorHelper::applyConnections(oox::drawingml::ShapePtr& pConnector,
+void ConnectorHelper::applyConnections(const oox::drawingml::ShapePtr& 
pConnector,
                                        oox::drawingml::ShapeIdMap& rShapeMap)
 {
     uno::Reference<drawing::XShape> xConnector(pConnector->getXShape());
diff --git a/oox/source/drawingml/connectorshapecontext.cxx 
b/oox/source/drawingml/connectorshapecontext.cxx
index 62c7a245e87b..9b3fd6733aa4 100644
--- a/oox/source/drawingml/connectorshapecontext.cxx
+++ b/oox/source/drawingml/connectorshapecontext.cxx
@@ -33,7 +33,7 @@ using namespace ::com::sun::star;
 namespace oox::drawingml {
 
 ConnectorShapePropertiesContext::ConnectorShapePropertiesContext(
-    ContextHandler2Helper const& rParent, ShapePtr& pShapePtr,
+    ContextHandler2Helper const& rParent, const ShapePtr& pShapePtr,
     std::vector<ConnectorShapeProperties>& rConnectorShapePropertiesList)
     : ContextHandler2(rParent)
     , mrConnectorShapePropertiesList(rConnectorShapePropertiesList)
diff --git a/oox/source/drawingml/diagram/diagram.hxx 
b/oox/source/drawingml/diagram/diagram.hxx
index 5eb82069b91b..0a1a59336da9 100644
--- a/oox/source/drawingml/diagram/diagram.hxx
+++ b/oox/source/drawingml/diagram/diagram.hxx
@@ -129,7 +129,7 @@ class Diagram
 {
 public:
     explicit Diagram();
-    void setData( OoxDiagramDataPtr& pData )
+    void setData( const OoxDiagramDataPtr& pData )
         { mpData = pData; }
     const OoxDiagramDataPtr& getData() const
         { return mpData; }
diff --git a/oox/source/drawingml/diagram/diagramhelper.cxx 
b/oox/source/drawingml/diagram/diagramhelper.cxx
index 327524b655fa..cfd0b45b790f 100644
--- a/oox/source/drawingml/diagram/diagramhelper.cxx
+++ b/oox/source/drawingml/diagram/diagramhelper.cxx
@@ -251,7 +251,7 @@ void AdvancedDiagramHelper::doAnchor(SdrObjGroup& rTarget, 
::oox::drawingml::Sha
 }
 
 const std::shared_ptr< ::oox::drawingml::Theme >& 
AdvancedDiagramHelper::getOrCreateThemePtr(
-    rtl::Reference< oox::shape::ShapeFilterBase >& rxFilter) const
+    const rtl::Reference< oox::shape::ShapeFilterBase >& rxFilter) const
 {
     // (Re-)Use already existing Theme if existing/imported if possible.
     // If not, re-import Theme if data is available and thus possible
diff --git a/oox/source/drawingml/diagram/diagramhelper.hxx 
b/oox/source/drawingml/diagram/diagramhelper.hxx
index 86a83926ec25..09ce59845264 100644
--- a/oox/source/drawingml/diagram/diagramhelper.hxx
+++ b/oox/source/drawingml/diagram/diagramhelper.hxx
@@ -85,7 +85,7 @@ public:
 
     void doAnchor(SdrObjGroup& rTarget, ::oox::drawingml::Shape& rRootShape);
     const std::shared_ptr< ::oox::drawingml::Theme >& getOrCreateThemePtr(
-        rtl::Reference< oox::shape::ShapeFilterBase>& rxFilter ) const;
+        const rtl::Reference< oox::shape::ShapeFilterBase>& rxFilter ) const;
 };
 
 }
diff --git a/oox/source/drawingml/fontworkhelpers.cxx 
b/oox/source/drawingml/fontworkhelpers.cxx
index 565f6b6c7b88..c37bad867b48 100644
--- a/oox/source/drawingml/fontworkhelpers.cxx
+++ b/oox/source/drawingml/fontworkhelpers.cxx
@@ -867,7 +867,7 @@ void FontworkHelpers::collectCharColorProps(const 
uno::Reference<text::XText>& r
 }
 
 void FontworkHelpers::applyPropsToRuns(const 
std::vector<beans::PropertyValue>& rTextPropVec,
-                                       uno::Reference<text::XText>& rXText)
+                                       const uno::Reference<text::XText>& 
rXText)
 {
     if (!rXText.is())
         return;
@@ -1092,8 +1092,9 @@ bool lcl_getThemeColorTransformationValue(const 
model::ComplexColor& rComplexCol
 // Adds the child elements 'lumMod' and 'lumOff' to 'schemeClr' 
maCurrentElement of pGrabStack,
 // if such exist in rComplexColor. 'alpha' is contained in the 
maTransformations of rComplexColor
 // in case of gradient fill.
-void lcl_addColorTransformationToGrabBagStack(const model::ComplexColor& 
rComplexColor,
-                                              
std::unique_ptr<oox::GrabBagStack>& pGrabBagStack)
+void lcl_addColorTransformationToGrabBagStack(
+    const model::ComplexColor& rComplexColor,
+    const std::unique_ptr<oox::GrabBagStack>& pGrabBagStack)
 {
     if (pGrabBagStack == nullptr)
         return;
@@ -1624,7 +1625,8 @@ void 
FontworkHelpers::createCharInteropGrabBagUpdatesFromShapeProps(
 }
 
 void FontworkHelpers::applyUpdatesToCharInteropGrabBag(
-    const std::vector<beans::PropertyValue>& rUpdatePropVec, 
uno::Reference<text::XText>& rXText)
+    const std::vector<beans::PropertyValue>& rUpdatePropVec,
+    const uno::Reference<text::XText>& rXText)
 {
     if (!rXText.is())
         return;
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 77baafbe755d..6f9905a4c612 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2427,7 +2427,7 @@ void DrawingML::WriteShapeTransformation( const 
Reference< XShape >& rXShape, sa
             bFlipHWrite, bFlipVWrite, ExportRotateClockwisify(nRotation + 
nCameraRotation), IsGroupShape( rXShape ));
 }
 
-static OUString lcl_GetTarget(const css::uno::Reference<css::frame::XModel>& 
xModel, OUString& rURL)
+static OUString lcl_GetTarget(const css::uno::Reference<css::frame::XModel>& 
xModel, std::u16string_view rURL)
 {
     Reference<drawing::XDrawPagesSupplier> xDPS(xModel, uno::UNO_QUERY_THROW);
     Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), 
uno::UNO_SET_THROW);
@@ -2450,9 +2450,9 @@ static OUString lcl_GetTarget(const 
css::uno::Reference<css::frame::XModel>& xMo
     }
     if (sTarget.isEmpty())
     {
-        sal_Int32 nSplit = rURL.lastIndexOf(' ');
-        if (nSplit > -1)
-            sTarget = OUString::Concat("slide") + rURL.subView(nSplit + 1) + 
".xml";
+        size_t nSplit = rURL.rfind(' ');
+        if (nSplit != std::u16string_view::npos)
+            sTarget = OUString::Concat("slide") + rURL.substr(nSplit + 1) + 
".xml";
     }
 
     return sTarget;
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx 
b/oox/source/ppt/presentationfragmenthandler.cxx
index 3266e9945bde..180cd7128867 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -126,7 +126,7 @@ PresentationFragmentHandler::~PresentationFragmentHandler() 
noexcept
 {
 }
 
-void PresentationFragmentHandler::importSlideNames(XmlFilterBase& rFilter, 
const std::vector<SlidePersistPtr>& rSlidePersist)
+void PresentationFragmentHandler::importSlideNames(const XmlFilterBase& 
rFilter, const std::vector<SlidePersistPtr>& rSlidePersist)
 {
     sal_Int32 nMaxPages = rSlidePersist.size();
     for (sal_Int32 nPage = 0; nPage < nMaxPages; nPage++)
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 446b7d5623a2..847ab5f2ab97 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -390,7 +390,7 @@ void SlidePersist::hideShapesAsMasterShapes()
 }
 
 // This angle determines in the direction of the line
-static sal_Int32 lcl_GetAngle(uno::Reference<drawing::XShape>& rXShape, 
awt::Point& rPt)
+static sal_Int32 lcl_GetAngle(const uno::Reference<drawing::XShape>& rXShape, 
const awt::Point& rPt)
 {
     SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape);
     tools::Rectangle aR(pObj->GetSnapRect());
@@ -429,8 +429,8 @@ Reference<XAnimationNode> 
SlidePersist::getAnimationNode(const OUString& sId) co
     return aResult;
 }
 
-static void lcl_SetEdgeLineValue(uno::Reference<drawing::XShape>& rXConnector,
-                                 oox::drawingml::ShapePtr& rShapePtr)
+static void lcl_SetEdgeLineValue(const uno::Reference<drawing::XShape>& 
rXConnector,
+                                 const oox::drawingml::ShapePtr& rShapePtr)
 {
     sal_Int32 nEdge = 0;
     awt::Point aStartPt, aEndPt;
@@ -517,7 +517,7 @@ static void 
lcl_SetEdgeLineValue(uno::Reference<drawing::XShape>& rXConnector,
 }
 
 // create connection between two shape with a connector shape.
-void SlidePersist::createConnectorShapeConnection(oox::drawingml::ShapePtr& 
pConnector)
+void SlidePersist::createConnectorShapeConnection(const 
oox::drawingml::ShapePtr& pConnector)
 {
     oox::drawingml::ConnectorShapePropertiesList aConnectorShapeProperties
         = pConnector->getConnectorShapeProperties();
diff --git a/oox/source/shape/WordprocessingCanvasContext.cxx 
b/oox/source/shape/WordprocessingCanvasContext.cxx
index b03886441d6a..5ec1af292869 100644
--- a/oox/source/shape/WordprocessingCanvasContext.cxx
+++ b/oox/source/shape/WordprocessingCanvasContext.cxx
@@ -32,7 +32,7 @@ using namespace com::sun::star;
 namespace oox::shape
 {
 WordprocessingCanvasContext::WordprocessingCanvasContext(FragmentHandler2 
const& rParent,
-                                                         css::awt::Size& rSize)
+                                                         const css::awt::Size& 
rSize)
     : FragmentHandler2(rParent)
     , m_bFullWPGSupport(true)
 {
diff --git a/oox/source/shape/WordprocessingCanvasContext.hxx 
b/oox/source/shape/WordprocessingCanvasContext.hxx
index ffc6a84aeed5..105a83cfcb60 100644
--- a/oox/source/shape/WordprocessingCanvasContext.hxx
+++ b/oox/source/shape/WordprocessingCanvasContext.hxx
@@ -20,7 +20,7 @@ class WordprocessingCanvasContext final : public 
oox::core::FragmentHandler2
 public:
     // mpShapePtr points to the root of the group. rSize is the size of the 
background shape.
     explicit WordprocessingCanvasContext(oox::core::FragmentHandler2 const& 
rParent,
-                                         css::awt::Size& rSize);
+                                         const css::awt::Size& rSize);
     ~WordprocessingCanvasContext() override;
 
     oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElementToken,
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 56abef55fcc1..c60e3d8971c3 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -503,7 +503,7 @@ void lcl_setTextPropsToShape(const 
uno::Reference<beans::XPropertySet>& xShapePr
     }
 }
 
-void lcl_applyUsedTextPropsToAllTextRuns(uno::Reference<text::XText>& xText,
+void lcl_applyUsedTextPropsToAllTextRuns(const uno::Reference<text::XText>& 
xText,
                                          const 
std::vector<beans::PropertyValue>& aTextPropVec)
 {
     if (!xText.is())

Reply via email to