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 --- core/fpdfdoc/cpvt_generateap.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core/fpdfdoc/cpvt_generateap.cpp') diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 90d5d94f7f..132e771d47 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -34,9 +34,11 @@ namespace { bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const int32_t& nWidgetType) { - CPDF_Dictionary* pFormDict = nullptr; - if (CPDF_Dictionary* pRootDict = pDoc->GetRoot()) - pFormDict = pRootDict->GetDictFor("AcroForm"); + const CPDF_Dictionary* pRootDict = pDoc->GetRoot(); + if (!pRootDict) + return false; + + const CPDF_Dictionary* pFormDict = pRootDict->GetDictFor("AcroForm"); if (!pFormDict) return false; -- cgit v1.2.3