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

Unified Diff: core/fpdfdoc/cpdf_annot.cpp

Issue 2239853002: Hidden annotations should not be drawn (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Hidden annotations should not be drawn Created 4 years, 4 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 | core/fpdfdoc/cpvt_generateap.cpp » ('j') | core/fpdfdoc/include/cpdf_annot.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_annot.cpp
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index 2b9b936cd1b54b2e95cd71f048a837bf77ff3cb2..47dd4cfe1cd982513a7709b426019df115aa427f 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -133,11 +133,19 @@ static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage,
matrix.Concat(*pUser2Device);
return pForm;
}
+
+FX_BOOL CPDF_Annot::IsAnnotationHidden(CPDF_Dictionary* pAnnotDict) {
dsinclair 2016/08/15 13:39:00 Add a // static. comment before the method.
tonikitoo 2016/08/15 13:51:02 Done.
+ return pAnnotDict->GetIntegerBy("F") & ANNOTFLAG_HIDDEN;
+}
+
FX_BOOL CPDF_Annot::DrawAppearance(CPDF_Page* pPage,
CFX_RenderDevice* pDevice,
const CFX_Matrix* pUser2Device,
AppearanceMode mode,
const CPDF_RenderOptions* pOptions) {
+ if (IsAnnotationHidden(m_pAnnotDict))
+ return FALSE;
+
CFX_Matrix matrix;
CPDF_Form* pForm =
FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix);
« no previous file with comments | « no previous file | core/fpdfdoc/cpvt_generateap.cpp » ('j') | core/fpdfdoc/include/cpdf_annot.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698