Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2256)

Unified Diff: core/fpdfapi/fpdf_page/fpdf_page_doc.cpp

Issue 1918113002: Clean up CPDF_Page. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: more Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_tilingpattern.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: 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 b9019f857780bef39d58596a3794a0dba4646067..aed6e1e05ca7e037d4c4e3785b9228f81ee31155 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);
}
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_tilingpattern.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698