From 0158106c1c77c6af4f7195d086cb0f2d129de838 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 30 Aug 2017 14:19:26 -0700 Subject: Add truly const versions of CPDF_Document getters. Instead of only having CPDF_Dictionary* GetRoot() const, provide const CPDF_Dictionary* GetRoot() const and CPDF_Dictionary* GetRoot(). Do the same for GetInfo(). Change-Id: I6eae1208d38327fcdc7d0cd75069a01c95f4a92a Reviewed-on: https://pdfium-review.googlesource.com/11671 Commit-Queue: Lei Zhang Reviewed-by: Tom Sepez Reviewed-by: dsinclair --- fpdfsdk/fpdfview.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'fpdfsdk/fpdfview.cpp') diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index bf8daad958..2bc229d14d 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -564,12 +564,12 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_HasXFAField(FPDF_DOCUMENT document, if (!document) return false; - CPDF_Document* pdfDoc = - (static_cast(document))->GetPDFDoc(); - if (!pdfDoc) + const CPDF_Document* pDoc = + static_cast(document)->GetPDFDoc(); + if (!pDoc) return false; - CPDF_Dictionary* pRoot = pdfDoc->GetRoot(); + const CPDF_Dictionary* pRoot = pDoc->GetRoot(); if (!pRoot) return false; @@ -587,7 +587,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_HasXFAField(FPDF_DOCUMENT document, } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_LoadXFA(FPDF_DOCUMENT document) { - return document && (static_cast(document))->LoadXFADoc(); + return document && static_cast(document)->LoadXFADoc(); } #endif // PDF_ENABLE_XFA @@ -640,7 +640,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetFileVersion(FPDF_DOCUMENT doc, if (!pDoc) return false; - CPDF_Parser* pParser = pDoc->GetParser(); + const CPDF_Parser* pParser = pDoc->GetParser(); if (!pParser) return false; @@ -1349,7 +1349,7 @@ FPDF_CountNamedDests(FPDF_DOCUMENT document) { if (!pDoc) return 0; - CPDF_Dictionary* pRoot = pDoc->GetRoot(); + const CPDF_Dictionary* pRoot = pDoc->GetRoot(); if (!pRoot) return 0; @@ -1445,7 +1445,7 @@ FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDF_GetNamedDest(FPDF_DOCUMENT document, if (!pDoc) return nullptr; - CPDF_Dictionary* pRoot = pDoc->GetRoot(); + const CPDF_Dictionary* pRoot = pDoc->GetRoot(); if (!pRoot) return nullptr; -- cgit v1.2.3