diff options
Diffstat (limited to 'core/fpdfdoc/cpdf_annot.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_annot.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp index 10360eaf68..e79acab7a0 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. |