Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2928)

Unified Diff: core/fpdfdoc/cpvt_generateap.cpp

Issue 2337673002: Annotations and fields do not have DR (Closed)
Patch Set: Nits Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/formfiller/cba_fontmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpvt_generateap.cpp
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index be96d2d1d3bf46bf306f60b0f9d5aa12e81127f1..8c8cb9333c4fa4c16988aabf15c66692cb7647a6 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -46,26 +46,15 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
FX_FLOAT fFontSize = FX_atof(syntax.GetWord());
CPVT_Color crText = CPVT_Color::ParseColor(DA);
- FX_BOOL bUseFormRes = FALSE;
- CPDF_Dictionary* pFontDict = nullptr;
- CPDF_Dictionary* pDRDict = pAnnotDict->GetDictBy("DR");
- if (!pDRDict) {
- pDRDict = pFormDict->GetDictBy("DR");
- bUseFormRes = TRUE;
- }
- CPDF_Dictionary* pDRFontDict = pDRDict ? pDRDict->GetDictBy("Font") : nullptr;
- if (pDRFontDict) {
- pFontDict = pDRFontDict->GetDictBy(sFontName.Mid(1));
- if (!pFontDict && !bUseFormRes) {
- pDRDict = pFormDict->GetDictBy("DR");
- pDRFontDict = pDRDict->GetDictBy("Font");
- if (pDRFontDict)
- pFontDict = pDRFontDict->GetDictBy(sFontName.Mid(1));
- }
- }
+ CPDF_Dictionary* pDRDict = pFormDict->GetDictBy("DR");
+ if (!pDRDict)
+ return false;
+
+ CPDF_Dictionary* pDRFontDict = pDRDict->GetDictBy("Font");
if (!pDRFontDict)
return false;
+ CPDF_Dictionary* pFontDict = pDRFontDict->GetDictBy(sFontName.Mid(1));
if (!pFontDict) {
pFontDict = new CPDF_Dictionary;
pFontDict->SetAtName("Type", "Font");
« no previous file with comments | « no previous file | fpdfsdk/formfiller/cba_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698