summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/editeng/editobj.cxx22
-rw-r--r--editeng/source/editeng/editobj2.hxx12
2 files changed, 33 insertions, 1 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 34eacc474167..3a7036b05fb8 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -225,6 +225,26 @@ void ContentInfo::Dump() const
}
#endif
+bool ContentInfo::operator==( const ContentInfo& rCompare ) const
+{
+ if( (maText == rCompare.maText) &&
+ (aStyle == rCompare.aStyle ) &&
+ (maCharAttribs.size() == rCompare.maCharAttribs.size()) &&
+ (eFamily == rCompare.eFamily ) &&
+ (aParaAttribs == rCompare.aParaAttribs ) )
+ {
+ for (size_t i = 0, n = maCharAttribs.size(); i < n; ++i)
+ {
+ if (!(*(maCharAttribs[i]) == *(rCompare.maCharAttribs[i])))
+ return false;
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
EditTextObject::EditTextObject( SfxItemPool* pPool ) :
mpImpl(new EditTextObjectImpl(this, pPool))
{
@@ -1606,7 +1626,7 @@ bool EditTextObjectImpl::operator==( const EditTextObjectImpl& rCompare ) const
for (size_t i = 0, n = aContents.size(); i < n; ++i)
{
- if (aContents[i] != rCompare.aContents[i])
+ if (!(*(aContents[i]) == *(rCompare.aContents[i])))
return false;
}
diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx
index 928f4ba12b84..460a891f7632 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -69,8 +69,19 @@ public:
bool IsFeature() const;
void SetItem(const SfxPoolItem& rNew);
+
+ inline bool operator==( const XEditAttribute& rCompare ) const;
};
+inline bool XEditAttribute::operator==( const XEditAttribute& rCompare ) const
+{
+ return (nStart == rCompare.nStart) &&
+ (nEnd == rCompare.nEnd) &&
+ ((pItem == rCompare.pItem) ||
+ ((pItem->Which() == rCompare.pItem->Which()) &&
+ (*pItem == *rCompare.pItem)));
+}
+
struct XParaPortion
{
long nHeight;
@@ -152,6 +163,7 @@ public:
const WrongList* GetWrongList() const;
void SetWrongList( WrongList* p );
+ bool operator==( const ContentInfo& rCompare ) const;
// #i102062#
bool isWrongListEqual(const ContentInfo& rCompare) const;