sw/inc/IMark.hxx | 4 +- sw/inc/docsh.hxx | 2 - sw/inc/shellio.hxx | 6 +-- sw/inc/tblafmt.hxx | 2 - sw/inc/viewopt.hxx | 2 - sw/source/core/access/accpara.cxx | 4 +- sw/source/core/access/accpara.hxx | 2 - sw/source/core/doc/dbgoutsw.cxx | 4 +- sw/source/core/doc/tblafmt.cxx | 4 +- sw/source/core/inc/drawfont.hxx | 2 - sw/source/core/inc/swblocks.hxx | 6 +-- sw/source/core/swg/swblocks.cxx | 24 ++++++------ sw/source/core/text/inftxt.hxx | 2 - sw/source/core/text/porlin.hxx | 2 - sw/source/filter/html/htmlfly.hxx | 10 ++--- sw/source/filter/html/htmlflyt.cxx | 10 ++--- sw/source/filter/ww8/wrtw8sty.cxx | 4 +- sw/source/filter/ww8/wrtww8.hxx | 2 - sw/source/filter/ww8/ww8par2.cxx | 4 +- sw/source/filter/ww8/ww8par2.hxx | 2 - sw/source/filter/ww8/ww8toolbar.cxx | 4 +- sw/source/filter/ww8/ww8toolbar.hxx | 2 - sw/source/filter/xml/xmltbli.cxx | 4 +- sw/source/filter/xml/xmltbli.hxx | 2 - sw/source/ui/dialog/uiregionsw.cxx | 2 - sw/source/uibase/app/docsh.cxx | 4 +- sw/source/uibase/dochdl/gloshdl.cxx | 4 +- sw/source/uibase/inc/gloshdl.hxx | 4 +- sw/source/uibase/inc/redlndlg.hxx | 4 +- sw/source/uibase/misc/redlndlg.cxx | 8 ++-- sw/source/uibase/sidebar/CommentsPanel.hxx | 4 +- sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx | 4 +- sw/source/writerfilter/dmapper/GraphicHelpers.hxx | 2 - sw/source/writerfilter/rtftok/rtfdocumentimpl.hxx | 4 +- 34 files changed, 75 insertions(+), 75 deletions(-)
New commits: commit d30d8f5f1c1f9af52dfb909c8baf8c697495d984 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Nov 7 11:53:15 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Nov 7 15:15:01 2024 +0100 loplugin:passstuffbyref in sw Change-Id: I22f4f4a0f2729b953669322eda803ce298eea236 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176202 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx index d9619f4a4dba..fc69edfca651 100644 --- a/sw/inc/IMark.hxx +++ b/sw/inc/IMark.hxx @@ -238,8 +238,8 @@ namespace sw::mark virtual OUString GetContent() const { return OUString(); } virtual void ReplaceContent(const OUString& /*sNewContent*/) {} - OUString GetFieldname() const { return m_aFieldname; } - OUString GetFieldHelptext() const { return m_aFieldHelptext; } + const OUString & GetFieldname() const { return m_aFieldname; } + const OUString & GetFieldHelptext() const { return m_aFieldHelptext; } parameter_map_t* GetParameters() { return &m_vParams; } diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 858c778ac784..56fbec40e1fb 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -178,7 +178,7 @@ private: static void InitInterface_Impl(); public: - static OUString GetEventName( sal_Int32 nId ); + static const OUString & GetEventName( sal_Int32 nId ); /// Doc is required for SO data exchange! SwDocShell( SfxObjectCreateMode eMode = SfxObjectCreateMode::EMBEDDED ); diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index 48405803870e..a0c3b2eb32ea 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -335,14 +335,14 @@ public: void SetName( const OUString& ); ErrCode const & GetError() const { return m_nErr; } - OUString GetBaseURL() const; + const OUString & GetBaseURL() const; void SetBaseURL( const OUString& rURL ); sal_uInt16 GetCount() const; // Get count text modules. sal_uInt16 GetIndex( const OUString& ) const; // Get index of short names. sal_uInt16 GetLongIndex( std::u16string_view ) const; // Get index of long names. - OUString GetShortName( sal_uInt16 ) const; // Get short name for index. - OUString GetLongName( sal_uInt16 ) const; // Get long name for index. + const OUString & GetShortName( sal_uInt16 ) const; // Get short name for index. + const OUString & GetLongName( sal_uInt16 ) const; // Get long name for index. bool Delete( sal_uInt16 ); void Rename( sal_uInt16, const OUString*, const OUString* ); diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx index a209eab50382..d0a147af7885 100644 --- a/sw/inc/tblafmt.hxx +++ b/sw/inc/tblafmt.hxx @@ -323,7 +323,7 @@ public: void RemoveBoxFormat(const OUString& sName); void ChangeBoxFormatName(std::u16string_view sFromName, const OUString& sToName); /// If found returns its name. If not found returns an empty OUString - OUString GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) const; + const OUString & GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) const; /// If found returns a ptr to a BoxFormat. If not found returns nullptr SwBoxAutoFormat* GetBoxFormat(std::u16string_view sName) const; }; diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 9c15ca640b63..56ef7ff19900 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -330,7 +330,7 @@ public: m_sThemeName = rThemeName; } - OUString GetThemeName() const + const OUString & GetThemeName() const { return m_sThemeName; } diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index f945d792e660..57743ad19cdc 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -123,9 +123,9 @@ OUString const & SwAccessibleParagraph::GetString() return GetPortionData().GetAccessibleString(); } -OUString SwAccessibleParagraph::GetDescription() +const OUString & SwAccessibleParagraph::GetDescription() { - return OUString(); // provide empty description for paragraphs + return EMPTY_OUSTRING; // provide empty description for paragraphs } sal_Int32 SwAccessibleParagraph::GetCaretPos() diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx index 4fdc68992395..357c4f17c77d 100644 --- a/sw/source/core/access/accpara.hxx +++ b/sw/source/core/access/accpara.hxx @@ -95,7 +95,7 @@ class SwAccessibleParagraph : /// get the (accessible) text string (requires frame; check before) OUString const & GetString(); - static OUString GetDescription(); + static const OUString & GetDescription(); // get the current care position sal_Int32 GetCaretPos(); diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index b80e40f290bd..8ac3f44eab23 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -353,9 +353,9 @@ const char * dbg_out(const SwPaM & rPam) return dbg_out(lcl_dbg_out(rPam)); } -static OUString lcl_dbg_out(const SwNodeNum & ) +static const OUString & lcl_dbg_out(const SwNodeNum & ) { - return OUString();/*rNum.ToString();*/ + return EMPTY_OUSTRING;/*rNum.ToString();*/ } const char * dbg_out(const SwNodeNum & rNum) diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 8b3e4bd30f88..b73e195a6bbc 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -1222,7 +1222,7 @@ void SwCellStyleTable::RemoveBoxFormat(const OUString& sName) SAL_INFO("sw.core", "SwCellStyleTable::RemoveBoxFormat, format with given name doesn't exists"); } -OUString SwCellStyleTable::GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) const +const OUString & SwCellStyleTable::GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) const { for (size_t i=0; i < m_aCellStyles.size(); ++i) { @@ -1231,7 +1231,7 @@ OUString SwCellStyleTable::GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) c } // box format not found - return OUString(); + return EMPTY_OUSTRING; } SwBoxAutoFormat* SwCellStyleTable::GetBoxFormat(std::u16string_view sName) const diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx index 0251888959ff..c66708657fba 100644 --- a/sw/source/core/inc/drawfont.hxx +++ b/sw/source/core/inc/drawfont.hxx @@ -252,7 +252,7 @@ public: return m_nMeasureLen; } - std::optional<SwLinePortionLayoutContext> GetLayoutContext() const { return m_nLayoutContext; } + const std::optional<SwLinePortionLayoutContext> & GetLayoutContext() const { return m_nLayoutContext; } sal_Int32 GetOffset() const { diff --git a/sw/source/core/inc/swblocks.hxx b/sw/source/core/inc/swblocks.hxx index 364f5f1a9ee8..369b91d6fa4a 100644 --- a/sw/source/core/inc/swblocks.hxx +++ b/sw/source/core/inc/swblocks.hxx @@ -91,9 +91,9 @@ public: sal_uInt16 GetCount() const; /// Get count of Text Blocks sal_uInt16 GetIndex( const OUString& ) const; /// Index for shortnames sal_uInt16 GetLongIndex( std::u16string_view ) const; /// Index for longnames - OUString GetShortName( sal_uInt16 ) const; /// Return shortname for index - OUString GetLongName( sal_uInt16 ) const; /// Return longname for index - OUString GetPackageName( sal_uInt16 ) const; /// Return packagename for index + const OUString & GetShortName( sal_uInt16 ) const; /// Return shortname for index + const OUString & GetLongName( sal_uInt16 ) const; /// Return longname for index + const OUString & GetPackageName( sal_uInt16 ) const; /// Return packagename for index const OUString& GetFileName() const {return m_aFile;} /// Return physical file name void SetName( const OUString& rName ) /// Logic name diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index fb4769311724..b4b23084f3f8 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -152,25 +152,25 @@ sal_uInt16 SwImpBlocks::GetLongIndex( std::u16string_view aLong ) const return USHRT_MAX; } -OUString SwImpBlocks::GetShortName( sal_uInt16 n ) const +const OUString & SwImpBlocks::GetShortName( sal_uInt16 n ) const { if( n < m_aNames.size() ) return m_aNames[n]->m_aShort; - return OUString(); + return EMPTY_OUSTRING; } -OUString SwImpBlocks::GetLongName( sal_uInt16 n ) const +const OUString & SwImpBlocks::GetLongName( sal_uInt16 n ) const { if( n < m_aNames.size() ) return m_aNames[n]->m_aLong; - return OUString(); + return EMPTY_OUSTRING; } -OUString SwImpBlocks::GetPackageName( sal_uInt16 n ) const +const OUString & SwImpBlocks::GetPackageName( sal_uInt16 n ) const { if( n < m_aNames.size() ) return m_aNames[n]->m_aPackageName; - return OUString(); + return EMPTY_OUSTRING; } void SwImpBlocks::AddName( const OUString& rShort, const OUString& rLong, @@ -268,18 +268,18 @@ sal_uInt16 SwTextBlocks::GetLongIndex( std::u16string_view r ) const return m_pImp ? m_pImp->GetLongIndex( r ) : USHRT_MAX; } -OUString SwTextBlocks::GetShortName( sal_uInt16 n ) const +const OUString & SwTextBlocks::GetShortName( sal_uInt16 n ) const { if( m_pImp ) return m_pImp->GetShortName( n ); - return OUString(); + return EMPTY_OUSTRING; } -OUString SwTextBlocks::GetLongName( sal_uInt16 n ) const +const OUString & SwTextBlocks::GetLongName( sal_uInt16 n ) const { if( m_pImp ) return m_pImp->GetLongName( n ); - return OUString(); + return EMPTY_OUSTRING; } bool SwTextBlocks::Delete( sal_uInt16 n ) @@ -566,11 +566,11 @@ void SwTextBlocks::EndPutMuchBlockEntries() m_pImp->PutMuchEntries( false ); } -OUString SwTextBlocks::GetBaseURL() const +const OUString & SwTextBlocks::GetBaseURL() const { if(m_pImp) return m_pImp->GetBaseURL(); - return OUString(); + return EMPTY_OUSTRING; } void SwTextBlocks::SetBaseURL( const OUString& rURL ) diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 8576ed5c8707..4a3bf7a1c514 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -282,7 +282,7 @@ public: void SetMeasureLen(const TextFrameIndex nNew) { m_nMeasureLen = nNew; } void SetText( const OUString &rNew ){ m_pText = &rNew; } - std::optional<SwLinePortionLayoutContext> GetLayoutContext() const { return m_nLayoutContext; } + const std::optional<SwLinePortionLayoutContext> & GetLayoutContext() const { return m_nLayoutContext; } void SetLayoutContext(std::optional<SwLinePortionLayoutContext> nNew) { diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx index 9c9891101b23..2c8031d866f4 100644 --- a/sw/source/core/text/porlin.hxx +++ b/sw/source/core/text/porlin.hxx @@ -78,7 +78,7 @@ public: void ExtraShrunkWidth(const SwTwips nNew) { m_nExtraShrunkWidth = nNew; } SwTwips GetHangingBaseline() const { return mnHangingBaseline; } void SetHangingBaseline( const SwTwips nNewBaseline ) { mnHangingBaseline = nNewBaseline; } - std::optional<SwLinePortionLayoutContext> GetLayoutContext() const { return m_nLayoutContext; } + const std::optional<SwLinePortionLayoutContext> & GetLayoutContext() const { return m_nLayoutContext; } void SetLayoutContext(std::optional<SwLinePortionLayoutContext> nNew) { m_nLayoutContext = nNew; diff --git a/sw/source/filter/html/htmlfly.hxx b/sw/source/filter/html/htmlfly.hxx index 4038ac2a2dcf..4deb1ae4696d 100644 --- a/sw/source/filter/html/htmlfly.hxx +++ b/sw/source/filter/html/htmlfly.hxx @@ -85,11 +85,11 @@ struct AllHtmlFlags { HtmlContainerFlags nContainer; }; -AllHtmlFlags getHTMLOutFramePageFlyTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); -AllHtmlFlags getHTMLOutFrameParaFrameTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); -AllHtmlFlags getHTMLOutFrameParaPrtAreaTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); -AllHtmlFlags getHTMLOutFrameParaOtherTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); -AllHtmlFlags getHTMLOutFrameAsCharTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); +const AllHtmlFlags & getHTMLOutFramePageFlyTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); +const AllHtmlFlags & getHTMLOutFrameParaFrameTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); +const AllHtmlFlags & getHTMLOutFrameParaPrtAreaTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); +const AllHtmlFlags & getHTMLOutFrameParaOtherTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); +const AllHtmlFlags & getHTMLOutFrameAsCharTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode); class SwHTMLPosFlyFrame { diff --git a/sw/source/filter/html/htmlflyt.cxx b/sw/source/filter/html/htmlflyt.cxx index 9653c0bb062e..58c807dc6103 100644 --- a/sw/source/filter/html/htmlflyt.cxx +++ b/sw/source/filter/html/htmlflyt.cxx @@ -106,7 +106,7 @@ constexpr AllHtmlFlags aHTMLOutFramePageFlyTable[][MAX_BROWSERS] = } }; -AllHtmlFlags getHTMLOutFramePageFlyTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) +const AllHtmlFlags & getHTMLOutFramePageFlyTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) { static_assert(std::size(aHTMLOutFramePageFlyTable) == MAX_FRMTYPES); assert(eFrameType < HTML_FRMTYPE_END); @@ -199,7 +199,7 @@ constexpr AllHtmlFlags aHTMLOutFrameParaFrameTable[][MAX_BROWSERS] = } }; -AllHtmlFlags getHTMLOutFrameParaFrameTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) +const AllHtmlFlags & getHTMLOutFrameParaFrameTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) { static_assert(std::size(aHTMLOutFrameParaFrameTable) == MAX_FRMTYPES); assert(eFrameType < HTML_FRMTYPE_END); @@ -291,7 +291,7 @@ constexpr AllHtmlFlags aHTMLOutFrameParaPrtAreaTable[][MAX_BROWSERS] = } }; -AllHtmlFlags getHTMLOutFrameParaPrtAreaTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) +const AllHtmlFlags & getHTMLOutFrameParaPrtAreaTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) { static_assert(std::size(aHTMLOutFrameParaPrtAreaTable) == MAX_FRMTYPES); assert(eFrameType < HTML_FRMTYPE_END); @@ -383,7 +383,7 @@ constexpr AllHtmlFlags aHTMLOutFrameParaOtherTable[][MAX_BROWSERS] = } }; -AllHtmlFlags getHTMLOutFrameParaOtherTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) +const AllHtmlFlags & getHTMLOutFrameParaOtherTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) { static_assert(std::size(aHTMLOutFrameParaOtherTable) == MAX_FRMTYPES); assert(eFrameType < HTML_FRMTYPE_END); @@ -475,7 +475,7 @@ constexpr AllHtmlFlags aHTMLOutFrameAsCharTable[][MAX_BROWSERS] = } }; -AllHtmlFlags getHTMLOutFrameAsCharTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) +const AllHtmlFlags & getHTMLOutFrameAsCharTable(SwHTMLFrameType eFrameType, sal_uInt16 nExportMode) { static_assert(std::size(aHTMLOutFrameAsCharTable) == MAX_FRMTYPES); assert(eFrameType < HTML_FRMTYPE_END); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index c5868b517211..d36541a0a891 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -476,14 +476,14 @@ OString const & MSWordStyles::GetStyleId(sal_uInt16 nSlot) const return m_aStyles[nSlot].style_id; } -OUString MSWordStyles::GetStyleWWName(SwFormat const*const pFormat) const +const OUString & MSWordStyles::GetStyleWWName(SwFormat const*const pFormat) const { if (auto slot = m_rExport.m_pStyles->GetSlot(pFormat); slot != 0xfff) { assert(!m_aStyles[slot].ww_name.isEmpty()); return m_aStyles[slot].ww_name; } - return OUString(); + return EMPTY_OUSTRING; } /// For WW8 only - extend pO so that the size of pTableStrm is even. diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index bd07c5b155c9..89999b4a90e3 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1658,7 +1658,7 @@ public: /// Get styleId of the nSlot-th style (nSlot is its position in m_aStyles). OString const & GetStyleId(sal_uInt16 nSlot) const; /// the awful TOC field references names, not styleIds - OUString GetStyleWWName(SwFormat const* pFormat) const; + OUString const & GetStyleWWName(SwFormat const* pFormat) const; const SwFormat* GetSwFormat(sal_uInt16 nSlot) const { return m_aStyles[nSlot].format; } /// Get numbering rule of the nSlot-th style diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 3fd1fc85f14c..78f6ee19ac85 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -3357,12 +3357,12 @@ sal_uInt16 WW8TabDesc::GetLogicalWWCol() const // returns number of col as INDIC } // find name of numrule valid for current WW-COL -OUString WW8TabDesc::GetNumRuleName() const +const OUString & WW8TabDesc::GetNumRuleName() const { sal_uInt16 nCol = GetLogicalWWCol(); if (nCol < m_aNumRuleNames.size()) return m_aNumRuleNames[nCol]; - return OUString(); + return EMPTY_OUSTRING; } void WW8TabDesc::SetNumRuleName( const OUString& rName ) diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index 0944303ef072..9834c518a058 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -291,7 +291,7 @@ public: const WW8_TCell* GetCurrentWWCell() const { return m_pCurrentWWCell; } short GetCurrentCol() const { return m_nCurrentCol; } // find name of numrule valid for current WW-COL - OUString GetNumRuleName() const; + const OUString & GetNumRuleName() const; void SetNumRuleName( const OUString& rName ); sw::util::RedlineStack* getOldRedlineStack() { return mxOldRedlineStack.get(); } diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index 880e568f4c23..0ce3db3582fa 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -600,12 +600,12 @@ SwTBC::ImportToolBarControl( SwCTBWrapper& rWrapper, const css::uno::Reference< return true; } -OUString +const OUString & SwTBC::GetCustomText() { if ( m_tbcd ) return m_tbcd->getGeneralInfo().CustomText(); - return OUString(); + return EMPTY_OUSTRING; } bool diff --git a/sw/source/filter/ww8/ww8toolbar.hxx b/sw/source/filter/ww8/ww8toolbar.hxx index 2d6876744ccf..4905b1584fd4 100644 --- a/sw/source/filter/ww8/ww8toolbar.hxx +++ b/sw/source/filter/ww8/ww8toolbar.hxx @@ -37,7 +37,7 @@ public: SwTBC(); bool Read(SvStream &rS) override; bool ImportToolBarControl( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper&, bool ); - OUString GetCustomText(); + const OUString & GetCustomText(); }; class SwCTB : public TBBase diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 8bd58ca29baf..7a2bbb59cf39 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1378,12 +1378,12 @@ sal_Int32 SwXMLTableContext::GetColumnWidth( sal_uInt32 nCol, return nWidth2; } -OUString SwXMLTableContext::GetColumnDefaultCellStyleName( sal_uInt32 nCol ) const +const OUString & SwXMLTableContext::GetColumnDefaultCellStyleName( sal_uInt32 nCol ) const { if( m_xColumnDefaultCellStyleNames && nCol < m_xColumnDefaultCellStyleNames->size()) return (*m_xColumnDefaultCellStyleNames)[static_cast<size_t>(nCol)]; - return OUString(); + return EMPTY_OUSTRING; } void SwXMLTableContext::InsertCell( const OUString& rStyleName, diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx index 400fc8ba0cda..6b7219f84323 100644 --- a/sw/source/filter/xml/xmltbli.hxx +++ b/sw/source/filter/xml/xmltbli.hxx @@ -154,7 +154,7 @@ public: void InsertColumn( sal_Int32 nWidth, bool bRelWidth, const OUString *pDfltCellStyleName = nullptr ); sal_Int32 GetColumnWidth( sal_uInt32 nCol, sal_uInt32 nColSpan ) const; - OUString GetColumnDefaultCellStyleName( sal_uInt32 nCol ) const; + const OUString & GetColumnDefaultCellStyleName( sal_uInt32 nCol ) const; inline sal_uInt32 GetColumnCount() const; bool IsInsertCellPossible() const { return m_nCurCol < GetColumnCount(); } diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 0cf29d4f769b..03ac7d48c9d1 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -67,7 +67,7 @@ using namespace ::com::sun::star; namespace { -OUString BuildBitmap(bool bProtect, bool bHidden) +const OUString & BuildBitmap(bool bProtect, bool bHidden) { if (bProtect) return bHidden ? RID_BMP_PROT_HIDE : RID_BMP_PROT_NO_HIDE; diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index a9887b0e8494..53977e38bd10 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -1337,13 +1337,13 @@ Sequence< OUString > SwDocShell::GetEventNames() return aRet; } -OUString SwDocShell::GetEventName( sal_Int32 nIndex ) +const OUString & SwDocShell::GetEventName( sal_Int32 nIndex ) { if (nIndex < s_nEvents) { return s_EventNames[nIndex]; } - return OUString(); + return EMPTY_OUSTRING; } const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index f6866e4b38a3..ec9cb818d9a0 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -252,13 +252,13 @@ sal_uInt16 SwGlossaryHdl::GetGlossaryCnt() const return m_pCurGrp ? m_pCurGrp->GetCount() : 0; } -OUString SwGlossaryHdl::GetGlossaryName( sal_uInt16 nId ) +const OUString & SwGlossaryHdl::GetGlossaryName( sal_uInt16 nId ) { OSL_ENSURE(nId < GetGlossaryCnt(), "Text building block array over-indexed."); return m_pCurGrp->GetLongName( nId ); } -OUString SwGlossaryHdl::GetGlossaryShortName(sal_uInt16 nId) +const OUString & SwGlossaryHdl::GetGlossaryShortName(sal_uInt16 nId) { OSL_ENSURE(nId < GetGlossaryCnt(), "Text building block array over-indexed."); return m_pCurGrp->GetShortName( nId ); diff --git a/sw/source/uibase/inc/gloshdl.hxx b/sw/source/uibase/inc/gloshdl.hxx index c7f0187000c8..0539d6a06ac9 100644 --- a/sw/source/uibase/inc/gloshdl.hxx +++ b/sw/source/uibase/inc/gloshdl.hxx @@ -56,9 +56,9 @@ public: void SetCurGroup(const OUString &aGrp, bool bApi = false, bool bAlwaysCreateNew = false); sal_uInt16 GetGlossaryCnt() const; - OUString GetGlossaryName(sal_uInt16); + const OUString & GetGlossaryName(sal_uInt16); OUString GetGlossaryShortName(std::u16string_view aName); - OUString GetGlossaryShortName(sal_uInt16); + const OUString & GetGlossaryShortName(sal_uInt16); bool Rename( const OUString& rOldShortName, const OUString& rNewShortName, const OUString& rNewName); diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx index e56383203d7d..0d9df16f3b57 100644 --- a/sw/source/uibase/inc/redlndlg.hxx +++ b/sw/source/uibase/inc/redlndlg.hxx @@ -104,9 +104,9 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg final : public SfxListener SAL_DLLPRIVATE void RemoveParents(SwRedlineTable::size_type nStart, SwRedlineTable::size_type nEnd); SAL_DLLPRIVATE void InitAuthors(); - SAL_DLLPRIVATE static OUString GetActionImage(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0, + SAL_DLLPRIVATE static const OUString & GetActionImage(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0, bool bTableChanges = false, bool bRowChanges = false); - SAL_DLLPRIVATE OUString GetActionText(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0); + SAL_DLLPRIVATE const OUString & GetActionText(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0); SAL_DLLPRIVATE SwRedlineTable::size_type GetRedlinePos(const weld::TreeIter& rEntry); SwRedlineAcceptDlg(SwRedlineAcceptDlg const&) = delete; diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 61fff609764b..9c09948c05f8 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -395,7 +395,7 @@ void SwRedlineAcceptDlg::InitAuthors() m_bOnlyFormatedRedlines ); } -OUString SwRedlineAcceptDlg::GetActionImage(const SwRangeRedline& rRedln, sal_uInt16 nStack, +const OUString & SwRedlineAcceptDlg::GetActionImage(const SwRangeRedline& rRedln, sal_uInt16 nStack, bool bTableChanges, bool bRowChanges) { switch (rRedln.GetType(nStack)) @@ -425,10 +425,10 @@ OUString SwRedlineAcceptDlg::GetActionImage(const SwRangeRedline& rRedln, sal_uI default: break; } - return OUString(); + return EMPTY_OUSTRING; } -OUString SwRedlineAcceptDlg::GetActionText(const SwRangeRedline& rRedln, sal_uInt16 nStack) +const OUString & SwRedlineAcceptDlg::GetActionText(const SwRangeRedline& rRedln, sal_uInt16 nStack) { switch( rRedln.GetType(nStack) ) { @@ -441,7 +441,7 @@ OUString SwRedlineAcceptDlg::GetActionText(const SwRangeRedline& rRedln, sal_uIn default:;//prevent warning } - return OUString(); + return EMPTY_OUSTRING; } // newly initialise after activation diff --git a/sw/source/uibase/sidebar/CommentsPanel.hxx b/sw/source/uibase/sidebar/CommentsPanel.hxx index 832633b08a7e..3d2bbc9ac87a 100644 --- a/sw/source/uibase/sidebar/CommentsPanel.hxx +++ b/sw/source/uibase/sidebar/CommentsPanel.hxx @@ -88,8 +88,8 @@ public: void InitControls(const SwPostItField* pPostItField); void SetCommentText(OUString sText) { msText = sText; } - OUString GetAuthor() { return msAuthor; } - Date GetDate() { return maDate; } + const OUString& GetAuthor() { return msAuthor; } + const Date& GetDate() { return maDate; } }; class Thread final diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx b/sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx index d155adc94b68..329b876b43d2 100644 --- a/sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx +++ b/sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx @@ -155,14 +155,14 @@ public: m_aMoved[m_aMoved.size() - 1] = ""; } - OUString getMoved() const + const OUString & getMoved() const { if ( m_aMoved.size() >= 2 && !m_aMoved[m_aMoved.size() - 2].isEmpty() ) return m_aMoved[m_aMoved.size() - 2]; else if ( !m_aMoved.empty() ) return m_aMoved[m_aMoved.size() -1 ]; - return OUString(); + return EMPTY_OUSTRING; } }; diff --git a/sw/source/writerfilter/dmapper/GraphicHelpers.hxx b/sw/source/writerfilter/dmapper/GraphicHelpers.hxx index 184a480ad8ca..dee4ab435159 100644 --- a/sw/source/writerfilter/dmapper/GraphicHelpers.hxx +++ b/sw/source/writerfilter/dmapper/GraphicHelpers.hxx @@ -75,7 +75,7 @@ public: virtual void attribute(Id nName, const Value& rValue) override; virtual void sprm(Sprm& rSprm) override; - css::awt::Size getExtent() const { return m_Extent; } + const css::awt::Size& getExtent() const { return m_Extent; } }; } diff --git a/sw/source/writerfilter/rtftok/rtfdocumentimpl.hxx b/sw/source/writerfilter/rtftok/rtfdocumentimpl.hxx index 58e47e9e96e4..835c91b15e80 100644 --- a/sw/source/writerfilter/rtftok/rtfdocumentimpl.hxx +++ b/sw/source/writerfilter/rtftok/rtfdocumentimpl.hxx @@ -523,9 +523,9 @@ public: void setInternalState(RTFInternalState nInternalState) { m_nInternalState = nInternalState; } RTFInternalState getInternalState() const { return m_nInternalState; } RTFDocumentImpl* getDocumentImpl() { return m_pDocumentImpl; } - OUString getDocVar() { return m_aDocVar; } + const OUString& getDocVar() { return m_aDocVar; } void appendDocVar(OUString& aDocVar) { m_aDocVar += aDocVar; }; - OUString getDocVarName() { return m_aDocVarName; } + const OUString& getDocVarName() { return m_aDocVarName; } void setDocVarName(OUString& aDocVarName) { m_aDocVarName = aDocVarName; } void clearDocVarName() { m_aDocVarName = ""; }