summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-22 16:01:17 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-22 20:48:24 +0200
commit84522fc8798cf0d89835f58f4b335b0045a50bfb (patch)
tree86ef30cc0104fc8bf6a0ff36f3c8747e4166b65b /sfx2
parentdf8f780cc24410d2fec5c4d4e1ed58d492559241 (diff)
merge duplicate GetFocus implementations
Change-Id: Ifc2e3fab6dacb3b0bca74c0584c16170b8b97de4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99234 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/inet/inettbc.cxx9
-rw-r--r--sfx2/source/view/classificationcontroller.cxx8
2 files changed, 4 insertions, 13 deletions
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 1e11800c3b91..17dd5de0b61c 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -71,6 +71,8 @@ public:
: InterimItemWindow(pParent, "sfx/ui/urlbox.ui", "URLBox")
, m_xWidget(new SvtURLBox(m_xBuilder->weld_combo_box("urlbox")))
{
+ InitControlBase(m_xWidget->getWidget());
+
m_xWidget->connect_key_press(LINK(this, URLBoxItemWindow, KeyInputHdl));
int nWidth = GetDesktopRectPixel().GetWidth() > 800 ? 300 : 225;
@@ -88,13 +90,6 @@ public:
InterimItemWindow::dispose();
}
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
-
void set_sensitive(bool bSensitive)
{
Enable(bSensitive);
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx
index 53eccc0ba587..9493a77ff314 100644
--- a/sfx2/source/view/classificationcontroller.cxx
+++ b/sfx2/source/view/classificationcontroller.cxx
@@ -104,12 +104,6 @@ class SAL_WARN_UNUSED ClassificationControl final : public InterimItemWindow
void SetOptimalSize();
void DataChanged(const DataChangedEvent& rEvent) override;
- void GetFocus() override
- {
- if (m_xCategory)
- m_xCategory->grab_focus();
- InterimItemWindow::GetFocus();
- }
public:
explicit ClassificationControl(vcl::Window* pParent);
@@ -262,6 +256,8 @@ ClassificationControl::ClassificationControl(vcl::Window* pParent)
, m_xLabel(m_xBuilder->weld_label("label"))
, m_xCategory(m_xBuilder->weld_combo_box("combobox"))
{
+ InitControlBase(m_xCategory.get());
+
m_xCategory->connect_key_press(LINK(this, ClassificationControl, KeyInputHdl));
// WB_NOLABEL means here that the control won't be replaced with a label