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

Unified Diff: core/fpdfdoc/cpvt_generateap.cpp

Issue 2239853002: Hidden annotations should not be drawn (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpvt_generateap.cpp
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index f15869b13004d4021c5f15f9b30ac76a566abf83..c15a2118f69d5ca9695d7d9223f306f5ca91d3c4 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -14,6 +14,7 @@
#include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h"
#include "core/fpdfdoc/cpvt_color.h"
#include "core/fpdfdoc/cpvt_fontmap.h"
+#include "core/fpdfdoc/include/cpdf_annot.h"
#include "core/fpdfdoc/include/cpdf_formfield.h"
#include "core/fpdfdoc/include/cpvt_word.h"
@@ -619,6 +620,10 @@ bool CPVT_GenerateAP::GenerateCircleAP(CPDF_Document* pDoc,
if (pAnnotDict->KeyExist("AP"))
return false;
+ uint32_t flags = pAnnotDict->GetIntegerBy("F");
+ if (flags & ANNOTFLAG_HIDDEN)
+ return false;
+
jaepark 2016/08/11 21:39:20 Wouldn't the annotation still be drawn if it has a
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -695,6 +700,10 @@ bool CPVT_GenerateAP::GenerateHighlightAP(CPDF_Document* pDoc,
if (pAnnotDict->KeyExist("AP"))
return false;
+ uint32_t flags = pAnnotDict->GetIntegerBy("F");
+ if (flags & ANNOTFLAG_HIDDEN)
+ return false;
+
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -725,6 +734,10 @@ bool CPVT_GenerateAP::GenerateInkAP(CPDF_Document* pDoc,
if (pAnnotDict->KeyExist("AP"))
return false;
+ uint32_t flags = pAnnotDict->GetIntegerBy("F");
+ if (flags & ANNOTFLAG_HIDDEN)
+ return false;
+
FX_FLOAT fBorderWidth = GetBorderWidth(*pAnnotDict);
bool bIsStroke = fBorderWidth > 0;
@@ -781,6 +794,10 @@ bool CPVT_GenerateAP::GenerateUnderlineAP(CPDF_Document* pDoc,
if (pAnnotDict->KeyExist("AP"))
return false;
+ uint32_t flags = pAnnotDict->GetIntegerBy("F");
+ if (flags & ANNOTFLAG_HIDDEN)
dsinclair 2016/08/12 03:06:58 if flags is just used in the if no need to store i
+ return false;
+
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -810,6 +827,10 @@ bool CPVT_GenerateAP::GenerateSquareAP(CPDF_Document* pDoc,
if (pAnnotDict->KeyExist("AP"))
return false;
+ uint32_t flags = pAnnotDict->GetIntegerBy("F");
+ if (flags & ANNOTFLAG_HIDDEN)
+ return false;
+
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -860,6 +881,10 @@ bool CPVT_GenerateAP::GenerateSquigglyAP(CPDF_Document* pDoc,
if (pAnnotDict->KeyExist("AP"))
return false;
+ uint32_t flags = pAnnotDict->GetIntegerBy("F");
+ if (flags & ANNOTFLAG_HIDDEN)
+ return false;
+
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -911,6 +936,10 @@ bool CPVT_GenerateAP::GenerateStrikeOutAP(CPDF_Document* pDoc,
if (pAnnotDict->KeyExist("AP"))
return false;
+ uint32_t flags = pAnnotDict->GetIntegerBy("F");
+ if (flags & ANNOTFLAG_HIDDEN)
+ return false;
+
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698