Chromium Code Reviews| Index: core/fpdfdoc/cpdf_annot.cpp |
| diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp |
| index df12e9a82ef7428c7800f109e41eb89b973bc68f..c5041f8e24d05f03849674cf99d427bb5ab749c9 100644 |
| --- a/core/fpdfdoc/cpdf_annot.cpp |
| +++ b/core/fpdfdoc/cpdf_annot.cpp |
| @@ -21,13 +21,17 @@ |
| 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) { |
| if (m_sSubtype == "Circle") |
| CPVT_GenerateAP::GenerateCircleAP(m_pDocument, m_pAnnotDict); |
| else if (m_sSubtype == "Highlight") |
| CPVT_GenerateAP::GenerateHighlightAP(m_pDocument, m_pAnnotDict); |
| else if (m_sSubtype == "Ink") |
| CPVT_GenerateAP::GenerateInkAP(m_pDocument, m_pAnnotDict); |
| + else if (m_sSubtype == "Popup") |
|
dsinclair
2016/08/24 14:00:20
Should we switch m_sSubtype to be an enum class? W
jaepark
2016/08/24 18:37:48
I'd like to do this in another CL if that's OK sin
dsinclair
2016/08/24 18:56:26
As a followup Cl is fine.
jaepark
2016/08/26 02:37:29
Acknowledged.
|
| + CPVT_GenerateAP::GeneratePopupAP(m_pDocument, m_pAnnotDict); |
| else if (m_sSubtype == "Square") |
| CPVT_GenerateAP::GenerateSquareAP(m_pDocument, m_pAnnotDict); |
| else if (m_sSubtype == "Squiggly") |
| @@ -149,6 +153,9 @@ FX_BOOL CPDF_Annot::DrawAppearance(CPDF_Page* pPage, |
| if (IsAnnotationHidden(m_pAnnotDict)) |
| return FALSE; |
| + if (m_sSubtype == "Popup" && !m_bOpenState) |
| + return FALSE; |
| + |
| CFX_Matrix matrix; |
| CPDF_Form* pForm = |
| FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); |