[Libreoffice-commits] core.git: include/svl include/vcl sot/source svl/source vcl/inc vcl/source vcl/unx

Noel Grandin noel.grandin at collabora.co.uk
Sat Dec 23 11:36:47 UTC 2017


 include/svl/ownlist.hxx            |    2 +-
 include/svl/urihelper.hxx          |    2 +-
 include/vcl/alpha.hxx              |    2 +-
 include/vcl/bitmapex.hxx           |    4 ++--
 include/vcl/button.hxx             |    2 +-
 include/vcl/errinf.hxx             |    2 +-
 include/vcl/listctrl.hxx           |    2 +-
 include/vcl/svapp.hxx              |    2 +-
 include/vcl/toolbox.hxx            |    2 +-
 sot/source/sdstor/stgcache.hxx     |    2 +-
 svl/source/items/stylepool.cxx     |    6 +++---
 svl/source/misc/urihelper.cxx      |    2 +-
 vcl/inc/implimagetree.hxx          |    2 +-
 vcl/inc/opengl/watchdog.hxx        |    2 +-
 vcl/inc/unx/cpdmgr.hxx             |    2 +-
 vcl/source/control/listctrl.cxx    |    2 +-
 vcl/source/gdi/alpha.cxx           |    2 +-
 vcl/source/image/ImplImageTree.cxx |    2 +-
 vcl/source/window/toolbox2.cxx     |    2 +-
 vcl/unx/generic/printer/cpdmgr.cxx |    2 +-
 20 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit a8c1c0ae1617c68d49deb33e9236a2c1b7cac14d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Sat Dec 23 09:17:30 2017 +0200

    loplugin:passstuffbyref improved returns in vcl
    
    Change-Id: I0b103df2e7ce59093869f547225c95865d33da27
    Reviewed-on: https://gerrit.libreoffice.org/46916
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svl/ownlist.hxx b/include/svl/ownlist.hxx
index 620b48078ac7..ef4d616032e1 100644
--- a/include/svl/ownlist.hxx
+++ b/include/svl/ownlist.hxx
@@ -68,7 +68,7 @@ public:
 
     size_t          size() const { return aCommandList.size(); }
 
-    SvCommand       operator[]( size_t i) {
+    SvCommand const & operator[]( size_t i) {
                         return aCommandList[ i ];
                     }
 
diff --git a/include/svl/urihelper.hxx b/include/svl/urihelper.hxx
index 6b5a2fc2ff36..92668263837c 100644
--- a/include/svl/urihelper.hxx
+++ b/include/svl/urihelper.hxx
@@ -61,7 +61,7 @@ SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
 
 SVL_DLLPUBLIC void SetMaybeFileHdl(Link<OUString *, bool> const & rTheMaybeFileHdl);
 
-SVL_DLLPUBLIC Link<OUString *, bool> GetMaybeFileHdl();
+SVL_DLLPUBLIC Link<OUString *, bool> const & GetMaybeFileHdl();
 
 /**
    Converts a URI reference to a relative one, ignoring certain differences (for
diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx
index e21bcc3b0732..e3fd8ee43ec5 100644
--- a/include/vcl/alpha.hxx
+++ b/include/vcl/alpha.hxx
@@ -55,7 +55,7 @@ public:
 
     BitmapChecksum   GetChecksum() const { return Bitmap::GetChecksum(); }
 
-    Bitmap      GetBitmap() const;
+    Bitmap const & GetBitmap() const;
 
     bool        Erase( sal_uInt8 cTransparency );
     bool        Replace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency );
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index c7a7bc7e2e59..a850572357e9 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -427,8 +427,8 @@ public:
                             const Size &rSize );
 public:
 
-    SAL_DLLPRIVATE  std::shared_ptr<ImpBitmap>  ImplGetBitmapImpBitmap() const { return aBitmap.ImplGetImpBitmap(); }
-    SAL_DLLPRIVATE  std::shared_ptr<ImpBitmap>  ImplGetMaskImpBitmap() const { return aMask.ImplGetImpBitmap(); }
+    SAL_DLLPRIVATE std::shared_ptr<ImpBitmap> const & ImplGetBitmapImpBitmap() const { return aBitmap.ImplGetImpBitmap(); }
+    SAL_DLLPRIVATE std::shared_ptr<ImpBitmap> const & ImplGetMaskImpBitmap() const { return aMask.ImplGetImpBitmap(); }
 
 
 private:
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 3a4159d35392..29bcfdc10b65 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -77,7 +77,7 @@ public:
 
     /// Setup handler for UNO commands so that commands like .uno:Something are handled automagically by this button.
     void                SetCommandHandler(const OUString& aCommand);
-    const OUString      GetCommand() const { return maCommand; }
+    OUString const &    GetCommand() const { return maCommand; }
 
     static OUString     GetStandardText( StandardButtonType eButton );
 
diff --git a/include/vcl/errinf.hxx b/include/vcl/errinf.hxx
index 4a3990b237ef..bc8c01a13e05 100644
--- a/include/vcl/errinf.hxx
+++ b/include/vcl/errinf.hxx
@@ -145,7 +145,7 @@ public:
                                 nUserId(nArgUserId) {}
     virtual                 ~ErrorInfo();
 
-    ErrCode                 GetErrorCode() const { return nUserId; }
+    ErrCode const &         GetErrorCode() const { return nUserId; }
 
     static ErrorInfo*       GetErrorInfo(ErrCode);
 
diff --git a/include/vcl/listctrl.hxx b/include/vcl/listctrl.hxx
index 6659ccafb3ff..d640ad2c7ee6 100644
--- a/include/vcl/listctrl.hxx
+++ b/include/vcl/listctrl.hxx
@@ -44,7 +44,7 @@ public:
     virtual void dispose() override;
 
     void addEntry(VclPtr<vcl::Window> xEntry, sal_uInt32 nPos = std::numeric_limits<sal_uInt16>::max());
-    std::vector<VclPtr<vcl::Window>> getEntries() const;
+    std::vector<VclPtr<vcl::Window>> const & getEntries() const;
     void deleteEntry(sal_uInt32 nPos);
 
     virtual Size GetOptimalSize() const override;
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index dd10349a41b2..0c81eeda5d8c 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -188,7 +188,7 @@ public:
 
      @returns The event's data string.
     */
-    OUString GetStringData() const
+    OUString const & GetStringData() const
     {
         assert(
             aEvent == Type::Accept || aEvent == Type::Help
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index df9120f305d2..f49bcae6fd9a 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -355,7 +355,7 @@ public:
     sal_uInt16          GetItemId( const OUString& rCommand ) const;
     tools::Rectangle           GetItemRect( sal_uInt16 nItemId );
     tools::Rectangle           GetItemPosRect( ImplToolItems::size_type nPos );
-    tools::Rectangle           GetOverflowRect() const;
+    tools::Rectangle const &   GetOverflowRect() const;
 
     /// Returns size of the bitmap / text that is inside this toolbox item.
     Size                GetItemContentSize( sal_uInt16 nItemId );
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx
index 8c9cdb7cf315..9f311ffbd702 100644
--- a/sot/source/sdstor/stgcache.hxx
+++ b/sot/source/sdstor/stgcache.hxx
@@ -73,7 +73,7 @@ public:
     void  SetStrm( SvStream*, bool );
     void  SetStrm( UCBStorageStream* );
     bool  Good() const                      { return m_nError == ERRCODE_NONE; }
-    ErrCode GetError() const                { return m_nError;    }
+    ErrCode const & GetError() const        { return m_nError;    }
     void  MoveError( StorageBase const & );
     void  SetError( ErrCode );
     void  ResetError();
diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx
index 15be4eb971ed..04d801c3ac5b 100644
--- a/svl/source/items/stylepool.cxx
+++ b/svl/source/items/stylepool.cxx
@@ -61,11 +61,11 @@ namespace {
         // #i86923#
         bool hasItemSet( const bool bCheckUsage ) const;
         // #i87808#
-        const std::shared_ptr<SfxItemSet> getItemSet() const
+        std::shared_ptr<SfxItemSet> const & getItemSet() const
         {
             return maItemSet.back();
         }
-        const std::shared_ptr<SfxItemSet> getUsedOrLastAddedItemSet() const;
+        std::shared_ptr<SfxItemSet> const & getUsedOrLastAddedItemSet() const;
         void setItemSet( const SfxItemSet& rSet ){ maItemSet.push_back( std::shared_ptr<SfxItemSet>( rSet.Clone() ) ); }
         // #i86923#
         Node* findChildNode( const SfxPoolItem& rItem,
@@ -80,7 +80,7 @@ namespace {
     };
 
     // #i87808#
-    const std::shared_ptr<SfxItemSet> Node::getUsedOrLastAddedItemSet() const
+    std::shared_ptr<SfxItemSet> const & Node::getUsedOrLastAddedItemSet() const
     {
         std::vector< std::shared_ptr<SfxItemSet> >::const_reverse_iterator aIter;
 
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index fc5e6322ec02..8c059fc15a80 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -112,7 +112,7 @@ void URIHelper::SetMaybeFileHdl(Link<OUString *, bool> const & rTheMaybeFileHdl)
     MaybeFileHdl::get() = rTheMaybeFileHdl;
 }
 
-Link<OUString *, bool> URIHelper::GetMaybeFileHdl()
+Link<OUString *, bool> const & URIHelper::GetMaybeFileHdl()
 {
     return MaybeFileHdl::get();
 }
diff --git a/vcl/inc/implimagetree.hxx b/vcl/inc/implimagetree.hxx
index 341fd44ddfd9..d939b63e6d86 100644
--- a/vcl/inc/implimagetree.hxx
+++ b/vcl/inc/implimagetree.hxx
@@ -77,7 +77,7 @@ public:
      *  be too late for the destructors of the bitmaps in maIconCache)*/
     void shutdown();
 
-    css::uno::Reference< css::container::XNameAccess > getNameAccess();
+    css::uno::Reference< css::container::XNameAccess > const & getNameAccess();
 
 private:
     ImplImageTree(const ImplImageTree&) = delete;
diff --git a/vcl/inc/opengl/watchdog.hxx b/vcl/inc/opengl/watchdog.hxx
index c266de62f7dc..cbf7e04958ae 100644
--- a/vcl/inc/opengl/watchdog.hxx
+++ b/vcl/inc/opengl/watchdog.hxx
@@ -43,7 +43,7 @@ public:
         mbRelaxed = bRelaxed;
     }
 
-    WatchdogTimingsValues getWatchdogTimingsValues(WatchdogTimingMode eMode)
+    WatchdogTimingsValues const & getWatchdogTimingsValues(WatchdogTimingMode eMode)
     {
         size_t index = 0;
         index = (eMode == WatchdogTimingMode::SHADER_COMPILE) ? 1 : 0;
diff --git a/vcl/inc/unx/cpdmgr.hxx b/vcl/inc/unx/cpdmgr.hxx
index 8c755dcea122..36ccc95221d7 100644
--- a/vcl/inc/unx/cpdmgr.hxx
+++ b/vcl/inc/unx/cpdmgr.hxx
@@ -107,7 +107,7 @@ public:
     GDBusProxy * getProxy( std::string target );
     void addBackend( std::pair< std::string, GDBusProxy * > pair );
     void addTempBackend( std::pair< std::string, gchar* > pair );
-    std::vector<std::pair<std::string, gchar*>> getTempBackends();
+    std::vector<std::pair<std::string, gchar*>> const & getTempBackends();
     void addNewPrinter( const OUString&, const OUString&, CPDPrinter * );
 #endif
 
diff --git a/vcl/source/control/listctrl.cxx b/vcl/source/control/listctrl.cxx
index 50b03eddc918..705b945fd18b 100644
--- a/vcl/source/control/listctrl.cxx
+++ b/vcl/source/control/listctrl.cxx
@@ -148,7 +148,7 @@ void ListControl::deleteEntry(sal_uInt32 nPos)
     RecalcAll();
 }
 
-std::vector<VclPtr<vcl::Window>> ListControl::getEntries() const
+std::vector<VclPtr<vcl::Window>> const & ListControl::getEntries() const
 {
     return maEntries;
 }
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index 285d0bfb0bf9..dbb584e45dda 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -75,7 +75,7 @@ void AlphaMask::ImplSetBitmap( const Bitmap& rBitmap )
     *static_cast<Bitmap*>(this) = rBitmap;
 }
 
-Bitmap AlphaMask::GetBitmap() const
+Bitmap const & AlphaMask::GetBitmap() const
 {
     return ImplGetBitmap();
 }
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index 32835f868691..c2061ad5bc79 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -557,7 +557,7 @@ bool ImplImageTree::checkPathAccess()
     return rNameAccess.is();
 }
 
-css::uno::Reference<css::container::XNameAccess> ImplImageTree::getNameAccess()
+css::uno::Reference<css::container::XNameAccess> const & ImplImageTree::getNameAccess()
 {
     checkPathAccess();
     return getCurrentIconSet().maNameAccess;
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index f181da0a99d9..43142586d970 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -863,7 +863,7 @@ tools::Rectangle ToolBox::GetItemPosRect( ImplToolItems::size_type nPos )
         return tools::Rectangle();
 }
 
-tools::Rectangle ToolBox::GetOverflowRect() const
+tools::Rectangle const & ToolBox::GetOverflowRect() const
 {
     return mpData->maMenubuttonItem.maRect;
 }
diff --git a/vcl/unx/generic/printer/cpdmgr.cxx b/vcl/unx/generic/printer/cpdmgr.cxx
index a830c86c9312..f628dc3aa664 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -184,7 +184,7 @@ void CPDManager::addTempBackend(std::pair<std::string, gchar*> pair) {
     m_tBackends.push_back(pair);
 }
 
-std::vector<std::pair<std::string, gchar*>> CPDManager::getTempBackends() {
+std::vector<std::pair<std::string, gchar*>> const & CPDManager::getTempBackends() {
     return m_tBackends;
 }
 


More information about the Libreoffice-commits mailing list