diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-02 15:47:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-02 17:56:53 +0200 |
commit | 585e0ac43b9bd8a2f714903034e435c84ae3fc96 (patch) | |
tree | 2838f44bbe3d0b87bcf9da4e0af28c50ce4ce7d6 /sc | |
parent | b5b198ad3db3a1020b249ea3452eee6bce03e9b9 (diff) |
revert part of "tdf#81765 slow loading of .ods"
it turns out that
soffice --headless --convert-to pdf tdf89833-2.xlsm
semi-reliably fails with
stl concept checking "Error: attempt to compare a dereferenceable
iterator to a singular iterator"
because we are modifying ScPatternAttr all over the place, which messes
with the sorted list in the pool.
Change-Id: Id662ac32b024c2c60b32b6cf433c12deb614f0fa
Reviewed-on: https://gerrit.libreoffice.org/71677
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/patattr.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/patattr.cxx | 40 |
2 files changed, 0 insertions, 42 deletions
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index 52fd8536d861..8004a57c3a26 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -65,8 +65,6 @@ public: virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool operator==(const SfxPoolItem& rCmp) const override; - virtual bool operator<(const SfxPoolItem& rCmp) const override; - virtual bool IsSortable() const override { return true; } const SfxPoolItem& GetItem( sal_uInt16 nWhichP ) const { return GetItemSet().Get(nWhichP); } diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index fbf6d33e4a6c..52bdfcda5b27 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -120,17 +120,6 @@ static bool StrCmp( const OUString* pStr1, const OUString* pStr2 ) return *pStr1 == *pStr2; } -static bool StrLess( const OUString* pStr1, const OUString* pStr2 ) -{ - if (pStr1 == pStr2) - return false; - if (pStr1 && !pStr2) - return false; - if (!pStr1 && pStr2) - return true; - return *pStr1 < *pStr2; -} - static bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 ) { // #i62090# The SfxItemSet in the SfxSetItem base class always has the same ranges @@ -146,23 +135,6 @@ static bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 ) return ( 0 == memcmp( pItems1, pItems2, (ATTR_PATTERN_END - ATTR_PATTERN_START + 1) * sizeof(pItems1[0]) ) ); } -static int CmpPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 ) -{ - // #i62090# The SfxItemSet in the SfxSetItem base class always has the same ranges - // (single range from ATTR_PATTERN_START to ATTR_PATTERN_END), and the items are pooled, - // so it's enough to compare just the pointers (Count just because it's even faster). - - if ( rSet1.Count() < rSet2.Count() ) - return -1; - if ( rSet1.Count() > rSet2.Count() ) - return 1; - - SfxPoolItem const ** pItems1 = rSet1.GetItems_Impl(); // inline method of SfxItemSet - SfxPoolItem const ** pItems2 = rSet2.GetItems_Impl(); - - return memcmp( pItems1, pItems2, (ATTR_PATTERN_END - ATTR_PATTERN_START + 1) * sizeof(pItems1[0]) ); -} - bool ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const { // #i62090# Use quick comparison between ScPatternAttr's ItemSets @@ -171,18 +143,6 @@ bool ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const StrCmp( GetStyleName(), static_cast<const ScPatternAttr&>(rCmp).GetStyleName() ) ); } -bool ScPatternAttr::operator<( const SfxPoolItem& rCmp ) const -{ - // #i62090# Use quick comparison between ScPatternAttr's ItemSets - auto const & rOtherAttr = static_cast<const ScPatternAttr&>(rCmp); - int cmp = CmpPatternSets( GetItemSet(), rOtherAttr.GetItemSet() ); - if (cmp < 0) - return true; - if (cmp > 0) - return false; - return StrLess(GetStyleName(), rOtherAttr.GetStyleName()); -} - SvxCellOrientation ScPatternAttr::GetCellOrientation( const SfxItemSet& rItemSet, const SfxItemSet* pCondSet ) { SvxCellOrientation eOrient = SvxCellOrientation::Standard; |