diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/cpdfsdk_annothandlermgr.cpp | 6 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_baannothandler.cpp | 9 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_widgethandler.cpp | 3 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_xfawidgethandler.cpp | 3 | ||||
-rw-r--r-- | fpdfsdk/fpdfformfill.cpp | 1 | ||||
-rw-r--r-- | fpdfsdk/fpdfview.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/fsdk_mgr.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/include/cpdfsdk_annothandlermgr.h | 3 | ||||
-rw-r--r-- | fpdfsdk/include/cpdfsdk_baannothandler.h | 3 | ||||
-rw-r--r-- | fpdfsdk/include/cpdfsdk_widgethandler.h | 3 | ||||
-rw-r--r-- | fpdfsdk/include/cpdfsdk_xfawidgethandler.h | 3 | ||||
-rw-r--r-- | fpdfsdk/include/ipdfsdk_annothandler.h | 3 |
12 files changed, 29 insertions, 14 deletions
diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp index 12362e3781..0fd48d2aa0 100644 --- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp +++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp @@ -93,9 +93,11 @@ IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device) { + CFX_Matrix* pUser2Device, + bool bDrawAnnots) { ASSERT(pAnnot); - GetAnnotHandler(pAnnot)->OnDraw(pPageView, pAnnot, pDevice, pUser2Device); + GetAnnotHandler(pAnnot)->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, + bDrawAnnots); } FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( diff --git a/fpdfsdk/cpdfsdk_baannothandler.cpp b/fpdfsdk/cpdfsdk_baannothandler.cpp index 10071045ff..f0d67f4617 100644 --- a/fpdfsdk/cpdfsdk_baannothandler.cpp +++ b/fpdfsdk/cpdfsdk_baannothandler.cpp @@ -62,13 +62,16 @@ void CPDFSDK_BAAnnotHandler::DeleteAnnot(CPDFSDK_Annot* pAnnot) {} void CPDFSDK_BAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device) { + CFX_Matrix* pUser2Device, + bool bDrawAnnots) { #ifdef PDF_ENABLE_XFA if (pAnnot->IsXFAField()) return; #endif // PDF_ENABLE_XFA - static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance( - pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); + if (bDrawAnnots && pAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::POPUP) { + static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance( + pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); + } } void CPDFSDK_BAAnnotHandler::OnDelete(CPDFSDK_Annot* pAnnot) {} diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp index b490daa8ba..8a061e5541 100644 --- a/fpdfsdk/cpdfsdk_widgethandler.cpp +++ b/fpdfsdk/cpdfsdk_widgethandler.cpp @@ -92,7 +92,8 @@ void CPDFSDK_WidgetHandler::DeleteAnnot(CPDFSDK_Annot* pAnnot) {} void CPDFSDK_WidgetHandler::OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device) { + CFX_Matrix* pUser2Device, + bool bDrawAnnots) { if (pAnnot->IsSignatureWidget()) { static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance( pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp index 74220118ce..8621f77dbd 100644 --- a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp +++ b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp @@ -46,7 +46,8 @@ CPDFSDK_Annot* CPDFSDK_XFAWidgetHandler::NewAnnot(CXFA_FFWidget* pAnnot, void CPDFSDK_XFAWidgetHandler::OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device) { + CFX_Matrix* pUser2Device, + bool bDrawAnnots) { ASSERT(pPageView); ASSERT(pAnnot); diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index 449eac0870..2ac6c60999 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -114,6 +114,7 @@ void FFLCommon(FPDF_FORMHANDLE hHandle, options.m_BackColor = 0xffffff; } options.m_AddFlags = flags >> 8; + options.m_bDrawAnnots = flags & FPDF_ANNOT; #ifdef PDF_ENABLE_XFA options.m_pOCContext = new CPDF_OCContext(pPDFDoc, CPDF_OCContext::View); diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 1c0af1dc10..4e20751f5d 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -896,7 +896,7 @@ void FPDF_RenderPage_Retail(CPDF_PageRenderContext* pContext, pContext->m_pAnnots.reset(new CPDF_AnnotList(pPage)); FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY; pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext.get(), - bPrinting, &matrix, TRUE, nullptr); + bPrinting, &matrix, FALSE, nullptr); } pContext->m_pRenderer.reset(new CPDF_ProgressiveRenderer( diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp index 694e3154ce..c8f387e903 100644 --- a/fpdfsdk/fsdk_mgr.cpp +++ b/fpdfsdk/fsdk_mgr.cpp @@ -12,6 +12,7 @@ #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" +#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" #include "core/fpdfdoc/include/cpdf_docjsactions.h" #include "core/fpdfdoc/include/cpdf_interform.h" #include "core/fxcrt/include/cfx_retain_ptr.h" @@ -581,7 +582,8 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, CPDFSDK_AnnotIterator annotIterator(this, true); while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) { CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); - pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device); + pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device, + pOptions->m_bDrawAnnots); } } diff --git a/fpdfsdk/include/cpdfsdk_annothandlermgr.h b/fpdfsdk/include/cpdfsdk_annothandlermgr.h index 540bd985ac..f4be66a432 100644 --- a/fpdfsdk/include/cpdfsdk_annothandlermgr.h +++ b/fpdfsdk/include/cpdfsdk_annothandlermgr.h @@ -48,7 +48,8 @@ class CPDFSDK_AnnotHandlerMgr { virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device); + CFX_Matrix* pUser2Device, + bool bDrawAnnots); virtual void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, diff --git a/fpdfsdk/include/cpdfsdk_baannothandler.h b/fpdfsdk/include/cpdfsdk_baannothandler.h index 5425b0bf36..ba50df3ccb 100644 --- a/fpdfsdk/include/cpdfsdk_baannothandler.h +++ b/fpdfsdk/include/cpdfsdk_baannothandler.h @@ -44,7 +44,8 @@ class CPDFSDK_BAAnnotHandler : public IPDFSDK_AnnotHandler { void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device) override; + CFX_Matrix* pUser2Device, + bool bDrawAnnots) override; void OnCreate(CPDFSDK_Annot* pAnnot) override; void OnLoad(CPDFSDK_Annot* pAnnot) override; void OnDelete(CPDFSDK_Annot* pAnnot) override; diff --git a/fpdfsdk/include/cpdfsdk_widgethandler.h b/fpdfsdk/include/cpdfsdk_widgethandler.h index b8cb182bf9..d34510d092 100644 --- a/fpdfsdk/include/cpdfsdk_widgethandler.h +++ b/fpdfsdk/include/cpdfsdk_widgethandler.h @@ -44,7 +44,8 @@ class CPDFSDK_WidgetHandler : public IPDFSDK_AnnotHandler { void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device) override; + CFX_Matrix* pUser2Device, + bool bDrawAnnots) override; void OnCreate(CPDFSDK_Annot* pAnnot) override; void OnLoad(CPDFSDK_Annot* pAnnot) override; void OnDelete(CPDFSDK_Annot* pAnnot) override; diff --git a/fpdfsdk/include/cpdfsdk_xfawidgethandler.h b/fpdfsdk/include/cpdfsdk_xfawidgethandler.h index 10eb1eeb87..dec2675ed8 100644 --- a/fpdfsdk/include/cpdfsdk_xfawidgethandler.h +++ b/fpdfsdk/include/cpdfsdk_xfawidgethandler.h @@ -39,7 +39,8 @@ class CPDFSDK_XFAWidgetHandler : public IPDFSDK_AnnotHandler { void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device) override; + CFX_Matrix* pUser2Device, + bool bDrawAnnots) override; void OnCreate(CPDFSDK_Annot* pAnnot) override; void OnLoad(CPDFSDK_Annot* pAnnot) override; void OnDelete(CPDFSDK_Annot* pAnnot) override; diff --git a/fpdfsdk/include/ipdfsdk_annothandler.h b/fpdfsdk/include/ipdfsdk_annothandler.h index 289d48007f..d2f9010b76 100644 --- a/fpdfsdk/include/ipdfsdk_annothandler.h +++ b/fpdfsdk/include/ipdfsdk_annothandler.h @@ -43,7 +43,8 @@ class IPDFSDK_AnnotHandler { virtual void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device) = 0; + CFX_Matrix* pUser2Device, + bool bDrawAnnots) = 0; virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0; virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0; virtual void OnDelete(CPDFSDK_Annot* pAnnot) = 0; |