From 5cc24654fb345189140acb4711ff981e1c720951 Mon Sep 17 00:00:00 2001 From: thestig Date: Tue, 26 Apr 2016 11:46:02 -0700 Subject: Clean up CPDF_Page. - Merge CPDF_Page::Load() into ctor. - Remove always nullptr param for CPDF_Page::ParseContent(). - Remove unneeded indirection in IPDF_RenderModule. - Delete CPDF_ParseOptions. - Fix up CPDF_Pattern. Review URL: https://codereview.chromium.org/1918113002 --- core/fpdfapi/fpdf_page/fpdf_page_doc.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'core/fpdfapi/fpdf_page/fpdf_page_doc.cpp') diff --git a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp index b9019f8577..aed6e1e05c 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp @@ -150,10 +150,8 @@ void CPDF_DocPageData::Clear(FX_BOOL bForceRelease) { if (!ptData->get()) continue; - if (bForceRelease || ptData->use_count() < 2) { - ptData->get()->SetForceClear(bForceRelease); + if (bForceRelease || ptData->use_count() < 2) ptData->clear(); - } } for (auto& it : m_FontMap) { @@ -436,9 +434,9 @@ CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : nullptr; if (pDict) { int type = pDict->GetIntegerBy("PatternType"); - if (type == 1) { + if (type == CPDF_Pattern::TILING) { pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix); - } else if (type == 2) { + } else if (type == CPDF_Pattern::SHADING) { pPattern = new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix); } -- cgit v1.2.3