From ca90b8742ac780d492f96181bdd52b8d9c17a227 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 31 Aug 2016 10:41:00 -0700 Subject: Make CPDF_ColorState have a CFX_ColorStateData rather than inheriting Review-Url: https://codereview.chromium.org/2294133002 --- core/fpdfapi/fpdf_page/fpdf_page_parser.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'core/fpdfapi/fpdf_page/fpdf_page_parser.cpp') diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp index 70e1d1aea6..5272a4464b 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -686,21 +686,19 @@ void CPDF_StreamContentParser::Handle_ConcatMatrix() { } void CPDF_StreamContentParser::Handle_SetColorSpace_Fill() { - CFX_ByteString csname = GetString(0); - CPDF_ColorSpace* pCS = FindColorSpace(csname); - if (!pCS) { + CPDF_ColorSpace* pCS = FindColorSpace(GetString(0)); + if (!pCS) return; - } - m_pCurStates->m_ColorState.GetPrivateCopy()->m_FillColor.SetColorSpace(pCS); + + m_pCurStates->m_ColorState.GetMutableFillColor()->SetColorSpace(pCS); } void CPDF_StreamContentParser::Handle_SetColorSpace_Stroke() { - CFX_ByteString csname = GetString(0); - CPDF_ColorSpace* pCS = FindColorSpace(csname); - if (!pCS) { + CPDF_ColorSpace* pCS = FindColorSpace(GetString(0)); + if (!pCS) return; - } - m_pCurStates->m_ColorState.GetPrivateCopy()->m_StrokeColor.SetColorSpace(pCS); + + m_pCurStates->m_ColorState.GetMutableStrokeColor()->SetColorSpace(pCS); } void CPDF_StreamContentParser::Handle_SetDash() { -- cgit v1.2.3