Kaydet (Commit) ed29dc6b authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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/46847Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit 9675f307)

Change-Id: I93b603f369528187980d644a5364fa9bcf2f4615
Reviewed-on: https://gerrit.libreoffice.org/46904Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
Tested-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 3c96ded8
......@@ -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); }
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment