summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-08-30 14:19:26 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-08-30 22:17:09 +0000
commit0158106c1c77c6af4f7195d086cb0f2d129de838 (patch)
treeaed97db22abfaab6424378436c925a37d832c0e7 /fpdfsdk/formfiller
parent4793f3474f2778dbbd225d797f011db0f45e0953 (diff)
downloadpdfium-0158106c1c77c6af4f7195d086cb0f2d129de838.tar.xz
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 <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller')
-rw-r--r--fpdfsdk/formfiller/cba_fontmap.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index 577faf4b8f..c3ab2b8f56 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -89,7 +89,7 @@ CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString* sFontAlias,
return nullptr;
CPDF_Document* pDocument = GetDocument();
- CPDF_Dictionary* pRootDict = pDocument->GetRoot();
+ const CPDF_Dictionary* pRootDict = pDocument->GetRoot();
if (!pRootDict)
return nullptr;
@@ -198,7 +198,8 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString* sAlias) {
CPDF_Dictionary* pAcroFormDict = nullptr;
const bool bWidget = (m_pAnnotDict->GetStringFor("Subtype") == "Widget");
if (bWidget) {
- if (CPDF_Dictionary* pRootDict = m_pDocument->GetRoot())
+ const CPDF_Dictionary* pRootDict = m_pDocument->GetRoot();
+ if (pRootDict)
pAcroFormDict = pRootDict->GetDictFor("AcroForm");
}