sc/inc/SolverSettings.hxx | 2 +- sc/inc/SparklineAttributes.hxx | 16 ++++++++-------- sc/inc/dbdata.hxx | 2 +- sc/inc/document.hxx | 10 +++++----- sc/inc/dpcache.hxx | 2 +- sc/inc/dpfilteredcache.hxx | 2 +- sc/inc/sheetlimits.hxx | 4 ++-- sc/inc/table.hxx | 2 +- sc/inc/tabprotection.hxx | 2 +- sc/inc/userlist.hxx | 2 +- sc/source/core/data/document.cxx | 4 ++-- sc/source/core/data/dpcache.cxx | 4 ++-- sc/source/core/data/dpfilteredcache.cxx | 2 +- sc/source/core/data/table7.cxx | 2 +- sc/source/core/data/tabprotection.cxx | 4 ++-- sc/source/core/tool/dbdata.cxx | 6 +++--- sc/source/core/tool/userlist.cxx | 4 ++-- sc/source/filter/excel/xilink.cxx | 6 +++--- sc/source/filter/excel/xlchart.cxx | 4 ++-- sc/source/filter/excel/xlroot.cxx | 2 +- sc/source/filter/inc/commentsbuffer.hxx | 2 +- sc/source/filter/inc/connectionsbuffer.hxx | 4 ++-- sc/source/filter/inc/xichart.hxx | 4 ++-- sc/source/filter/inc/xlchart.hxx | 2 +- sc/source/filter/inc/xlroot.hxx | 4 ++-- sc/source/filter/oox/commentsbuffer.cxx | 2 +- sc/source/ui/Accessibility/AccessibleDocument.cxx | 4 ++-- sc/source/ui/docshell/docsh.cxx | 12 ++++++------ sc/source/ui/inc/AccessibleDocument.hxx | 2 +- sc/source/ui/inc/docsh.hxx | 12 ++++++------ sc/source/ui/inc/duplicaterecordsdlg.hxx | 2 +- sc/source/ui/sparklines/SparklineAttributes.cxx | 16 ++++++++-------- 32 files changed, 74 insertions(+), 74 deletions(-)
New commits: commit dd77b743a703daa09563218cc8158db0ca2a4b97 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Nov 7 11:09:49 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Nov 7 12:11:35 2024 +0100 loplugin:passstuffbyref in sc Change-Id: Ic3ce1406aa2567ca676bb8f431c52f590fadaec6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176198 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/sc/inc/SolverSettings.hxx b/sc/inc/SolverSettings.hxx index 442570eaee6c..2916c6ad3519 100644 --- a/sc/inc/SolverSettings.hxx +++ b/sc/inc/SolverSettings.hxx @@ -295,7 +295,7 @@ public: SC_DLLPUBLIC void GetEngineOptions(css::uno::Sequence<css::beans::PropertyValue>& aOptions); SC_DLLPUBLIC void SetEngineOptions(const css::uno::Sequence<css::beans::PropertyValue>& aOptions); - SC_DLLPUBLIC std::vector<ModelConstraint> GetConstraints() { return m_aConstraints; } + SC_DLLPUBLIC const std::vector<ModelConstraint>& GetConstraints() { return m_aConstraints; } SC_DLLPUBLIC void SetConstraints(std::vector<ModelConstraint> aConstraints); SC_DLLPUBLIC void SaveSolverSettings(); diff --git a/sc/inc/SparklineAttributes.hxx b/sc/inc/SparklineAttributes.hxx index 5fcc9ddeef02..19f5c117fae9 100644 --- a/sc/inc/SparklineAttributes.hxx +++ b/sc/inc/SparklineAttributes.hxx @@ -64,28 +64,28 @@ public: void resetColors(); - model::ComplexColor getColorSeries() const; + const model::ComplexColor& getColorSeries() const; void setColorSeries(model::ComplexColor const& rColorSeries); - model::ComplexColor getColorNegative() const; + const model::ComplexColor& getColorNegative() const; void setColorNegative(model::ComplexColor const& rColorSeries); - model::ComplexColor getColorAxis() const; + const model::ComplexColor& getColorAxis() const; void setColorAxis(model::ComplexColor const& rColorSeries); - model::ComplexColor getColorMarkers() const; + const model::ComplexColor& getColorMarkers() const; void setColorMarkers(model::ComplexColor const& rColorSeries); - model::ComplexColor getColorFirst() const; + const model::ComplexColor& getColorFirst() const; void setColorFirst(model::ComplexColor const& rColorSeries); - model::ComplexColor getColorLast() const; + const model::ComplexColor& getColorLast() const; void setColorLast(model::ComplexColor const& rColorSeries); - model::ComplexColor getColorHigh() const; + const model::ComplexColor& getColorHigh() const; void setColorHigh(model::ComplexColor const& rColorSeries); - model::ComplexColor getColorLow() const; + const model::ComplexColor& getColorLow() const; void setColorLow(model::ComplexColor const& rColorSeries); AxisType getMinAxisType() const; diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index 532d71528e07..be6d193f7d54 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -175,7 +175,7 @@ public: /** Returns table column name if nCol is within column range and name is stored, else empty string. */ - OUString GetTableColumnName( SCCOL nCol ) const; + const OUString & GetTableColumnName( SCCOL nCol ) const; OUString GetSourceString() const; OUString GetOperations() const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index bf8eaa34f2f2..7caa75d7db1e 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -666,7 +666,7 @@ public: mbCustomXml = bUse; aCustomXmlFragmentPath = sCustomXmlPath; } - OUString getCustomXmlItems() { return aCustomXmlFragmentPath; } + const OUString & getCustomXmlItems() { return aCustomXmlFragmentPath; } bool hasCustomXml() { return mbCustomXml; } bool IsEmbedFonts() const { return mbEmbedFonts; } @@ -742,7 +742,7 @@ public: void SetConsolidateDlgData( std::unique_ptr<ScConsolidateParam> pData ); const ScConsolidateParam* GetConsolidateDlgData() const { return pConsolidateDlgData.get(); } void SetEasyConditionalFormatDialogData(const ScConditionEasyDialogData& data); - ScConditionEasyDialogData GetEasyConditionalFormatDialogData() const + const ScConditionEasyDialogData & GetEasyConditionalFormatDialogData() const { return pConditionalFormatDialogData; } @@ -989,8 +989,8 @@ public: SC_DLLPUBLIC SCROW MaxRow() const { return mxSheetLimits->mnMaxRow; } SC_DLLPUBLIC SCCOL GetMaxColCount() const { return mxSheetLimits->GetMaxColCount(); } SC_DLLPUBLIC SCROW GetMaxRowCount() const { return mxSheetLimits->GetMaxRowCount(); } - SC_DLLPUBLIC OUString MaxRowAsString() const { return mxSheetLimits->MaxRowAsString(); } - SC_DLLPUBLIC OUString MaxColAsString() const { return mxSheetLimits->MaxColAsString(); } + SC_DLLPUBLIC const OUString & MaxRowAsString() const { return mxSheetLimits->MaxRowAsString(); } + SC_DLLPUBLIC const OUString & MaxColAsString() const { return mxSheetLimits->MaxColAsString(); } ScSheetLimits& GetSheetLimits() const { return *mxSheetLimits; } [[nodiscard]] bool ValidCol(SCCOL nCol) const { return ::ValidCol(nCol, mxSheetLimits->mnMaxCol); } [[nodiscard]] bool ValidRow(SCROW nRow) const { return ::ValidRow(nRow, mxSheetLimits->mnMaxRow); } @@ -1003,7 +1003,7 @@ public: SC_DLLPUBLIC std::vector<OUString> GetAllTableNames() const; - OUString GetCopyTabName(SCTAB nTab) const; + const OUString & GetCopyTabName(SCTAB nTab) const; SC_DLLPUBLIC void SetAnonymousDBData(SCTAB nTab, std::unique_ptr<ScDBData> pDBData); SC_DLLPUBLIC ScDBData* GetAnonymousDBData(SCTAB nTab); diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx index ada1d7cddc88..1e7d7075e813 100644 --- a/sc/inc/dpcache.hxx +++ b/sc/inc/dpcache.hxx @@ -186,7 +186,7 @@ public: */ SC_DLLPUBLIC SCROW GetDataSize() const; SCROW GetItemDataId( sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty ) const; - SC_DLLPUBLIC OUString GetDimensionName(std::vector<OUString>::size_type nDim) const; + SC_DLLPUBLIC const OUString & GetDimensionName(std::vector<OUString>::size_type nDim) const; bool IsRowEmpty(SCROW nRow) const; bool ValidQuery(SCROW nRow, const ScQueryParam& rQueryParam) const; diff --git a/sc/inc/dpfilteredcache.hxx b/sc/inc/dpfilteredcache.hxx index e7737141dbc3..e82d15c78bf5 100644 --- a/sc/inc/dpfilteredcache.hxx +++ b/sc/inc/dpfilteredcache.hxx @@ -126,7 +126,7 @@ public: returned object! */ const ScDPItemData* getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const; void getValue(ScDPValue& rVal, SCCOL nCol, SCROW nRow) const; - OUString getFieldName(SCCOL nIndex) const; + const OUString& getFieldName(SCCOL nIndex) const; /** Get the unique entries for a field specified by index. The caller must make sure that the table is filled before calling function, or it will diff --git a/sc/inc/sheetlimits.hxx b/sc/inc/sheetlimits.hxx index 506f63efb09d..343d6fb4566a 100644 --- a/sc/inc/sheetlimits.hxx +++ b/sc/inc/sheetlimits.hxx @@ -67,12 +67,12 @@ struct ScSheetLimits final : public salhelper::SimpleReferenceObject // equivalent of MAXCOLCOUNT in address.hxx SCCOL GetMaxColCount() const { return mnMaxCol + 1; } // max row number as string - OUString MaxRowAsString() const + const OUString& MaxRowAsString() const { return mnMaxRow == MAXROW ? MAXROW_STRING : MAXROW_JUMBO_STRING; } // mac col as string ("AMJ" or "XFD") - OUString MaxColAsString() const + const OUString& MaxColAsString() const { return mnMaxCol == MAXCOL ? MAXCOL_STRING : MAXCOL_JUMBO_STRING; } diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index b70f77c95445..c1dfb716b595 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -445,7 +445,7 @@ public: void SetFormula( SCCOL nCol, SCROW nRow, const OUString& rFormula, formula::FormulaGrammar::Grammar eGram ); - SC_DLLPUBLIC std::shared_ptr<sc::SolverSettings> GetSolverSettings(); + SC_DLLPUBLIC const std::shared_ptr<sc::SolverSettings> & GetSolverSettings(); // tdf#156815 Sets the solver settings object to nullptr to force reloading Solver settings the // next time the dialog is opened. This is required when sheets are renamed diff --git a/sc/inc/tabprotection.hxx b/sc/inc/tabprotection.hxx index 55a663137de6..a799012fbcd4 100644 --- a/sc/inc/tabprotection.hxx +++ b/sc/inc/tabprotection.hxx @@ -64,7 +64,7 @@ namespace ScPassHashHelper * returns false. */ bool needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED); - OUString getHashURI(ScPasswordHash eHash); + const OUString & getHashURI(ScPasswordHash eHash); ScPasswordHash getHashTypeFromURI(std::u16string_view rURI); } diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx index 5f913bc47dae..627d8ce8f022 100644 --- a/sc/inc/userlist.hxx +++ b/sc/inc/userlist.hxx @@ -50,7 +50,7 @@ public: void SetString(const OUString& rStr); size_t GetSubCount() const { return maSubStrings.size(); } bool GetSubIndex(const OUString& rSubStr, sal_uInt16& rIndex, bool& bMatchCase) const; - OUString GetSubStr(sal_uInt16 nIndex) const; + const OUString& GetSubStr(sal_uInt16 nIndex) const; sal_Int32 Compare(const OUString& rSubStr1, const OUString& rSubStr2) const; sal_Int32 ICompare(const OUString& rSubStr1, const OUString& rSubStr2) const; }; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index dbcdbe089163..4b55f0889a0a 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -199,11 +199,11 @@ bool ScDocument::GetName( SCTAB nTab, OUString& rName ) const return false; } -OUString ScDocument::GetCopyTabName( SCTAB nTab ) const +const OUString & ScDocument::GetCopyTabName( SCTAB nTab ) const { if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabNames.size())) return maTabNames[nTab]; - return OUString(); + return EMPTY_OUSTRING; } bool ScDocument::SetCodeName( SCTAB nTab, const OUString& rName ) diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 151e703b0451..412a058bb5b9 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -913,7 +913,7 @@ const ScDPCache::GroupItems* ScDPCache::GetGroupItems(tools::Long nDim) const return nullptr; } -OUString ScDPCache::GetDimensionName(std::vector<OUString>::size_type nDim) const +const OUString & ScDPCache::GetDimensionName(std::vector<OUString>::size_type nDim) const { OSL_ENSURE(nDim < maLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName"); OSL_ENSURE(maLabelNames.size() == static_cast <sal_uInt16> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName"); @@ -923,7 +923,7 @@ OUString ScDPCache::GetDimensionName(std::vector<OUString>::size_type nDim) cons return maLabelNames[nDim+1]; } else - return OUString(); + return EMPTY_OUSTRING; } void ScDPCache::PostInit() diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx index b47fc43aeb8c..08942141377e 100644 --- a/sc/source/core/data/dpfilteredcache.cxx +++ b/sc/source/core/data/dpfilteredcache.cxx @@ -271,7 +271,7 @@ void ScDPFilteredCache::getValue( ScDPValue& rVal, SCCOL nCol, SCROW nRow) cons rVal.Set(0.0, ScDPValue::Empty); } -OUString ScDPFilteredCache::getFieldName(SCCOL nIndex) const +const OUString & ScDPFilteredCache::getFieldName(SCCOL nIndex) const { return mrCache.GetDimensionName(nIndex); } diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx index 451c1895c194..b1aab8dc2052 100644 --- a/sc/source/core/data/table7.cxx +++ b/sc/source/core/data/table7.cxx @@ -651,7 +651,7 @@ void ScTable::CollectBroadcasterState(sc::BroadcasterState& rState) const pCol->CollectBroadcasterState(rState); } -std::shared_ptr<sc::SolverSettings> ScTable::GetSolverSettings() +const std::shared_ptr<sc::SolverSettings> & ScTable::GetSolverSettings() { if (!m_pSolverSettings) m_pSolverSettings = std::make_shared<sc::SolverSettings>(*this); diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx index 266c5c380790..6f960c6d100a 100644 --- a/sc/source/core/data/tabprotection.cxx +++ b/sc/source/core/data/tabprotection.cxx @@ -62,7 +62,7 @@ bool ScPassHashHelper::needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash return false; } -OUString ScPassHashHelper::getHashURI(ScPasswordHash eHash) +const OUString & ScPassHashHelper::getHashURI(ScPasswordHash eHash) { switch (eHash) { @@ -76,7 +76,7 @@ OUString ScPassHashHelper::getHashURI(ScPasswordHash eHash) default: ; } - return OUString(); + return EMPTY_OUSTRING; } ScPasswordHash ScPassHashHelper::getHashTypeFromURI(std::u16string_view rURI) diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 24009dfbe4e2..c926983e558f 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -924,14 +924,14 @@ sal_Int32 ScDBData::GetColumnNameOffset( const OUString& rName ) const return -1; } -OUString ScDBData::GetTableColumnName( SCCOL nCol ) const +const OUString & ScDBData::GetTableColumnName( SCCOL nCol ) const { if (maTableColumnNames.empty()) - return OUString(); + return EMPTY_OUSTRING; SCCOL nOffset = nCol - nStartCol; if (nOffset < 0 || maTableColumnNames.size() <= o3tl::make_unsigned(nOffset)) - return OUString(); + return EMPTY_OUSTRING; return maTableColumnNames[nOffset]; } diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index b1030eca6293..85d6f99d4cf5 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -82,12 +82,12 @@ bool ScUserListData::GetSubIndex(const OUString& rSubStr, sal_uInt16& rIndex, bo return false; } -OUString ScUserListData::GetSubStr(sal_uInt16 nIndex) const +const OUString & ScUserListData::GetSubStr(sal_uInt16 nIndex) const { if (nIndex < maSubStrings.size()) return maSubStrings[nIndex].maReal; else - return OUString(); + return EMPTY_OUSTRING; } sal_Int32 ScUserListData::Compare(const OUString& rSubStr1, const OUString& rSubStr2) const diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index cfaf9af5680f..987d0185042e 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -118,7 +118,7 @@ public: /** Returns the specified macro name (1-based) or an empty string on error. */ OUString GetMacroName( sal_uInt16 nXclNameIdx ) const; - OUString GetTabName( sal_uInt16 nXtiTab ) const; + const OUString & GetTabName( sal_uInt16 nXtiTab ) const; sal_uInt16 GetTabCount() const; @@ -725,10 +725,10 @@ OUString XclImpSupbook::GetMacroName( sal_uInt16 nXclNameIdx ) const return (pName && pName->IsVBName()) ? pName->GetScName() : OUString(); } -OUString XclImpSupbook::GetTabName( sal_uInt16 nXtiTab ) const +const OUString & XclImpSupbook::GetTabName( sal_uInt16 nXtiTab ) const { if (nXtiTab >= maSupbTabList.size()) - return OUString(); + return EMPTY_OUSTRING; return maSupbTabList[nXtiTab]->GetTabName(); } diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx index 548c2c9be3b9..41b49f71be6e 100644 --- a/sc/source/filter/excel/xlchart.cxx +++ b/sc/source/filter/excel/xlchart.cxx @@ -399,7 +399,7 @@ bool XclChartHelper::HasMarkerFillColor( sal_uInt16 nMarkerType ) return (nMarkerType < SAL_N_ELEMENTS( spbFilled )) && spbFilled[ nMarkerType ]; } -OUString XclChartHelper::GetErrorBarValuesRole( sal_uInt8 nBarType ) +const OUString & XclChartHelper::GetErrorBarValuesRole( sal_uInt8 nBarType ) { switch( nBarType ) { @@ -409,7 +409,7 @@ OUString XclChartHelper::GetErrorBarValuesRole( sal_uInt8 nBarType ) case EXC_CHSERERR_YMINUS: return EXC_CHPROP_ROLE_ERRORBARS_NEGY; default: OSL_FAIL( "XclChartHelper::GetErrorBarValuesRole - unknown bar type" ); } - return OUString(); + return EMPTY_OUSTRING; } // Chart formatting info provider ============================================= diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 06c1299afe91..4ee2b155c8d7 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -323,7 +323,7 @@ SvNumberFormatter& XclRoot::GetFormatter() const return *GetDoc().GetFormatTable(); } -Date XclRoot::GetNullDate() const +const Date & XclRoot::GetNullDate() const { return GetFormatter().GetNullDate(); } diff --git a/sc/source/filter/inc/commentsbuffer.hxx b/sc/source/filter/inc/commentsbuffer.hxx index 04baa15b0b7e..74e4d7cb123d 100644 --- a/sc/source/filter/inc/commentsbuffer.hxx +++ b/sc/source/filter/inc/commentsbuffer.hxx @@ -81,7 +81,7 @@ public: /** Finalizes the formatted string of all comments. */ void finalizeImport(); - std::vector<OUString> getAuthors() const; + const std::vector<OUString> & getAuthors() const; private: typedef RefVector< Comment > CommentVector; diff --git a/sc/source/filter/inc/connectionsbuffer.hxx b/sc/source/filter/inc/connectionsbuffer.hxx index 66272793c4cf..4bad185febc5 100644 --- a/sc/source/filter/inc/connectionsbuffer.hxx +++ b/sc/source/filter/inc/connectionsbuffer.hxx @@ -196,11 +196,11 @@ public: /** Returns read-only access to the connection model data. */ const ConnectionModel& getModel() const { return maModel; } - css::uno::Sequence<css::uno::Any> getDbPrSequenceAny() const + const css::uno::Sequence<css::uno::Any> & getDbPrSequenceAny() const { return maModel.maDbPrSequenceAny; } - css::uno::Sequence<css::uno::Any> getOlapPrSequenceAny() const + const css::uno::Sequence<css::uno::Any> & getOlapPrSequenceAny() const { return maModel.maOlapPrSequenceAny; } diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index 05f1e6b3b9ea..a4edbba1881d 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -411,9 +411,9 @@ public: /** Returns true, if the source link contains explicit string data. */ bool HasString() const { return mxString && !mxString->IsEmpty(); } /** Returns explicit string data or an empty string. */ - OUString GetString() const { + const OUString & GetString() const { if (mxString) return mxString->GetText(); - return OUString(); + return EMPTY_OUSTRING; } /** Returns the number of data points of this source link. */ sal_uInt16 GetCellCount() const; diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx index 71ac94585e03..2215755df75d 100644 --- a/sc/source/filter/inc/xlchart.hxx +++ b/sc/source/filter/inc/xlchart.hxx @@ -1103,7 +1103,7 @@ public: /** Returns true, if the passed marker type is filled. */ static bool HasMarkerFillColor( sal_uInt16 nMarkerType ); /** Returns the role name for a manual data source for error bars. */ - static OUString GetErrorBarValuesRole( sal_uInt8 nBarType ); + static const OUString & GetErrorBarValuesRole( sal_uInt8 nBarType ); }; // Chart formatting info provider ============================================= diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx index 380a6b49403b..6ed01f2ce4c2 100644 --- a/sc/source/filter/inc/xlroot.hxx +++ b/sc/source/filter/inc/xlroot.hxx @@ -178,7 +178,7 @@ public: const OUString& GetUserName() const { return mrData.maUserName; } /** Returns the default password used for stream encryption. */ - static OUString GetDefaultPassword() { return XclRootData::gaDefPassword; } + static const OUString & GetDefaultPassword() { return XclRootData::gaDefPassword; } /** Requests and verifies a password from the medium or the user. */ css::uno::Sequence< css::beans::NamedValue > RequestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const; @@ -217,7 +217,7 @@ public: /** Returns the number formatter of the Calc document. */ SvNumberFormatter& GetFormatter() const; /** Returns the null date of the current number formatter. */ - Date GetNullDate() const; + const Date & GetNullDate() const; /** Returns the base year depending on the current null date (1900 or 1904). */ sal_uInt16 GetBaseYear() const; /** Converts a date/time value to a floating-point value. */ diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx index 48550e740388..6f650d5cb00e 100644 --- a/sc/source/filter/oox/commentsbuffer.cxx +++ b/sc/source/filter/oox/commentsbuffer.cxx @@ -299,7 +299,7 @@ void CommentsBuffer::appendAuthor( const OUString& rAuthor ) maAuthors.push_back( rAuthor ); } -std::vector<OUString> CommentsBuffer::getAuthors() const { return maAuthors; } +const std::vector<OUString> & CommentsBuffer::getAuthors() const { return maAuthors; } CommentRef CommentsBuffer::createComment() { diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 29387480a107..0d5639e8de29 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -2175,9 +2175,9 @@ OUString ScAccessibleDocument::GetCurrentCellName() const return sName; } -OUString ScAccessibleDocument::GetCurrentCellDescription() +const OUString & ScAccessibleDocument::GetCurrentCellDescription() { - return OUString(); + return EMPTY_OUSTRING; } ScDocument *ScAccessibleDocument::GetDocument() const diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 7ef50cc7a8d3..4b502120e369 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2899,32 +2899,32 @@ OUString ScDocShell::GetOwnFilterName() return pFilterSc50; } -OUString ScDocShell::GetHtmlFilterName() +const OUString & ScDocShell::GetHtmlFilterName() { return pFilterHtml; } -OUString ScDocShell::GetWebQueryFilterName() +const OUString & ScDocShell::GetWebQueryFilterName() { return pFilterHtmlWebQ; } -OUString ScDocShell::GetAsciiFilterName() +const OUString & ScDocShell::GetAsciiFilterName() { return SC_TEXT_CSV_FILTER_NAME; } -OUString ScDocShell::GetLotusFilterName() +const OUString & ScDocShell::GetLotusFilterName() { return pFilterLotus; } -OUString ScDocShell::GetDBaseFilterName() +const OUString & ScDocShell::GetDBaseFilterName() { return pFilterDBase; } -OUString ScDocShell::GetDifFilterName() +const OUString & ScDocShell::GetDifFilterName() { return pFilterDif; } diff --git a/sc/source/ui/inc/AccessibleDocument.hxx b/sc/source/ui/inc/AccessibleDocument.hxx index d7935dfd768e..eec10141a7bd 100644 --- a/sc/source/ui/inc/AccessibleDocument.hxx +++ b/sc/source/ui/inc/AccessibleDocument.hxx @@ -246,7 +246,7 @@ private: void RemoveChild(const css::uno::Reference<css::accessibility::XAccessible>& xAcc, bool bFireEvent); OUString GetCurrentCellName() const; - static OUString GetCurrentCellDescription(); + static const OUString & GetCurrentCellDescription(); tools::Rectangle GetVisibleArea_Impl() const; public: diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 5b3ace8e1535..046cf75ea3a3 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -402,12 +402,12 @@ public: SAL_RET_MAYBENULL static ScDocShell* GetShellByNum( sal_uInt16 nDocNo ); static OUString GetOwnFilterName(); - static OUString GetHtmlFilterName(); - static OUString GetWebQueryFilterName(); - static OUString GetAsciiFilterName(); - static OUString GetLotusFilterName(); - static OUString GetDBaseFilterName(); - static OUString GetDifFilterName(); + static const OUString & GetHtmlFilterName(); + static const OUString & GetWebQueryFilterName(); + static const OUString & GetAsciiFilterName(); + static const OUString & GetLotusFilterName(); + static const OUString & GetDBaseFilterName(); + static const OUString & GetDifFilterName(); static bool HasAutomaticTableName( std::u16string_view rFilter ); static void LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument& rDocument, const ScAddress& rPos, const ScPostIt* pNote); diff --git a/sc/source/ui/inc/duplicaterecordsdlg.hxx b/sc/source/ui/inc/duplicaterecordsdlg.hxx index 706ef3b18d00..c0bee041465c 100644 --- a/sc/source/ui/inc/duplicaterecordsdlg.hxx +++ b/sc/source/ui/inc/duplicaterecordsdlg.hxx @@ -47,7 +47,7 @@ public: ScViewData& rViewData, ScRange& aRange); virtual ~ScDuplicateRecordsDlg() override; - DuplicatesResponse GetDialogData() { return maResponse; }; + const DuplicatesResponse& GetDialogData() { return maResponse; }; private: void Init(); diff --git a/sc/source/ui/sparklines/SparklineAttributes.cxx b/sc/source/ui/sparklines/SparklineAttributes.cxx index 8a615c1f7b00..ae8e2706b9aa 100644 --- a/sc/source/ui/sparklines/SparklineAttributes.cxx +++ b/sc/source/ui/sparklines/SparklineAttributes.cxx @@ -157,7 +157,7 @@ void SparklineAttributes::resetColors() m_aImplementation->m_aColorLow = model::ComplexColor(); } -model::ComplexColor SparklineAttributes::getColorSeries() const +const model::ComplexColor& SparklineAttributes::getColorSeries() const { return m_aImplementation->m_aColorSeries; } @@ -167,7 +167,7 @@ void SparklineAttributes::setColorSeries(model::ComplexColor const& rColor) m_aImplementation->m_aColorSeries = rColor; } -model::ComplexColor SparklineAttributes::getColorNegative() const +const model::ComplexColor& SparklineAttributes::getColorNegative() const { return m_aImplementation->m_aColorNegative; } @@ -177,7 +177,7 @@ void SparklineAttributes::setColorNegative(model::ComplexColor const& rColor) m_aImplementation->m_aColorNegative = rColor; } -model::ComplexColor SparklineAttributes::getColorAxis() const +const model::ComplexColor& SparklineAttributes::getColorAxis() const { return m_aImplementation->m_aColorAxis; } @@ -187,7 +187,7 @@ void SparklineAttributes::setColorAxis(model::ComplexColor const& rColor) m_aImplementation->m_aColorAxis = rColor; } -model::ComplexColor SparklineAttributes::getColorMarkers() const +const model::ComplexColor& SparklineAttributes::getColorMarkers() const { return m_aImplementation->m_aColorMarkers; } @@ -196,7 +196,7 @@ void SparklineAttributes::setColorMarkers(model::ComplexColor const& rColor) m_aImplementation->m_aColorMarkers = rColor; } -model::ComplexColor SparklineAttributes::getColorFirst() const +const model::ComplexColor& SparklineAttributes::getColorFirst() const { return m_aImplementation->m_aColorFirst; } @@ -205,7 +205,7 @@ void SparklineAttributes::setColorFirst(model::ComplexColor const& rColor) m_aImplementation->m_aColorFirst = rColor; } -model::ComplexColor SparklineAttributes::getColorLast() const +const model::ComplexColor& SparklineAttributes::getColorLast() const { return m_aImplementation->m_aColorLast; } @@ -214,7 +214,7 @@ void SparklineAttributes::setColorLast(model::ComplexColor const& rColor) m_aImplementation->m_aColorLast = rColor; } -model::ComplexColor SparklineAttributes::getColorHigh() const +const model::ComplexColor& SparklineAttributes::getColorHigh() const { return m_aImplementation->m_aColorHigh; } @@ -223,7 +223,7 @@ void SparklineAttributes::setColorHigh(model::ComplexColor const& rColor) m_aImplementation->m_aColorHigh = rColor; } -model::ComplexColor SparklineAttributes::getColorLow() const +const model::ComplexColor& SparklineAttributes::getColorLow() const { return m_aImplementation->m_aColorLow; }