summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_widgethandler.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-07-25 23:25:55 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-25 23:25:55 +0000
commit11a6becb837a16972ffda8f94c8fb69ae100f3f4 (patch)
tree38f7e3508f1ef221eabd62b14665e78437da2d8f /fpdfsdk/cpdfsdk_widgethandler.cpp
parent91b8302dec04ca4ddc1f91545d192350665580cf (diff)
downloadpdfium-11a6becb837a16972ffda8f94c8fb69ae100f3f4.tar.xz
Remove some ASSERT (and cast) in favor of checked cases.
Because it is a stronger pattern at runtime. These were found by essentially: grep -ni '\bassert\b.*type' Change-Id: I913d77139053e8980528597a6633e1859e5204c4 Reviewed-on: https://pdfium-review.googlesource.com/38890 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_widgethandler.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_widgethandler.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp
index a21063d55e..12ae17372a 100644
--- a/fpdfsdk/cpdfsdk_widgethandler.cpp
+++ b/fpdfsdk/cpdfsdk_widgethandler.cpp
@@ -31,11 +31,10 @@ CPDFSDK_WidgetHandler::CPDFSDK_WidgetHandler(
CPDFSDK_WidgetHandler::~CPDFSDK_WidgetHandler() {}
bool CPDFSDK_WidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
- ASSERT(pAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::WIDGET);
- if (pAnnot->IsSignatureWidget())
+ CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
+ if (pWidget->IsSignatureWidget())
return false;
- CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
if (!pWidget->IsVisible())
return false;