diff options
author | Mark Hung <marklh9@gmail.com> | 2020-03-04 19:16:47 +0800 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-06 20:40:17 +0100 |
commit | 32c8bd660e74169a17fdfd4cdbf42bb79dc5a10d (patch) | |
tree | 9af03076116f64675304bb2a2db458887292c438 /svx | |
parent | e3b14639dca24f5ca559044651d2140f8f4a0e74 (diff) |
tdf#120216 improve svx table performance.
By defining operator== for SdrConnectStyleData and
SdrFrameBorderData, and make a deeper comparison instead
of the pointer stored shared_ptr in SdrFrameBorderPrimitive2D.
The SdrFrameBorderPrimitive2D::operator== always
return false before. The response time of clicking a cell
and then entering editing mode improved from 4s to 0.5s
in my environment.
Change-Id: I625d9f69a07f42cac4a6cba45ec9e1c4195b6d58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90120
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx index c853da76ad11..3c131948579b 100644 --- a/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx @@ -654,6 +654,13 @@ namespace drawinglayer::primitive2d { } + bool SdrFrameBorderData::SdrConnectStyleData::operator==(const SdrFrameBorderData::SdrConnectStyleData& rCompare) const + { + return mbStyleMirrored == rCompare.mbStyleMirrored + && maStyle == rCompare.maStyle + && maNormalizedPerpendicular == rCompare.maNormalizedPerpendicular; + } + SdrFrameBorderData::SdrFrameBorderData( const basegfx::B2DPoint& rOrigin, const basegfx::B2DVector& rX, @@ -748,6 +755,16 @@ namespace drawinglayer::primitive2d } + bool SdrFrameBorderData::operator==(const SdrFrameBorderData& rCompare) const + { + return maOrigin == rCompare.maOrigin + && maX == rCompare.maX + && maStyle == rCompare.maStyle + && maColor == rCompare.maColor + && mbForceColor == rCompare.mbForceColor + && maStart == rCompare.maStart + && maEnd == rCompare.maEnd; + } void SdrFrameBorderPrimitive2D::create2DDecomposition( @@ -860,7 +877,9 @@ namespace drawinglayer::primitive2d { const SdrFrameBorderPrimitive2D& rCompare = static_cast<const SdrFrameBorderPrimitive2D&>(rPrimitive); - return getFrameBorders() == rCompare.getFrameBorders() + return (getFrameBorders() == rCompare.getFrameBorders() + || (getFrameBorders() && rCompare.getFrameBorders() + && *getFrameBorders() == *rCompare.getFrameBorders())) && doForceToSingleDiscreteUnit() == rCompare.doForceToSingleDiscreteUnit(); } |