summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-05 13:57:29 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-05 13:57:29 +0000
commitfbcc5d9afb4506eea1003d024a5fac5d601cc196 (patch)
tree5ae5371f5216b1c6d9623534e1261ac606337280 /core/fpdfapi/parser
parentac42dd2d4b5bfefcbdd023b196db45bff94a1a7c (diff)
downloadpdfium-fbcc5d9afb4506eea1003d024a5fac5d601cc196.tar.xz
Add test for FPDF_GetPageSizeByIndex()
Ensure that FPDF_GetPageSizeByIndex() doesn't do a full page parse. Issue was noticed on CL https://pdfium-review.googlesource.com/32830 Change-Id: I51966e0b91e1a002d33ee51f00c0428fa1cda04d Reviewed-on: https://pdfium-review.googlesource.com/33792 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_document.h4
1 files changed, 4 insertions, 0 deletions
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;