summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-05-23 16:23:07 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-05-23 18:32:19 +0000
commit5122f3c5459d9b4053485241292728cd770cbaf8 (patch)
treec757fdc80c74e09a55092a783c590dc37a9f2ab0 /sw
parentc2690669d29c0679b7de8eec1e91a0fd17cea054 (diff)
tdf#91368 - micro-optimization for over-used method.
Change-Id: Ia43d66230ef3118d2f23c2e6ba8eb0a081ab6b93 Reviewed-on: https://gerrit.libreoffice.org/15878 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/format.hxx3
-rw-r--r--sw/source/core/doc/docfmt.cxx4
2 files changed, 4 insertions, 3 deletions
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index 11ed94319e81..83bdf16b8932 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -111,7 +111,8 @@ public:
inline SwFormat* DerivedFrom() const { return const_cast<SwFormat*>(static_cast<const SwFormat*>(GetRegisteredIn())); }
inline bool IsDefault() const { return DerivedFrom() == 0; }
- inline OUString GetName() const { return m_aFormatName; }
+ inline OUString GetName() const { return m_aFormatName; }
+ inline bool HasName(const OUString &rName) const { return m_aFormatName == rName; }
void SetName( const OUString& rNewName, bool bBroadcast=false );
inline void SetName( const sal_Char* pNewName,
bool bBroadcast=false);
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 6750c6f84500..bb1ea8717ee7 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1599,13 +1599,13 @@ void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles )
}
SwFormat* SwDoc::FindFormatByName( const SwFormatsBase& rFormatArr,
- const OUString& rName )
+ const OUString& rName )
{
SwFormat* pFnd = 0;
for( size_t n = 0; n < rFormatArr.GetFormatCount(); ++n )
{
// Does the Doc already contain the template?
- if( rFormatArr.GetFormat(n)->GetName() == rName )
+ if( rFormatArr.GetFormat(n)->HasName( rName ) )
{
pFnd = rFormatArr.GetFormat(n);
break;