Remove two CFWL_Widget methods.
- All derived classes override the empty OnDrawWidget() method.
- Inline RegisterEventTarget() into the only caller.
Change-Id: Ibd7b2b5cbd119ce367e465ffde398f45d4bf8e8d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/86632
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp
index 28129ad..aeb949e 100644
--- a/xfa/fwl/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/cfwl_datetimepicker.cpp
@@ -39,8 +39,9 @@
m_pMonthCal->SetWidgetRect(
CFX_RectF(0, 0, m_pMonthCal->GetAutosizedWidgetRect().Size()));
- RegisterEventTarget(m_pMonthCal);
- RegisterEventTarget(m_pEdit);
+ CFWL_NoteDriver* pNoteDriver = GetFWLApp()->GetNoteDriver();
+ pNoteDriver->RegisterEventTarget(this, m_pMonthCal);
+ pNoteDriver->RegisterEventTarget(this, m_pEdit);
}
CFWL_DateTimePicker::~CFWL_DateTimePicker() = default;
diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp
index 236a5eb..a5328ac 100644
--- a/xfa/fwl/cfwl_widget.cpp
+++ b/xfa/fwl/cfwl_widget.cpp
@@ -258,11 +258,6 @@
pDriver->SetGrab(bSet ? this : nullptr);
}
-void CFWL_Widget::RegisterEventTarget(CFWL_Widget* pEventSource) {
- CFWL_NoteDriver* pNoteDriver = GetFWLApp()->GetNoteDriver();
- pNoteDriver->RegisterEventTarget(this, pEventSource);
-}
-
void CFWL_Widget::UnregisterEventTarget() {
CFWL_NoteDriver* pNoteDriver = GetFWLApp()->GetNoteDriver();
pNoteDriver->UnregisterEventTarget(this);
@@ -350,9 +345,6 @@
void CFWL_Widget::OnProcessEvent(CFWL_Event* pEvent) {}
-void CFWL_Widget::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
- const CFX_Matrix& matrix) {}
-
CFWL_Widget::ScopedUpdateLock::ScopedUpdateLock(CFWL_Widget* widget)
: widget_(widget) {
widget_->LockUpdate();
diff --git a/xfa/fwl/cfwl_widget.h b/xfa/fwl/cfwl_widget.h
index 5cac2be..f1f1dab 100644
--- a/xfa/fwl/cfwl_widget.h
+++ b/xfa/fwl/cfwl_widget.h
@@ -118,8 +118,6 @@
// IFWL_WidgetDelegate:
void OnProcessMessage(CFWL_Message* pMessage) override;
void OnProcessEvent(CFWL_Event* pEvent) override;
- void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
- const CFX_Matrix& matrix) override;
void InflateWidgetRect(CFX_RectF& rect);
void SetWidgetRect(const CFX_RectF& rect);
@@ -172,7 +170,6 @@
FDE_TextAlignment iTTOAlign,
CFX_RectF* pRect);
void SetGrab(bool bSet);
- void RegisterEventTarget(CFWL_Widget* pEventSource);
void UnregisterEventTarget();
void DispatchEvent(CFWL_Event* pEvent);
void DrawBorder(CFGAS_GEGraphics* pGraphics,