summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_widget.h
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/cpdfsdk_widget.h')
-rw-r--r--fpdfsdk/cpdfsdk_widget.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.h b/fpdfsdk/cpdfsdk_widget.h
index 97971c8342..1349981293 100644
--- a/fpdfsdk/cpdfsdk_widget.h
+++ b/fpdfsdk/cpdfsdk_widget.h
@@ -144,4 +144,10 @@ class CPDFSDK_Widget : public CPDFSDK_BAAnnot {
#endif // PDF_ENABLE_XFA
};
+inline CPDFSDK_Widget* ToCPDFSDKWidget(CPDFSDK_Annot* pAnnot) {
+ return pAnnot && pAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::WIDGET
+ ? static_cast<CPDFSDK_Widget*>(pAnnot)
+ : nullptr;
+}
+
#endif // FPDFSDK_CPDFSDK_WIDGET_H_