Index: core/fpdfdoc/cpdf_annot.cpp |
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp |
index 10360eaf68517e1454493795cd3eeb5f4c395377..e79acab7a09c40ec9c792810f9a68b5a92d784da 100644 |
--- a/core/fpdfdoc/cpdf_annot.cpp |
+++ b/core/fpdfdoc/cpdf_annot.cpp |
@@ -21,7 +21,9 @@ |
CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument) |
: m_pAnnotDict(pDict), |
m_pDocument(pDocument), |
- m_sSubtype(m_pAnnotDict->GetStringBy("Subtype")) { |
+ m_sSubtype(m_pAnnotDict->GetStringBy("Subtype")), |
+ m_bOpenState(false), |
+ m_pPopupAnnot(nullptr) { |
GenerateAPIfNeeded(); |
} |
@@ -36,6 +38,8 @@ void CPDF_Annot::GenerateAPIfNeeded() { |
CPVT_GenerateAP::GenerateHighlightAP(m_pDocument, m_pAnnotDict); |
else if (m_sSubtype == "Ink") |
CPVT_GenerateAP::GenerateInkAP(m_pDocument, m_pAnnotDict); |
+ else if (m_sSubtype == "Popup") |
+ CPVT_GenerateAP::GeneratePopupAP(m_pDocument, m_pAnnotDict); |
else if (m_sSubtype == "Square") |
CPVT_GenerateAP::GenerateSquareAP(m_pDocument, m_pAnnotDict); |
else if (m_sSubtype == "Squiggly") |
@@ -152,6 +156,9 @@ FX_BOOL CPDF_Annot::DrawAppearance(CPDF_Page* pPage, |
if (IsAnnotationHidden(m_pAnnotDict)) |
return FALSE; |
+ if (m_sSubtype == "Popup" && !m_bOpenState) |
+ return FALSE; |
+ |
// It might happen that by the time this annotation instance was created, |
// it was flagged as "hidden" (e.g. /F 2), and hence CPVT_GenerateAP decided |
// to not "generate" its AP. |