diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 14:29:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 21:43:49 +0200 |
commit | 05f47e6d9f0c442e481b2435cc5c2ef615ab347a (patch) | |
tree | bfa2c4c29007a63d42a227456f2fc6717e79ccb3 /sw/source/uibase/docvw | |
parent | f9b104abc1185d4f9f3af66f49ec9e39f85a1c36 (diff) |
replace 'resize(size+1)' with emplace_back
which is considerably faster if we're dealing with a std::list, and just
easier on the eyes if we're dealing with a std::vector
Change-Id: I373689205ebc048689f29ab80a7ee8551b20cc96
Reviewed-on: https://gerrit.libreoffice.org/39816
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/docvw')
-rw-r--r-- | sw/source/uibase/docvw/HeaderFooterWin.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PageBreakWin.cxx | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx index ca5c7857d96c..9d567d207236 100644 --- a/sw/source/uibase/docvw/HeaderFooterWin.cxx +++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx @@ -351,10 +351,9 @@ void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const ::tools: if (Application::GetSettings().GetStyleSettings().GetHighContrastMode()) aSignColor = Color(COL_WHITE).getBColor(); - aSeq.resize(aSeq.size() + 1); - aSeq[aSeq.size() - 1] = drawinglayer::primitive2d::Primitive2DReference( + aSeq.push_back( drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( - B2DPolyPolygon(aSign), aSignColor)); + B2DPolyPolygon(aSign), aSignColor)) ); // Create the processor and process the primitives const drawinglayer::geometry::ViewInformation2D aNewViewInfos; diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 5615b3f8cd9f..fa1c78afe3af 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -196,8 +196,8 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const ::tools::Re if (Application::GetSettings().GetStyleSettings().GetHighContrastMode()) aTriangleColor = Color(COL_WHITE).getBColor(); - aSeq.resize(aSeq.size() + 1); - aSeq[aSeq.size() - 1].set( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + aSeq.emplace_back(); + aSeq.back().set( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( B2DPolyPolygon(aTriangle), aTriangleColor)); drawinglayer::primitive2d::Primitive2DContainer aGhostedSeq(1); |