diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-07-25 23:25:55 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-25 23:25:55 +0000 |
commit | 11a6becb837a16972ffda8f94c8fb69ae100f3f4 (patch) | |
tree | 38f7e3508f1ef221eabd62b14665e78437da2d8f /fpdfsdk/cpdfsdk_annothandlermgr.cpp | |
parent | 91b8302dec04ca4ddc1f91545d192350665580cf (diff) | |
download | pdfium-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_annothandlermgr.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_annothandlermgr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp index 09d844f809..15ebfaacb4 100644 --- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp +++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp @@ -16,6 +16,7 @@ #include "fpdfsdk/cpdfsdk_datetime.h" #include "fpdfsdk/cpdfsdk_formfillenvironment.h" #include "fpdfsdk/cpdfsdk_pageview.h" +#include "fpdfsdk/cpdfsdk_widget.h" #include "fpdfsdk/cpdfsdk_widgethandler.h" #include "third_party/base/ptr_util.h" @@ -330,8 +331,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, #endif // PDF_ENABLE_XFA // For PDF annots. - ASSERT(pSDKAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::WIDGET); - CPDFSDK_AnnotIterator ai(pSDKAnnot->GetPageView(), - pSDKAnnot->GetAnnotSubtype()); - return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot); + CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pSDKAnnot); + CPDFSDK_AnnotIterator ai(pWidget->GetPageView(), pWidget->GetAnnotSubtype()); + return bNext ? ai.GetNextAnnot(pWidget) : ai.GetPrevAnnot(pWidget); } |