Index: core/fpdfdoc/cpdf_annot.cpp |
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp |
index 4e0b04e9b623195c36ff47093d66f53cf7d53941..f06f476df5d8a91792506ef07236901b5c84a4e6 100644 |
--- a/core/fpdfdoc/cpdf_annot.cpp |
+++ b/core/fpdfdoc/cpdf_annot.cpp |
@@ -322,6 +322,19 @@ FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage, |
CPDF_RenderContext* pContext, |
const CFX_Matrix* pUser2Device, |
AppearanceMode mode) { |
+ if (IsAnnotationHidden(m_pAnnotDict)) |
Lei Zhang
2016/09/09 07:09:01
The newly added code is the same as the code in Dr
jaepark
2016/09/09 18:44:32
Done.
|
+ return FALSE; |
+ |
+ if (m_nSubtype == CPDF_Annot::Subtype::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. |
+ // If for a reason the object is no longer hidden, but still does not have |
+ // its "AP" generated, generate it now. |
+ GenerateAPIfNeeded(); |
+ |
CFX_Matrix matrix; |
CPDF_Form* pForm = |
FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); |