From 58d8d8ac67aa9b907f1304a48efa0f7a473d9de4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 10 Dec 2015 12:27:50 +0200 Subject: tdf#69977: uno::Sequence is expensive when used as a mutable data-structure. Plain std::vector halves the time taken to display the chart dialog Create a class to represent the std::vector we are going to be passing around, and move some of the utility methods into it to make the code prettier. Also create an optimised append(&&) method for the common case of appending small temporaries. Change-Id: I7f5b43fb4a8a84e40e6a52fcb7e9f974091b4485 --- svx/source/table/tablehandles.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'svx/source/table/tablehandles.cxx') diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index 74227c6f338a..ca9954ea4819 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -49,7 +49,7 @@ protected: bool mbVisible; // geometry creation for OverlayObject - virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence() override; + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; public: OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bVisible ); @@ -212,9 +212,9 @@ OverlayTableEdge::~OverlayTableEdge() { } -drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayObjectPrimitive2DSequence() +drawinglayer::primitive2d::Primitive2DContainer OverlayTableEdge::createOverlayObjectPrimitive2DSequence() { - drawinglayer::primitive2d::Primitive2DSequence aRetval; + drawinglayer::primitive2d::Primitive2DContainer aRetval; if(maPolyPolygon.count()) { @@ -228,16 +228,16 @@ drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayOb if(mbVisible) { // visible, just return as sequence - aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); + aRetval = drawinglayer::primitive2d::Primitive2DContainer { aReference }; } else { // embed in HiddenGeometryPrimitive2D to support HitTest of this invisible // overlay object - const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aReference, 1); + const drawinglayer::primitive2d::Primitive2DContainer aSequence { aReference }; const drawinglayer::primitive2d::Primitive2DReference aNewReference( new drawinglayer::primitive2d::HiddenGeometryPrimitive2D(aSequence)); - aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aNewReference, 1); + aRetval = drawinglayer::primitive2d::Primitive2DContainer { aNewReference }; } } -- cgit