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

Unified Diff: core/fpdfdoc/cpdf_annot.cpp

Issue 2273893002: Display content of the annotation when mouse hover. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Display content of the annotation when mouse hover. 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 | « DEPS ('k') | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »
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 10360eaf68517e1454493795cd3eeb5f4c395377..e79acab7a09c40ec9c792810f9a68b5a92d784da 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.
« no previous file with comments | « DEPS ('k') | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698