summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-02-04 20:23:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-02-05 11:57:57 +0100
commit824a84a894755f2ce41f4612f27d2e1110676c6d (patch)
treeef34634ebdd50da780c22ff5d280a0a758edd740 /svtools
parent349593166af244566fe0a8d2c11f3bcd73048c1d (diff)
Related: tdf#146836 daisy chain together some more event handlers
so old ones are not clobbered but are called from the new ones Change-Id: I4cdd25fc1f3b13b10711d5c2f30c46645ae6c968 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129503 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx33
1 files changed, 27 insertions, 6 deletions
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index 9980d1ae469b..b6a27a2567f4 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -362,8 +362,8 @@ namespace svt
m_pEntry = pEntry;
m_pEntry->show();
m_pEntry->set_width_chars(1); // so a smaller than default width can be used
- m_pEntry->connect_key_press(LINK(this, ControlBase, KeyInputHdl));
- m_pEntry->connect_focus_in(LINK(this, ControlBase, FocusInHdl));
+ connect_key_press(LINK(this, ControlBase, KeyInputHdl));
+ connect_focus_in(LINK(this, ControlBase, FocusInHdl));
connect_focus_out(LINK(this, ControlBase, FocusOutHdl));
m_pEntry->connect_mouse_press(LINK(this, ControlBase, MousePressHdl));
m_pEntry->connect_mouse_release(LINK(this, ControlBase, MouseReleaseHdl));
@@ -447,11 +447,21 @@ namespace svt
get_formatter().connect_changed(rLink);
}
+ void FormattedControlBase::connect_focus_in(const Link<weld::Widget&, void>& rLink)
+ {
+ get_widget().connect_focus_in(rLink);
+ }
+
void FormattedControlBase::connect_focus_out(const Link<weld::Widget&, void>& rLink)
{
get_formatter().connect_focus_out(rLink);
}
+ void FormattedControlBase::connect_key_press(const Link<const KeyEvent&, bool>& rLink)
+ {
+ get_widget().connect_key_press(rLink);
+ }
+
weld::EntryFormatter& FormattedControlBase::get_formatter()
{
return *m_xEntryFormatter;
@@ -578,11 +588,11 @@ namespace svt
}
PatternControl::PatternControl(BrowserDataWin* pParent)
- : EditControl(pParent)
+ : EditControlBase(pParent)
+ , m_xWidget(m_xBuilder->weld_entry("entry"))
{
- m_xWidget->connect_key_press(Link<const KeyEvent&, bool>()); // 1) acknowledge we first remove the old one
m_xEntryFormatter.reset(new weld::PatternFormatter(*m_xWidget));
- m_xEntryFormatter->connect_key_press(LINK(this, ControlBase, KeyInputHdl)); // 2) and here we reattach via the formatter
+ InitEditControlBase(m_xWidget.get());
}
void PatternControl::connect_changed(const Link<weld::Entry&, void>& rLink)
@@ -590,15 +600,26 @@ namespace svt
m_xEntryFormatter->connect_changed(rLink);
}
+ void PatternControl::connect_focus_in(const Link<weld::Widget&, void>& rLink)
+ {
+ m_xEntryFormatter->connect_focus_in(rLink);
+ }
+
void PatternControl::connect_focus_out(const Link<weld::Widget&, void>& rLink)
{
m_xEntryFormatter->connect_focus_out(rLink);
}
+ void PatternControl::connect_key_press(const Link<const KeyEvent&, bool>& rLink)
+ {
+ m_xEntryFormatter->connect_key_press(rLink);
+ }
+
void PatternControl::dispose()
{
m_xEntryFormatter.reset();
- EditControl::dispose();
+ m_xWidget.reset();
+ EditControlBase::dispose();
}
EditCellController::EditCellController(EditControlBase* pEdit)