sw/inc/format.hxx | 3 ++- sw/source/core/doc/docfmt.cxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
New commits: commit 5122f3c5459d9b4053485241292728cd770cbaf8 Author: Michael Meeks <michael.me...@collabora.com> Date: Sat May 23 16:23:07 2015 +0100 tdf#91368 - micro-optimization for over-used method. Change-Id: Ia43d66230ef3118d2f23c2e6ba8eb0a081ab6b93 Reviewed-on: https://gerrit.libreoffice.org/15878 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Meeks <michael.me...@collabora.com> Tested-by: Michael Meeks <michael.me...@collabora.com> diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index 11ed943..83bdf16 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 6750c6f..bb1ea87 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits