[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/qa vcl/source vcl/unx vcl/workben

Noel Grandin noel at peralex.com
Thu Apr 14 08:23:42 UTC 2016


 include/vcl/FilterConfigItem.hxx               |    2 +-
 include/vcl/bitmap.hxx                         |    2 +-
 include/vcl/builder.hxx                        |    2 +-
 include/vcl/dockwin.hxx                        |    2 +-
 include/vcl/field.hxx                          |    8 ++++----
 include/vcl/graph.hxx                          |    2 +-
 include/vcl/longcurr.hxx                       |   12 ++++++------
 include/vcl/pdfextoutdevdata.hxx               |    2 +-
 include/vcl/syswin.hxx                         |    2 +-
 include/vcl/texteng.hxx                        |    2 +-
 include/vcl/vclevent.hxx                       |    2 +-
 include/vcl/window.hxx                         |    6 +++---
 vcl/inc/brdwin.hxx                             |    2 +-
 vcl/inc/canvasbitmap.hxx                       |    2 +-
 vcl/inc/fontattributes.hxx                     |    2 +-
 vcl/inc/impfont.hxx                            |    2 +-
 vcl/inc/opengl/x11/salvd.hxx                   |    2 +-
 vcl/inc/unx/glyphcache.hxx                     |    6 +++---
 vcl/inc/unx/gtk/gtkframe.hxx                   |    2 +-
 vcl/inc/unx/salbmp.h                           |    2 +-
 vcl/inc/unx/saldisp.hxx                        |    2 +-
 vcl/inc/unx/salframe.h                         |    2 +-
 vcl/inc/unx/salgdi.h                           |    2 +-
 vcl/inc/unx/salvd.h                            |    2 +-
 vcl/inc/unx/sm.hxx                             |    2 +-
 vcl/qa/cppunit/lifecycle.cxx                   |    2 +-
 vcl/source/gdi/pdfextoutdevdata.cxx            |    2 +-
 vcl/source/gdi/print3.cxx                      |    2 +-
 vcl/source/gdi/textlayout.cxx                  |    2 +-
 vcl/source/window/menufloatingwindow.hxx       |    2 +-
 vcl/source/window/window2.cxx                  |    6 +++---
 vcl/unx/generic/app/sm.cxx                     |    2 +-
 vcl/unx/generic/gdi/cairo_xlib_cairo.hxx       |    2 +-
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |    2 +-
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx       |    4 ++--
 vcl/workben/vcldemo.cxx                        |    2 +-
 36 files changed, 51 insertions(+), 51 deletions(-)

New commits:
commit d8644c8edb405abd9d71e62e43e898c1d2a28fd2
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 14 09:23:37 2016 +0200

    loplugin:passstuffbyref in vcl
    
    Change-Id: I17a4dc73c3fc81b0bfebdf442021af65f8f6166c
    Reviewed-on: https://gerrit.libreoffice.org/24075
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/vcl/FilterConfigItem.hxx b/include/vcl/FilterConfigItem.hxx
index f12eec5..61bf5e3 100644
--- a/include/vcl/FilterConfigItem.hxx
+++ b/include/vcl/FilterConfigItem.hxx
@@ -79,7 +79,7 @@ public:
     void        WriteBool( const OUString& rKey, bool bValue );
     void        WriteInt32( const OUString& rKey, sal_Int32 nValue );
 
-    css::uno::Sequence< css::beans::PropertyValue > GetFilterData() const { return aFilterData;}
+    const css::uno::Sequence< css::beans::PropertyValue >& GetFilterData() const { return aFilterData;}
 
     // GetStatusIndicator is returning the "StatusIndicator" property of the FilterData sequence
     css::uno::Reference< css::task::XStatusIndicator > GetStatusIndicator() const;
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index e534d20..31811b9 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -717,7 +717,7 @@ public:
 public:
 
     SAL_DLLPRIVATE void     ImplMakeUnique();
-    std::shared_ptr<ImpBitmap> ImplGetImpBitmap() const { return mxImpBmp;}
+    const std::shared_ptr<ImpBitmap>& ImplGetImpBitmap() const { return mxImpBmp; }
     SAL_DLLPRIVATE void     ImplSetImpBitmap( const std::shared_ptr<ImpBitmap>& xImpBmp );
     SAL_DLLPRIVATE void     ImplAssignWithSize( const Bitmap& rBitmap );
 
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 1af5bc5..928e512 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -106,7 +106,7 @@ public:
     static void     reorderWithinParent(std::vector< vcl::Window*>& rChilds, bool bIsButtonBox);
     static void     reorderWithinParent(vcl::Window &rWindow, sal_uInt16 nNewPosition);
 
-    css::uno::Reference<css::frame::XFrame> getFrame() { return m_xFrame; }
+    const css::uno::Reference<css::frame::XFrame>& getFrame() { return m_xFrame; }
 
 private:
     VclBuilder(const VclBuilder&) = delete;
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index e126c3e..48413b4 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -135,7 +135,7 @@ public:
     void            ToggleFloatingMode();
 
     void            SetDragArea( const Rectangle& rRect );
-    Rectangle       GetDragArea() const { return maDragArea;}
+    const Rectangle& GetDragArea() const { return maDragArea;}
 
     void            Lock();
     void            Unlock();
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index 62db9fb..75f8207 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -586,9 +586,9 @@ public:
     virtual void            Last() override;
 
     void                    SetFirst( const Date& rNewFirst )   { maFirst = rNewFirst; }
-    Date                    GetFirst() const                    { return maFirst; }
+    const Date&             GetFirst() const                    { return maFirst; }
     void                    SetLast( const Date& rNewLast )     { maLast = rNewLast; }
-    Date                    GetLast() const                     { return maLast; }
+    const Date&             GetLast() const                     { return maLast; }
     virtual void            dispose() override;
 };
 
@@ -617,9 +617,9 @@ public:
     virtual void            Last() override;
 
     void                    SetFirst( const tools::Time& rNewFirst )   { maFirst = rNewFirst; }
-    tools::Time             GetFirst() const                    { return maFirst; }
+    const tools::Time&      GetFirst() const                    { return maFirst; }
     void                    SetLast( const tools::Time& rNewLast )     { maLast = rNewLast; }
-    tools::Time             GetLast() const                     { return maLast; }
+    const tools::Time&      GetLast() const                     { return maLast; }
 
     void                    SetExtFormat( ExtTimeFieldFormat eFormat );
     virtual void            dispose() override;
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index 6f71d24..da73cc6 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -99,7 +99,7 @@ public:
     }
 
     // data read access
-    const Size      getSizePixel() const { return maSizePixel; }
+    const Size&     getSizePixel() const { return maSizePixel; }
     bool            getUnlimitedSize() const { return mbUnlimitedSize; }
     bool            getAntiAliase() const { return mbAntiAliase; }
     bool            getSnapHorVerLines() const { return mbSnapHorVerLines; }
diff --git a/include/vcl/longcurr.hxx b/include/vcl/longcurr.hxx
index 8b40478..48eca60 100644
--- a/include/vcl/longcurr.hxx
+++ b/include/vcl/longcurr.hxx
@@ -58,12 +58,12 @@ public:
     OUString                GetCurrencySymbol() const;
 
     void                    SetMin(const BigInt& rNewMin);
-    BigInt                  GetMin() const { return mnMin; }
+    const BigInt&           GetMin() const { return mnMin; }
     void                    SetMax(const BigInt& rNewMax);
-    BigInt                  GetMax() const { return mnMax; }
+    const BigInt&           GetMax() const { return mnMax; }
 
     void                    SetDecimalDigits( sal_uInt16 nDigits );
-    sal_uInt16                  GetDecimalDigits() const { return mnDecimalDigits;}
+    sal_uInt16              GetDecimalDigits() const { return mnDecimalDigits;}
     void                    SetValue(const BigInt& rNewValue);
     void                    SetUserValue( BigInt nNewValue );
     BigInt                  GetValue() const;
@@ -92,11 +92,11 @@ public:
     void            Last() override;
 
     void            SetFirst(const BigInt& rNewFirst ) { mnFirst = rNewFirst; }
-    BigInt          GetFirst() const { return mnFirst; }
+    const BigInt&   GetFirst() const { return mnFirst; }
     void            SetLast(const BigInt& rNewLast ) { mnLast = rNewLast; }
-    BigInt          GetLast() const { return mnLast; }
+    const BigInt&   GetLast() const { return mnLast; }
     void            SetSpinSize(const BigInt& rNewSize) { mnSpinSize = rNewSize; }
-    BigInt          GetSpinSize() const { return mnSpinSize; }
+    const BigInt&   GetSpinSize() const { return mnSpinSize; }
 };
 
 
diff --git a/include/vcl/pdfextoutdevdata.hxx b/include/vcl/pdfextoutdevdata.hxx
index 9ba411e..08ea937 100644
--- a/include/vcl/pdfextoutdevdata.hxx
+++ b/include/vcl/pdfextoutdevdata.hxx
@@ -152,7 +152,7 @@ public:
 
     std::vector< PDFExtOutDevBookmarkEntry >& GetBookmarks() { return maBookmarks;}
 
-    Graphic GetCurrentGraphic() const;
+    const Graphic& GetCurrentGraphic() const;
 
     /** Start a new group of render output
 
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index e6b637b..49f7c89 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -214,7 +214,7 @@ public:
     bool            IsRollUp() const { return mbRollUp; }
 
     void            SetRollUpOutputSizePixel( const Size& rSize ) { maRollUpOutSize = rSize; }
-    Size            GetRollUpOutputSizePixel() const { return maRollUpOutSize; }
+    const Size&     GetRollUpOutputSizePixel() const { return maRollUpOutSize; }
 
     void            SetMinOutputSizePixel( const Size& rSize );
     const Size&     GetMinOutputSizePixel() const { return maMinOutSize; }
diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx
index 988bd3c..c440659 100644
--- a/include/vcl/texteng.hxx
+++ b/include/vcl/texteng.hxx
@@ -314,7 +314,7 @@ public:
     static bool         DoesKeyChangeText( const KeyEvent& rKeyEvent );
     static bool         IsSimpleCharInput( const KeyEvent& rKeyEvent );
 
-    Color               GetTextColor() const { return maTextColor; }
+    const Color&        GetTextColor() const { return maTextColor; }
 };
 
 #endif // INCLUDED_VCL_TEXTENG_HXX
diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx
index 4d15991..83bcd57 100644
--- a/include/vcl/vclevent.hxx
+++ b/include/vcl/vclevent.hxx
@@ -238,7 +238,7 @@ class VCL_DLLPUBLIC VclAccessibleEvent: public VclSimpleEvent
 public:
     VclAccessibleEvent( sal_uLong n, const css::uno::Reference< css::accessibility::XAccessible >& rxAccessible );
     virtual ~VclAccessibleEvent();
-    css::uno::Reference< css::accessibility::XAccessible > GetAccessible() const { return mxAccessible;}
+    const css::uno::Reference< css::accessibility::XAccessible >& GetAccessible() const { return mxAccessible;}
 
 private:
     css::uno::Reference< css::accessibility::XAccessible > mxAccessible;
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 4c22c61..11dc971 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -931,13 +931,13 @@ public:
 
     void SetControlForeground();
     void SetControlForeground(const Color& rColor);
-    Color GetControlForeground() const;
+    const Color& GetControlForeground() const;
     bool IsControlForeground() const;
     void ApplyControlForeground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor);
 
     void SetControlBackground();
     void SetControlBackground( const Color& rColor );
-    Color GetControlBackground() const;
+    const Color& GetControlBackground() const;
     bool IsControlBackground() const;
     void ApplyControlBackground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor);
 
@@ -1516,7 +1516,7 @@ public:
      */
     void add_mnemonic_label(FixedText *pLabel);
     void remove_mnemonic_label(FixedText *pLabel);
-    std::vector<VclPtr<FixedText> > list_mnemonic_labels() const;
+    const std::vector<VclPtr<FixedText> >& list_mnemonic_labels() const;
 
     /*
      * Move this widget to be the nNewPosition'd child of its parent
diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx
index b4a60b2..72c9935 100644
--- a/vcl/inc/brdwin.hxx
+++ b/vcl/inc/brdwin.hxx
@@ -163,7 +163,7 @@ public:
     void                    SetMenuBarMode( bool bHide );
 
     void                    SetNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
-    VclPtr<NotebookBar>     GetNotebookBar() const { return mpNotebookBar; }
+    const VclPtr<NotebookBar>& GetNotebookBar() const { return mpNotebookBar; }
 
     void                    SetMinOutputSize( long nWidth, long nHeight )
                                 { mnMinWidth = nWidth; mnMinHeight = nHeight; }
diff --git a/vcl/inc/canvasbitmap.hxx b/vcl/inc/canvasbitmap.hxx
index a278b24..5595698 100644
--- a/vcl/inc/canvasbitmap.hxx
+++ b/vcl/inc/canvasbitmap.hxx
@@ -112,7 +112,7 @@ namespace unotools
         explicit VclCanvasBitmap( const BitmapEx& rBitmap );
 
         /// Retrieve contained bitmap. Call me with locked Solar mutex!
-        BitmapEx getBitmapEx() const { return m_aBmpEx; }
+        const BitmapEx& getBitmapEx() const { return m_aBmpEx; }
    };
 }
 }
diff --git a/vcl/inc/fontattributes.hxx b/vcl/inc/fontattributes.hxx
index 226ddbe..6e464b3 100644
--- a/vcl/inc/fontattributes.hxx
+++ b/vcl/inc/fontattributes.hxx
@@ -64,7 +64,7 @@ public:
 
     // Device dependent functions
     int                 GetQuality() const                          { return mnQuality; }
-    OUString            GetMapNames() const                         { return maMapNames; }
+    const OUString&     GetMapNames() const                         { return maMapNames; }
 
     bool                IsBuiltInFont() const                       { return mbDevice; }
     bool                CanEmbed() const                            { return mbEmbeddable; }
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index b566ea4..37fdea5 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -76,7 +76,7 @@ public:
 
     // device dependent functions
     int                 GetQuality() const                              { return mnQuality; }
-    OUString            GetMapNames() const                             { return maMapNames; }
+    const OUString&     GetMapNames() const                             { return maMapNames; }
 
     void                SetQuality( int nQuality )                      { mnQuality = nQuality; }
     void                IncreaseQualityBy( int nQualityAmount )         { mnQuality += nQualityAmount; }
diff --git a/vcl/inc/opengl/x11/salvd.hxx b/vcl/inc/opengl/x11/salvd.hxx
index 0f746aa..bac2325 100644
--- a/vcl/inc/opengl/x11/salvd.hxx
+++ b/vcl/inc/opengl/x11/salvd.hxx
@@ -43,7 +43,7 @@ public:
     virtual long GetHeight() const override { return mnHeight; }
 
     SalDisplay *            GetDisplay() const { return mpDisplay; }
-    SalX11Screen            GetXScreenNumber() const { return mnXScreen; }
+    const SalX11Screen&     GetXScreenNumber() const { return mnXScreen; }
 
     virtual SalGraphics*    AcquireGraphics() override;
     virtual void            ReleaseGraphics( SalGraphics* pGraphics ) override;
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index bcadbb1..04723cb 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -104,8 +104,8 @@ class GlyphMetric
 public:
                             GlyphMetric() : mnAdvanceWidth(0) {}
 
-    Point                   GetOffset() const   { return maOffset; }
-    Size                    GetSize() const     { return maSize; }
+    const Point&            GetOffset() const   { return maOffset; }
+    const Size&             GetSize() const     { return maSize; }
     long                    GetCharWidth() const { return mnAdvanceWidth; }
 
 protected:
@@ -155,7 +155,7 @@ public:
     FT_Face                 GetFtFace() const;
     int                     GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
     void                    SetFontOptions(const std::shared_ptr<FontConfigFontOptions>&);
-    std::shared_ptr<FontConfigFontOptions> GetFontOptions() const;
+    const std::shared_ptr<FontConfigFontOptions>& GetFontOptions() const;
     bool                    NeedsArtificialBold() const { return mbArtBold; }
     bool                    NeedsArtificialItalic() const { return mbArtItalic; }
 
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 072f9da..3610add 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -381,7 +381,7 @@ public:
     GdkWindow*  getForeignTopLevel() const { return m_pForeignTopLevel; }
     GdkNativeWindow getForeignTopLevelWindow() const { return m_aForeignTopLevelWindow; }
     Pixmap getBackgroundPixmap() const { return m_hBackgroundPixmap; }
-    SalX11Screen getXScreenNumber() const { return m_nXScreen; }
+    const SalX11Screen& getXScreenNumber() const { return m_nXScreen; }
     int          GetDisplayScreen() const { return maGeometry.nDisplayScreenNumber; }
     void updateScreenNumber();
 
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h
index 71823ca..761bbb6 100644
--- a/vcl/inc/unx/salbmp.h
+++ b/vcl/inc/unx/salbmp.h
@@ -201,7 +201,7 @@ public:
                     {
                         return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 );
                     }
-    SalX11Screen    ImplGetScreen() const { return mnXScreen; }
+    const SalX11Screen& ImplGetScreen() const { return mnXScreen; }
 
     bool            ImplMatches( SalX11Screen nXScreen, long nDepth, const SalTwoRect& rTwoRect ) const;
 
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index daf25a5..547fdf2 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -324,7 +324,7 @@ public:
 
     ::Window         GetDrawable( SalX11Screen nXScreen ) const { return getDataForScreen( nXScreen ).m_aRefWindow; }
     Display        *GetDisplay() const { return pDisp_; }
-    SalX11Screen    GetDefaultXScreen() const { return m_nXDefaultScreen; }
+    const SalX11Screen& GetDefaultXScreen() const { return m_nXDefaultScreen; }
     const Size&     GetScreenSize( SalX11Screen nXScreen ) const { return getDataForScreen( nXScreen ).m_aSize; }
     srv_vendor_t    GetServerVendor() const { return meServerVendor; }
     void            SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); }
diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h
index 6d7cab6..2329b0b 100644
--- a/vcl/inc/unx/salframe.h
+++ b/vcl/inc/unx/salframe.h
@@ -176,7 +176,7 @@ public:
     {
         return pDisplay_->GetDisplay();
     }
-    SalX11Screen            GetScreenNumber() const { return m_nXScreen; }
+    const SalX11Screen&     GetScreenNumber() const { return m_nXScreen; }
     ::Window                GetWindow() const { return mhWindow; }
     ::Window                GetShellWindow() const { return mhShellWindow; }
     ::Window                GetForeignParent() const { return mhForeignParent; }
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index 9b77c70..88db9ce 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -94,7 +94,7 @@ public:
     using SalGraphics::GetPixel;
     inline  Pixel                   GetPixel( SalColor nSalColor ) const;
 
-    SalX11Screen                    GetScreenNumber() const { return m_nXScreen; }
+    const SalX11Screen&             GetScreenNumber() const { return m_nXScreen; }
 
     // override all pure virtual methods
     virtual void                    GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) override;
diff --git a/vcl/inc/unx/salvd.h b/vcl/inc/unx/salvd.h
index d6af7ce..f7e59eb 100644
--- a/vcl/inc/unx/salvd.h
+++ b/vcl/inc/unx/salvd.h
@@ -59,7 +59,7 @@ public:
     }
     Pixmap          GetDrawable() const { return hDrawable_; }
     sal_uInt16      GetDepth() const { return nDepth_; }
-    SalX11Screen            GetXScreenNumber() const { return m_nXScreen; }
+    const SalX11Screen&     GetXScreenNumber() const { return m_nXScreen; }
 
     virtual SalGraphics*    AcquireGraphics() override;
     virtual void            ReleaseGraphics( SalGraphics* pGraphics ) override;
diff --git a/vcl/inc/unx/sm.hxx b/vcl/inc/unx/sm.hxx
index 190ead3..203c372 100644
--- a/vcl/inc/unx/sm.hxx
+++ b/vcl/inc/unx/sm.hxx
@@ -71,7 +71,7 @@ public:
     static void interactionDone( bool bCancelShutdown );
 
     static OUString getExecName();
-    static VCLPLUG_GEN_PUBLIC OString getSessionID();
+    static VCLPLUG_GEN_PUBLIC const OString& getSessionID();
 };
 
 #endif
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index 0d6c0c1..a6389c2 100644
--- a/vcl/qa/cppunit/lifecycle.cxx
+++ b/vcl/qa/cppunit/lifecycle.cxx
@@ -230,7 +230,7 @@ public:
         pNew->mpRef = static_cast<void *>(static_cast<vcl::Window *>(pNew->mxRef));
         return pNew;
     }
-    VclPtr<vcl::Window> getRef() { return mxRef; }
+    const VclPtr<vcl::Window>& getRef() { return mxRef; }
     void disposeAndClear()
     {
         mxRef.disposeAndClear();
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index fd1addf..a0cab66 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -533,7 +533,7 @@ PDFExtOutDevData::~PDFExtOutDevData()
     delete mpGlobalSyncData;
 }
 
-Graphic PDFExtOutDevData::GetCurrentGraphic() const
+const Graphic& PDFExtOutDevData::GetCurrentGraphic() const
 {
     return mpPageSyncData->mCurrentGraphic;
 }
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index d44d412..76e358f 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -192,7 +192,7 @@ public:
     {}
     ~ImplPrinterControllerData() { mpProgress.disposeAndClear(); }
 
-    Size getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const
+    const Size& getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const
     {
         if( mbPapersizeFromSetup )
             return maDefaultPageSize;
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index b476d22..3afe8e2 100644
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -95,7 +95,7 @@ namespace vcl
         {
             m_aCompleteTextRect.SetEmpty();
         }
-        Rectangle onEndDrawText()
+        const Rectangle& onEndDrawText()
         {
             return m_aCompleteTextRect;
         }
diff --git a/vcl/source/window/menufloatingwindow.hxx b/vcl/source/window/menufloatingwindow.hxx
index 07e5c08..8791293 100644
--- a/vcl/source/window/menufloatingwindow.hxx
+++ b/vcl/source/window/menufloatingwindow.hxx
@@ -101,7 +101,7 @@ public:
     virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
 
     void SetFocusId( const VclPtr<vcl::Window>& xId ) { xSaveFocusId = xId; }
-    VclPtr<vcl::Window> GetFocusId() const      { return xSaveFocusId; }
+    const VclPtr<vcl::Window>& GetFocusId() const      { return xSaveFocusId; }
 
     void EnableScrollMenu( bool b );
     bool IsScrollMenu() const        { return bScrollMenu; }
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 9c35022..dfd2754 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1154,7 +1154,7 @@ bool Window::IsControlFont() const
     return (mpWindowImpl->mpControlFont != nullptr);
 }
 
-Color Window::GetControlForeground() const
+const Color& Window::GetControlForeground() const
 {
     return mpWindowImpl->maControlForeground;
 }
@@ -1164,7 +1164,7 @@ bool Window::IsControlForeground() const
     return mpWindowImpl->mbControlForeground;
 }
 
-Color Window::GetControlBackground() const
+const Color& Window::GetControlBackground() const
 {
     return mpWindowImpl->maControlBackground;
 }
@@ -2018,7 +2018,7 @@ void Window::remove_mnemonic_label(FixedText *pLabel)
     pLabel->set_mnemonic_widget(nullptr);
 }
 
-std::vector<VclPtr<FixedText> > Window::list_mnemonic_labels() const
+const std::vector<VclPtr<FixedText> >& Window::list_mnemonic_labels() const
 {
     return mpWindowImpl->m_aMnemonicLabels;
 }
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index ddefa5a..dd5389b 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -471,7 +471,7 @@ void SessionManagerClient::open(SalSession * pSession)
     }
 }
 
-OString SessionManagerClient::getSessionID()
+const OString& SessionManagerClient::getSessionID()
 {
     return m_aClientID;
 }
diff --git a/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx b/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx
index 56cc9f0..6a58364 100644
--- a/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx
+++ b/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx
@@ -90,7 +90,7 @@ namespace cairo {
 
         int getDepth() const;
         DeviceFormat getFormat() const;
-        X11PixmapSharedPtr getPixmap() const { return mpPixmap; }
+        const X11PixmapSharedPtr& getPixmap() const { return mpPixmap; }
         void* getRenderFormat() const { return maSysData.pRenderFormat; }
         long getDrawable() const { return mpPixmap ? mpPixmap->mhDrawable : maSysData.hDrawable; }
     };
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 5476dd1..5ea4853 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -590,7 +590,7 @@ void ServerFont::SetFontOptions(const std::shared_ptr<FontConfigFontOptions>& xF
         mnLoadFlags |= FT_LOAD_NO_BITMAP;
 }
 
-std::shared_ptr<FontConfigFontOptions> ServerFont::GetFontOptions() const
+const std::shared_ptr<FontConfigFontOptions>& ServerFont::GetFontOptions() const
 {
     return mxFontOptions;
 }
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index d20e1b4..44fccb0 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -336,8 +336,8 @@ public:
     {
     }
 
-    OUString     getTitle() const { return m_sTitle; }
-    OUString     getFilter() const { return m_sFilter; }
+    const OUString& getTitle() const { return m_sTitle; }
+    const OUString& getFilter() const { return m_sFilter; }
 
     /// determines if the filter has sub filter (i.e., the filter is a filter group in real)
     bool        hasSubFilters( ) const;
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index f47dc31..9b77a41 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -158,7 +158,7 @@ public:
 
     Size maSize;
     void SetSizePixel(const Size &rSize) { maSize = rSize; }
-    Size GetSizePixel() const            { return maSize;  }
+    const Size& GetSizePixel() const            { return maSize;  }
 
 
 // more of a 'Window' concept - push upwards ?


More information about the Libreoffice-commits mailing list