summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_datetimepicker.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-07-16 21:17:46 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-16 21:17:46 +0000
commit31781107f6bda92e732fed805f62e8512bc78149 (patch)
tree7a08649ac5a490ce68925b9c762f176ee6629316 /xfa/fwl/cfwl_datetimepicker.cpp
parentc30b4e16885c8fd5f59965f48b61ec033ae4691a (diff)
downloadpdfium-31781107f6bda92e732fed805f62e8512bc78149.tar.xz
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 <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_datetimepicker.cpp')
-rw-r--r--xfa/fwl/cfwl_datetimepicker.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp
index 8c37e1dbe8..0af01fb2a1 100644
--- a/xfa/fwl/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/cfwl_datetimepicker.cpp
@@ -178,6 +178,10 @@ WideString CFWL_DateTimePicker::GetEditText() const {
return m_pEdit ? m_pEdit->GetText() : L"";
}
+int32_t CFWL_DateTimePicker::GetEditTextLength() const {
+ return m_pEdit ? m_pEdit->GetTextLength() : 0;
+}
+
CFX_RectF CFWL_DateTimePicker::GetBBox() const {
CFX_RectF rect = m_pProperties->m_rtWidget;
if (NeedsToShowButton())
@@ -460,3 +464,43 @@ void CFWL_DateTimePicker::GetPopupPos(float fMinHeight,
m_pWidgetMgr->GetAdapterPopupPos(this, fMinHeight, fMaxHeight, rtAnchor,
pPopupRect);
}
+
+void CFWL_DateTimePicker::ClearText() {
+ m_pEdit->ClearText();
+}
+
+void CFWL_DateTimePicker::SelectAll() {
+ m_pEdit->SelectAll();
+}
+
+void CFWL_DateTimePicker::ClearSelection() {
+ m_pEdit->ClearSelection();
+}
+
+Optional<WideString> CFWL_DateTimePicker::Copy() {
+ return m_pEdit->Copy();
+}
+
+Optional<WideString> CFWL_DateTimePicker::Cut() {
+ return m_pEdit->Cut();
+}
+
+bool CFWL_DateTimePicker::Paste(const WideString& wsPaste) {
+ return m_pEdit->Paste(wsPaste);
+}
+
+bool CFWL_DateTimePicker::Undo() {
+ return m_pEdit->Undo();
+}
+
+bool CFWL_DateTimePicker::Redo() {
+ return m_pEdit->Redo();
+}
+
+bool CFWL_DateTimePicker::CanUndo() {
+ return m_pEdit->CanUndo();
+}
+
+bool CFWL_DateTimePicker::CanRedo() {
+ return m_pEdit->CanRedo();
+}