include/sfx2/docfile.hxx            |    2 +-
 include/sfx2/viewfrm.hxx            |    2 +-
 include/sfx2/viewsh.hxx             |    2 +-
 include/svtools/brwbox.hxx          |    2 +-
 include/svtools/ctrltool.hxx        |    2 +-
 include/svtools/imagemgr.hxx        |    6 +++---
 include/svtools/tabbar.hxx          |    4 ++--
 include/svtools/valueset.hxx        |    2 +-
 sfx2/source/doc/docfile.cxx         |    2 +-
 sfx2/source/view/viewfrm.cxx        |    4 ++--
 sfx2/source/view/viewsh.cxx         |    2 +-
 svtools/source/brwbox/brwbox1.cxx   |    4 ++--
 svtools/source/control/ctrltool.cxx |    4 ++--
 svtools/source/control/tabbar.cxx   |    8 ++++----
 svtools/source/control/valueacc.cxx |    2 +-
 svtools/source/control/valueimp.hxx |    2 +-
 svtools/source/control/valueset.cxx |    4 ++--
 svtools/source/misc/imagemgr.cxx    |   10 +++++-----
 18 files changed, 32 insertions(+), 32 deletions(-)

New commits:
commit 8d5d06da8d01d46ede24bfc8e2789830493a5a7d
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Nov 6 19:58:09 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Nov 7 06:58:12 2024 +0100

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

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 2100eac9e592..8fffe17108f2 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -528,7 +528,7 @@ public:
     tools::Long            GetTitleHeight() const;
 
     // access to dynamic values of cursor row
-    OUString        GetColumnTitle( sal_uInt16 nColumnId ) const;
+    const OUString &       GetColumnTitle( sal_uInt16 nColumnId ) const;
     tools::Rectangle       GetFieldRect( sal_uInt16 nColumnId ) const;
     tools::Long     GetColumnWidth( sal_uInt16 nColumnId ) const;
     sal_uInt16      GetColumnId( sal_uInt16 nPos ) const;
diff --git a/include/svtools/ctrltool.hxx b/include/svtools/ctrltool.hxx
index d70a49177f69..f8caa7efd2cd 100644
--- a/include/svtools/ctrltool.hxx
+++ b/include/svtools/ctrltool.hxx
@@ -159,7 +159,7 @@ public:
 
     std::unique_ptr<FontList> Clone() const;
 
-    OUString                GetFontMapText( const FontMetric& rFontMetric ) 
const;
+    const OUString &        GetFontMapText( const FontMetric& rFontMetric ) 
const;
 
     const OUString&         GetNormalStr() const { return maNormal; }
     const OUString&         GetItalicStr() const { return maNormalItalic; }
diff --git a/include/svtools/imagemgr.hxx b/include/svtools/imagemgr.hxx
index a2b48247f4d2..332998ed6c59 100644
--- a/include/svtools/imagemgr.hxx
+++ b/include/svtools/imagemgr.hxx
@@ -120,14 +120,14 @@ private:
     static OUString    GetDescription_Impl( const INetURLObject& rObject, bool 
bDetectFolder );
 
 public:
-    SVT_DLLPUBLIC static OUString GetImageId( const INetURLObject& rURL, bool 
bBig = false );
+    SVT_DLLPUBLIC static const OUString & GetImageId( const INetURLObject& 
rURL, bool bBig = false );
     SVT_DLLPUBLIC static Image  GetImage(
         const INetURLObject& rURL, bool bBig = false,
         css::uno::Reference<css::ucb::XCommandEnvironment> const & env
             = utl::UCBContentHelper::getDefaultCommandEnvironment());
-    SVT_DLLPUBLIC static OUString GetFileImageId( const INetURLObject& rURL );
+    SVT_DLLPUBLIC static const OUString & GetFileImageId( const INetURLObject& 
rURL );
     SVT_DLLPUBLIC static Image  GetImageNoDefault(const INetURLObject& rURL, 
vcl::ImageType eImageType = vcl::ImageType::Small);
-    SVT_DLLPUBLIC static OUString GetFolderImageId( const svtools::VolumeInfo& 
rInfo );
+    SVT_DLLPUBLIC static const OUString & GetFolderImageId( const 
svtools::VolumeInfo& rInfo );
 
     SVT_DLLPUBLIC static OUString GetDescription( const INetURLObject& rObject 
);
     SVT_DLLPUBLIC static OUString GetFileDescription( const INetURLObject& 
rObject );
diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index 335779bdaef3..5b87858067f9 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -376,7 +376,7 @@ private:
 
 protected:
     virtual void AddTabClick();
-    OUString     GetAuxiliaryText(sal_uInt16 nPageId) const; // needed in 
derived class LayerTabBar
+    const OUString & GetAuxiliaryText(sal_uInt16 nPageId) const; // needed in 
derived class LayerTabBar
     void         SetAuxiliaryText(sal_uInt16 nPageId, const OUString& rText );
 
 public:
@@ -477,7 +477,7 @@ public:
     void            EndSwitchPage();
 
     virtual void    SetPageText( sal_uInt16 nPageId, const OUString& rText );
-    OUString        GetPageText( sal_uInt16 nPageId ) const;
+    const OUString & GetPageText( sal_uInt16 nPageId ) const;
     OUString        GetHelpText( sal_uInt16 nPageId ) const;
 
     tools::Long            GetSplitSize() const { return mnSplitSize; }
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index a132d80f2a60..2a51c19d0990 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -356,7 +356,7 @@ public:
     void            SetItemData( sal_uInt16 nItemId, void* pData );
     void*           GetItemData( sal_uInt16 nItemId ) const;
     void            SetItemText( sal_uInt16 nItemId, const OUString& rStr );
-    OUString        GetItemText( sal_uInt16 nItemId ) const;
+    const OUString & GetItemText( sal_uInt16 nItemId ) const;
     void            SetColor( const Color& rColor );
     void            SetColor()
     {
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index 982e00cfd388..841a96d7af7e 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -832,12 +832,12 @@ void BrowseBox::RemoveColumns()
 }
 
 
-OUString BrowseBox::GetColumnTitle( sal_uInt16 nId ) const
+const OUString & BrowseBox::GetColumnTitle( sal_uInt16 nId ) const
 {
 
     sal_uInt16 nItemPos = GetColumnPos( nId );
     if ( nItemPos >= mvCols.size() )
-        return OUString();
+        return EMPTY_OUSTRING;
     return mvCols[ nItemPos ]->Title();
 }
 
diff --git a/svtools/source/control/ctrltool.cxx 
b/svtools/source/control/ctrltool.cxx
index 438b229c73a7..cb5cbb8074bb 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -509,11 +509,11 @@ OUString FontList::GetStyleName(const FontMetric& rInfo) 
const
     return aStyleName;
 }
 
-OUString FontList::GetFontMapText( const FontMetric& rInfo ) const
+const OUString & FontList::GetFontMapText( const FontMetric& rInfo ) const
 {
     if ( rInfo.GetFamilyName().isEmpty() )
     {
-        return OUString();
+        return EMPTY_OUSTRING;
     }
 
     // Search Fontname
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index de5d0d4afaf6..81780ad8c92f 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -2215,20 +2215,20 @@ void TabBar::SetPageText(sal_uInt16 nPageId, const 
OUString& rText)
     }
 }
 
-OUString TabBar::GetPageText(sal_uInt16 nPageId) const
+const OUString & TabBar::GetPageText(sal_uInt16 nPageId) const
 {
     sal_uInt16 nPos = GetPagePos(nPageId);
     if (nPos != PAGE_NOT_FOUND)
         return mpImpl->maItemList[nPos].maText;
-    return OUString();
+    return EMPTY_OUSTRING;
 }
 
-OUString TabBar::GetAuxiliaryText(sal_uInt16 nPageId) const
+const OUString & TabBar::GetAuxiliaryText(sal_uInt16 nPageId) const
 {
     sal_uInt16 nPos = GetPagePos(nPageId);
     if (nPos != PAGE_NOT_FOUND)
         return mpImpl->maItemList[nPos].maAuxiliaryText;
-    return OUString();
+    return EMPTY_OUSTRING;
 }
 
 void TabBar::SetAuxiliaryText(sal_uInt16 nPageId, const OUString& rText )
diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 5d44c91cc298..c8f9cafded65 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -53,7 +53,7 @@ ValueSetItem::~ValueSetItem()
     }
 }
 
-rtl::Reference< ValueItemAcc > ValueSetItem::GetAccessible( bool 
bIsTransientChildrenDisabled )
+const rtl::Reference< ValueItemAcc > & ValueSetItem::GetAccessible( bool 
bIsTransientChildrenDisabled )
 {
     if( !mxAcc.is() )
         mxAcc = new ValueItemAcc( this, bIsTransientChildrenDisabled );
diff --git a/svtools/source/control/valueimp.hxx 
b/svtools/source/control/valueimp.hxx
index f0902c8efdd9..89cfeb84f945 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -61,7 +61,7 @@ struct ValueSetItem
     explicit ValueSetItem( ValueSet& rParent );
     ~ValueSetItem();
 
-    rtl::Reference< ValueItemAcc > GetAccessible( bool 
bIsTransientChildrenDisabled );
+    const rtl::Reference< ValueItemAcc > & GetAccessible( bool 
bIsTransientChildrenDisabled );
 };
 
 typedef comphelper::WeakComponentImplHelper<
diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 000c4156996d..03666c97688b 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1801,14 +1801,14 @@ OUString ValueSet::RequestHelp(tools::Rectangle& 
rHelpRect)
     return sRet;
 }
 
-OUString ValueSet::GetItemText(sal_uInt16 nItemId) const
+const OUString & ValueSet::GetItemText(sal_uInt16 nItemId) const
 {
     const size_t nPos = GetItemPos(nItemId);
 
     if ( nPos != VALUESET_ITEM_NOTFOUND )
         return mItemList[nPos]->maText;
 
-    return OUString();
+    return EMPTY_OUSTRING;
 }
 
 void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index a1952bf26243..92de98d54659 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -507,7 +507,7 @@ static TranslateId GetFolderDescriptionId_Impl( const 
OUString& rURL )
     return pRet;
 }
 
-static OUString GetImageNameFromList_Impl( SvImageId nImageId, vcl::ImageType 
eImageType )
+static const OUString & GetImageNameFromList_Impl( SvImageId nImageId, 
vcl::ImageType eImageType )
 {
     if (eImageType == vcl::ImageType::Size32)
     {
@@ -737,7 +737,7 @@ static OUString GetImageNameFromList_Impl( SvImageId 
nImageId, vcl::ImageType eI
         }
     }
 
-    return OUString();
+    return EMPTY_OUSTRING;
 }
 
 static Image GetImageFromList_Impl( SvImageId nImageId, vcl::ImageType 
eImageType)
@@ -810,7 +810,7 @@ OUString SvFileInformationManager::GetDescription_Impl( 
const INetURLObject& rOb
     return sDescription;
 }
 
-OUString SvFileInformationManager::GetImageId(const INetURLObject& rObject, 
bool bBig)
+const OUString & SvFileInformationManager::GetImageId(const INetURLObject& 
rObject, bool bBig)
 {
     SvImageId nImage = GetImageId_Impl(
         rObject, true, utl::UCBContentHelper::getDefaultCommandEnvironment() );
@@ -827,7 +827,7 @@ Image SvFileInformationManager::GetImage(
     return GetImageFromList_Impl(nImage, bBig ? vcl::ImageType::Size26 : 
vcl::ImageType::Size16);
 }
 
-OUString SvFileInformationManager::GetFileImageId(const INetURLObject& rObject)
+const OUString & SvFileInformationManager::GetFileImageId(const INetURLObject& 
rObject)
 {
     SvImageId nImage = GetImageId_Impl(
         rObject, false, utl::UCBContentHelper::getDefaultCommandEnvironment() 
);
@@ -847,7 +847,7 @@ Image SvFileInformationManager::GetImageNoDefault(const 
INetURLObject& rObject,
     return GetImageFromList_Impl(nImage, eImageType);
 }
 
-OUString SvFileInformationManager::GetFolderImageId( const 
svtools::VolumeInfo& rInfo )
+const OUString & SvFileInformationManager::GetFolderImageId( const 
svtools::VolumeInfo& rInfo )
 {
     SvImageId nImage = SvImageId::Folder;
     DBG_ASSERT( nImage != SvImageId::NONE, "invalid ImageId" );
commit 1580c31f616ac62e7989efd846a419ac9f63b7c5
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Nov 6 17:21:43 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Nov 7 06:58:03 2024 +0100

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

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 17d409c8d134..9725a71340e5 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -221,7 +221,7 @@ public:
     SAL_DLLPRIVATE OUString const & GetBackup_Impl();
 
     SAL_DLLPRIVATE css::uno::Reference< css::embed::XStorage > const & 
GetZipStorageToSign_Impl( bool bReadOnly = true );
-    SAL_DLLPRIVATE css::uno::Reference<css::embed::XStorage> 
GetScriptingStorageToSign_Impl();
+    SAL_DLLPRIVATE const css::uno::Reference<css::embed::XStorage> & 
GetScriptingStorageToSign_Impl();
     SAL_DLLPRIVATE void CloseZipStorage_Impl();
 
     // the storage that will be returned by the medium on GetStorage request
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 23271831d2c8..de21273be0b3 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -196,7 +196,7 @@ public:
 
     SAL_DLLPRIVATE void MakeActive_Impl( bool bActivate );
     SAL_DLLPRIVATE const Size& GetMargin_Impl() const;
-    SAL_DLLPRIVATE OUString GetActualPresentationURL_Impl() const;
+    SAL_DLLPRIVATE const OUString & GetActualPresentationURL_Impl() const;
     SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &);
     SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &);
     SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl();
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index a5157967fc07..621f9125b0a5 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -497,7 +497,7 @@ public:
     OUString getA11yFocusedParagraph() const;
     int getA11yCaretPosition() const;
     void SetSigningCertificate(const 
css::uno::Reference<css::security::XCertificate>& xCertificate);
-    css::uno::Reference<css::security::XCertificate> GetSigningCertificate() 
const;
+    const css::uno::Reference<css::security::XCertificate> & 
GetSigningCertificate() const;
 };
 
 #endif // INCLUDED_SFX2_VIEWSH_HXX
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index c96e338cbe11..8ad182f836e7 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1999,7 +1999,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( 
bool bCreateTempFile )
     return pImpl->xStorage;
 }
 
-uno::Reference<embed::XStorage> SfxMedium::GetScriptingStorageToSign_Impl()
+const uno::Reference<embed::XStorage> & 
SfxMedium::GetScriptingStorageToSign_Impl()
 {
     // this was set when it was initially loaded
     if (pImpl->m_bODFWholesomeEncryption)
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 6925d9ea0a4b..bf82f4cf85f1 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2938,11 +2938,11 @@ bool SfxViewFrame::DoClose()
     return GetFrame().DoClose();
 }
 
-OUString SfxViewFrame::GetActualPresentationURL_Impl() const
+const OUString & SfxViewFrame::GetActualPresentationURL_Impl() const
 {
     if ( m_xObjSh.is() )
         return m_xObjSh->GetMedium()->GetName();
-    return OUString();
+    return EMPTY_OUSTRING;
 }
 
 void SfxViewFrame::SetModalMode( bool bModal )
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index db8529957e95..f598c66cfc13 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2812,7 +2812,7 @@ void SfxViewShell::SetSigningCertificate(const 
uno::Reference<security::XCertifi
     pImpl->m_xSigningCertificate = xCertificate;
 }
 
-uno::Reference<security::XCertificate> SfxViewShell::GetSigningCertificate() 
const
+const uno::Reference<security::XCertificate> & 
SfxViewShell::GetSigningCertificate() const
 {
     return pImpl->m_xSigningCertificate;
 }

Reply via email to