summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-14 14:57:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-14 21:28:40 +0200
commit1f9468fc29874eae5100317282ab8b395904406d (patch)
tree7da605653b3a979d18c2283f42ac8a3efd9eae63 /sd
parent43b0d4f709a3a1446a32e36abb5deaa3bb45ddd9 (diff)
use std::vector::insert instead of push_back
because it will pre-allocate space and often is optimised to memcpy Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index eb64897db853..002c1c5db4e6 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -155,8 +155,9 @@ bool SdPdfFilter::Import()
{
auto* pMarker = static_cast<vcl::pdf::PDFAnnotationMarkerInk*>(
rPDFAnnotation.mpMarker.get());
- for (auto const& rPolygon : pMarker->maStrokes)
- rCustomAnnotationMarker.maPolygons.push_back(rPolygon);
+ rCustomAnnotationMarker.maPolygons.insert(
+ rCustomAnnotationMarker.maPolygons.end(), pMarker->maStrokes.begin(),
+ pMarker->maStrokes.end());
rCustomAnnotationMarker.mnLineWidth = pMarker->mnWidth;
rCustomAnnotationMarker.maFillColor = pMarker->maFillColor;
}
@@ -166,8 +167,9 @@ bool SdPdfFilter::Import()
rCustomAnnotationMarker.maLineColor.SetAlpha(255 - 0x90);
auto* pMarker = static_cast<vcl::pdf::PDFAnnotationMarkerHighlight*>(
rPDFAnnotation.mpMarker.get());
- for (auto const& rPolygon : pMarker->maQuads)
- rCustomAnnotationMarker.maPolygons.push_back(rPolygon);
+ rCustomAnnotationMarker.maPolygons.insert(
+ rCustomAnnotationMarker.maPolygons.end(), pMarker->maQuads.begin(),
+ pMarker->maQuads.end());
rCustomAnnotationMarker.mnLineWidth = 1;
rCustomAnnotationMarker.maFillColor = rPDFAnnotation.maColor;
if (!rCustomAnnotationMarker.maFillColor.IsTransparent())