basic/source/inc/codegen.hxx                        |    2 +-
 basic/source/inc/namecont.hxx                       |    2 +-
 basic/source/uno/namecont.cxx                       |    2 +-
 chart2/inc/ChartModel.hxx                           |    2 +-
 chart2/inc/ChartView.hxx                            |    4 ++--
 chart2/source/model/main/ChartModel.cxx             |    2 +-
 chart2/source/view/main/ChartView.cxx               |    4 ++--
 comphelper/source/misc/lok.cxx                      |    2 +-
 compilerplugins/clang/passstuffbyref.cxx            |    6 ++++++
 cui/source/dialogs/hyperlinktabpagebase.cxx         |    4 ++--
 cui/source/inc/hyperlinktabpagebase.hxx             |    2 +-
 editeng/source/items/frmitems.cxx                   |   12 ++++++------
 framework/source/inc/accelerators/storageholder.hxx |    2 +-
 include/basegfx/utils/bgradient.hxx                 |    2 +-
 include/comphelper/lok.hxx                          |    2 +-
 include/editeng/lrspitem.hxx                        |   12 ++++++------
 include/sfx2/viewsh.hxx                             |    2 +-
 include/svl/urihelper.hxx                           |    2 +-
 include/svx/TableAutoFmt.hxx                        |    2 +-
 include/svx/svdobj.hxx                              |    2 +-
 include/test/nanpayload_test.hxx                    |    4 ++--
 include/tools/XPath.hxx                             |    2 +-
 include/vcl/toolkit/svlbitm.hxx                     |    2 +-
 include/vcl/toolkit/treelistentry.hxx               |    4 ++--
 include/xmloff/xmlexp.hxx                           |    2 +-
 o3tl/qa/cow_wrapper_clients.hxx                     |    2 +-
 sc/inc/appoptio.hxx                                 |    2 +-
 sc/inc/spellcheckcontext.hxx                        |    2 +-
 sc/inc/tokenstringcontext.hxx                       |    2 +-
 sc/source/core/data/table3.cxx                      |    4 ++--
 sc/source/ui/dbgui/tpsubt.cxx                       |    6 +++---
 sc/source/ui/dialogs/SelectSheetViewDialog.cxx      |    2 +-
 sc/source/ui/inc/csvcontrol.hxx                     |    2 +-
 sc/source/ui/inc/dataprovider.hxx                   |    4 ++--
 sc/source/ui/inc/tpsubt.hxx                         |    2 +-
 sc/source/ui/view/spellcheckcontext.cxx             |    4 ++--
 sd/inc/ResourceId.hxx                               |    2 +-
 sd/source/ui/framework/configuration/ResourceId.cxx |    4 ++--
 sd/source/ui/inc/DrawController.hxx                 |    2 +-
 sd/source/ui/inc/SlideshowLayerRenderer.hxx         |    2 +-
 sd/source/ui/tools/SlideshowLayerRenderer.cxx       |    2 +-
 sd/source/ui/unoidl/DrawController.cxx              |    2 +-
 sdext/source/minimizer/pppoptimizertoken.cxx        |    2 +-
 sdext/source/minimizer/pppoptimizertoken.hxx        |    2 +-
 sfx2/source/view/viewsh.cxx                         |    2 +-
 starmath/inc/cfgitem.hxx                            |    2 +-
 starmath/source/ElementsDockingWindow.cxx           |    4 ++--
 starmath/source/cfgitem.cxx                         |    2 +-
 svl/source/misc/urihelper.cxx                       |    8 ++++----
 sw/inc/redline.hxx                                  |    2 +-
 sw/inc/unotxdoc.hxx                                 |    2 +-
 sw/qa/extras/embedded_fonts/embedded_fonts.cxx      |    2 +-
 sw/source/core/doc/DocumentRedlineManager.cxx       |   20 ++++++++++----------
 sw/source/core/inc/DocumentRedlineManager.hxx       |    8 ++++----
 sw/source/filter/html/wrthtml.hxx                   |    2 +-
 sw/source/uibase/config/SwBaselineGridConfig.cxx    |    2 +-
 sw/source/uibase/inc/SwBaselineGridConfig.hxx       |    2 +-
 sw/source/uibase/uno/unotxdoc.cxx                   |    2 +-
 sw/source/writerfilter/ooxml/ShadowContext.hxx      |    2 +-
 vcl/inc/pdf/EncryptionHashTransporter.hxx           |   10 +++++-----
 vcl/inc/qt5/QtInstanceTreeIter.hxx                  |    2 +-
 vcl/inc/qt5/QtTreeViewModel.hxx                     |    2 +-
 vcl/qt5/QtTreeViewModel.cxx                         |    2 +-
 vcl/source/treelist/svlbitm.cxx                     |    2 +-
 xmloff/source/style/XMLFontAutoStylePool.cxx        |    2 +-
 65 files changed, 111 insertions(+), 105 deletions(-)

New commits:
commit 4b10710e09ee72694165573a2425d0925401289e
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Mar 4 16:50:21 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Mar 4 19:22:19 2026 +0100

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

diff --git a/basic/source/inc/codegen.hxx b/basic/source/inc/codegen.hxx
index ff8851317b6e..fab605bcc76c 100644
--- a/basic/source/inc/codegen.hxx
+++ b/basic/source/inc/codegen.hxx
@@ -89,7 +89,7 @@ struct ParamInfoFlag{
     static void setFlagFor(sal_uInt32& val, const ParamInfo &&pe){
         val |= static_cast<sal_uInt32>(pe);
     };
-    static bool checkFlagFor(const sal_uInt32& val, const ParamInfo &&pe){
+    static bool checkFlagFor(sal_uInt32 val, const ParamInfo &&pe){
         return val & static_cast<sal_uInt32>(pe);
     };
 };
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 4f628aa03650..48d8bb950263 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -82,7 +82,7 @@ public:
                        std::unique_lock<std::mutex>& guard);
 
     // Methods XElementAccess
-    css::uno::Type getElementType();
+    const css::uno::Type & getElementType();
     sal_Bool hasElements();
 
     // Methods XNameAccess
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 5c20f637b476..33ac0dee21af 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -97,7 +97,7 @@ static bool GbMigrationSuppressErrors = false;
 // Implementation class NameContainer
 
 // Methods XElementAccess
-Type NameContainer::getElementType()
+const Type & NameContainer::getElementType()
 {
     return mType;
 }
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 88f208e70bec..be3e6f9e9fcd 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -533,7 +533,7 @@ public:
     void applyColorPaletteToDataSeries(const ChartColorPalette& rColorPalette);
     void onDocumentThemeChanged();
 
-    std::optional<css::util::DateTime> getNullDate() const;
+    const std::optional<css::util::DateTime> & getNullDate() const;
     void changeNullDate(const css::util::DateTime& aNullDate);
 
 private:
diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx
index b266a60f407d..28d0077ffb4c 100644
--- a/chart2/inc/ChartView.hxx
+++ b/chart2/inc/ChartView.hxx
@@ -131,9 +131,9 @@ public:
     */
     css::awt::Rectangle getRectangleOfObject( const OUString& rObjectCID, bool 
bSnapRect=false );
 
-    css::awt::Rectangle getDiagramRectangleExcludingAxes();
+    const css::awt::Rectangle & getDiagramRectangleExcludingAxes();
 
-    std::shared_ptr< DrawModelWrapper > getDrawModelWrapper();
+    const std::shared_ptr< DrawModelWrapper > & getDrawModelWrapper();
 
     // ___XTransferable___
     virtual css::uno::Any SAL_CALL getTransferData( const 
css::datatransfer::DataFlavor& aFlavor ) override;
diff --git a/chart2/source/model/main/ChartModel.cxx 
b/chart2/source/model/main/ChartModel.cxx
index 8ae24816b578..bdb278a7bbeb 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1661,7 +1661,7 @@ void ChartModel::changeNullDate(const 
css::util::DateTime& aNullDate)
     }
 }
 
-std::optional<css::util::DateTime> ChartModel::getNullDate() const
+const std::optional<css::util::DateTime> & ChartModel::getNullDate() const
 {
     return m_aNullDate;
 }
diff --git a/chart2/source/view/main/ChartView.cxx 
b/chart2/source/view/main/ChartView.cxx
index 43eb0c7d46f7..28e4333da5b9 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -851,7 +851,7 @@ rtl::Reference< SvxShape > ChartView::getShapeForCID( const 
OUString& rObjectCID
     return xShape2;
 }
 
-awt::Rectangle ChartView::getDiagramRectangleExcludingAxes()
+const awt::Rectangle & ChartView::getDiagramRectangleExcludingAxes()
 {
     impl_updateView();
     return m_aResultingDiagramRectangleExcludingAxes;
@@ -907,7 +907,7 @@ awt::Rectangle ChartView::getRectangleOfObject( const 
OUString& rObjectCID, bool
     return aRet;
 }
 
-std::shared_ptr< DrawModelWrapper > ChartView::getDrawModelWrapper()
+const std::shared_ptr< DrawModelWrapper > & ChartView::getDrawModelWrapper()
 {
     return m_pDrawModelWrapper;
 }
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index bf62b5ae01e1..8736e6e82fd9 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -445,7 +445,7 @@ void setInitialClientVisibleArea(const awt::Rectangle& 
rClientVisibleArea)
     g_aInitialClientVisibleArea = rClientVisibleArea;
 }
 
-awt::Rectangle getInitialClientVisibleArea() { return 
g_aInitialClientVisibleArea; }
+const awt::Rectangle & getInitialClientVisibleArea() { return 
g_aInitialClientVisibleArea; }
 
 } // namespace
 
diff --git a/compilerplugins/clang/passstuffbyref.cxx 
b/compilerplugins/clang/passstuffbyref.cxx
index 265b250e13f2..a1313cc6886d 100644
--- a/compilerplugins/clang/passstuffbyref.cxx
+++ b/compilerplugins/clang/passstuffbyref.cxx
@@ -196,12 +196,18 @@ void PassStuffByRef::checkParams(const FunctionDecl * 
functionDecl) {
     {
         return;
     }
+    // template function
+    if (dc.Function("toString").Struct("assertion_traits"))
+        return;
     // not sure why, but changing these causes problems
     if (dc.Function("lcl_createColorMapFromShapeProps")
         || dc.Function("getAPIAnglesFrom3DProperties").Class("Scene3DHelper")
         || dc.Function("FillSeriesSimple").Class("ScTable")
         || dc.Function("FillAutoSimple").Class("ScTable"))
         return;
+    // passing a bool flag by const& so we can cancel a loop inside the 
function
+    if (dc.Function("TranslateDocumentCancellable"))
+        return;
 
     unsigned n = functionDecl->getNumParams();
     assert(!functionDecls_.empty());
diff --git a/cui/source/dialogs/hyperlinktabpagebase.cxx 
b/cui/source/dialogs/hyperlinktabpagebase.cxx
index 64736f8acd0e..0e7f0cfbd908 100644
--- a/cui/source/dialogs/hyperlinktabpagebase.cxx
+++ b/cui/source/dialogs/hyperlinktabpagebase.cxx
@@ -101,12 +101,12 @@ void 
HyperlinkTabPageBase::GetDataFromCommonFields(OUString& aStrName, OUString&
     eMode = (m_xForm->get_active() == 1) ? HLINK_BUTTON : HLINK_FIELD;
 }
 
-OUString HyperlinkTabPageBase::GetSchemeFromURL(std::u16string_view rStrUrl)
+const OUString& HyperlinkTabPageBase::GetSchemeFromURL(std::u16string_view 
rStrUrl)
 {
     INetURLObject aURL(rStrUrl);
     if (aURL.GetProtocol() != INetProtocol::NotValid)
         return INetURLObject::GetScheme(aURL.GetProtocol());
-    return OUString();
+    return EMPTY_OUSTRING;
 }
 
 void HyperlinkTabPageBase::ShowMarkWnd()
diff --git a/cui/source/inc/hyperlinktabpagebase.hxx 
b/cui/source/inc/hyperlinktabpagebase.hxx
index 270ffb8d942d..53b5465ebf46 100644
--- a/cui/source/inc/hyperlinktabpagebase.hxx
+++ b/cui/source/inc/hyperlinktabpagebase.hxx
@@ -70,7 +70,7 @@ protected:
     void GetDataFromCommonFields(OUString& aStrName, OUString& aStrIntName, 
OUString& aStrFrame,
                                  SvxLinkInsertMode& eMode);
 
-    static OUString GetSchemeFromURL(std::u16string_view rStrUrl);
+    static const OUString& GetSchemeFromURL(std::u16string_view rStrUrl);
 
     virtual bool ShouldOpenMarkWnd() { return false; }
     virtual void SetMarkWndShouldOpen(bool bOpen) { m_bMarkWndOpen = bOpen; }
diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index ea924f74ffe2..673500d8c2a9 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -673,7 +673,7 @@ void SvxLRSpaceItem::SetLeft(SvxIndentValue stL, const 
sal_uInt16 nProp)
     }
 }
 
-SvxIndentValue SvxLRSpaceItem::GetLeft() const { return m_stLeftMargin; }
+const SvxIndentValue & SvxLRSpaceItem::GetLeft() const { return 
m_stLeftMargin; }
 
 sal_Int32 SvxLRSpaceItem::ResolveLeft(const SvxFontUnitMetrics& rMetrics) const
 {
@@ -693,9 +693,9 @@ void SvxRightMarginItem::SetRight(SvxIndentValue stR, const 
sal_uInt16 nProp)
     }
 }
 
-SvxIndentValue SvxRightMarginItem::GetRight() const { return m_stRightMargin; }
+const SvxIndentValue & SvxRightMarginItem::GetRight() const { return 
m_stRightMargin; }
 
-SvxIndentValue SvxLRSpaceItem::GetRight() const { return m_stRightMargin; }
+const SvxIndentValue & SvxLRSpaceItem::GetRight() const { return 
m_stRightMargin; }
 
 sal_Int32 SvxRightMarginItem::ResolveRight(const SvxFontUnitMetrics& rMetrics) 
const
 {
@@ -795,7 +795,7 @@ void SvxLRSpaceItem::SetTextLeft(SvxIndentValue stL, const 
sal_uInt16 nProp)
     }
 }
 
-SvxIndentValue SvxLRSpaceItem::GetTextFirstLineOffset() const
+const SvxIndentValue & SvxLRSpaceItem::GetTextFirstLineOffset() const
 {
     return m_stFirstLineOffset;
 }
@@ -805,7 +805,7 @@ sal_Int32 SvxLRSpaceItem::ResolveTextFirstLineOffset(const 
SvxFontUnitMetrics& r
     return m_stFirstLineOffset.Resolve(rMetrics);
 }
 
-SvxIndentValue SvxTextLeftMarginItem::GetTextLeft() const { return 
m_stTextLeftMargin; }
+const SvxIndentValue & SvxTextLeftMarginItem::GetTextLeft() const { return 
m_stTextLeftMargin; }
 
 sal_Int32 SvxTextLeftMarginItem::ResolveTextLeft(const SvxFontUnitMetrics& 
rMetrics) const
 {
@@ -1309,7 +1309,7 @@ void 
SvxFirstLineIndentItem::SetTextFirstLineOffset(SvxIndentValue stValue, sal_
     }
 }
 
-SvxIndentValue SvxFirstLineIndentItem::GetTextFirstLineOffset() const
+const SvxIndentValue & SvxFirstLineIndentItem::GetTextFirstLineOffset() const
 {
     return m_stFirstLineOffset;
 }
diff --git a/framework/source/inc/accelerators/storageholder.hxx 
b/framework/source/inc/accelerators/storageholder.hxx
index 7f0c420bdf1a..df42796879d1 100644
--- a/framework/source/inc/accelerators/storageholder.hxx
+++ b/framework/source/inc/accelerators/storageholder.hxx
@@ -62,7 +62,7 @@ class StorageHolder final
                     Storage.clear();
                 }
 
-                css::uno::Reference<css::embed::XStorage> getStorage(const 
std::unique_lock<std::mutex>&) const
+                const css::uno::Reference<css::embed::XStorage>& 
getStorage(const std::unique_lock<std::mutex>&) const
                 {
                     return Storage;
                 }
diff --git a/include/basegfx/utils/bgradient.hxx 
b/include/basegfx/utils/bgradient.hxx
index 2c84548b48ed..003c41b1855d 100644
--- a/include/basegfx/utils/bgradient.hxx
+++ b/include/basegfx/utils/bgradient.hxx
@@ -145,7 +145,7 @@ public:
 
     void changeStartAndEnd(BColor const& rStart, BColor const& rEnd);
 
-    BColor getStopColor(size_t i) const { return maStops[i].getStopColor(); }
+    const BColor& getStopColor(size_t i) const { return 
maStops[i].getStopColor(); }
 
     void removeLastStop() { return maStops.pop_back(); }
 
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index ebdb8439ba0e..993f6e53ed2a 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -173,7 +173,7 @@ COMPHELPER_DLLPUBLIC ViewShellDocId getDocId();
 
 COMPHELPER_DLLPUBLIC void
 setInitialClientVisibleArea(const css::awt::Rectangle& rClientVisibleArea);
-COMPHELPER_DLLPUBLIC css::awt::Rectangle getInitialClientVisibleArea();
+COMPHELPER_DLLPUBLIC const css::awt::Rectangle& getInitialClientVisibleArea();
 }
 
 #endif // INCLUDED_COMPHELPER_LOK_HXX
diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx
index 726fffc2301e..46f7ce09fe0c 100644
--- a/include/editeng/lrspitem.hxx
+++ b/include/editeng/lrspitem.hxx
@@ -152,7 +152,7 @@ public:
 
     void SetTextLeft(SvxIndentValue stL, const sal_uInt16 nProp = 100);
     sal_Int32 ResolveTextLeft(const SvxFontUnitMetrics& rMetrics) const;
-    SvxIndentValue GetTextLeft() const;
+    const SvxIndentValue & GetTextLeft() const;
 
     DECLARE_ITEM_TYPE_FUNCTION(SvxTextLeftMarginItem)
     explicit SvxTextLeftMarginItem(const sal_uInt16 nId);
@@ -198,7 +198,7 @@ public:
     sal_uInt16 GetPropTextFirstLineOffset() const;
 
     void SetTextFirstLineOffset(SvxIndentValue stValue, sal_uInt16 nProp = 
100);
-    SvxIndentValue GetTextFirstLineOffset() const;
+    const SvxIndentValue & GetTextFirstLineOffset() const;
     sal_Int32 ResolveTextFirstLineOffset(const SvxFontUnitMetrics& rMetrics) 
const;
 
     DECLARE_ITEM_TYPE_FUNCTION(SvxFirstLineIndentItem)
@@ -239,7 +239,7 @@ public:
     void SetRight(SvxIndentValue stR, const sal_uInt16 nProp = 100);
 
     // Query/direct setting of the absolute values
-    SvxIndentValue GetRight() const;
+    const SvxIndentValue & GetRight() const;
     sal_Int32 ResolveRight(const SvxFontUnitMetrics& rMetrics) const;
     sal_Int32 ResolveRightFixedPart() const;
     sal_Int32 ResolveRightVariablePart(const SvxFontUnitMetrics& rMetrics) 
const;
@@ -386,9 +386,9 @@ public:
     void SetRight(SvxIndentValue stR, const sal_uInt16 nProp = 100);
 
     // Query/direct setting of the absolute values
-    SvxIndentValue GetLeft() const;
+    const SvxIndentValue & GetLeft() const;
     sal_Int32 ResolveLeft(const SvxFontUnitMetrics& rMetrics) const;
-    SvxIndentValue GetRight() const;
+    const SvxIndentValue & GetRight() const;
     sal_Int32 ResolveRight(const SvxFontUnitMetrics& rMetrics) const;
     bool IsAutoFirst()  const { return bAutoFirst; }
     void SetAutoFirst( const bool bNew ) { bAutoFirst = bNew; }
@@ -406,7 +406,7 @@ public:
     sal_Int32 ResolveTextLeft(const SvxFontUnitMetrics& rMetrics) const;
 
     void SetTextFirstLineOffset(SvxIndentValue stValue, sal_uInt16 nProp = 
100);
-    SvxIndentValue GetTextFirstLineOffset() const;
+    const SvxIndentValue & GetTextFirstLineOffset() const;
     sal_Int32 ResolveTextFirstLineOffset(const SvxFontUnitMetrics& rMetrics) 
const;
 
     void SetPropTextFirstLineOffset( const sal_uInt16 nProp )
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 5d2dc0d9f9b5..63ac690d8ee7 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -499,7 +499,7 @@ public:
     OUString getA11yFocusedParagraph() const;
     int getA11yCaretPosition() const;
     void SetSigningCertificate(const svl::crypto::CertificateOrName& 
rCertificateOrName);
-    svl::crypto::CertificateOrName GetSigningCertificate() const;
+    const svl::crypto::CertificateOrName & GetSigningCertificate() const;
 
     // These are used for visual signing: SetSignPDFCertificate() is called 
when the signature
     // line is inserted, and GetSignPDFCertificate() is used by the signing 
code to get the already
diff --git a/include/svl/urihelper.hxx b/include/svl/urihelper.hxx
index 6de0ed746c05..5222f43983b9 100644
--- a/include/svl/urihelper.hxx
+++ b/include/svl/urihelper.hxx
@@ -122,7 +122,7 @@ SVL_DLLPUBLIC OUString FindFirstURLInText(OUString const & 
rText,
 
 SVL_DLLPUBLIC OUString FindFirstDOIInText(std::u16string_view rText,
                                           sal_Int32 & rBegin,
-                                          const sal_Int32 & rEnd,
+                                          sal_Int32 nEnd,
                                           CharClass const & rCharClass);
 
 /** Remove any password component from both absolute and relative URLs.
diff --git a/include/svx/TableAutoFmt.hxx b/include/svx/TableAutoFmt.hxx
index ec5290008025..78106832f58f 100644
--- a/include/svx/TableAutoFmt.hxx
+++ b/include/svx/TableAutoFmt.hxx
@@ -108,7 +108,7 @@ public:
         if (prop < PROP_COUNT)
             mSetProperties[prop] = set;
     }
-    std::bitset<PROP_COUNT> GetPropertySet() const { return mSetProperties; }
+    const std::bitset<PROP_COUNT>& GetPropertySet() const { return 
mSetProperties; }
     void SetPropertySet(std::bitset<PROP_COUNT> aSet) { mSetProperties = aSet; 
}
 };
 
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index dcf53c3d357c..71843af739b4 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -825,7 +825,7 @@ public:
     void SetEmptyPresObj(bool bEpt);
     bool IsEmptyPresObj() const { return m_bEmptyPresObj;}
     void SetCustomPromptText(const OUString& aVal);
-    OUString GetCustomPromptText() const { return m_aCustomPromptText; }
+    const OUString & GetCustomPromptText() const { return m_aCustomPromptText; 
}
     void SetNotVisibleAsMaster(bool bFlg);
     bool IsNotVisibleAsMaster() const { return m_bNotVisibleAsMaster;}
     void SetUserCall(SdrObjUserCall* pUser);
diff --git a/include/test/nanpayload_test.hxx b/include/test/nanpayload_test.hxx
index 198ffeb18f9c..e76cc7ef6e76 100644
--- a/include/test/nanpayload_test.hxx
+++ b/include/test/nanpayload_test.hxx
@@ -54,9 +54,9 @@ public:
         m_bSupported = true;
     }
 
-    bool getIfSupported() { return m_bSupported; }
+    bool getIfSupported() const { return m_bSupported; }
 
-    std::string getMessage() { return m_aMessage; }
+    const std::string& getMessage() const { return m_aMessage; }
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/tools/XPath.hxx b/include/tools/XPath.hxx
index 398c8d3f1f80..e6ce61203431 100644
--- a/include/tools/XPath.hxx
+++ b/include/tools/XPath.hxx
@@ -54,7 +54,7 @@ class TOOLS_DLLPUBLIC XPathObject final
 public:
     XPathObject(xmlXPathObjectPtr pXPathObject, std::string_view aString);
     ~XPathObject();
-    std::string_view getPathString() { return maPath; }
+    const std::string_view& getPathString() { return maPath; }
     sal_Int32 count();
     OUString attribute(const char* pAttribute);
     OUString content();
diff --git a/include/vcl/toolkit/svlbitm.hxx b/include/vcl/toolkit/svlbitm.hxx
index 6aacce557243..fc33709d3544 100644
--- a/include/vcl/toolkit/svlbitm.hxx
+++ b/include/vcl/toolkit/svlbitm.hxx
@@ -78,7 +78,7 @@ public:
                             ~SvLBoxButtonData();
 
     static SvBmp            GetIndex( SvItemStateFlags nItemState );
-    Size                    GetSize();
+    const Size &            GetSize();
     void                    SetLink( const Link<SvLBoxButtonData*,void>& 
rLink) { aLink=rLink; }
     bool                    IsRadio() const;
     // as buttons are not derived from LinkHdl
diff --git a/include/vcl/toolkit/treelistentry.hxx 
b/include/vcl/toolkit/treelistentry.hxx
index dc20bda5b240..56481e39babb 100644
--- a/include/vcl/toolkit/treelistentry.hxx
+++ b/include/vcl/toolkit/treelistentry.hxx
@@ -119,10 +119,10 @@ public:
     void SetFlags( SvTLEntryFlags nFlags );
 
     void SetTextColor( std::optional<Color> xColor ) { mxTextColor = xColor; }
-    OUString GetAccessibleName() { return m_sAccessibleName; }
+    const OUString & GetAccessibleName() { return m_sAccessibleName; }
     void SetAccessibleName(const OUString& rName) { m_sAccessibleName = rName; 
};
 
-    OUString GetToolTip() { return m_sToolTip; };
+    const OUString & GetToolTip() { return m_sToolTip; };
     void SetToolTip(const OUString& rToolTip) { m_sToolTip = rToolTip; };
 
     std::optional<Color> const & GetTextColor() const { return mxTextColor; }
diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index b54c97310fcb..ffa1ec8d63f5 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -316,7 +316,7 @@ public:
     // doesn't handle some style-specific content like headers/footers. These 
methods are for
     // passing the "already embedded" information from one instance to another.
 
-    std::unordered_map<OString, OUString> getEmbeddedFontFiles() const;
+    const std::unordered_map<OString, OUString> & getEmbeddedFontFiles() const;
     void setEmbeddedFontFiles(const std::unordered_map<OString, OUString>&);
 
     // XExporter
diff --git a/o3tl/qa/cow_wrapper_clients.hxx b/o3tl/qa/cow_wrapper_clients.hxx
index 0c0f4aeb7b5c..7421ec0f0e75 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( const ref_count_t& rCount) { return rCount; }
+    static std::size_t getCount( ref_count_t rCount) { return rCount; }
 };
 
 class cow_wrapper_client5
diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx
index d4beeec78c06..b34fb60a0759 100644
--- a/sc/inc/appoptio.hxx
+++ b/sc/inc/appoptio.hxx
@@ -48,7 +48,7 @@ public:
     sal_uInt16* GetLRUFuncList() const          { return pLRUList.get();      }
     void        SetLRUFuncList( const sal_uInt16* pList,
                                 const sal_uInt16  nCount );
-    std::unordered_set<sal_uInt16> GetFavouritesList() const { return 
sFavouritesList; }
+    const std::unordered_set<sal_uInt16> & GetFavouritesList() const { return 
sFavouritesList; }
     void        SetFavouritesList(const std::unordered_set<sal_uInt16>& rList) 
{ sFavouritesList = rList; }
     void        SetStatusFunc( sal_uInt32 nNew )    { nStatusFunc = nNew;   }
     sal_uInt32      GetStatusFunc() const           { return nStatusFunc;   }
diff --git a/sc/inc/spellcheckcontext.hxx b/sc/inc/spellcheckcontext.hxx
index 9d69c44c1e7b..46912a054e5f 100644
--- a/sc/inc/spellcheckcontext.hxx
+++ b/sc/inc/spellcheckcontext.hxx
@@ -67,7 +67,7 @@ public:
     void dispose();
 
     bool isMisspelled(SCCOL nCol, SCROW nRow) const;
-    MisspellRangeResult getMisspellRanges(SCCOL nCol, SCROW nRow) const;
+    const MisspellRangeResult& getMisspellRanges(SCCOL nCol, SCROW nRow) const;
     void setMisspellRanges(SCCOL nCol, SCROW nRow, const MisspellRangeResult& 
rRangeResult);
 
     void reset();
diff --git a/sc/inc/tokenstringcontext.hxx b/sc/inc/tokenstringcontext.hxx
index 7421120dd2a6..9fe9d4c62880 100644
--- a/sc/inc/tokenstringcontext.hxx
+++ b/sc/inc/tokenstringcontext.hxx
@@ -66,7 +66,7 @@ public:
     {
         m_oODFSavingVersion = eDefaultVersion;
     }
-    std::optional<SvtSaveOptions::ODFSaneDefaultVersion> getODFSavingVersion()
+    const std::optional<SvtSaveOptions::ODFSaneDefaultVersion>& 
getODFSavingVersion() const
     {
         return m_oODFSavingVersion;
     }
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 648670c4c1d9..8edc854d0431 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -110,7 +110,7 @@ using namespace ::com::sun::star::i18n;
     FALSE if no numeral element is found.
 */
 static bool SplitString(const OUString &sWhole, const LanguageTag& 
rLanguageTag, OUString &sPrefix,
-                        OUString &sSuffix, double &fNum, const bool &bInteger 
= false)
+                        OUString &sSuffix, double &fNum, const bool bInteger = 
false)
 {
     // Get prefix element, search for any digit and stop.
     sal_Int32 nPos = 0;
@@ -197,7 +197,7 @@ static bool SplitString(const OUString &sWhole, const 
LanguageTag& rLanguageTag,
 static short Compare(const OUString &sInput1, const OUString &sInput2,
                      const LanguageTag& rLanguageTag, const bool bCaseSens,
                      const ScUserListData* pData, const CollatorWrapper *pCW,
-                     const bool& bInteger = false)
+                     const bool bInteger = false)
 {
     OUString sStr1( sInput1 ), sStr2( sInput2 ), sPre1, sSuf1, sPre2, sSuf2;
 
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 8302c510b773..d95a616d339e 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -38,7 +38,7 @@
 
 // Subtotals group tabpage:
 
-ScTpSubTotalGroup::ScTpSubTotalGroup(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet& rArgSet, const 
sal_uInt16& rTabNumber)
+ScTpSubTotalGroup::ScTpSubTotalGroup(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet& rArgSet, const 
sal_uInt16 nTabNumber)
     : SfxTabPage(pPage, pController, 
u"modules/scalc/ui/subtotalgrppage.ui"_ustr, u"SubTotalGrpPage"_ustr, &rArgSet)
     , aStrNone(ScResId(SCSTR_NONE))
     , aStrColumn(ScResId(SCSTR_COLUMN_LETTER))
@@ -64,8 +64,8 @@ ScTpSubTotalGroup::ScTpSubTotalGroup(weld::Container* pPage, 
weld::DialogControl
     Init();
 
     // UI tests
-    mxLbGroup->set_buildable_name(mxLbGroup->get_buildable_name() + 
OUString::number(rTabNumber));
-    mxLbColumns->set_buildable_name(mxLbColumns->get_buildable_name() + 
OUString::number(rTabNumber));
+    mxLbGroup->set_buildable_name(mxLbGroup->get_buildable_name() + 
OUString::number(nTabNumber));
+    mxLbColumns->set_buildable_name(mxLbColumns->get_buildable_name() + 
OUString::number(nTabNumber));
 }
 
 ScTpSubTotalGroup::~ScTpSubTotalGroup()
diff --git a/sc/source/ui/dialogs/SelectSheetViewDialog.cxx 
b/sc/source/ui/dialogs/SelectSheetViewDialog.cxx
index 20cb006f26fe..af938e490b62 100644
--- a/sc/source/ui/dialogs/SelectSheetViewDialog.cxx
+++ b/sc/source/ui/dialogs/SelectSheetViewDialog.cxx
@@ -30,7 +30,7 @@ public:
     {
     }
 
-    OUString getName() const { return mpSheetView->GetName(); }
+    const OUString& getName() const { return mpSheetView->GetName(); }
     sc::SheetViewID getSheetViewID() const { return mnSheetViewID; }
 };
 
diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx
index 828380bd54f0..ff05e98219ba 100644
--- a/sc/source/ui/inc/csvcontrol.hxx
+++ b/sc/source/ui/inc/csvcontrol.hxx
@@ -253,7 +253,7 @@ public:
     /** Sends a table model changed event for a removed column to the 
accessibility object. */
     void                        AccSendRemoveColumnEvent( sal_uInt32 
nFirstColumn, sal_uInt32 nLastColumn );
 
-    rtl::Reference<ScAccessibleCsvControl> GetAccessible() { return 
mxAccessible; }
+    const rtl::Reference<ScAccessibleCsvControl>& GetAccessible() const { 
return mxAccessible; }
 
     // repaint helpers --------------------------------------------------------
 
diff --git a/sc/source/ui/inc/dataprovider.hxx 
b/sc/source/ui/inc/dataprovider.hxx
index 4234f8df2267..210db57d934f 100644
--- a/sc/source/ui/inc/dataprovider.hxx
+++ b/sc/source/ui/inc/dataprovider.hxx
@@ -59,8 +59,8 @@ public:
     bool IsRequestedTerminate();
     void Terminate();
     void EndThread();
-    bool IsParseError() { return mbIsParseError; }
-    auto GetLastException() { return mpLastException; }
+    bool IsParseError() const { return mbIsParseError; }
+    const std::exception_ptr & GetLastException() const { return 
mpLastException; }
 
     virtual void execute() override;
 };
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index 7a2ab7e93829..627fbc081daa 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -32,7 +32,7 @@ class ScSubTotalItem;
 class ScTpSubTotalGroup : public SfxTabPage
 {
 protected:
-    ScTpSubTotalGroup(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet& rArgSet, const sal_uInt16& nTabNumber);
+    ScTpSubTotalGroup(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet& rArgSet, const sal_uInt16 nTabNumber);
 
 public:
     virtual ~ScTpSubTotalGroup() override;
diff --git a/sc/source/ui/view/spellcheckcontext.cxx 
b/sc/source/ui/view/spellcheckcontext.cxx
index a82c113488a1..eeb807230c06 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -209,7 +209,7 @@ struct SpellCheckContext::SpellCheckResult
         maRanges = rMisspells;
     }
 
-    MisspellRangeResult query(SCCOL nCol, SCROW nRow) const
+    const MisspellRangeResult & query(SCCOL nCol, SCROW nRow) const
     {
         assert(mnCol == nCol);
         assert(mnRow == nRow);
@@ -258,7 +258,7 @@ bool SpellCheckContext::isMisspelled(SCCOL nCol, SCROW 
nRow) const
     return mpResult->query(nCol, nRow).mpRanges;
 }
 
-sc::MisspellRangeResult SpellCheckContext::getMisspellRanges(
+const sc::MisspellRangeResult & SpellCheckContext::getMisspellRanges(
     SCCOL nCol, SCROW nRow ) const
 {
     const_cast<SpellCheckContext*>(this)->ensureResults(nCol, nRow);
diff --git a/sd/inc/ResourceId.hxx b/sd/inc/ResourceId.hxx
index d9140d95eb92..e2e8f5510a6d 100644
--- a/sd/inc/ResourceId.hxx
+++ b/sd/inc/ResourceId.hxx
@@ -92,7 +92,7 @@ public:
     /** Return the URL of the resource.  Arguments supplied on creation are
         stripped away.  Use getFullResourceURL() to access them.
     */
-    OUString getResourceURL() const;
+    const OUString & getResourceURL() const;
 
     /** Return a URL object of the resource URL that may contain arguments.
     */
diff --git a/sd/source/ui/framework/configuration/ResourceId.cxx 
b/sd/source/ui/framework/configuration/ResourceId.cxx
index 31214f0491c3..eba6493d0688 100644
--- a/sd/source/ui/framework/configuration/ResourceId.cxx
+++ b/sd/source/ui/framework/configuration/ResourceId.cxx
@@ -83,12 +83,12 @@ ResourceId::~ResourceId()
     mpURL.reset();
 }
 
-OUString ResourceId::getResourceURL() const
+const OUString & ResourceId::getResourceURL() const
 {
     if (!maResourceURLs.empty())
         return maResourceURLs[0];
     else
-        return OUString();
+        return EMPTY_OUSTRING;
 }
 
 util::URL ResourceId::getFullResourceURL()
diff --git a/sd/source/ui/inc/DrawController.hxx 
b/sd/source/ui/inc/DrawController.hxx
index 3f7bc5b807cd..73765d297be4 100644
--- a/sd/source/ui/inc/DrawController.hxx
+++ b/sd/source/ui/inc/DrawController.hxx
@@ -212,7 +212,7 @@ public:
 
     SD_DLLPUBLIC const rtl::Reference<sd::framework::ConfigurationController> 
& getConfigurationController();
 
-    rtl::Reference<sd::framework::ModuleController> getModuleController();
+    const rtl::Reference<sd::framework::ModuleController> & 
getModuleController();
 
     // XSlideSorterSelectionSupplier
     virtual css::uno::Any SAL_CALL getSlideSorterSelection(  ) override;
diff --git a/sd/source/ui/inc/SlideshowLayerRenderer.hxx 
b/sd/source/ui/inc/SlideshowLayerRenderer.hxx
index 407abcea4f28..e3bedca9897e 100644
--- a/sd/source/ui/inc/SlideshowLayerRenderer.hxx
+++ b/sd/source/ui/inc/SlideshowLayerRenderer.hxx
@@ -171,7 +171,7 @@ public:
      * depending on the size of the slide and the desired size. The size can 
differ,
      * because the it must match the slide aspect ratio.
      **/
-    Size calculateAndSetSizePixel(Size const& rDesiredSizePixel);
+    const Size& calculateAndSetSizePixel(Size const& rDesiredSizePixel);
 
     /** Renders one layer
      *
diff --git a/sd/source/ui/tools/SlideshowLayerRenderer.cxx 
b/sd/source/ui/tools/SlideshowLayerRenderer.cxx
index 47c23302f357..aba3e1ce84aa 100644
--- a/sd/source/ui/tools/SlideshowLayerRenderer.cxx
+++ b/sd/source/ui/tools/SlideshowLayerRenderer.cxx
@@ -834,7 +834,7 @@ void SlideshowLayerRenderer::setupMasterPageFields()
     }
 }
 
-Size SlideshowLayerRenderer::calculateAndSetSizePixel(Size const& 
rDesiredSizePixel)
+const Size& SlideshowLayerRenderer::calculateAndSetSizePixel(Size const& 
rDesiredSizePixel)
 {
     double fRatio = double(mrPage.GetHeight()) / mrPage.GetWidth();
     Size aSize(rDesiredSizePixel.Width(), 
::tools::Long(rDesiredSizePixel.Width() * fRatio));
diff --git a/sd/source/ui/unoidl/DrawController.cxx 
b/sd/source/ui/unoidl/DrawController.cxx
index bc8b87ba196f..483dc9afe24a 100644
--- a/sd/source/ui/unoidl/DrawController.cxx
+++ b/sd/source/ui/unoidl/DrawController.cxx
@@ -569,7 +569,7 @@ const rtl::Reference<framework::ConfigurationController> &
     return mxConfigurationController;
 }
 
-rtl::Reference<framework::ModuleController> 
DrawController::getModuleController()
+const rtl::Reference<framework::ModuleController> & 
DrawController::getModuleController()
 {
     ThrowIfDisposed();
 
diff --git a/sdext/source/minimizer/pppoptimizertoken.cxx 
b/sdext/source/minimizer/pppoptimizertoken.cxx
index 2ac08ee76aaa..6b09dfecabac 100644
--- a/sdext/source/minimizer/pppoptimizertoken.cxx
+++ b/sdext/source/minimizer/pppoptimizertoken.cxx
@@ -101,7 +101,7 @@ PPPOptimizerTokenEnum TKGet( const OUString& rToken )
     return eRetValue;
 }
 
-OUString TKGet( const PPPOptimizerTokenEnum eToken )
+const OUString & TKGet( const PPPOptimizerTokenEnum eToken )
 {
     return pTokenTableArray[ eToken ].pS;
 }
diff --git a/sdext/source/minimizer/pppoptimizertoken.hxx 
b/sdext/source/minimizer/pppoptimizertoken.hxx
index 4e2c29d0a2c3..023b69788cb3 100644
--- a/sdext/source/minimizer/pppoptimizertoken.hxx
+++ b/sdext/source/minimizer/pppoptimizertoken.hxx
@@ -63,7 +63,7 @@ enum PPPOptimizerTokenEnum
 };
 
 PPPOptimizerTokenEnum TKGet(const OUString&);
-OUString TKGet(const PPPOptimizerTokenEnum);
+const OUString& TKGet(const PPPOptimizerTokenEnum);
 
 #endif
 
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 3e696e834974..5c44ba032929 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2826,7 +2826,7 @@ void SfxViewShell::SetSigningCertificate(const 
svl::crypto::CertificateOrName& r
     pImpl->m_aSigningCertificate = rCertificate;
 }
 
-svl::crypto::CertificateOrName SfxViewShell::GetSigningCertificate() const
+const svl::crypto::CertificateOrName & SfxViewShell::GetSigningCertificate() 
const
 {
     return pImpl->m_aSigningCertificate;
 }
diff --git a/starmath/inc/cfgitem.hxx b/starmath/inc/cfgitem.hxx
index f82f1136332e..3bd70f921e34 100644
--- a/starmath/inc/cfgitem.hxx
+++ b/starmath/inc/cfgitem.hxx
@@ -165,7 +165,7 @@ public:
     const SmFormat& GetStandardFormat() const;
     void SetStandardFormat(const SmFormat& rFormat, bool bSaveFontFormatList = 
false);
 
-    css::uno::Sequence<OUString> LoadUserDefinedNames();
+    const css::uno::Sequence<OUString>& LoadUserDefinedNames();
     void GetUserDefinedFormula(std::u16string_view sName, OUString& sFormula);
     bool HasUserDefinedFormula(std::u16string_view sName);
     void SaveUserDefinedFormula(std::u16string_view sName, const OUString& 
sElement);
diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 6dde6585cfc2..a65542138ada 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -498,10 +498,10 @@ struct ElementData
     OUString maElementSource;
     OUString maHelpText;
     int maPos;
-    ElementData(const OUString& aElementSource, const OUString& aHelpText, 
const int& aPos)
+    ElementData(const OUString& aElementSource, const OUString& aHelpText, 
const int nPos)
         : maElementSource(aElementSource)
         , maHelpText(aHelpText)
-        , maPos(aPos)
+        , maPos(nPos)
     {
     }
 };
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 25eec2f22ed8..070fda0397c0 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -662,7 +662,7 @@ void SmMathConfig::ReadFontFormat( SmFontFormat 
&rFontFormat,
     OSL_ENSURE( bOK, "read FontFormat failed" );
 }
 
-css::uno::Sequence<OUString> SmMathConfig::LoadUserDefinedNames()
+const css::uno::Sequence<OUString> & SmMathConfig::LoadUserDefinedNames()
 {
     m_sUserDefinedNames = GetNodeNames(USER_DEFINED_LIST);
     return m_sUserDefinedNames;
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 7fce7b2fd818..8e46aa5e33af 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -747,14 +747,14 @@ OUString URIHelper::FindFirstURLInText(OUString const & 
rText,
 
 OUString URIHelper::FindFirstDOIInText(std::u16string_view rText,
                                        sal_Int32 & rBegin,
-                                       const sal_Int32 & rEnd,
+                                       sal_Int32 nEnd,
                                        CharClass const & rCharClass)
 {
-    if (rBegin > rEnd || rEnd > static_cast<sal_Int32>(rText.size()))
+    if (rBegin > nEnd || nEnd > static_cast<sal_Int32>(rText.size()))
         return OUString();
 
     sal_Int32 start = 7;
-    sal_Int32 count = rEnd-rBegin;
+    sal_Int32 count = nEnd-rBegin;
     OUString candidate(rText.substr(rBegin, count));
     // Match with regex "doi:10\.\d{4,9}\/[-._;()\/:a-zA-Z0-9]+"
     if (candidate.startsWithIgnoreAsciiCase("doi:10."))
@@ -800,7 +800,7 @@ OUString URIHelper::FindFirstDOIInText(std::u16string_view 
rText,
             return OUString::Concat("https://doi.org/";)+candidate.subView(4);
         }
     }
-    rBegin = rEnd;
+    rBegin = nEnd;
     return OUString();
 }
 
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index a37db1e0ebbf..4d3838b742a4 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -67,7 +67,7 @@ public:
 
     const UIName& GetFormatName() const        { return m_sFormatNm; }
     void SetItemSet( const std::shared_ptr<SfxItemSet>& pSet );
-    std::shared_ptr<SfxItemSet> GetItemSet( ) const { return m_pSet; }
+    const std::shared_ptr<SfxItemSet> & GetItemSet( ) const { return m_pSet; }
     void SetFormatAll( bool bAll )               { m_bFormatAll = bAll; }
 
     void dumpAsXml(xmlTextWriterPtr pWriter) const override;
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 88c7505d5444..ac112dbc6460 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -553,7 +553,7 @@ public:
     rtl::Reference<SwXTextEmbeddedObject> createTextEmbeddedObject();
     rtl::Reference<SvXMLEmbeddedObjectHelper> createEmbeddedObjectResolver();
     rtl::Reference< SwXStyleFamilies > getSwStyleFamilies();
-    rtl::Reference< SwXRedlines > getSwRedlines();
+    const rtl::Reference< SwXRedlines > & getSwRedlines();
     rtl::Reference<SwXTextFieldTypes> getSwTextFields();
     rtl::Reference<SwXTextFrames> getSwTextFrames();
     rtl::Reference<SwXTextSections> getSwTextSections();
diff --git a/sw/qa/extras/embedded_fonts/embedded_fonts.cxx 
b/sw/qa/extras/embedded_fonts/embedded_fonts.cxx
index e8449b31f3ff..203ce0ad823e 100644
--- a/sw/qa/extras/embedded_fonts/embedded_fonts.cxx
+++ b/sw/qa/extras/embedded_fonts/embedded_fonts.cxx
@@ -52,7 +52,7 @@ public:
     }
 
     int getRequestCount() const { return mnRequestCount; }
-    OUString getRequestedFontName() const { return maRequestedFontName; }
+    const OUString& getRequestedFontName() const { return maRequestedFontName; 
}
 
     virtual void SAL_CALL handle(uno::Reference<task::XInteractionRequest> 
const& rRequest) override
     {
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index c4c4018ae4c0..91081b44537e 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1005,10 +1005,10 @@ namespace
 
     /// Given a redline that has another underlying redline, drop that 
underlying redline.
     /// Used to accept an insert or rejecting a delete, i.e. no changes to the 
text node strings.
-    bool lcl_DeleteInnerRedline(const SwRedlineTable& rArr, const 
SwRedlineTable::size_type& rPos,
+    bool lcl_DeleteInnerRedline(const SwRedlineTable& rArr, const 
SwRedlineTable::size_type nPos,
                                       int nDepth)
     {
-        SwRangeRedline* pRedl = rArr[rPos];
+        SwRangeRedline* pRedl = rArr[nPos];
         SwDoc& rDoc = pRedl->GetDoc();
         SwPaM const updatePaM(*pRedl->Start(), *pRedl->End());
 
@@ -1019,17 +1019,17 @@ 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(const SwRedlineTable& rArr, const 
SwRedlineTable::size_type& rPos)
+    bool lcl_AcceptOuterFormat(const SwRedlineTable& rArr, const 
SwRedlineTable::size_type nPos)
     {
-        SwRangeRedline* pRedl = rArr[rPos];
+        SwRangeRedline* pRedl = rArr[nPos];
         return pRedl->PopData();
     }
 
     /// 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(const SwRedlineTable& rArr, const 
SwRedlineTable::size_type& rPos)
+    bool lcl_RejectOuterFormat(const SwRedlineTable& rArr, const 
SwRedlineTable::size_type nPos)
     {
-        SwRangeRedline* pRedl = rArr[rPos];
+        SwRangeRedline* pRedl = rArr[nPos];
         SwDoc& rDoc = pRedl->GetDoc();
         SwPaM aPam(*(pRedl->Start()), *(pRedl->End()));
         rDoc.ResetAttrs(aPam);
@@ -3374,8 +3374,8 @@ const SwRangeRedline* DocumentRedlineManager::GetRedline( 
const SwPosition& rPos
 }
 
 bool DocumentRedlineManager::AcceptRedlineRange(SwRedlineTable::size_type 
nPosOrigin,
-                                                const 
SwRedlineTable::size_type& nPosStart,
-                                                const 
SwRedlineTable::size_type& nPosEnd,
+                                                const 
SwRedlineTable::size_type nPosStart,
+                                                const 
SwRedlineTable::size_type nPosEnd,
                                                 bool bCallDelete, bool bDirect)
 {
     bool bRet = false;
@@ -3718,8 +3718,8 @@ void 
DocumentRedlineManager::AcceptRedlineParagraphFormatting( const SwPaM &rPam
 }
 
 bool DocumentRedlineManager::RejectRedlineRange(SwRedlineTable::size_type 
nPosOrigin,
-                                                const 
SwRedlineTable::size_type& nPosStart,
-                                                const 
SwRedlineTable::size_type& nPosEnd,
+                                                const 
SwRedlineTable::size_type nPosStart,
+                                                const 
SwRedlineTable::size_type nPosEnd,
                                                 bool bCallDelete, bool bDirect)
 {
     bool bRet = false;
diff --git a/sw/source/core/inc/DocumentRedlineManager.hxx 
b/sw/source/core/inc/DocumentRedlineManager.hxx
index e377b6ce8d10..c8200e286f7c 100644
--- a/sw/source/core/inc/DocumentRedlineManager.hxx
+++ b/sw/source/core/inc/DocumentRedlineManager.hxx
@@ -167,12 +167,12 @@ public:
 private:
 
     bool RejectRedlineRange(SwRedlineTable::size_type nPosOrigin,
-                            const SwRedlineTable::size_type& nPosStart,
-                            const SwRedlineTable::size_type& nPosEnd, bool 
bCallDelete,
+                            const SwRedlineTable::size_type nPosStart,
+                            const SwRedlineTable::size_type nPosEnd, bool 
bCallDelete,
                             bool bDirect);
     bool AcceptRedlineRange(SwRedlineTable::size_type nPosOrigin,
-                            const SwRedlineTable::size_type& nPosStart,
-                            const SwRedlineTable::size_type& nPosEnd, bool 
bCallDelete,
+                            const SwRedlineTable::size_type nPosStart,
+                            const SwRedlineTable::size_type nPosEnd, bool 
bCallDelete,
                             bool bDirect);
     bool AcceptMovedRedlines(sal_uInt32 nMovedID, bool bCallDelete);
     bool RejectMovedRedlines(sal_uInt32 nMovedID, bool bCallDelete);
diff --git a/sw/source/filter/html/wrthtml.hxx 
b/sw/source/filter/html/wrthtml.hxx
index 4e7cfc33dbb6..b7d71a7eff5c 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -622,7 +622,7 @@ public:
     sal_Int32 indexOfDotLeaders( SwPoolFormatId nPoolId, std::u16string_view 
rText );
 
     /// Determines the prefix string needed to respect the requested namespace 
alias.
-    OString GetNamespace() const { return maNamespace; }
+    const OString & GetNamespace() const { return maNamespace; }
 
     bool IsPrettyPrint() const { return !m_bSpacePreserve && m_bPrettyPrint; }
     bool IsLFPossible() const { return !m_bSpacePreserve && m_bLFPossible; }
diff --git a/sw/source/uibase/config/SwBaselineGridConfig.cxx 
b/sw/source/uibase/config/SwBaselineGridConfig.cxx
index 2a2c5d92537f..0e6c58bed250 100644
--- a/sw/source/uibase/config/SwBaselineGridConfig.cxx
+++ b/sw/source/uibase/config/SwBaselineGridConfig.cxx
@@ -27,7 +27,7 @@ SwBaselineGridConfig::SwBaselineGridConfig(SwMasterUsrPref& 
rParent)
     EnableNotification(GetPropertyNames());
 }
 
-css::uno::Sequence<OUString> SwBaselineGridConfig::GetPropertyNames()
+const css::uno::Sequence<OUString>& SwBaselineGridConfig::GetPropertyNames()
 {
     static css::uno::Sequence<OUString> aNames{
         u"VisibleGrid"_ustr, // 0
diff --git a/sw/source/uibase/inc/SwBaselineGridConfig.hxx 
b/sw/source/uibase/inc/SwBaselineGridConfig.hxx
index 54cc80de15c6..71fec9e7457d 100644
--- a/sw/source/uibase/inc/SwBaselineGridConfig.hxx
+++ b/sw/source/uibase/inc/SwBaselineGridConfig.hxx
@@ -21,7 +21,7 @@ class SwBaselineGridConfig final : public utl::ConfigItem
 private:
     SwMasterUsrPref& m_rParent;
 
-    static css::uno::Sequence<OUString> GetPropertyNames();
+    static const css::uno::Sequence<OUString>& GetPropertyNames();
 
     virtual void ImplCommit() override;
 
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 077d27c499e2..25891569456a 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2393,7 +2393,7 @@ Reference< XEnumerationAccess > 
SwXTextDocument::getRedlines(  )
     return getSwRedlines();
 }
 
-rtl::Reference< SwXRedlines > SwXTextDocument::getSwRedlines(  )
+const rtl::Reference< SwXRedlines > & SwXTextDocument::getSwRedlines(  )
 {
     if(!mxXRedlines.is())
     {
diff --git a/sw/source/writerfilter/ooxml/ShadowContext.hxx 
b/sw/source/writerfilter/ooxml/ShadowContext.hxx
index c55abf7a4558..ddb5bb7ffc17 100644
--- a/sw/source/writerfilter/ooxml/ShadowContext.hxx
+++ b/sw/source/writerfilter/ooxml/ShadowContext.hxx
@@ -112,7 +112,7 @@ public:
     CallDataType getType() const { return m_eType; }
     sal_Int32 getElement() const { return m_nElement; }
     const ::rtl::OUString& getChars() { return m_aChars; }
-    css::uno::Reference<css::xml::sax::XFastAttributeList> getAttributes() 
const
+    const css::uno::Reference<css::xml::sax::XFastAttributeList>& 
getAttributes() const
     {
         return m_aAttributes;
     }
diff --git a/vcl/inc/pdf/EncryptionHashTransporter.hxx 
b/vcl/inc/pdf/EncryptionHashTransporter.hxx
index 9b523f3f90f0..3d6496fc1bf5 100644
--- a/vcl/inc/pdf/EncryptionHashTransporter.hxx
+++ b/vcl/inc/pdf/EncryptionHashTransporter.hxx
@@ -52,19 +52,19 @@ public:
 
     void invalidate() { m_pDigest.reset(); }
 
-    std::vector<sal_uInt8> getU() { return mU; }
+    const std::vector<sal_uInt8>& getU() const { return mU; }
     void setU(std::vector<sal_uInt8> const& rU) { mU = rU; }
 
-    std::vector<sal_uInt8> getUE() { return mUE; }
+    const std::vector<sal_uInt8>& getUE() const { return mUE; }
     void setUE(std::vector<sal_uInt8> const& rUE) { mUE = rUE; }
 
-    std::vector<sal_uInt8> getO() { return mO; }
+    const std::vector<sal_uInt8>& getO() const { return mO; }
     void setO(std::vector<sal_uInt8> const& rO) { mO = rO; }
 
-    std::vector<sal_uInt8> getOE() { return mOE; }
+    const std::vector<sal_uInt8>& getOE() const { return mOE; }
     void setOE(std::vector<sal_uInt8> const& rOE) { mOE = rOE; }
 
-    std::vector<sal_uInt8> getEncryptionKey() { return maEncryptionKey; }
+    const std::vector<sal_uInt8>& getEncryptionKey() const { return 
maEncryptionKey; }
     void setEncryptionKey(std::vector<sal_uInt8> const& rEncryptionKey)
     {
         maEncryptionKey = rEncryptionKey;
diff --git a/vcl/inc/qt5/QtInstanceTreeIter.hxx 
b/vcl/inc/qt5/QtInstanceTreeIter.hxx
index 485ea91f99f9..62b035927c07 100644
--- a/vcl/inc/qt5/QtInstanceTreeIter.hxx
+++ b/vcl/inc/qt5/QtInstanceTreeIter.hxx
@@ -20,7 +20,7 @@ public:
     explicit QtInstanceTreeIter(QModelIndex aModelIndex);
     virtual bool equal(const TreeIter& rOther) const override;
 
-    QModelIndex modelIndex() const { return m_aModelIndex; }
+    const QModelIndex& modelIndex() const { return m_aModelIndex; }
     void setModelIndex(const QModelIndex& aIndex) { m_aModelIndex = aIndex; }
 };
 
diff --git a/vcl/inc/qt5/QtTreeViewModel.hxx b/vcl/inc/qt5/QtTreeViewModel.hxx
index 6f4590a7f0e9..6591900caf2a 100644
--- a/vcl/inc/qt5/QtTreeViewModel.hxx
+++ b/vcl/inc/qt5/QtTreeViewModel.hxx
@@ -30,7 +30,7 @@ public:
 
     virtual bool hasChildren(const QModelIndex& rIndex = QModelIndex()) const 
override;
 
-    std::vector<int> editableColumns() const;
+    const std::vector<int>& editableColumns() const;
     void setEditableColumns(const std::vector<int>& rEditableColumns);
 
     bool getChildrenOnDemand(const QModelIndex& rIndex) const;
diff --git a/vcl/qt5/QtTreeViewModel.cxx b/vcl/qt5/QtTreeViewModel.cxx
index 647fe8dc1f81..a359cad1ad49 100644
--- a/vcl/qt5/QtTreeViewModel.cxx
+++ b/vcl/qt5/QtTreeViewModel.cxx
@@ -39,7 +39,7 @@ bool QtTreeViewModel::hasChildren(const QModelIndex& rIndex) 
const
     return QSortFilterProxyModel::hasChildren(rIndex);
 }
 
-std::vector<int> QtTreeViewModel::editableColumns() const
+const std::vector<int>& QtTreeViewModel::editableColumns() const
 {
     assert(std::ranges::is_sorted(m_aEditableColumns));
     return m_aEditableColumns;
diff --git a/vcl/source/treelist/svlbitm.cxx b/vcl/source/treelist/svlbitm.cxx
index 5162adc93f9d..6436dae2e3fb 100644
--- a/vcl/source/treelist/svlbitm.cxx
+++ b/vcl/source/treelist/svlbitm.cxx
@@ -68,7 +68,7 @@ SvBmp SvLBoxButtonData::GetIndex( SvItemStateFlags nItemState 
)
     return nIdx;
 }
 
-Size SvLBoxButtonData::GetSize()
+const Size & SvLBoxButtonData::GetSize()
 {
     if (!bDataOk)
         SetWidthAndHeight();
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx 
b/xmloff/source/style/XMLFontAutoStylePool.cxx
index e7ac4c068248..c1022b3f6b13 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -516,7 +516,7 @@ void SvXMLExport::exportFonts(const 
std::vector<XMLFontAutoStylePoolEntry_Impl*>
     }
 }
 
-std::unordered_map<OString, OUString> SvXMLExport::getEmbeddedFontFiles() const
+const std::unordered_map<OString, OUString> & 
SvXMLExport::getEmbeddedFontFiles() const
 {
     return m_aEmbeddedFontFiles;
 }

Reply via email to