From 508c95f1b655d9cfa6be37a5a9de9aff6fd383bf Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 18 Jul 2016 09:22:27 +0200 Subject: improve passstuffbyref return analysis Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c Reviewed-on: https://gerrit.libreoffice.org/27317 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/inc/authfld.hxx | 4 ++-- sw/inc/breakit.hxx | 2 +- sw/inc/dbmgr.hxx | 2 +- sw/inc/doc.hxx | 4 ++-- sw/inc/ndole.hxx | 2 +- sw/inc/swmodule.hxx | 4 ++-- sw/inc/tox.hxx | 26 +++++++++++++------------- sw/source/core/access/accpara.cxx | 4 ++-- sw/source/core/doc/doc.cxx | 2 +- sw/source/core/doc/docnew.cxx | 2 +- sw/source/core/inc/txmsrt.hxx | 4 ++-- sw/source/core/ole/ndole.cxx | 2 +- sw/source/ui/vba/vbaglobals.cxx | 2 +- sw/source/ui/vba/vbaglobals.hxx | 2 +- sw/source/uibase/app/swmodule.cxx | 4 ++-- sw/source/uibase/dbui/dbmgr.cxx | 2 +- sw/source/uibase/fldui/fldmgr.cxx | 2 +- sw/source/uibase/inc/fldmgr.hxx | 2 +- 18 files changed, 36 insertions(+), 36 deletions(-) (limited to 'sw') diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx index 219335120d9b..6cf7a2093d3c 100644 --- a/sw/inc/authfld.hxx +++ b/sw/inc/authfld.hxx @@ -36,7 +36,7 @@ public: SwAuthEntry( const SwAuthEntry& rCopy ); bool operator==(const SwAuthEntry& rComp); - inline OUString GetAuthorField(ToxAuthorityField ePos) const; + inline OUString const & GetAuthorField(ToxAuthorityField ePos) const; inline void SetAuthorField(ToxAuthorityField ePos, const OUString& rField); @@ -175,7 +175,7 @@ public: virtual OUString GetDescription() const override; }; -inline OUString SwAuthEntry::GetAuthorField(ToxAuthorityField ePos) const +inline OUString const & SwAuthEntry::GetAuthorField(ToxAuthorityField ePos) const { SAL_WARN_IF(AUTH_FIELD_END <= ePos, "sw", "wrong index"); return aAuthFields[ePos]; diff --git a/sw/inc/breakit.hxx b/sw/inc/breakit.hxx index 47615f45bc0f..2978f4472ef0 100644 --- a/sw/inc/breakit.hxx +++ b/sw/inc/breakit.hxx @@ -63,7 +63,7 @@ public: public: static SwBreakIt * Get(); - css::uno::Reference< css::i18n::XBreakIterator > GetBreakIter() + css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() { createBreakIterator(); return xBreak; diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index 222e55c07df5..c14f20a2ed96 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -344,7 +344,7 @@ public: OUString& rResult, double* pNumber); /** create and store or find an already stored connection to a data source for use in SwFieldMgr and SwDBTreeList */ - css::uno::Reference< css::sdbc::XConnection> + css::uno::Reference< css::sdbc::XConnection> const & RegisterConnection(OUString const& rSource); void CreateDSData(const SwDBData& rData) diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index cfaefece1ed1..dc96eb0af54d 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1606,7 +1606,7 @@ public: const css::uno::Reference& getXForms() const { return mxXForms;} - css::uno::Reference< css::linguistic2::XProofreadingIterator > GetGCIterator() const; + css::uno::Reference< css::linguistic2::XProofreadingIterator > const & GetGCIterator() const; // #i31958# is this an XForms document? bool isXForms() const; @@ -1621,7 +1621,7 @@ public: void SetDefaultPageMode(bool bSquaredPageMode); bool IsSquaredPageMode() const; - css::uno::Reference< css::script::vba::XVBAEventProcessor > GetVbaEventProcessor(); + css::uno::Reference< css::script::vba::XVBAEventProcessor > const & GetVbaEventProcessor(); void SetVBATemplateToProjectCache( css::uno::Reference< css::container::XNameContainer >& xCache ) { m_xTemplateToProjectCache = xCache; }; const css::uno::Reference< css::container::XNameContainer >& GetVBATemplateToProjectCache() { return m_xTemplateToProjectCache; }; ::sfx2::IXmlIdRegistry& GetXmlIdRegistry(); diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx index 372b053e315e..6dc1b481ce9e 100644 --- a/sw/inc/ndole.hxx +++ b/sw/inc/ndole.hxx @@ -71,7 +71,7 @@ public: // try to get OLE visualization in form of a Primitive2DSequence // and the corresponding B2DRange. This data may be locally buffered - drawinglayer::primitive2d::Primitive2DContainer tryToGetChartContentAsPrimitive2DSequence( + drawinglayer::primitive2d::Primitive2DContainer const & tryToGetChartContentAsPrimitive2DSequence( basegfx::B2DRange& rRange, bool bSynchron); void resetBufferedData(); diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 2d088022fe1e..c749f9e3d9cc 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -232,10 +232,10 @@ public: GetLngSvcEvtListener(); void CreateLngSvcEvtListener(); - css::uno::Reference< css::scanner::XScannerManager2 > + css::uno::Reference< css::scanner::XScannerManager2 > const & GetScannerManager(); - css::uno::Reference< css::linguistic2::XLanguageGuessing > + css::uno::Reference< css::linguistic2::XLanguageGuessing > const & GetLanguageGuesser(); }; diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 91d19beb7b58..63cf28621892 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -120,11 +120,11 @@ public: inline void SetSecondaryKeyReading(const OUString& rStr); inline void SetCitationKeyReading(const OUString& rStr); - inline OUString GetPrimaryKey() const; - inline OUString GetSecondaryKey() const; - inline OUString GetTextReading() const; - inline OUString GetPrimaryKeyReading() const; - inline OUString GetSecondaryKeyReading() const; + inline OUString const & GetPrimaryKey() const; + inline OUString const & GetSecondaryKey() const; + inline OUString const & GetTextReading() const; + inline OUString const & GetPrimaryKeyReading() const; + inline OUString const & GetSecondaryKeyReading() const; bool IsAutoGenerated() const {return m_bAutoGenerated;} void SetAutoGenerated(bool bSet) {m_bAutoGenerated = bSet;} @@ -292,7 +292,7 @@ public: SwForm& operator=( const SwForm& rForm ); inline void SetTemplate(sal_uInt16 nLevel, const OUString& rName); - inline OUString GetTemplate(sal_uInt16 nLevel) const; + inline OUString const & GetTemplate(sal_uInt16 nLevel) const; // #i21237# void SetPattern(sal_uInt16 nLevel, const SwFormTokens& rName); @@ -472,7 +472,7 @@ public: // index of objects - OUString GetStyleNames(sal_uInt16 nLevel) const + OUString const & GetStyleNames(sal_uInt16 nLevel) const { SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?"); return m_aStyleNames[nLevel]; @@ -599,31 +599,31 @@ inline sal_uInt16 SwTOXMark::GetLevel() const return m_nLevel; } -inline OUString SwTOXMark::GetPrimaryKey() const +inline OUString const & SwTOXMark::GetPrimaryKey() const { SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type"); return m_aPrimaryKey; } -inline OUString SwTOXMark::GetSecondaryKey() const +inline OUString const & SwTOXMark::GetSecondaryKey() const { SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type"); return m_aSecondaryKey; } -inline OUString SwTOXMark::GetTextReading() const +inline OUString const & SwTOXMark::GetTextReading() const { SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type"); return m_aTextReading; } -inline OUString SwTOXMark::GetPrimaryKeyReading() const +inline OUString const & SwTOXMark::GetPrimaryKeyReading() const { SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type"); return m_aPrimaryKeyReading; } -inline OUString SwTOXMark::GetSecondaryKeyReading() const +inline OUString const & SwTOXMark::GetSecondaryKeyReading() const { SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type"); return m_aSecondaryKeyReading; @@ -637,7 +637,7 @@ inline void SwForm::SetTemplate(sal_uInt16 nLevel, const OUString& rTemplate) m_aTemplate[nLevel] = rTemplate; } -inline OUString SwForm::GetTemplate(sal_uInt16 nLevel) const +inline OUString const & SwForm::GetTemplate(sal_uInt16 nLevel) const { SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()"); return m_aTemplate[nLevel]; diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index d497cfeff90a..6a5ac3040f9d 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1126,7 +1126,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleParagraph::getSupportedServiceNam return aRet; } -uno::Sequence< OUString > getAttributeNames() +uno::Sequence< OUString > const & getAttributeNames() { static uno::Sequence< OUString >* pNames = nullptr; @@ -1159,7 +1159,7 @@ uno::Sequence< OUString > getAttributeNames() return *pNames; } -uno::Sequence< OUString > getSupplementalAttributeNames() +uno::Sequence< OUString > const & getSupplementalAttributeNames() { static uno::Sequence< OUString >* pNames = nullptr; diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index d4b951adc1a8..63075b8a771d 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1744,7 +1744,7 @@ void SwDoc::ChkCondColls() } } -uno::Reference< script::vba::XVBAEventProcessor > +uno::Reference< script::vba::XVBAEventProcessor > const & SwDoc::GetVbaEventProcessor() { #if HAVE_FEATURE_SCRIPTING diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 80c148ba2539..0ada4b63e6f5 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -136,7 +136,7 @@ const sal_Char sGrfCollStr[] = "Graphikformatvorlage"; /* * global functions... */ - uno::Reference< linguistic2::XProofreadingIterator > SwDoc::GetGCIterator() const + uno::Reference< linguistic2::XProofreadingIterator > const & SwDoc::GetGCIterator() const { if (!m_xGCIterator.is() && SvtLinguConfig().HasGrammarChecker()) { diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx index 10e4d36405e9..210702d2ace9 100644 --- a/sw/source/core/inc/txmsrt.hxx +++ b/sw/source/core/inc/txmsrt.hxx @@ -145,7 +145,7 @@ struct SwTOXSortTabBase virtual OUString GetURL() const; - inline TextAndReading GetText() const; + inline TextAndReading const & GetText() const; inline const css::lang::Locale& GetLocale() const; private: @@ -155,7 +155,7 @@ private: virtual TextAndReading GetText_Impl() const = 0; }; -inline TextAndReading SwTOXSortTabBase::GetText() const +inline TextAndReading const & SwTOXSortTabBase::GetText() const { if( !bValidText ) { diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 416089205b48..46197375c712 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -1022,7 +1022,7 @@ OUString SwOLEObj::GetDescription() return SW_RESSTR(STR_OLE); } -drawinglayer::primitive2d::Primitive2DContainer SwOLEObj::tryToGetChartContentAsPrimitive2DSequence( +drawinglayer::primitive2d::Primitive2DContainer const & SwOLEObj::tryToGetChartContentAsPrimitive2DSequence( basegfx::B2DRange& rRange, bool bSynchron) { diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx index c7d719e69adc..82d8fbaa286d 100644 --- a/sw/source/ui/vba/vbaglobals.cxx +++ b/sw/source/ui/vba/vbaglobals.cxx @@ -52,7 +52,7 @@ SwVbaGlobals::~SwVbaGlobals() // XGlobals -uno::Reference +uno::Reference const & SwVbaGlobals::getApplication() throw (uno::RuntimeException) { OSL_TRACE("In SwVbaGlobals::getApplication"); diff --git a/sw/source/ui/vba/vbaglobals.hxx b/sw/source/ui/vba/vbaglobals.hxx index 47a029e6c4b3..e473f83956f0 100644 --- a/sw/source/ui/vba/vbaglobals.hxx +++ b/sw/source/ui/vba/vbaglobals.hxx @@ -38,7 +38,7 @@ class SwVbaGlobals : public SwVbaGlobals_BASE private: css::uno::Reference< ooo::vba::word::XApplication > mxApplication; - css::uno::Reference< ooo::vba::word::XApplication > getApplication() throw (css::uno::RuntimeException); + css::uno::Reference< ooo::vba::word::XApplication > const & getApplication() throw (css::uno::RuntimeException); public: diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index f436e09070e3..e637b960dba0 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -192,7 +192,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, GetColorConfig(); } } -uno::Reference< scanner::XScannerManager2 > +uno::Reference< scanner::XScannerManager2 > const & SwModule::GetScannerManager() { if (!m_xScannerManager.is()) @@ -202,7 +202,7 @@ SwModule::GetScannerManager() return m_xScannerManager; } -uno::Reference< linguistic2::XLanguageGuessing > SwModule::GetLanguageGuesser() +uno::Reference< linguistic2::XLanguageGuessing > const & SwModule::GetLanguageGuesser() { if (!m_xLanguageGuesser.is()) { diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 5721cd33971e..197cc08e5a76 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -2322,7 +2322,7 @@ bool SwDBManager::OpenDataSource(const OUString& rDataSource, const OUString& rT return pFound->xResultSet.is(); } -uno::Reference< sdbc::XConnection> SwDBManager::RegisterConnection(OUString const& rDataSource) +uno::Reference< sdbc::XConnection> const & SwDBManager::RegisterConnection(OUString const& rDataSource) { SwDSParam* pFound = SwDBManager::FindDSConnection(rDataSource, true); uno::Reference< sdbc::XDataSource> xSource; diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 9f02086a8aa4..29677576858d 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -1679,7 +1679,7 @@ sal_uLong SwFieldMgr::GetDefaultFormat(sal_uInt16 nTypeId, bool bIsText, SvNumbe return pFormatter->GetStandardFormat(nDefFormat, GetCurrLanguage()); } -Reference SwFieldMgr::GetNumberingInfo() const +Reference const & SwFieldMgr::GetNumberingInfo() const { if(!xNumberingInfo.is()) { diff --git a/sw/source/uibase/inc/fldmgr.hxx b/sw/source/uibase/inc/fldmgr.hxx index 526f5254b0ed..e65f163d0957 100644 --- a/sw/source/uibase/inc/fldmgr.hxx +++ b/sw/source/uibase/inc/fldmgr.hxx @@ -110,7 +110,7 @@ private: SAL_DLLPRIVATE sal_uInt16 GetCurrLanguage() const; css::uno::Reference xNumberingInfo; - SAL_DLLPRIVATE css::uno::Reference GetNumberingInfo()const; + SAL_DLLPRIVATE css::uno::Reference const & GetNumberingInfo()const; public: explicit SwFieldMgr(SwWrtShell* pSh = nullptr); -- cgit