summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_streamcontentparser.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-15 11:07:32 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-15 17:47:57 +0000
commite4602321f3175fa5addb6761d0e94f5c2fc93d0c (patch)
tree6671774659645fad6d9ce55a5910b4665a25094f /core/fpdfapi/page/cpdf_streamcontentparser.cpp
parenteb55885e9a9eec670ed98cbd12dc96d63e6a6623 (diff)
downloadpdfium-e4602321f3175fa5addb6761d0e94f5c2fc93d0c.tar.xz
Cleanup CFX_PathData.
This CL replaces the array of path points with a vector. Cleaning up the usage as required. Change-Id: Ifa386a2c847005fef68af748ebe99c4e08961238 Reviewed-on: https://pdfium-review.googlesource.com/2710 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 0af43d08b2..e991e456b7 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -1506,10 +1506,14 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, bool bStroke) {
m_pPathPoints[PathPointCount - 1].IsTypeAndOpen(FXPT_TYPE::MoveTo)) {
PathPointCount--;
}
+
CPDF_Path Path;
- Path.SetPointCount(PathPointCount);
- FXSYS_memcpy(Path.GetMutablePoints(), m_pPathPoints,
- sizeof(FX_PATHPOINT) * PathPointCount);
+ for (int i = 0; i < PathPointCount; i++) {
+ FX_PATHPOINT& point = m_pPathPoints[i];
+ Path.AppendPoint(point.m_PointX, point.m_PointY, point.m_Type,
+ point.m_CloseFigure);
+ }
+
CFX_Matrix matrix = m_pCurStates->m_CTM;
matrix.Concat(m_mtContentToUser);
if (bStroke || FillType) {