summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;