summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-12-31 21:34:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-02 12:19:10 +0100
commit4855257e52056241633c2b1d8159c3f0e71e05f3 (patch)
tree4a56a5ead5cacdf70ed7fb31bf8a949aba774030
parent884cbe174ee5e343e9ed56093421aad3e467bf57 (diff)
loplugin:passstuffbyref improved return in sw
Change-Id: I4484ac461761e4c46364b4f473c7e62f8ec72103 Reviewed-on: https://gerrit.libreoffice.org/47243 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--compilerplugins/clang/passstuffbyref.cxx3
-rw-r--r--sw/inc/AnnotationWin.hxx2
-rw-r--r--sw/inc/ddefld.hxx2
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/inc/editsh.hxx4
-rw-r--r--sw/inc/list.hxx4
-rw-r--r--sw/inc/ndole.hxx2
-rw-r--r--sw/inc/numrule.hxx2
-rw-r--r--sw/inc/pagedesc.hxx2
-rw-r--r--sw/inc/section.hxx6
-rw-r--r--sw/inc/shellio.hxx6
-rw-r--r--sw/inc/swmodule.hxx2
-rw-r--r--sw/inc/tox.hxx4
-rw-r--r--sw/inc/view.hxx2
-rw-r--r--sw/source/core/access/accpara.cxx2
-rw-r--r--sw/source/core/access/accpara.hxx2
-rw-r--r--sw/source/core/doc/docfld.cxx2
-rw-r--r--sw/source/core/doc/list.cxx4
-rw-r--r--sw/source/core/doc/number.cxx2
-rw-r--r--sw/source/core/docnode/section.cxx2
-rw-r--r--sw/source/core/edit/edfld.cxx2
-rw-r--r--sw/source/core/edit/edtox.cxx2
-rw-r--r--sw/source/core/fields/ddefld.cxx2
-rw-r--r--sw/source/core/inc/flyfrms.hxx2
-rw-r--r--sw/source/core/inc/unometa.hxx2
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx4
-rw-r--r--sw/source/core/layout/flyincnt.cxx2
-rw-r--r--sw/source/core/layout/pagedesc.cxx2
-rw-r--r--sw/source/core/ole/ndole.cxx2
-rw-r--r--sw/source/core/swg/swblocks.cxx4
-rw-r--r--sw/source/core/unocore/unorefmk.cxx2
-rw-r--r--sw/source/core/unocore/unostyle.cxx2
-rw-r--r--sw/source/filter/html/htmlctxt.cxx4
-rw-r--r--sw/source/filter/html/htmlfly.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
-rw-r--r--sw/source/filter/ww8/ww8toolbar.hxx2
-rw-r--r--sw/source/uibase/app/swmodul1.cxx2
-rw-r--r--sw/source/uibase/dbui/mmconfigitem.cxx26
-rw-r--r--sw/source/uibase/inc/mmconfigitem.hxx26
-rw-r--r--sw/source/uibase/inc/prcntfld.hxx2
-rw-r--r--sw/source/uibase/inc/uivwimp.hxx2
-rw-r--r--sw/source/uibase/sidebar/PageStylesPanel.cxx10
-rw-r--r--sw/source/uibase/sidebar/PageStylesPanel.hxx10
-rw-r--r--sw/source/uibase/uiview/view0.cxx2
-rw-r--r--xmlsecurity/inc/documentsignaturemanager.hxx4
-rw-r--r--xmlsecurity/inc/pdfsignaturehelper.hxx2
-rw-r--r--xmlsecurity/source/helper/documentsignaturemanager.cxx4
-rw-r--r--xmlsecurity/source/helper/pdfsignaturehelper.cxx2
49 files changed, 95 insertions, 94 deletions
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;
}