From b1ec280837cc6e1932754ef40de26d12b77aa910 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 25 May 2018 21:55:24 +0000 Subject: Add proper const/non-const versions of CPDF_Dictionary::GetDictFor(). BUG=pdfium:234 Change-Id: I6fde00c976ad4bb9cab632f465cf292f5b1da3d2 Reviewed-on: https://pdfium-review.googlesource.com/32914 Commit-Queue: Lei Zhang Reviewed-by: dsinclair --- fpdfsdk/formfiller/cba_fontmap.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/formfiller/cba_fontmap.cpp') diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp index 6b31de7b37..d219ca40b7 100644 --- a/fpdfsdk/formfiller/cba_fontmap.cpp +++ b/fpdfsdk/formfiller/cba_fontmap.cpp @@ -93,11 +93,11 @@ CPDF_Font* CBA_FontMap::FindFontSameCharset(ByteString* sFontAlias, if (!pRootDict) return nullptr; - CPDF_Dictionary* pAcroFormDict = pRootDict->GetDictFor("AcroForm"); + const CPDF_Dictionary* pAcroFormDict = pRootDict->GetDictFor("AcroForm"); if (!pAcroFormDict) return nullptr; - CPDF_Dictionary* pDRDict = pAcroFormDict->GetDictFor("DR"); + const CPDF_Dictionary* pDRDict = pAcroFormDict->GetDictFor("DR"); if (!pDRDict) return nullptr; @@ -108,13 +108,13 @@ CPDF_Document* CBA_FontMap::GetDocument() { return m_pDocument.Get(); } -CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict, +CPDF_Font* CBA_FontMap::FindResFontSameCharset(const CPDF_Dictionary* pResDict, ByteString* sFontAlias, int32_t nCharset) { if (!pResDict) return nullptr; - CPDF_Dictionary* pFonts = pResDict->GetDictFor("Font"); + const CPDF_Dictionary* pFonts = pResDict->GetDictFor("Font"); if (!pFonts) return nullptr; @@ -197,7 +197,7 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(ByteString* sAlias) { CPDF_Dictionary* pAcroFormDict = nullptr; const bool bWidget = (m_pAnnotDict->GetStringFor("Subtype") == "Widget"); if (bWidget) { - const CPDF_Dictionary* pRootDict = m_pDocument->GetRoot(); + CPDF_Dictionary* pRootDict = m_pDocument->GetRoot(); if (pRootDict) pAcroFormDict = pRootDict->GetDictFor("AcroForm"); } -- cgit v1.2.3