diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-19 20:55:54 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-19 20:55:54 +0000 |
commit | ee96772e0878fa385b9a4a736a2fc109e19fd01e (patch) | |
tree | def5fed9024c0aef25d7d1f81729b6f0a6687179 /fpdfsdk/cpdfsdk_xfawidgethandler.cpp | |
parent | c84ea8eda5a53229cf1faaed7cb54013b9ea18c3 (diff) | |
download | pdfium-ee96772e0878fa385b9a4a736a2fc109e19fd01e.tar.xz |
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 <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_xfawidgethandler.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_xfawidgethandler.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp index 261c27c384..16692b3d25 100644 --- a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp +++ b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp @@ -125,6 +125,34 @@ void CPDFSDK_XFAWidgetHandler::ReplaceSelection(CPDFSDK_Annot* pAnnot, return pWidgetHandler->PasteText(pAnnot->GetXFAWidget(), text); } +bool CPDFSDK_XFAWidgetHandler::CanUndo(CPDFSDK_Annot* pAnnot) { + if (!pAnnot) + return false; + CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); + return pWidgetHandler->CanUndo(pAnnot->GetXFAWidget()); +} + +bool CPDFSDK_XFAWidgetHandler::CanRedo(CPDFSDK_Annot* pAnnot) { + if (!pAnnot) + return false; + CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); + return pWidgetHandler->CanRedo(pAnnot->GetXFAWidget()); +} + +bool CPDFSDK_XFAWidgetHandler::Undo(CPDFSDK_Annot* pAnnot) { + if (!pAnnot) + return false; + CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); + return pWidgetHandler->Undo(pAnnot->GetXFAWidget()); +} + +bool CPDFSDK_XFAWidgetHandler::Redo(CPDFSDK_Annot* pAnnot) { + if (!pAnnot) + return false; + CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); + return pWidgetHandler->Redo(pAnnot->GetXFAWidget()); +} + bool CPDFSDK_XFAWidgetHandler::HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, const CFX_PointF& point) { |