From fed6e124109f089a38e24e37b104d983231bee78 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 24 Sep 2018 17:55:00 +0000 Subject: Give CFX_GraphStateData a work-over. Use std::vector for dash array. Use compiler-generated default operations. Squeeze some enums. Fix obvious logic botch in DashChanged(). Change-Id: If1d809cc46a3cf2db98a09a3f5a49d22138c0640 Reviewed-on: https://pdfium-review.googlesource.com/42613 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- xfa/fxgraphics/cxfa_graphics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xfa') diff --git a/xfa/fxgraphics/cxfa_graphics.cpp b/xfa/fxgraphics/cxfa_graphics.cpp index 628bd44268..03689da618 100644 --- a/xfa/fxgraphics/cxfa_graphics.cpp +++ b/xfa/fxgraphics/cxfa_graphics.cpp @@ -145,14 +145,14 @@ void CXFA_Graphics::SetLineDash(float dashPhase, float scale = m_info.isActOnDash ? m_info.graphState.m_LineWidth : 1.0; m_info.graphState.m_DashPhase = dashPhase; - m_info.graphState.SetDashCount(dashCount); + m_info.graphState.m_DashArray.resize(dashCount); for (size_t i = 0; i < dashCount; i++) m_info.graphState.m_DashArray[i] = dashArray[i] * scale; } void CXFA_Graphics::SetSolidLineDash() { if (m_type == FX_CONTEXT_Device && m_renderDevice) - m_info.graphState.SetDashCount(0); + m_info.graphState.m_DashArray.clear(); } void CXFA_Graphics::SetLineWidth(float lineWidth) { @@ -439,7 +439,7 @@ CXFA_Graphics::TInfo::TInfo(const TInfo& info) fillColor(info.fillColor) {} CXFA_Graphics::TInfo& CXFA_Graphics::TInfo::operator=(const TInfo& other) { - graphState.Copy(other.graphState); + graphState = other.graphState; CTM = other.CTM; isActOnDash = other.isActOnDash; strokeColor = other.strokeColor; -- cgit v1.2.3