Kaydet (Commit) 5122f3c5 authored tarafından Michael Meeks's avatar Michael Meeks

tdf#91368 - micro-optimization for over-used method.

Change-Id: Ia43d66230ef3118d2f23c2e6ba8eb0a081ab6b93
Reviewed-on: https://gerrit.libreoffice.org/15878Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst c2690669
...@@ -112,6 +112,7 @@ public: ...@@ -112,6 +112,7 @@ public:
inline bool IsDefault() const { return DerivedFrom() == 0; } 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 ); void SetName( const OUString& rNewName, bool bBroadcast=false );
inline void SetName( const sal_Char* pNewName, inline void SetName( const sal_Char* pNewName,
bool bBroadcast=false); bool bBroadcast=false);
......
...@@ -1605,7 +1605,7 @@ SwFormat* SwDoc::FindFormatByName( const SwFormatsBase& rFormatArr, ...@@ -1605,7 +1605,7 @@ SwFormat* SwDoc::FindFormatByName( const SwFormatsBase& rFormatArr,
for( size_t n = 0; n < rFormatArr.GetFormatCount(); ++n ) for( size_t n = 0; n < rFormatArr.GetFormatCount(); ++n )
{ {
// Does the Doc already contain the template? // Does the Doc already contain the template?
if( rFormatArr.GetFormat(n)->GetName() == rName ) if( rFormatArr.GetFormat(n)->HasName( rName ) )
{ {
pFnd = rFormatArr.GetFormat(n); pFnd = rFormatArr.GetFormat(n);
break; break;
......
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