[Libreoffice-commits] core.git: sw/inc sw/source

Tor Lillqvist tml at collabora.com
Thu Dec 21 14:31:03 UTC 2017


 sw/inc/section.hxx                |    2 +-
 sw/source/core/docnode/ndsect.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ed29dc6b3b4d7baa1a85621cceb940707454d87d
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Dec 20 13:28:53 2017 +0200

    Make SwSection::GetSectionName() return a reference to the name
    
    Has a small but measureable impact on the time it takes to load a
    specific pathological (huge) customer document. The load time drops
    from 1min 46s to 1min 38s on my machine.
    
    Reviewed-on: https://gerrit.libreoffice.org/46847
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 9675f307fbd7961b3d00f810dad3eacc9920e07d)
    
    Change-Id: I93b603f369528187980d644a5364fa9bcf2f4615
    Reviewed-on: https://gerrit.libreoffice.org/46904
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>

diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index e2584dc27e11..7eeadf7c0ebd 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -166,7 +166,7 @@ public:
 
     void SetSectionData(SwSectionData const& rData);
 
-    OUString GetSectionName() const         { return m_Data.GetSectionName(); }
+    const OUString& GetSectionName() const         { return m_Data.GetSectionName(); }
     void SetSectionName(OUString const& rName){ m_Data.SetSectionName(rName); }
     SectionType GetType() const             { return m_Data.GetType(); }
     void SetType(SectionType const eType)   { return m_Data.SetType(eType); }
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index c8a1d4ccbbce..e5d2d017c799 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -1371,7 +1371,7 @@ OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const
         const SwSectionNode *const pSectNd = pFormat->GetSectionNode();
         if( pSectNd != nullptr )
         {
-            const OUString rNm = pSectNd->GetSection().GetSectionName();
+            const OUString& rNm = pSectNd->GetSection().GetSectionName();
             if (rNm.startsWith( aName ))
             {
                 // Calculate the Number and reset the Flag


More information about the Libreoffice-commits mailing list