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 /sc | |
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 'sc')
-rw-r--r-- | sc/source/core/data/global.cxx | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 34398fe41760..a5b4e10bda3d 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -788,24 +788,7 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1, return true; if ( pObj1 && pObj2 ) - { - // First test for equal text content - sal_Int32 nParCount = pObj1->GetParagraphCount(); - if ( nParCount != pObj2->GetParagraphCount() ) - return false; - for (sal_Int32 nPar=0; nPar<nParCount; nPar++) - if ( pObj1->GetText(nPar) != pObj2->GetText(nPar) ) - return false; - - SvMemoryStream aStream1; - SvMemoryStream aStream2; - pObj1->Store( aStream1 ); - pObj2->Store( aStream2 ); - const sal_uInt64 nSize = aStream1.Tell(); - if ( aStream2.Tell() == nSize ) - if ( !memcmp( aStream1.GetData(), aStream2.GetData(), (sal_uInt16) nSize ) ) - return true; - } + return pObj1->Equals( *pObj2, false); return false; } |