include/xmloff/XMLComplexColorContext.hxx       |    2 +-
 include/xmloff/xmlimp.hxx                       |    4 ++--
 xmloff/inc/txtlists.hxx                         |    4 ++--
 xmloff/source/core/xmlimp.cxx                   |    8 ++++----
 xmloff/source/draw/XMLNumberStyles.cxx          |    4 ++--
 xmloff/source/draw/XMLNumberStylesExport.hxx    |    2 +-
 xmloff/source/text/XMLTextFrameContext.cxx      |    2 +-
 xmloff/source/text/XMLTextMarkImportContext.cxx |    4 ++--
 xmloff/source/text/txtlists.cxx                 |    8 ++++----
 9 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 9a608faf3cdcaf355278c002f5a50d8871778791
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Nov 6 10:28:56 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Nov 6 12:34:34 2024 +0100

    loplugin:passstuffbyref in xmloff
    
    Change-Id: I4837cb60c2c78b5a9008b6ffbb6323da50c7c705
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176111
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/include/xmloff/XMLComplexColorContext.hxx 
b/include/xmloff/XMLComplexColorContext.hxx
index dd9db4112e60..7ede5f4ca057 100644
--- a/include/xmloff/XMLComplexColorContext.hxx
+++ b/include/xmloff/XMLComplexColorContext.hxx
@@ -49,7 +49,7 @@ public:
 
     void SAL_CALL endFastElement(sal_Int32 nElement) override;
 
-    model::ComplexColor getComplexColor() { return maComplexColor; }
+    const model::ComplexColor& getComplexColor() { return maComplexColor; }
 };
 
 class XMLOFF_DLLPUBLIC XMLComplexColorContext final : public SvXMLImportContext
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index aee75e7ab798..82eddedd6e45 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -386,8 +386,8 @@ public:
     static const OUString & getNameFromToken( sal_Int32 nToken );
     static OUString getPrefixAndNameFromToken( sal_Int32 nToken );
     static OUString getNamespacePrefixFromToken(sal_Int32 nToken, const 
SvXMLNamespaceMap* pMap);
-    static OUString getNamespaceURIFromToken( sal_Int32 nToken );
-    static OUString getNamespacePrefixFromURI( const OUString& rURI );
+    static const OUString & getNamespaceURIFromToken( sal_Int32 nToken );
+    static const OUString & getNamespacePrefixFromURI( const OUString& rURI );
     static sal_Int32 getTokenFromName(std::u16string_view sName);
 
     SvXMLNamespaceMap& GetNamespaceMap() { return *mxNamespaceMap; }
diff --git a/xmloff/inc/txtlists.hxx b/xmloff/inc/txtlists.hxx
index dda522c441f9..59454e79802f 100644
--- a/xmloff/inc/txtlists.hxx
+++ b/xmloff/inc/txtlists.hxx
@@ -64,9 +64,9 @@ class XMLTextListsHelper
                                   const OUString& sListStyleDefaultListId = 
OUString() );
 
         bool IsListProcessed( const OUString& sListId ) const;
-        OUString GetListStyleOfProcessedList(
+        const OUString & GetListStyleOfProcessedList(
                                         const OUString& sListId ) const;
-        OUString GetContinueListIdOfProcessedList(
+        const OUString & GetContinueListIdOfProcessedList(
                                         const OUString& sListId ) const;
         const OUString& GetLastProcessedListId() const { return 
msLastProcessedListId;}
         const OUString& GetListStyleOfLastProcessedList() const { return 
msListStyleOfLastProcessedList;}
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 6d9fa2a64c1a..6d8b88192308 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -2016,23 +2016,23 @@ OUString 
SvXMLImport::getNamespacePrefixFromToken(sal_Int32 nToken, const SvXMLN
         return OUString();
 }
 
-OUString SvXMLImport::getNamespaceURIFromToken( sal_Int32 nToken )
+const OUString & SvXMLImport::getNamespaceURIFromToken( sal_Int32 nToken )
 {
     sal_Int32 nNamespaceToken = ( nToken & NMSP_MASK ) >> NMSP_SHIFT;
     auto aIter( aNamespaceMap.find( nNamespaceToken ) );
     if( aIter != aNamespaceMap.end() )
         return (*aIter).second.second;
     else
-        return OUString();
+        return EMPTY_OUSTRING;
 }
 
-OUString SvXMLImport::getNamespacePrefixFromURI( const OUString& rURI )
+const OUString & SvXMLImport::getNamespacePrefixFromURI( const OUString& rURI )
 {
     auto aIter( aNamespaceURIPrefixMap.find(rURI) );
     if( aIter != aNamespaceURIPrefixMap.end() )
         return (*aIter).second;
     else
-        return OUString();
+        return EMPTY_OUSTRING;
 }
 
 sal_Int32 SvXMLImport::getTokenFromName( std::u16string_view rName )
diff --git a/xmloff/source/draw/XMLNumberStyles.cxx 
b/xmloff/source/draw/XMLNumberStyles.cxx
index ff6a809e7c8d..5c5a0e63c584 100644
--- a/xmloff/source/draw/XMLNumberStyles.cxx
+++ b/xmloff/source/draw/XMLNumberStyles.cxx
@@ -438,7 +438,7 @@ void SdXMLNumberStylesExporter::exportDateStyle( 
SdXMLExport& rExport, sal_Int32
     }
 }
 
-OUString SdXMLNumberStylesExporter::getTimeStyleName(const sal_Int32 
nTimeFormat )
+const OUString & SdXMLNumberStylesExporter::getTimeStyleName(const sal_Int32 
nTimeFormat )
 {
     sal_Int32 nFormat = nTimeFormat;
     if( nFormat > 1 )
@@ -450,7 +450,7 @@ OUString SdXMLNumberStylesExporter::getTimeStyleName(const 
sal_Int32 nTimeFormat
     }
     else
     {
-        return OUString();
+        return EMPTY_OUSTRING;
     }
 }
 
diff --git a/xmloff/source/draw/XMLNumberStylesExport.hxx 
b/xmloff/source/draw/XMLNumberStylesExport.hxx
index 8b4f39dc5a2e..37edecfe1524 100644
--- a/xmloff/source/draw/XMLNumberStylesExport.hxx
+++ b/xmloff/source/draw/XMLNumberStylesExport.hxx
@@ -33,7 +33,7 @@ public:
     static void exportTimeStyle(SdXMLExport& rExport, sal_Int32 nStyle);
     static void exportDateStyle(SdXMLExport& rExport, sal_Int32 nStyle);
 
-    static OUString getTimeStyleName(const sal_Int32 nTimeFormat);
+    static const OUString& getTimeStyleName(const sal_Int32 nTimeFormat);
     static OUString getDateStyleName(const sal_Int32 nDateFormat);
 };
 
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx 
b/xmloff/source/text/XMLTextFrameContext.cxx
index 5c293c7670c2..27d5d65b0374 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -420,7 +420,7 @@ public:
     const OUString& GetOrigName() const { return m_sOrigName; }
 
     css::text::TextContentAnchorType GetAnchorType() const { return 
eAnchorType; }
-    OUString GetMimeType() const { return sMimeType; }
+    const OUString & GetMimeType() const { return sMimeType; }
 
     const css::uno::Reference < css::beans::XPropertySet >& GetPropSet() const 
{ return xPropSet; }
 };
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx 
b/xmloff/source/text/XMLTextMarkImportContext.cxx
index 2803fd0b5f30..392ef6c440f0 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -126,7 +126,7 @@ SvXMLEnumMapEntry<lcl_MarkType> const lcl_aMarkTypeMap[] =
 };
 
 
-static OUString lcl_getFormFieldmarkName(std::u16string_view name)
+static const OUString & lcl_getFormFieldmarkName(std::u16string_view name)
 {
     if (name == ODF_FORMCHECKBOX ||
         name == u"msoffice.field.FORMCHECKBOX" ||
@@ -136,7 +136,7 @@ static OUString 
lcl_getFormFieldmarkName(std::u16string_view name)
              name == u"ecma.office-open-xml.field.FORMDROPDOWN")
         return ODF_FORMDROPDOWN;
     else
-        return OUString();
+        return EMPTY_OUSTRING;
 }
 
 static OUString lcl_getFieldmarkName(OUString const& name)
diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx
index 80e1abd490f2..4cbd7874050b 100644
--- a/xmloff/source/text/txtlists.cxx
+++ b/xmloff/source/text/txtlists.cxx
@@ -156,7 +156,7 @@ bool XMLTextListsHelper::IsListProcessed( const OUString& 
sListId ) const
     return mpProcessedLists->find( sListId ) != mpProcessedLists->end();
 }
 
-OUString XMLTextListsHelper::GetListStyleOfProcessedList(
+const OUString & XMLTextListsHelper::GetListStyleOfProcessedList(
                                             const OUString& sListId ) const
 {
     if ( mpProcessedLists )
@@ -168,10 +168,10 @@ OUString XMLTextListsHelper::GetListStyleOfProcessedList(
         }
     }
 
-    return OUString();
+    return EMPTY_OUSTRING;
 }
 
-OUString XMLTextListsHelper::GetContinueListIdOfProcessedList(
+const OUString & XMLTextListsHelper::GetContinueListIdOfProcessedList(
                                             const OUString& sListId ) const
 {
     if ( mpProcessedLists )
@@ -183,7 +183,7 @@ OUString 
XMLTextListsHelper::GetContinueListIdOfProcessedList(
         }
     }
 
-    return OUString();
+    return EMPTY_OUSTRING;
 }
 
 

Reply via email to