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

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: Removing useless comments. 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
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);
« no previous file with comments | « BUILD.gn ('k') | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | core/fpdfdoc/cpdf_annotlist.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698