summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cba_fontmap.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-21 14:38:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-21 14:38:28 -0700
commit907a5223ea5abd09878de20cc74c59ebd0d6c3c8 (patch)
tree7dba8b090eda4f65da57d1979bdb02cedd273055 /fpdfsdk/formfiller/cba_fontmap.cpp
parent56a8b1944d555ed65dda97164b702a9a657485ca (diff)
downloadpdfium-907a5223ea5abd09878de20cc74c59ebd0d6c3c8.tar.xz
Use FXFONT defines in place of integers.
Fix nits along the way. Review-Url: https://codereview.chromium.org/2083943003
Diffstat (limited to 'fpdfsdk/formfiller/cba_fontmap.cpp')
-rw-r--r--fpdfsdk/formfiller/cba_fontmap.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index 9102b7bf9a..b8c8865d44 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -79,24 +79,23 @@ void CBA_FontMap::SetDefaultFont(CPDF_Font* pFont,
CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias,
int32_t nCharset) {
- if (m_pAnnotDict->GetStringBy("Subtype") == "Widget") {
- CPDF_Document* pDocument = GetDocument();
- CPDF_Dictionary* pRootDict = pDocument->GetRoot();
- if (!pRootDict)
- return nullptr;
+ if (m_pAnnotDict->GetStringBy("Subtype") != "Widget")
+ return nullptr;
- CPDF_Dictionary* pAcroFormDict = pRootDict->GetDictBy("AcroForm");
- if (!pAcroFormDict)
- return nullptr;
+ CPDF_Document* pDocument = GetDocument();
+ CPDF_Dictionary* pRootDict = pDocument->GetRoot();
+ if (!pRootDict)
+ return nullptr;
- CPDF_Dictionary* pDRDict = pAcroFormDict->GetDictBy("DR");
- if (!pDRDict)
- return nullptr;
+ CPDF_Dictionary* pAcroFormDict = pRootDict->GetDictBy("AcroForm");
+ if (!pAcroFormDict)
+ return nullptr;
- return FindResFontSameCharset(pDRDict, sFontAlias, nCharset);
- }
+ CPDF_Dictionary* pDRDict = pAcroFormDict->GetDictBy("DR");
+ if (!pDRDict)
+ return nullptr;
- return nullptr;
+ return FindResFontSameCharset(pDRDict, sFontAlias, nCharset);
}
CPDF_Document* CBA_FontMap::GetDocument() {