From 31781107f6bda92e732fed805f62e8512bc78149 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Mon, 16 Jul 2018 21:17:46 +0000 Subject: Fix crash when typing letters into an XFA datetime field. The root of the issue is that CXFA_FFDateTimeEdit inherits from CXFA_FFTextEdit and methods in the former treat its widget as a CFWL_Edit, while it can be a CFWL_DateTimePicker. Bug: chromium:857521 Change-Id: I764b6c03095b16f6a9cf72ff36768ca4c57c4070 Reviewed-on: https://pdfium-review.googlesource.com/37910 Reviewed-by: Ryan Harrison Commit-Queue: Henrique Nakashima --- xfa/fwl/cfwl_datetimepicker.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'xfa/fwl/cfwl_datetimepicker.h') diff --git a/xfa/fwl/cfwl_datetimepicker.h b/xfa/fwl/cfwl_datetimepicker.h index 00e7f61d73..f80f09d1bf 100644 --- a/xfa/fwl/cfwl_datetimepicker.h +++ b/xfa/fwl/cfwl_datetimepicker.h @@ -49,13 +49,24 @@ class CFWL_DateTimePicker : public CFWL_Widget { void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); void SetEditText(const WideString& wsText); + int32_t GetEditTextLength() const; WideString GetEditText() const; + void ClearText(); + void SelectAll(); + void ClearSelection(); bool HasSelection() const { return m_pEdit->HasSelection(); } // Returns of the selection. std::pair GetSelection() const { return m_pEdit->GetSelection(); } + Optional Copy(); + Optional Cut(); + bool Paste(const WideString& wsPaste); + bool Undo(); + bool Redo(); + bool CanUndo(); + bool CanRedo(); CFX_RectF GetBBox() const; void SetEditLimit(int32_t nLimit) { m_pEdit->SetLimit(nLimit); } -- cgit v1.2.3