[Libreoffice-commits] core.git: 2 commits - basic/inc basic/source compilerplugins/clang cui/source include/basic include/svtools include/svx oox/source sd/source sfx2/source svtools/source svx/source sw/inc sw/source uui/source xmlsecurity/inc xmlsecurity/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Jan 2 11:19:31 UTC 2018


 basic/inc/basic.hrc                                    |    2 -
 basic/source/classes/sb.cxx                            |    7 ----
 compilerplugins/clang/passstuffbyref.cxx               |    3 +
 cui/source/options/optdict.cxx                         |    2 -
 cui/source/tabpages/backgrnd.cxx                       |    2 -
 include/basic/sbdef.hxx                                |    2 -
 include/svtools/ehdl.hxx                               |    4 +-
 include/svtools/soerr.hxx                              |    4 +-
 include/svx/svxerr.hxx                                 |    4 +-
 oox/source/ppt/pptimport.cxx                           |    2 -
 sd/source/ui/func/futhes.cxx                           |    2 -
 sd/source/ui/view/sdview4.cxx                          |    2 -
 sd/source/ui/view/viewshe2.cxx                         |    2 -
 sfx2/source/appl/appinit.cxx                           |    6 +--
 sfx2/source/view/ipclient.cxx                          |    2 -
 svtools/source/misc/ehdl.cxx                           |   26 +----------------
 svx/source/items/svxerr.cxx                            |   12 -------
 sw/inc/AnnotationWin.hxx                               |    2 -
 sw/inc/ddefld.hxx                                      |    2 -
 sw/inc/doc.hxx                                         |    2 -
 sw/inc/editsh.hxx                                      |    4 +-
 sw/inc/list.hxx                                        |    4 +-
 sw/inc/ndole.hxx                                       |    2 -
 sw/inc/numrule.hxx                                     |    2 -
 sw/inc/pagedesc.hxx                                    |    2 -
 sw/inc/section.hxx                                     |    6 +--
 sw/inc/shellio.hxx                                     |    6 +--
 sw/inc/swmodule.hxx                                    |    2 -
 sw/inc/tox.hxx                                         |    4 +-
 sw/inc/view.hxx                                        |    2 -
 sw/source/core/access/accpara.cxx                      |    2 -
 sw/source/core/access/accpara.hxx                      |    2 -
 sw/source/core/doc/docfld.cxx                          |    2 -
 sw/source/core/doc/list.cxx                            |    4 +-
 sw/source/core/doc/number.cxx                          |    2 -
 sw/source/core/docnode/section.cxx                     |    2 -
 sw/source/core/edit/edfld.cxx                          |    2 -
 sw/source/core/edit/edtox.cxx                          |    2 -
 sw/source/core/fields/ddefld.cxx                       |    2 -
 sw/source/core/inc/flyfrms.hxx                         |    2 -
 sw/source/core/inc/unometa.hxx                         |    2 -
 sw/source/core/layout/anchoreddrawobject.cxx           |    4 +-
 sw/source/core/layout/flyincnt.cxx                     |    2 -
 sw/source/core/layout/pagedesc.cxx                     |    2 -
 sw/source/core/ole/ndole.cxx                           |    2 -
 sw/source/core/swg/swblocks.cxx                        |    4 +-
 sw/source/core/unocore/unorefmk.cxx                    |    2 -
 sw/source/core/unocore/unostyle.cxx                    |    2 -
 sw/source/filter/html/htmlctxt.cxx                     |    4 +-
 sw/source/filter/html/htmlfly.hxx                      |    2 -
 sw/source/filter/ww8/docxattributeoutput.cxx           |    2 -
 sw/source/filter/ww8/wrtww8.hxx                        |    2 -
 sw/source/filter/ww8/ww8toolbar.hxx                    |    2 -
 sw/source/uibase/app/swmodul1.cxx                      |    2 -
 sw/source/uibase/dbui/mmconfigitem.cxx                 |   26 ++++++++---------
 sw/source/uibase/inc/mmconfigitem.hxx                  |   26 ++++++++---------
 sw/source/uibase/inc/prcntfld.hxx                      |    2 -
 sw/source/uibase/inc/uivwimp.hxx                       |    2 -
 sw/source/uibase/sidebar/PageStylesPanel.cxx           |   10 +++---
 sw/source/uibase/sidebar/PageStylesPanel.hxx           |   10 +++---
 sw/source/uibase/uiview/view0.cxx                      |    2 -
 sw/source/uibase/uiview/viewling.cxx                   |    4 +-
 uui/source/iahndl-errorhandler.cxx                     |    4 +-
 xmlsecurity/inc/documentsignaturemanager.hxx           |    4 +-
 xmlsecurity/inc/pdfsignaturehelper.hxx                 |    2 -
 xmlsecurity/source/helper/documentsignaturemanager.cxx |    4 +-
 xmlsecurity/source/helper/pdfsignaturehelper.cxx       |    2 -
 67 files changed, 122 insertions(+), 156 deletions(-)

New commits:
commit 4855257e52056241633c2b1d8159c3f0e71e05f3
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Sun Dec 31 21:34:58 2017 +0200

    loplugin:passstuffbyref improved return in sw
    
    Change-Id: I4484ac461761e4c46364b4f473c7e62f8ec72103
    Reviewed-on: https://gerrit.libreoffice.org/47243
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx
index cb7ac1366c70..aca8b89da5a3 100644
--- a/compilerplugins/clang/passstuffbyref.cxx
+++ b/compilerplugins/clang/passstuffbyref.cxx
@@ -251,7 +251,8 @@ void PassStuffByRef::checkReturnValue(const FunctionDecl * functionDecl, const C
             .GlobalNamespace())
         || (dc.Function("TopLeft").Class("SwRect").GlobalNamespace())
         || (dc.Function("ConvDicList_CreateInstance").GlobalNamespace())
-        || (dc.Function("Create").Class("OUnoAutoPilot").Namespace("dbp").GlobalNamespace()))
+        || (dc.Function("Create").Class("OUnoAutoPilot").Namespace("dbp").GlobalNamespace())
+        || (dc.Function("Size_").Class("SwRect").GlobalNamespace()))
     {
         return;
     }
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index ed6eb3fc6904..5d485d598b01 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -99,7 +99,7 @@ class SwAnnotationWin : public vcl::Window
         void TranslateTopPosition(const long aAmount);
         void CheckMetaText();
 
-        Point GetAnchorPos() { return mAnchorRect.Pos(); }
+        Point const & GetAnchorPos() { return mAnchorRect.Pos(); }
         const SwRect& GetAnchorRect() { return mAnchorRect; }
         bool IsAnchorRectChanged() { return mbAnchorRectChanged; }
         void ResetAnchorRectChanged() { mbAnchorRectChanged = false; }
diff --git a/sw/inc/ddefld.hxx b/sw/inc/ddefld.hxx
index c79e65a46d7e..a583f247a966 100644
--- a/sw/inc/ddefld.hxx
+++ b/sw/inc/ddefld.hxx
@@ -55,7 +55,7 @@ public:
     virtual bool QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) const override;
     virtual bool PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich ) override;
 
-    OUString GetCmd() const;
+    OUString const & GetCmd() const;
     void SetCmd( const OUString& aStr );
 
     SfxLinkUpdateMode GetType() const          { return refLink->GetUpdateMode();  }
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 6a0d7ca59b2b..1a680165d9e7 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -706,7 +706,7 @@ public:
                        const std::vector<OUString>* pAllDBNames = nullptr );
 
     void ChgDBData( const SwDBData& rNewData );
-    SwDBData GetDBData();
+    SwDBData const & GetDBData();
     const SwDBData& GetDBDesc();
 
     // Some helper functions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 8f53e58fd1da..197d3b274525 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -419,7 +419,7 @@ public:
     void ChangeAuthorityData(const SwAuthEntry* pNewData);
 
     /// Database information.
-    SwDBData GetDBData() const;
+    SwDBData const & GetDBData() const;
     const SwDBData& GetDBDesc() const;
     void ChgDBData(const SwDBData& SwDBData);
     void ChangeDBFields( const std::vector<OUString>& rOldNames,
@@ -487,7 +487,7 @@ public:
     void                InsertTOXType(const SwTOXType& rTyp);
 
     /// AutoMark file
-    OUString        GetTOIAutoMarkURL() const;
+    OUString const & GetTOIAutoMarkURL() const;
     void            SetTOIAutoMarkURL(const OUString& rSet);
     void            ApplyAutoMark();
 
diff --git a/sw/inc/list.hxx b/sw/inc/list.hxx
index a5698c3cb1e5..1c5bfc7d4478 100644
--- a/sw/inc/list.hxx
+++ b/sw/inc/list.hxx
@@ -38,9 +38,9 @@ class SwList
                 const SwNodes& rNodes );
         ~SwList();
 
-        const OUString GetListId() const;
+        const OUString & GetListId() const;
 
-        const OUString GetDefaultListStyleName() const;
+        const OUString & GetDefaultListStyleName() const;
         void SetDefaultListStyleName(OUString const&);
 
         void InsertListItem( SwNodeNum& rNodeNum,
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 13e32c2b3580..1936bb030b20 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -64,7 +64,7 @@ public:
 
     OUString GetDescription();
 
-    const css::uno::Reference < css::embed::XEmbeddedObject > GetOleRef();
+    css::uno::Reference < css::embed::XEmbeddedObject > const & GetOleRef();
     svt::EmbeddedObjectRef& GetObject();
     const OUString& GetCurrentPersistName() const { return m_aName; }
     OUString GetStyleString();
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index 560a655f055a..d841a4b64f2a 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -280,7 +280,7 @@ namespace numfunc
 
         @author OD
     */
-    OUString GetDefBulletFontname();
+    OUString const & GetDefBulletFontname();
 
     /** determine if default bullet font is user defined
 
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 21878db19466..60e5958de00e 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -364,7 +364,7 @@ public:
     SwPageDescExt & operator = (const SwPageDescExt & rSrc);
     SwPageDescExt & operator = (const SwPageDesc & rSrc);
 
-    OUString GetName() const;
+    OUString const & GetName() const;
 
     operator SwPageDesc() const; // #i7983#
 };
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 7eeadf7c0ebd..30b582b89a80 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -196,13 +196,13 @@ public:
 
     inline SwSection* GetParent() const;
 
-    OUString GetCondition() const           { return m_Data.GetCondition(); }
+    OUString const & GetCondition() const           { return m_Data.GetCondition(); }
     void SetCondition(OUString const& rNew) { m_Data.SetCondition(rNew); }
 
-    OUString GetLinkFileName() const;
+    OUString const & GetLinkFileName() const;
     void SetLinkFileName(OUString const& rNew);
     // Password of linked file (only valid during runtime!)
-    OUString GetLinkFilePassword() const
+    OUString const & GetLinkFilePassword() const
         { return m_Data.GetLinkFilePassword(); }
     void SetLinkFilePassword(OUString const& rS)
         { m_Data.SetLinkFilePassword(rS); }
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index eb764518061a..ac1cd9e50d48 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -302,7 +302,7 @@ public:
     void   ClearDoc();                  // Delete Doc-contents.
     OUString GetName();
     void   SetName( const OUString& );
-    ErrCode GetError() const { return nErr; }
+    ErrCode const & GetError() const { return nErr; }
 
     OUString GetBaseURL() const;
     void   SetBaseURL( const OUString& rURL );
@@ -317,7 +317,7 @@ public:
 
     bool   Delete( sal_uInt16 );
     void   Rename( sal_uInt16, const OUString*, const OUString* );
-    ErrCode CopyBlock( SwTextBlocks const & rSource, OUString& rSrcShort,
+    ErrCode const & CopyBlock( SwTextBlocks const & rSource, OUString& rSrcShort,
                                     const OUString& rLong );
 
     bool   BeginGetDoc( sal_uInt16 );   // Read text modules.
@@ -331,7 +331,7 @@ public:
     bool IsOnlyTextBlock( sal_uInt16 ) const;
     bool IsOnlyTextBlock( const OUString& rShort ) const;
 
-    OUString GetFileName() const;           // Filename of pImp.
+    OUString const & GetFileName() const;           // Filename of pImp.
     bool IsReadOnly() const;            // ReadOnly-flag of pImp.
 
     bool GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTable );
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 4a7cad8a36c7..8b9d8e265a18 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -210,7 +210,7 @@ public:
     sal_uInt16          GetPieceLen() const;
 
     // Return defined DocStat - WordDelimiter.
-    OUString            GetDocStatWordDelim() const;
+    OUString const & GetDocStatWordDelim() const;
 
     // Pass metric of ModuleConfig (for HTML-export).
     FieldUnit GetMetric( bool bWeb ) const;
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index b75eba42de56..b32b3c8f96ba 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -451,7 +451,7 @@ public:
 
     const OUString&     GetTitle() const;           // Title
     const OUString&     GetBookmarkName() const;
-    OUString            GetTypeName() const;        // Name
+    OUString const &    GetTypeName() const;        // Name
     const SwForm&       GetTOXForm() const;         // description of the lines
 
     void                SetCreate(SwTOXElement);
@@ -688,7 +688,7 @@ inline const OUString& SwTOXBase::GetBookmarkName() const
 inline const OUString& SwTOXBase::GetEntryTypeName() const
     { return m_aEntryTypeName; }
 
-inline OUString SwTOXBase::GetTypeName() const
+inline OUString const & SwTOXBase::GetTypeName() const
     { return GetTOXType()->GetTypeName();  }
 
 inline const SwForm& SwTOXBase::GetTOXForm() const
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index bec26a1a99c5..2b0d63f83d97 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -606,7 +606,7 @@ public:
     // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
     // or to support printing
     void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem> const & rConfigItem);
-    std::shared_ptr<SwMailMergeConfigItem> GetMailMergeConfigItem() const;
+    std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() const;
     std::shared_ptr<SwMailMergeConfigItem> EnsureMailMergeConfigItem(const SfxItemSet* pArgs = nullptr);
 
     void ExecFormatPaintbrush(SfxRequest const &);
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 4fb50f858d8d..8b101756331d 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -127,7 +127,7 @@ const SwTextNode* SwAccessibleParagraph::GetTextNode() const
     return pNode;
 }
 
-OUString SwAccessibleParagraph::GetString()
+OUString const & SwAccessibleParagraph::GetString()
 {
     return GetPortionData().GetAccessibleString();
 }
diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx
index f6c89632afb3..c96001afb2b8 100644
--- a/sw/source/core/access/accpara.hxx
+++ b/sw/source/core/access/accpara.hxx
@@ -92,7 +92,7 @@ class SwAccessibleParagraph :
     const SwTextNode* GetTextNode() const;
 
     /// get the (accessible) text string (requires frame; check before)
-    OUString GetString();
+    OUString const & GetString();
 
     static OUString GetDescription();
 
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index d63795dfe189..27fafaf0de90 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -340,7 +340,7 @@ OUString LookString( SwHash** ppTable, sal_uInt16 nSize, const OUString& rName )
     return OUString();
 }
 
-SwDBData SwDoc::GetDBData()
+SwDBData const & SwDoc::GetDBData()
 {
     return GetDBDesc();
 }
diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx
index 711ebbfd1804..46be497f77ad 100644
--- a/sw/source/core/doc/list.cxx
+++ b/sw/source/core/doc/list.cxx
@@ -220,12 +220,12 @@ SwList::~SwList()
 {
 }
 
-const OUString SwList::GetListId() const
+const OUString & SwList::GetListId() const
 {
     return mpListImpl->GetListId();
 }
 
-const OUString SwList::GetDefaultListStyleName() const
+const OUString & SwList::GetDefaultListStyleName() const
 {
     return mpListImpl->GetDefaultListStyleName();
 }
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 1117de69cc03..b60a20168802 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1257,7 +1257,7 @@ namespace numfunc
     {
     }
 
-    OUString GetDefBulletFontname()
+    OUString const & GetDefBulletFontname()
     {
         return SwDefBulletConfig::getInstance().GetFontname();
     }
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 469024234ec6..1930db0fb453 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -542,7 +542,7 @@ void SwSection::SetCondHidden(bool const bFlag)
 }
 
 // Set/remove the linked FileName
-OUString SwSection::GetLinkFileName() const
+OUString const & SwSection::GetLinkFileName() const
 {
     if (m_RefLink.is())
     {
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index 4737f411cd8d..d57da627a3cc 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -295,7 +295,7 @@ void SwEditShell::UpdateFields( SwField &rField )
     EndAllAction();
 }
 
-SwDBData SwEditShell::GetDBData() const
+SwDBData const & SwEditShell::GetDBData() const
 {
     return GetDoc()->GetDBData();
 }
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 0af2a5d91ee4..35afdd5654e6 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -263,7 +263,7 @@ bool SwEditShell::IsUpdateTOX() const
     return GetDoc()->IsUpdateTOX();
 }
 
-OUString SwEditShell::GetTOIAutoMarkURL() const
+OUString const & SwEditShell::GetTOIAutoMarkURL() const
 {
     return GetDoc()->GetTOIAutoMarkURL();
 }
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 3ff14069088a..d9c9993dcdd5 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -273,7 +273,7 @@ void SwDDEFieldType::SetCmd( const OUString& _aStr )
     refLink->SetLinkSourceName( aStr );
 }
 
-OUString SwDDEFieldType::GetCmd() const
+OUString const & SwDDEFieldType::GetCmd() const
 {
     return refLink->GetLinkSourceName();
 }
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index 1bde38f6784b..c0fafd733efc 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -218,7 +218,7 @@ public:
     void SetRefPoint( const Point& rPoint, const Point &rRelAttr,
         const Point &rRelPos );
     const Point &GetRefPoint() const { return aRef; }
-    const Point GetRelPos() const;
+    Point const & GetRelPos() const;
 
     // (26.11.93, see tabfrm.hxx, but might also be valid for others)
     // For creation of a Fly after a FlyCnt was created _and_ inserted.
diff --git a/sw/source/core/inc/unometa.hxx b/sw/source/core/inc/unometa.hxx
index 525e29d76e98..ff6188a6d078 100644
--- a/sw/source/core/inc/unometa.hxx
+++ b/sw/source/core/inc/unometa.hxx
@@ -101,7 +101,7 @@ public:
 
     /// init params with position of the attribute content (w/out CH_TXTATR)
     bool SetContentRange( SwTextNode *& rpNode, sal_Int32 & rStart, sal_Int32 & rEnd) const;
-    css::uno::Reference< css::text::XText > GetParentText() const;
+    css::uno::Reference< css::text::XText > const & GetParentText() const;
 
     /// @throws css::lang::IllegalArgumentException
     /// @throws css::uno::RuntimeException
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index dfbdce3021bb..bc7d76bae69e 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -48,7 +48,7 @@ class SwPosNotify
         explicit SwPosNotify( SwAnchoredDrawObject* _pAnchoredDrawObj );
         ~SwPosNotify() COVERITY_NOEXCEPT_FALSE;
         // #i32795#
-        Point LastObjPos() const;
+        Point const & LastObjPos() const;
 };
 
 SwPosNotify::SwPosNotify( SwAnchoredDrawObject* _pAnchoredDrawObj ) :
@@ -123,7 +123,7 @@ SwPosNotify::~SwPosNotify() COVERITY_NOEXCEPT_FALSE
 }
 
 // --> #i32795#
-Point SwPosNotify::LastObjPos() const
+Point const & SwPosNotify::LastObjPos() const
 {
     return maOldObjRect.Pos();
 }
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index af87a79ea1bd..a89ea5871609 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -191,7 +191,7 @@ void SwFlyInContentFrame::NotifyBackground( SwPageFrame *, const SwRect& rRect,
         AnchorFrame()->Prepare( eHint, static_cast<void const *>(&rRect) );
 }
 
-const Point SwFlyInContentFrame::GetRelPos() const
+Point const & SwFlyInContentFrame::GetRelPos() const
 {
     Calc(getRootFrame()->GetCurrShell()->GetOut());
     return GetCurrRelPos();
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 38d56884e609..26cfde205d6f 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -457,7 +457,7 @@ SwPageDescExt::~SwPageDescExt()
 {
 }
 
-OUString SwPageDescExt::GetName() const
+OUString const & SwPageDescExt::GetName() const
 {
     return m_PageDesc.GetName();
 }
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index bcefe2a10130..b08dc6fe9d8e 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -872,7 +872,7 @@ bool SwOLEObj::IsOleRef() const
     return m_xOLERef.is();
 }
 
-const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef()
+uno::Reference < embed::XEmbeddedObject > const & SwOLEObj::GetOleRef()
 {
     if( !m_xOLERef.is() )
     {
diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx
index 079984ed9635..c3e891d080cd 100644
--- a/sw/source/core/swg/swblocks.cxx
+++ b/sw/source/core/swg/swblocks.cxx
@@ -368,7 +368,7 @@ void SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString* l )
     }
 }
 
-ErrCode SwTextBlocks::CopyBlock( SwTextBlocks const & rSource, OUString& rSrcShort,
+ErrCode const & SwTextBlocks::CopyBlock( SwTextBlocks const & rSource, OUString& rSrcShort,
                                 const OUString& rLong )
 {
     bool bIsOld = false;
@@ -525,7 +525,7 @@ void SwTextBlocks::ClearDoc()
     }
 }
 
-OUString SwTextBlocks::GetFileName() const
+OUString const & SwTextBlocks::GetFileName() const
 {
     return pImp->GetFileName();
 }
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 3722a5296ea7..49dfa4a0c56c 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -681,7 +681,7 @@ void SwXMeta::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
     m_EventListeners.disposeAndClear(ev);
 }
 
-uno::Reference<text::XText> SwXMeta::GetParentText() const
+uno::Reference<text::XText> const & SwXMeta::GetParentText() const
 {
     return m_pImpl->m_xParentText;
 }
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index c560c3acf941..cb9b4c1d58ae 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -3351,7 +3351,7 @@ class SwAutoStylesEnumImpl
 public:
     SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAutoStyleFamily eFam );
     bool hasMoreElements() { return aIter != mAutoStyles.end(); }
-    std::shared_ptr<SfxItemSet> nextElement() { return *(aIter++); }
+    std::shared_ptr<SfxItemSet> const & nextElement() { return *(aIter++); }
     IStyleAccess::SwAutoStyleFamily getFamily() const { return eFamily; }
     SwDoc* getDoc() const { return pDoc; }
 };
diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx
index bd48c6a9c223..19657967268f 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -76,7 +76,7 @@ public:
     void SetNumInfo( const SwHTMLNumRuleInfo& rInf ) { aNumRuleInfo.Set(rInf); }
     const SwHTMLNumRuleInfo& GetNumInfo() const { return aNumRuleInfo; }
 
-    std::shared_ptr<HTMLAttrTable> GetAttrTab(bool bCreate = false);
+    std::shared_ptr<HTMLAttrTable> const & GetAttrTab(bool bCreate = false);
 
     void SetContextStMin( size_t nMin ) { nContextStMin = nMin; }
     size_t GetContextStMin() const { return nContextStMin; }
@@ -97,7 +97,7 @@ public:
     bool GetFixFooterDist() const { return bFixFooterDist; }
 };
 
-std::shared_ptr<HTMLAttrTable> HTMLAttrContext_SaveDoc::GetAttrTab( bool bCreate )
+std::shared_ptr<HTMLAttrTable> const & HTMLAttrContext_SaveDoc::GetAttrTab( bool bCreate )
 {
     if (!xAttrTab && bCreate)
     {
diff --git a/sw/source/filter/html/htmlfly.hxx b/sw/source/filter/html/htmlfly.hxx
index 9f01ef648038..e3ea1101be48 100644
--- a/sw/source/filter/html/htmlfly.hxx
+++ b/sw/source/filter/html/htmlfly.hxx
@@ -116,7 +116,7 @@ public:
     const SdrObject*     GetSdrObject() const    { return pSdrObject; }
     const SwNodeIndex&   GetNdIndex() const      { return *pNdIdx; }
     sal_Int32            GetContentIndex() const { return nContentIdx; }
-    AllHtmlFlags         GetOutMode() const      { return nAllFlags; }
+    AllHtmlFlags const & GetOutMode() const      { return nAllFlags; }
     HtmlOut              GetOutFn() const        { return nAllFlags.nOut; }
     HtmlPosition         GetOutPos() const       { return nAllFlags.nPosition; }
 };
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index eaa3b84af42b..4c160c5376eb 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -213,7 +213,7 @@ class FieldMarkParamsHelper
     const sw::mark::IFieldmark& mrFieldmark;
     public:
     explicit FieldMarkParamsHelper( const sw::mark::IFieldmark& rFieldmark ) : mrFieldmark( rFieldmark ) {}
-    OUString getName() { return mrFieldmark.GetName(); }
+    OUString const & getName() { return mrFieldmark.GetName(); }
     template < typename T >
     bool extractParam( const OUString& rKey, T& rResult )
     {
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 93f4d392c0d9..6fc71a97b624 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -306,7 +306,7 @@ public:
     void Write( SvStream *pTableStram ) const;
     void WriteDocx( DocxAttributeOutput* rAttrOutput ) const;
     void WriteRtf( const RtfAttributeOutput* rAttrOutput ) const;
-    OUString GetFamilyName() const { return msFamilyNm; }
+    OUString const & GetFamilyName() const { return msFamilyNm; }
     friend bool operator < (const wwFont &r1, const wwFont &r2);
 };
 
diff --git a/sw/source/filter/ww8/ww8toolbar.hxx b/sw/source/filter/ww8/ww8toolbar.hxx
index b5b9bc2a9d74..ec51bcfdc987 100644
--- a/sw/source/filter/ww8/ww8toolbar.hxx
+++ b/sw/source/filter/ww8/ww8toolbar.hxx
@@ -72,7 +72,7 @@ public:
     bool IsMenuToolbar();
     bool ImportCustomToolBar( SwCTBWrapper&, CustomToolBarImportHelper& );
     bool ImportMenuTB( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
-    OUString GetName() { return tb.getName().getString(); }
+    OUString const & GetName() { return tb.getName().getString(); }
 };
 
 class TBDelta : public TBBase
diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx
index 565e07f6b2b1..1e82eaf98bd2 100644
--- a/sw/source/uibase/app/swmodul1.cxx
+++ b/sw/source/uibase/app/swmodul1.cxx
@@ -584,7 +584,7 @@ const SwViewOption* SwModule::GetViewOption(bool bWeb)
     return GetUsrPref( bWeb );
 }
 
-OUString SwModule::GetDocStatWordDelim() const
+OUString const & SwModule::GetDocStatWordDelim() const
 {
     return m_pModuleConfig->GetWordDelimiter();
 }
diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx
index 9c97e831ee25..9170ffe1cb14 100644
--- a/sw/source/uibase/dbui/mmconfigitem.cxx
+++ b/sw/source/uibase/dbui/mmconfigitem.cxx
@@ -822,17 +822,17 @@ void SwMailMergeConfigItem::SetCurrentConnection(
         m_pImpl->SetModified();
 }
 
-Reference< XDataSource>  SwMailMergeConfigItem::GetSource()
+Reference< XDataSource> const & SwMailMergeConfigItem::GetSource()
 {
     return m_pImpl->m_xSource;
 }
 
-SharedConnection SwMailMergeConfigItem::GetConnection()
+SharedConnection const & SwMailMergeConfigItem::GetConnection()
 {
     return m_pImpl->m_xConnection;
 }
 
-Reference< XColumnsSupplier> SwMailMergeConfigItem::GetColumnsSupplier()
+Reference< XColumnsSupplier> const & SwMailMergeConfigItem::GetColumnsSupplier()
 {
     if(!m_pImpl->m_xColumnsSupplier.is() && m_pImpl->m_xConnection.is())
     {
@@ -862,7 +862,7 @@ void SwMailMergeConfigItem::SetCurrentDBData( const SwDBData& rDBData)
     }
 }
 
-Reference< XResultSet>   SwMailMergeConfigItem::GetResultSet() const
+Reference< XResultSet> const & SwMailMergeConfigItem::GetResultSet() const
 {
     if(!m_pImpl->m_xConnection.is() && !m_pImpl->m_aDBData.sDataSource.isEmpty())
     {
@@ -1306,7 +1306,7 @@ bool SwMailMergeConfigItem::IsGreetingFieldsAssigned() const
     return bResult;
 }
 
-OUString     SwMailMergeConfigItem::GetMailDisplayName() const
+OUString const & SwMailMergeConfigItem::GetMailDisplayName() const
 {
     return m_pImpl->m_sMailDisplayName;
 }
@@ -1320,7 +1320,7 @@ void SwMailMergeConfigItem::SetMailDisplayName(const OUString& rName)
     }
 }
 
-OUString     SwMailMergeConfigItem::GetMailAddress() const
+OUString const & SwMailMergeConfigItem::GetMailAddress() const
 {
     return m_pImpl->m_sMailAddress;
 }
@@ -1348,7 +1348,7 @@ void  SwMailMergeConfigItem::SetMailReplyTo(bool bSet)
     }
 }
 
-OUString     SwMailMergeConfigItem::GetMailReplyTo() const
+OUString const & SwMailMergeConfigItem::GetMailReplyTo() const
 {
     return m_pImpl->m_sMailReplyTo;
 }
@@ -1362,7 +1362,7 @@ void SwMailMergeConfigItem::SetMailReplyTo(const OUString& rReplyTo)
     }
 }
 
-OUString  SwMailMergeConfigItem::GetMailServer() const
+OUString const & SwMailMergeConfigItem::GetMailServer() const
 {
     return m_pImpl->m_sMailServer;
 }
@@ -1421,7 +1421,7 @@ void SwMailMergeConfigItem::SetAuthentication(bool bSet)
     }
 }
 
-OUString     SwMailMergeConfigItem::GetMailUserName() const
+OUString const & SwMailMergeConfigItem::GetMailUserName() const
 {
     return m_pImpl->m_sMailUserName;
 }
@@ -1435,7 +1435,7 @@ void SwMailMergeConfigItem::SetMailUserName(const OUString& rName)
     }
 }
 
-OUString     SwMailMergeConfigItem::GetMailPassword() const
+OUString const & SwMailMergeConfigItem::GetMailPassword() const
 {
     return m_pImpl->m_sMailPassword;
 }
@@ -1463,7 +1463,7 @@ void SwMailMergeConfigItem::SetSMTPAfterPOP(bool bSet)
     }
 }
 
-OUString     SwMailMergeConfigItem::GetInServerName() const
+OUString const & SwMailMergeConfigItem::GetInServerName() const
 {
     return m_pImpl->m_sInServerName;
 }
@@ -1505,7 +1505,7 @@ void SwMailMergeConfigItem::SetInServerPOP(bool bSet)
     }
 }
 
-OUString     SwMailMergeConfigItem::GetInServerUserName() const
+OUString const & SwMailMergeConfigItem::GetInServerUserName() const
 {
     return m_pImpl->m_sInServerUserName;
 }
@@ -1519,7 +1519,7 @@ void SwMailMergeConfigItem::SetInServerUserName(const OUString& rName)
     }
 }
 
-OUString     SwMailMergeConfigItem::GetInServerPassword() const
+OUString const & SwMailMergeConfigItem::GetInServerPassword() const
 {
     return m_pImpl->m_sInServerPassword;
 }
diff --git a/sw/source/uibase/inc/mmconfigitem.hxx b/sw/source/uibase/inc/mmconfigitem.hxx
index 72ad3253a103..9064bd2b220b 100644
--- a/sw/source/uibase/inc/mmconfigitem.hxx
+++ b/sw/source/uibase/inc/mmconfigitem.hxx
@@ -85,13 +85,13 @@ public:
         css::uno::Reference< css::sdbcx::XColumnsSupplier> const & xColumnsSupplier,
         const SwDBData& rDBData);
 
-    css::uno::Reference< css::sdbc::XDataSource> GetSource();
+    css::uno::Reference< css::sdbc::XDataSource> const & GetSource();
 
-    SharedConnection GetConnection();
+    SharedConnection const & GetConnection();
 
-    css::uno::Reference< css::sdbcx::XColumnsSupplier> GetColumnsSupplier();
+    css::uno::Reference< css::sdbcx::XColumnsSupplier> const & GetColumnsSupplier();
 
-    css::uno::Reference< css::sdbc::XResultSet> GetResultSet() const;
+    css::uno::Reference< css::sdbc::XResultSet> const & GetResultSet() const;
 
     void DisposeResultSet();
 
@@ -157,19 +157,19 @@ public:
     bool IsGreetingFieldsAssigned() const;
 
     //e-Mail settings:
-    OUString GetMailDisplayName() const;
+    OUString const & GetMailDisplayName() const;
     void SetMailDisplayName(const OUString& rName);
 
-    OUString GetMailAddress() const;
+    OUString const & GetMailAddress() const;
     void SetMailAddress(const OUString& rAddress);
 
     bool IsMailReplyTo() const;
     void SetMailReplyTo(bool bSet);
 
-    OUString GetMailReplyTo() const;
+    OUString const & GetMailReplyTo() const;
     void SetMailReplyTo(const OUString& rReplyTo);
 
-    OUString GetMailServer() const;
+    OUString const & GetMailServer() const;
     void SetMailServer(const OUString& rAddress);
 
     sal_Int16 GetMailPort() const;
@@ -181,16 +181,16 @@ public:
     bool IsAuthentication() const;
     void SetAuthentication(bool bSet);
 
-    OUString GetMailUserName() const;
+    OUString const & GetMailUserName() const;
     void SetMailUserName(const OUString& rName);
 
-    OUString GetMailPassword() const;
+    OUString const & GetMailPassword() const;
     void SetMailPassword(const OUString& rPassword);
 
     bool IsSMTPAfterPOP() const;
     void SetSMTPAfterPOP(bool bSet);
 
-    OUString GetInServerName() const;
+    OUString const & GetInServerName() const;
     void SetInServerName(const OUString& rServer);
 
     sal_Int16 GetInServerPort() const;
@@ -199,10 +199,10 @@ public:
     bool IsInServerPOP() const;
     void SetInServerPOP(bool bSet);
 
-    OUString GetInServerUserName() const;
+    OUString const & GetInServerUserName() const;
     void SetInServerUserName(const OUString& rName);
 
-    OUString GetInServerPassword() const;
+    OUString const & GetInServerPassword() const;
     void SetInServerPassword(const OUString& rPassword);
 
     //session information
diff --git a/sw/source/uibase/inc/prcntfld.hxx b/sw/source/uibase/inc/prcntfld.hxx
index e28d7e2dd989..06021f4fb52e 100644
--- a/sw/source/uibase/inc/prcntfld.hxx
+++ b/sw/source/uibase/inc/prcntfld.hxx
@@ -60,7 +60,7 @@ public:
     void SetText(const OUString& rStr) { m_pField->SetText(rStr); }
     void SaveValue() { m_pField->SaveValue(); }
     void ClearModifyFlag() { m_pField->ClearModifyFlag(); }
-    OUString GetSavedValue() const { return m_pField->GetSavedValue(); }
+    OUString const & GetSavedValue() const { return m_pField->GetSavedValue(); }
     OUString GetText() const { return m_pField->GetText(); }
     void SetMetricFieldMin(sal_Int64 nNewMin) { m_pField->SetMin(nNewMin); }
     void SetMetricFieldMax(sal_Int64 nNewMax) { m_pField->SetMax(nNewMax); }
diff --git a/sw/source/uibase/inc/uivwimp.hxx b/sw/source/uibase/inc/uivwimp.hxx
index ed2f1912fbf8..46b627c518b7 100644
--- a/sw/source/uibase/inc/uivwimp.hxx
+++ b/sw/source/uibase/inc/uivwimp.hxx
@@ -138,7 +138,7 @@ public:
     {
         xConfigItem = rItem;
     }
-    std::shared_ptr<SwMailMergeConfigItem>  GetMailMergeConfigItem() {return xConfigItem;}
+    std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() {return xConfigItem;}
 
     //#i33307# restore editing position
     void                    SetRestorePosition(const Point& rCursorPos, bool bSelectObj)
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.cxx b/sw/source/uibase/sidebar/PageStylesPanel.cxx
index d8e4eec4fd58..25dfef9adf95 100644
--- a/sw/source/uibase/sidebar/PageStylesPanel.cxx
+++ b/sw/source/uibase/sidebar/PageStylesPanel.cxx
@@ -252,7 +252,7 @@ void PageStylesPanel::Update()
     }
 }
 
-Color PageStylesPanel::GetColorSetOrDefault()
+Color const & PageStylesPanel::GetColorSetOrDefault()
 {
    if ( !mpBgColorItem )
         mpBgColorItem.reset( new XFillColorItem( OUString(), Color(0x72, 0x9f, 0xcf) ) );
@@ -260,7 +260,7 @@ Color PageStylesPanel::GetColorSetOrDefault()
    return mpBgColorItem->GetColorValue();
 }
 
-XGradient PageStylesPanel::GetGradientSetOrDefault()
+XGradient const & PageStylesPanel::GetGradientSetOrDefault()
 {
     if( !mpBgGradientItem )
     {
@@ -275,7 +275,7 @@ XGradient PageStylesPanel::GetGradientSetOrDefault()
     return mpBgGradientItem->GetGradientValue();
 }
 
-const OUString PageStylesPanel::GetHatchingSetOrDefault()
+OUString const & PageStylesPanel::GetHatchingSetOrDefault()
 {
     if( !mpBgHatchItem )
     {
@@ -290,7 +290,7 @@ const OUString PageStylesPanel::GetHatchingSetOrDefault()
     return mpBgHatchItem->GetName();
 }
 
-const OUString PageStylesPanel::GetBitmapSetOrDefault()
+OUString const & PageStylesPanel::GetBitmapSetOrDefault()
 {
     if( !mpBgBitmapItem || mpBgBitmapItem->isPattern() )
     {
@@ -305,7 +305,7 @@ const OUString PageStylesPanel::GetBitmapSetOrDefault()
     return mpBgBitmapItem->GetName();
 }
 
-const OUString PageStylesPanel::GetPatternSetOrDefault()
+OUString const & PageStylesPanel::GetPatternSetOrDefault()
 {
     if( !mpBgBitmapItem || !mpBgBitmapItem->isPattern() )
     {
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.hxx b/sw/source/uibase/sidebar/PageStylesPanel.hxx
index d7d364f0d055..27890af084e8 100644
--- a/sw/source/uibase/sidebar/PageStylesPanel.hxx
+++ b/sw/source/uibase/sidebar/PageStylesPanel.hxx
@@ -107,11 +107,11 @@ private:
 
     void Initialize();
     void Update();
-    Color GetColorSetOrDefault();
-    XGradient GetGradientSetOrDefault();
-    const OUString GetHatchingSetOrDefault();
-    const OUString GetBitmapSetOrDefault();
-    const OUString GetPatternSetOrDefault();
+    Color const & GetColorSetOrDefault();
+    XGradient const & GetGradientSetOrDefault();
+    OUString const & GetHatchingSetOrDefault();
+    OUString const & GetBitmapSetOrDefault();
+    OUString const & GetPatternSetOrDefault();
 
     void ModifyFillColor();
 
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index 9345af5541f2..6abebf33b8ed 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -137,7 +137,7 @@ void SwView::SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem> const
     UIFeatureChanged();
 }
 
-std::shared_ptr<SwMailMergeConfigItem> SwView::GetMailMergeConfigItem() const
+std::shared_ptr<SwMailMergeConfigItem> const & SwView::GetMailMergeConfigItem() const
 {
     return m_pViewImpl->GetMailMergeConfigItem();
 }
diff --git a/xmlsecurity/inc/documentsignaturemanager.hxx b/xmlsecurity/inc/documentsignaturemanager.hxx
index f1cc8293de42..8a3837ded39b 100644
--- a/xmlsecurity/inc/documentsignaturemanager.hxx
+++ b/xmlsecurity/inc/documentsignaturemanager.hxx
@@ -81,8 +81,8 @@ public:
     /// Get the security environment.
     css::uno::Reference<css::xml::crypto::XSecurityEnvironment> getSecurityEnvironment();
     css::uno::Reference<css::xml::crypto::XSecurityEnvironment> getGpgSecurityEnvironment();
-    css::uno::Reference<css::xml::crypto::XXMLSecurityContext> getSecurityContext();
-    css::uno::Reference<css::xml::crypto::XXMLSecurityContext> getGpgSecurityContext();
+    css::uno::Reference<css::xml::crypto::XXMLSecurityContext> const & getSecurityContext();
+    css::uno::Reference<css::xml::crypto::XXMLSecurityContext> const & getGpgSecurityContext();
 };
 
 #endif // INCLUDED_XMLSECURITY_INC_DOCUMENTSIGNATUREMANAGER_HXX
diff --git a/xmlsecurity/inc/pdfsignaturehelper.hxx b/xmlsecurity/inc/pdfsignaturehelper.hxx
index 7b89acb50aaa..392331832963 100644
--- a/xmlsecurity/inc/pdfsignaturehelper.hxx
+++ b/xmlsecurity/inc/pdfsignaturehelper.hxx
@@ -33,7 +33,7 @@ public:
     PDFSignatureHelper();
     bool ReadAndVerifySignature(const css::uno::Reference<css::io::XInputStream>& xInputStream);
     css::uno::Sequence<css::security::DocumentSignatureInformation> GetDocumentSignatureInformations(const css::uno::Reference<css::xml::crypto::XSecurityEnvironment>& xSecEnv) const;
-    SignatureInformations GetSignatureInformations() const;
+    SignatureInformations const & GetSignatureInformations() const;
 
     /// Return the ID of the next created signature.
     sal_Int32 GetNewSecurityId() const;
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index fd88d0a52e7e..9fb36dbb699e 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -571,12 +571,12 @@ uno::Reference<xml::crypto::XSecurityEnvironment> DocumentSignatureManager::getG
     return mxGpgSecurityContext.is() ? mxGpgSecurityContext->getSecurityEnvironment() : uno::Reference<xml::crypto::XSecurityEnvironment>();
 }
 
-uno::Reference<xml::crypto::XXMLSecurityContext> DocumentSignatureManager::getSecurityContext()
+uno::Reference<xml::crypto::XXMLSecurityContext> const & DocumentSignatureManager::getSecurityContext()
 {
     return mxSecurityContext;
 }
 
-uno::Reference<xml::crypto::XXMLSecurityContext> DocumentSignatureManager::getGpgSecurityContext()
+uno::Reference<xml::crypto::XXMLSecurityContext> const & DocumentSignatureManager::getGpgSecurityContext()
 {
     return mxGpgSecurityContext;
 }
diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx
index 5356705f7b17..c75266d8626e 100644
--- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx
@@ -62,7 +62,7 @@ bool PDFSignatureHelper::ReadAndVerifySignature(const uno::Reference<io::XInputS
     return true;
 }
 
-SignatureInformations PDFSignatureHelper::GetSignatureInformations() const
+SignatureInformations const & PDFSignatureHelper::GetSignatureInformations() const
 {
     return m_aSignatureInfos;
 }
commit 884cbe174ee5e343e9ed56093421aad3e467bf57
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jan 2 11:00:41 2018 +0200

    RID_* can be extern global variables
    
    no need to access them via methods
    
    Change-Id: If0d1a65d6f56ce2fc585749d974ba13c9f2749b2
    Reviewed-on: https://gerrit.libreoffice.org/47245
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basic/inc/basic.hrc b/basic/inc/basic.hrc
index 49eb93cd102d..36fe29f11ef3 100644
--- a/basic/inc/basic.hrc
+++ b/basic/inc/basic.hrc
@@ -22,7 +22,7 @@
 
 #define NC_(Context, String) (Context "\004" u8##String)
 
-std::pair<const char*, ErrCode> RID_BASIC_START[] =
+std::pair<const char*, ErrCode> const RID_BASIC_START[] =
 {
     { NC_("RID_BASIC_START", "Syntax error."), ERRCODE_BASIC_SYNTAX },
     { NC_("RID_BASIC_START", "Return without Gosub."), ERRCODE_BASIC_NO_GOSUB },
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 1be75c333424..1dcd71704399 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1560,18 +1560,13 @@ void StarBASIC::SetErrorData( ErrCode nCode, sal_uInt16 nLine,
     aGlobals.nCol2 = nCol2;
 }
 
-const ErrMsgCode* getRID_BASIC_START()
-{
-    return RID_BASIC_START;
-}
-
 void StarBASIC::MakeErrorText( ErrCode nId, const OUString& aMsg )
 {
     SolarMutexGuard aSolarGuard;
     sal_uInt16 nOldID = GetVBErrorCode( nId );
 
     const char* pErrorMsg = nullptr;
-    for (ErrMsgCode* pItem = RID_BASIC_START; pItem->second; ++pItem)
+    for (std::pair<const char *, ErrCode> const *pItem = RID_BASIC_START; pItem->second; ++pItem)
     {
         if (nId == pItem->second)
         {
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 8b23f40c5445..1fc1d62ec928 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -177,7 +177,7 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void)
         xNewDic = nullptr;
         // error: couldn't create new dictionary
         SfxErrorContext aContext( ERRCTX_SVX_LINGU_DICTIONARY, OUString(),
-            this, getRID_SVXERRCTX(), SvxResLocale() );
+            this, RID_SVXERRCTX, SvxResLocale() );
         ErrorHandler::HandleError( *new StringErrorInfo(
                 ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ) );
         EndDialog();
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 958b4bd591f1..0bd155a15198 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -879,7 +879,7 @@ void SvxBackgroundTabPage::RaiseLoadError_Impl()
     SfxErrorContext aContext( ERRCTX_SVX_BACKGROUND,
                               OUString(),
                               this,
-                              getRID_SVXERRCTX(),
+                              RID_SVXERRCTX,
                               SvxResLocale() );
 
     ErrorHandler::HandleError(
diff --git a/include/basic/sbdef.hxx b/include/basic/sbdef.hxx
index e79c58b6c071..7d677f1c9be6 100644
--- a/include/basic/sbdef.hxx
+++ b/include/basic/sbdef.hxx
@@ -68,7 +68,7 @@ enum class PropertyMode
     Set
 };
 
-BASIC_DLLPUBLIC const ErrMsgCode* getRID_BASIC_START();
+BASIC_DLLPUBLIC extern std::pair<const char*, ErrCode> const RID_BASIC_START[];
 BASIC_DLLPUBLIC std::locale BasResLocale();
 BASIC_DLLPUBLIC OUString BasResId(const char* pId);
 
diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx
index a78e9d22d648..2042d70184eb 100644
--- a/include/svtools/ehdl.hxx
+++ b/include/svtools/ehdl.hxx
@@ -26,8 +26,8 @@
 #include <vcl/errinf.hxx>
 
 typedef std::pair<const char*, ErrCode> ErrMsgCode;
-SVT_DLLPUBLIC const ErrMsgCode* getRID_ERRHDL();
-SVT_DLLPUBLIC const ErrMsgCode* getRID_ERRCTX();
+SVT_DLLPUBLIC extern const ErrMsgCode RID_ERRHDL[];
+SVT_DLLPUBLIC extern const ErrMsgCode RID_ERRCTX[];
 
 namespace vcl { class Window; }
 
diff --git a/include/svtools/soerr.hxx b/include/svtools/soerr.hxx
index 96a4677bf5d0..9f39f6ca1563 100644
--- a/include/svtools/soerr.hxx
+++ b/include/svtools/soerr.hxx
@@ -35,8 +35,8 @@
 // error contexts
 #define ERRCTX_SO_DOVERB        1
 
-SVT_DLLPUBLIC const ErrMsgCode* getRID_SO_ERROR_HANDLER();
-SVT_DLLPUBLIC const ErrMsgCode* getRID_SO_ERRCTX();
+SVT_DLLPUBLIC extern const ErrMsgCode RID_SO_ERROR_HANDLER[];
+SVT_DLLPUBLIC extern const ErrMsgCode RID_SO_ERRCTX[];
 
 #endif
 
diff --git a/include/svx/svxerr.hxx b/include/svx/svxerr.hxx
index e746649ea317..f428a920af61 100644
--- a/include/svx/svxerr.hxx
+++ b/include/svx/svxerr.hxx
@@ -54,8 +54,8 @@ public:
     static void ensure();
 };
 
-SVX_DLLPUBLIC const ErrMsgCode* getRID_SVXERRCODE();
-SVX_DLLPUBLIC const ErrMsgCode* getRID_SVXERRCTX();
+SVX_DLLPUBLIC extern const ErrMsgCode RID_SVXERRCODE[];
+SVX_DLLPUBLIC extern const ErrMsgCode RID_SVXERRCTX[];
 
 #endif
 
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index adab8e4f1b96..3b622792282e 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -162,7 +162,7 @@ bool PowerPointImport::importDocument()
     {
         // Construct a warning message.
         INetURLObject aURL(getFileUrl());
-        SfxErrorContext aContext(ERRCTX_SFX_OPENDOC, aURL.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset), nullptr, getRID_ERRCTX());
+        SfxErrorContext aContext(ERRCTX_SFX_OPENDOC, aURL.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset), nullptr, RID_ERRCTX);
         OUString aWarning;
         aContext.GetString(ERRCODE_NONE.MakeWarning(), aWarning);
         aWarning += ":\n";
diff --git a/sd/source/ui/func/futhes.cxx b/sd/source/ui/func/futhes.cxx
index bc68092aef81..ad1907648d2c 100644
--- a/sd/source/ui/func/futhes.cxx
+++ b/sd/source/ui/func/futhes.cxx
@@ -67,7 +67,7 @@ rtl::Reference<FuPoor> FuThesaurus::Create( ViewShell* pViewSh, ::sd::Window* pW
 void FuThesaurus::DoExecute( SfxRequest& )
 {
     SfxErrorContext aContext(ERRCTX_SVX_LINGU_THESAURUS, OUString(),
-                             mpWindow, getRID_SVXERRCTX(), SvxResLocale());
+                             mpWindow, RID_SVXERRCTX, SvxResLocale());
 
     if (mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) !=  nullptr)
     {
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 42bcfa23e141..bf069c64e859 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -377,7 +377,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void)
     if( !mpViewSh )
         return;
 
-    SfxErrorContext aEc( ERRCTX_ERROR, mpViewSh->GetActiveWindow(), getRID_SO_ERRCTX() );
+    SfxErrorContext aEc( ERRCTX_ERROR, mpViewSh->GetActiveWindow(), RID_SO_ERRCTX );
     ErrCode nError = ERRCODE_NONE;
 
     ::std::vector< OUString >::const_iterator aIter( maDropFileVector.begin() );
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 64a11a91cda0..fd206cb0d1be 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -718,7 +718,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
 {
     ErrCode aErrCode = ERRCODE_NONE;
 
-    SfxErrorContext aEC(ERRCTX_SO_DOVERB, GetActiveWindow(), getRID_SO_ERRCTX());
+    SfxErrorContext aEC(ERRCTX_SO_DOVERB, GetActiveWindow(), RID_SO_ERRCTX);
     bool bAbort = false;
     GetDocSh()->SetWaitCursor( true );
     SfxViewShell* pViewShell = GetViewShell();
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index e190d594d897..218fa03c3656 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -208,13 +208,13 @@ void SfxApplication::Initialize_Impl()
     Help::EnableExtHelp();
 
     pImpl->m_pToolsErrorHdl = new SfxErrorHandler(
-        getRID_ERRHDL(), ErrCodeArea::Io, ErrCodeArea::Vcl);
+        RID_ERRHDL, ErrCodeArea::Io, ErrCodeArea::Vcl);
 
     pImpl->m_pSoErrorHdl = new SfxErrorHandler(
-        getRID_SO_ERROR_HANDLER(), ErrCodeArea::So, ErrCodeArea::So, SvtResLocale());
+        RID_SO_ERROR_HANDLER, ErrCodeArea::So, ErrCodeArea::So, SvtResLocale());
 #if HAVE_FEATURE_SCRIPTING
     pImpl->m_pSbxErrorHdl = new SfxErrorHandler(
-        getRID_BASIC_START(), ErrCodeArea::Sbx, ErrCodeArea::Sbx, BasResLocale());
+        RID_BASIC_START, ErrCodeArea::Sbx, ErrCodeArea::Sbx, BasResLocale());
 #endif
 
     if (!utl::ConfigManager::IsFuzzing())
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index cd1a4ec77656..86aa5fa35625 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -856,7 +856,7 @@ sal_Int64 SfxInPlaceClient::GetAspect() const
 
 ErrCode SfxInPlaceClient::DoVerb( long nVerb )
 {
-    SfxErrorContext aEc(ERRCTX_SO_DOVERB, m_pViewSh->GetWindow(), getRID_SO_ERRCTX());
+    SfxErrorContext aEc(ERRCTX_SO_DOVERB, m_pViewSh->GetWindow(), RID_SO_ERRCTX);
     ErrCode nError = ERRCODE_NONE;
 
     if ( m_xImp->m_xObject.is() )
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index f73adec3c045..6c2406f57ae8 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -242,7 +242,7 @@ SfxErrorContext::SfxErrorContext(
 :   ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), aResLocale(rResLocaleP)
 {
     if (!pIds)
-        pIds = getRID_ERRCTX();
+        pIds = RID_ERRCTX;
 }
 
 
@@ -253,7 +253,7 @@ SfxErrorContext::SfxErrorContext(
     aArg1(aArg1P)
 {
     if (!pIds)
-        pIds = getRID_ERRCTX();
+        pIds = RID_ERRCTX;
 }
 
 bool SfxErrorContext::GetString(ErrCode nErrId, OUString &rStr)
@@ -281,7 +281,7 @@ bool SfxErrorContext::GetString(ErrCode nErrId, OUString &rStr)
     if ( bRet )
     {
         sal_uInt16 nId = nErrId.IsWarning() ? ERRCTX_WARNING : ERRCTX_ERROR;
-        for (const ErrMsgCode* pItem = getRID_ERRCTX(); pItem->second; ++pItem)
+        for (const ErrMsgCode* pItem = RID_ERRCTX; pItem->second; ++pItem)
         {
             if (sal_uInt32(pItem->second) == nId)
             {
@@ -294,24 +294,4 @@ bool SfxErrorContext::GetString(ErrCode nErrId, OUString &rStr)
     return bRet;
 }
 
-const ErrMsgCode* getRID_ERRHDL()
-{
-    return RID_ERRHDL;
-}
-
-const ErrMsgCode* getRID_ERRCTX()
-{
-    return RID_ERRCTX;
-}
-
-const ErrMsgCode* getRID_SO_ERROR_HANDLER()
-{
-    return RID_SO_ERROR_HANDLER;
-}
-
-const ErrMsgCode* getRID_SO_ERRCTX()
-{
-    return RID_SO_ERRCTX;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/items/svxerr.cxx b/svx/source/items/svxerr.cxx
index ec8a4059bcbb..b92764a043d9 100644
--- a/svx/source/items/svxerr.cxx
+++ b/svx/source/items/svxerr.cxx
@@ -25,7 +25,7 @@
 
 SvxErrorHandler::SvxErrorHandler() :
   SfxErrorHandler(
-      getRID_SVXERRCODE(), ErrCodeArea::Svx, ErrCodeArea::Svx, SvxResLocale())
+      RID_SVXERRCODE, ErrCodeArea::Svx, ErrCodeArea::Svx, SvxResLocale())
 {
 }
 
@@ -40,14 +40,4 @@ void SvxErrorHandler::ensure()
     theSvxErrorHandler::get();
 }
 
-const ErrMsgCode* getRID_SVXERRCODE()
-{
-    return RID_SVXERRCODE;
-}
-
-const ErrMsgCode* getRID_SVXERRCTX()
-{
-    return RID_SVXERRCTX;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index dc220a5bb684..3fb3a1e16272 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -424,7 +424,7 @@ void SwView::HyphenateDocument()
     }
 
     SfxErrorContext aContext( ERRCTX_SVX_LINGU_HYPHENATION, OUString(), m_pEditWin,
-         getRID_SVXERRCTX(), SvxResLocale() );
+         RID_SVXERRCTX, SvxResLocale() );
 
     Reference< XHyphenator >  xHyph( ::GetHyphenator() );
     if (!xHyph.is())
@@ -546,7 +546,7 @@ void SwView::StartThesaurus()
         return;
 
     SfxErrorContext aContext( ERRCTX_SVX_LINGU_THESAURUS, OUString(), m_pEditWin,
-         getRID_SVXERRCTX(), SvxResLocale() );
+         RID_SVXERRCTX, SvxResLocale() );
 
     // Determine language
     LanguageType eLang = m_pWrtShell->GetCurLang();
diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx
index 1a23b6a81f42..dca09cf4bb7f 100644
--- a/uui/source/iahndl-errorhandler.cxx
+++ b/uui/source/iahndl-errorhandler.cxx
@@ -156,8 +156,8 @@ UUIInteractionHelper::handleErrorHandlerRequest(
         enum Source { SOURCE_DEFAULT, SOURCE_SVX, SOURCE_UUI };
         static char const * const aManager[3] = { "svt", "svx", "uui" };
         static const ErrMsgCode* const aId[3]
-            = { getRID_ERRHDL(),
-                getRID_SVXERRCODE(),
+            = { RID_ERRHDL,
+                RID_SVXERRCODE,
                 RID_UUI_ERRHDL };
         ErrCodeArea nErrorArea = nErrorCode.GetArea();
         Source eSource =


More information about the Libreoffice-commits mailing list