diff options
author | Eike Rathke <erack@redhat.com> | 2017-07-27 16:58:59 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-07-27 17:48:59 +0200 |
commit | 238de04de6c8b67f74c75514b86c08bf888feb48 (patch) | |
tree | 520fba3d64eca15c97ec04fd1d3a510348bd629d /editeng | |
parent | 221dae68df80298e81e6e6549636f3528f5c8bc3 (diff) |
Ditch use of EditTextObject::Store() in ScGlobal::EETextObjEqual()
This was the last incarnation of SfxItem binary stream serialization that is to
be eliminated after clipboard use is gone.
The "full" EditTextObject::operator==() in EditTextObjectImpl::operator==(),
and via ContentInfo::operator==() in SfxItemSet::operator==(), also compare the
SfxItemPool pointers which gets in the way here (not stored to stream hence
didn't matter and maybe the reason for not having switched EETextObjEqual() to
use operator==() back in the days).
Introduce *::Equals() functions that do not compare pool pointers and let
SfxItemSet::Equals() in that case not assume it would be operating on one pool
only.
Change-Id: Ifff939a92101c7f74695b676a45a7fdbb4f1d7f6
Reviewed-on: https://gerrit.libreoffice.org/40492
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 18 | ||||
-rw-r--r-- | editeng/source/editeng/editobj2.hxx | 3 |
2 files changed, 16 insertions, 5 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 3a7036b05fb8..c3ac63cd6d61 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -225,13 +225,13 @@ void ContentInfo::Dump() const } #endif -bool ContentInfo::operator==( const ContentInfo& rCompare ) const +bool ContentInfo::Equals( const ContentInfo& rCompare, bool bComparePool ) const { if( (maText == rCompare.maText) && (aStyle == rCompare.aStyle ) && (maCharAttribs.size() == rCompare.maCharAttribs.size()) && (eFamily == rCompare.eFamily ) && - (aParaAttribs == rCompare.aParaAttribs ) ) + aParaAttribs.Equals( rCompare.aParaAttribs, bComparePool ) ) { for (size_t i = 0, n = maCharAttribs.size(); i < n; ++i) { @@ -455,6 +455,11 @@ bool EditTextObject::operator==( const EditTextObject& rCompare ) const return mpImpl->operator==(*rCompare.mpImpl); } +bool EditTextObject::Equals( const EditTextObject& rCompare, bool bComparePool ) const +{ + return mpImpl->Equals(*rCompare.mpImpl, bComparePool); +} + // #i102062# bool EditTextObject::isWrongListEqual(const EditTextObject& rCompare) const { @@ -1612,11 +1617,16 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) bool EditTextObjectImpl::operator==( const EditTextObjectImpl& rCompare ) const { + return Equals( rCompare, true); +} + +bool EditTextObjectImpl::Equals( const EditTextObjectImpl& rCompare, bool bComparePool ) const +{ if( this == &rCompare ) return true; if( ( aContents.size() != rCompare.aContents.size() ) || - ( pPool != rCompare.pPool ) || + ( bComparePool && pPool != rCompare.pPool ) || ( nMetric != rCompare.nMetric ) || ( nUserType!= rCompare.nUserType ) || ( nScriptType != rCompare.nScriptType ) || @@ -1626,7 +1636,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]->Equals( *(rCompare.aContents[i]), bComparePool))) return false; } diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index 460a891f7632..21e91dcec7b8 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -163,7 +163,7 @@ public: const WrongList* GetWrongList() const; void SetWrongList( WrongList* p ); - bool operator==( const ContentInfo& rCompare ) const; + bool Equals( const ContentInfo& rCompare, bool bComparePool ) const; // #i102062# bool isWrongListEqual(const ContentInfo& rCompare) const; @@ -272,6 +272,7 @@ public: void StoreUnicodeStrings( bool b ) { bStoreUnicodeStrings = b; } bool operator==( const EditTextObjectImpl& rCompare ) const; + bool Equals( const EditTextObjectImpl& rCompare, bool bComparePool ) const; // #i102062# bool isWrongListEqual(const EditTextObjectImpl& rCompare) const; |