[Libreoffice-commits] core.git: svx/source
Caolán McNamara
caolanm at redhat.com
Mon Sep 25 22:29:54 UTC 2017
svx/source/svdraw/svdotextdecomposition.cxx | 27 ++++++---------------------
1 file changed, 6 insertions(+), 21 deletions(-)
New commits:
commit 890c1c1c2746fdddc06e9f924d51fe7e8a7cd062
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Sep 25 21:21:37 2017 +0100
we should be able to dispense with the intermediate vector
as since
commit 58d8d8ac67aa9b907f1304a48efa0f7a473d9de4
Author: Noel Grandin <noel at 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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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
More information about the Libreoffice-commits
mailing list