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
...@@ -111,7 +111,8 @@ public: ...@@ -111,7 +111,8 @@ public:
inline SwFormat* DerivedFrom() const { return const_cast<SwFormat*>(static_cast<const SwFormat*>(GetRegisteredIn())); } inline SwFormat* DerivedFrom() const { return const_cast<SwFormat*>(static_cast<const SwFormat*>(GetRegisteredIn())); }
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);
......
...@@ -1599,13 +1599,13 @@ void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles ) ...@@ -1599,13 +1599,13 @@ void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles )
} }
SwFormat* SwDoc::FindFormatByName( const SwFormatsBase& rFormatArr, SwFormat* SwDoc::FindFormatByName( const SwFormatsBase& rFormatArr,
const OUString& rName ) const OUString& rName )
{ {
SwFormat* pFnd = 0; SwFormat* pFnd = 0;
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