summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/page/cpdf_pageobjectholder.cpp3
-rw-r--r--core/fpdfapi/parser/cpdf_document.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.cpp b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
index 87a1aebaab..4d4fc56ac2 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.cpp
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
@@ -14,6 +14,7 @@
#include "core/fpdfapi/page/cpdf_contentparser.h"
#include "core/fpdfapi/page/cpdf_pageobject.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
+#include "core/fpdfapi/parser/cpdf_document.h"
CPDF_PageObjectHolder::CPDF_PageObjectHolder(CPDF_Document* pDoc,
CPDF_Dictionary* pFormDict)
@@ -38,6 +39,8 @@ void CPDF_PageObjectHolder::ContinueParse(PauseIndicatorIface* pPause) {
return;
m_ParseState = CONTENT_PARSED;
+ m_pDocument->IncrementParsedPageCount();
+
if (m_pParser->GetCurStates())
m_LastCTM = m_pParser->GetCurStates()->m_CTM;
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index fe3f170114..a34b25d001 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -106,6 +106,9 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
void CreateNewDoc();
CPDF_Dictionary* CreateNewPage(int iPage);
+ void IncrementParsedPageCount() { ++m_ParsedPageCount; }
+ uint32_t GetParsedPageCountForTesting() { return m_ParsedPageCount; }
+
CPDF_Font* AddStandardFont(const char* font, CPDF_FontEncoding* pEncoding);
CPDF_Font* AddFont(CFX_Font* pFont, int charset, bool bVert);
#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
@@ -165,6 +168,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
bool m_bLinearized;
int m_iFirstPageNo;
uint32_t m_dwFirstPageObjNum;
+ uint32_t m_ParsedPageCount = 0;
std::unique_ptr<CPDF_DocPageData> m_pDocPage;
std::unique_ptr<CPDF_DocRenderData> m_pDocRender;
std::unique_ptr<JBig2_DocumentContext> m_pCodecContext;