From ee96772e0878fa385b9a4a736a2fc109e19fd01e Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 19 Apr 2018 20:55:54 +0000 Subject: Add public APIs for undo / redo in forms. Add FORM_CanUndo(), FORM_CanRedo(), FORM_Undo(), and FORM_Redo(). BUG=chromium:764260 Change-Id: I1d9ea67152d9b35d9b8e1d7ef7d019706fdfa30a Reviewed-on: https://pdfium-review.googlesource.com/30872 Commit-Queue: Lei Zhang Reviewed-by: dsinclair --- fpdfsdk/cpdfsdk_widgethandler.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'fpdfsdk/cpdfsdk_widgethandler.cpp') diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp index 6281058059..17d783fcbe 100644 --- a/fpdfsdk/cpdfsdk_widgethandler.cpp +++ b/fpdfsdk/cpdfsdk_widgethandler.cpp @@ -299,6 +299,30 @@ void CPDFSDK_WidgetHandler::ReplaceSelection(CPDFSDK_Annot* pAnnot, m_pFormFiller->ReplaceSelection(pAnnot, text); } +bool CPDFSDK_WidgetHandler::CanUndo(CPDFSDK_Annot* pAnnot) { + if (!pAnnot->IsSignatureWidget() && m_pFormFiller) + return m_pFormFiller->CanUndo(pAnnot); + return false; +} + +bool CPDFSDK_WidgetHandler::CanRedo(CPDFSDK_Annot* pAnnot) { + if (!pAnnot->IsSignatureWidget() && m_pFormFiller) + return m_pFormFiller->CanRedo(pAnnot); + return false; +} + +bool CPDFSDK_WidgetHandler::Undo(CPDFSDK_Annot* pAnnot) { + if (!pAnnot->IsSignatureWidget() && m_pFormFiller) + return m_pFormFiller->Undo(pAnnot); + return false; +} + +bool CPDFSDK_WidgetHandler::Redo(CPDFSDK_Annot* pAnnot) { + if (!pAnnot->IsSignatureWidget() && m_pFormFiller) + return m_pFormFiller->Redo(pAnnot); + return false; +} + bool CPDFSDK_WidgetHandler::HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, const CFX_PointF& point) { -- cgit v1.2.3