diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-09-25 21:21:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-09-26 00:29:33 +0200 |
commit | 890c1c1c2746fdddc06e9f924d51fe7e8a7cd062 (patch) | |
tree | 7c1d12072d6c717167280371cfd5e317b874ab71 /svx | |
parent | a1ee7a24b1b02553ac02be14f7fe6b06359ed3fd (diff) |
we should be able to dispense with the intermediate vector
as since
commit 58d8d8ac67aa9b907f1304a48efa0f7a473d9de4
Author: Noel Grandin <noel@peralex.com>
Date: Thu Dec 10 12:27:50 2015 +0200
tdf#69977: uno::Sequence is expensive
the uno::Sequence Primitive2DSequence was replaced with
a std::deque Primitive2DContainer
Change-Id: I4d2a293967717f9070121ab6740abf620b941ead
Reviewed-on: https://gerrit.libreoffice.org/42767
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index ffee7eef34ce..1ec3d408fb7e 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -62,25 +62,12 @@ using namespace com::sun::star; namespace { - drawinglayer::primitive2d::Primitive2DContainer impConvertVectorToPrimitive2DSequence(const std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rPrimitiveVector) - { - const sal_Int32 nCount(rPrimitiveVector.size()); - drawinglayer::primitive2d::Primitive2DContainer aRetval(nCount); - - for(sal_Int32 a(0); a < nCount; a++) - { - aRetval[a] = drawinglayer::primitive2d::Primitive2DReference(rPrimitiveVector[a]); - } - - return aRetval; - } - class impTextBreakupHandler { private: - std::vector< drawinglayer::primitive2d::BasePrimitive2D* > maTextPortionPrimitives; - std::vector< drawinglayer::primitive2d::BasePrimitive2D* > maLinePrimitives; - std::vector< drawinglayer::primitive2d::BasePrimitive2D* > maParagraphPrimitives; + drawinglayer::primitive2d::Primitive2DContainer maTextPortionPrimitives; + drawinglayer::primitive2d::Primitive2DContainer maLinePrimitives; + drawinglayer::primitive2d::Primitive2DContainer maParagraphPrimitives; SdrOutliner& mrOutliner; basegfx::B2DHomMatrix maNewTransformA; @@ -507,9 +494,8 @@ namespace // empty line primitives (contrary to paragraphs, see below). if(!maTextPortionPrimitives.empty()) { - drawinglayer::primitive2d::Primitive2DContainer aLineSequence(impConvertVectorToPrimitive2DSequence(maTextPortionPrimitives)); + maLinePrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyLinePrimitive2D(maTextPortionPrimitives)); maTextPortionPrimitives.clear(); - maLinePrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyLinePrimitive2D(aLineSequence)); } } @@ -518,9 +504,8 @@ namespace // ALWAYS create a paragraph primitive, even when no content was added. This is done to // have the correct paragraph count even with empty paragraphs. Those paragraphs will // have an empty sub-PrimitiveSequence. - drawinglayer::primitive2d::Primitive2DContainer aParagraphSequence(impConvertVectorToPrimitive2DSequence(maLinePrimitives)); + maParagraphPrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D(maLinePrimitives)); maLinePrimitives.clear(); - maParagraphPrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D(aParagraphSequence)); } void impTextBreakupHandler::impHandleDrawPortionInfo(const DrawPortionInfo& rInfo) @@ -672,7 +657,7 @@ namespace impFlushLinePrimitivesToParagraphPrimitives(); } - return impConvertVectorToPrimitive2DSequence(maParagraphPrimitives); + return maParagraphPrimitives; } } // end of anonymous namespace |