summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_annothandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fsdk_annothandler.cpp')
-rw-r--r--fpdfsdk/src/fsdk_annothandler.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp
index b1b2e2cc76..d6a2c00bd6 100644
--- a/fpdfsdk/src/fsdk_annothandler.cpp
+++ b/fpdfsdk/src/fsdk_annothandler.cpp
@@ -57,7 +57,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot* pAnnot,
return pAnnotHandler->NewAnnot(pAnnot, pPageView);
}
- return new CPDFSDK_Annot(pAnnot, pPageView);
+ return new CPDFSDK_BAAnnot(pAnnot, pPageView);
}
void CPDFSDK_AnnotHandlerMgr::ReleaseAnnot(CPDFSDK_Annot* pAnnot) {
@@ -100,9 +100,9 @@ IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(
ASSERT(pAnnot != NULL);
CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
- ASSERT(pPDFAnnot != NULL);
-
- return GetAnnotHandler(pPDFAnnot->GetSubType());
+ if (pPDFAnnot)
+ return GetAnnotHandler(pPDFAnnot->GetSubType());
+ return nullptr;
}
IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(
@@ -121,7 +121,8 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView,
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
} else {
- pAnnot->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+ ((CPDFSDK_BAAnnot*)pAnnot)
+ ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
}
}
@@ -384,7 +385,8 @@ void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
CFX_ByteString sSubType = pAnnot->GetSubType();
if (sSubType == BFFT_SIGNATURE) {
- pAnnot->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+ ((CPDFSDK_BAAnnot*)pAnnot)
+ ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
} else {
if (m_pFormFiller) {
m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);