[Libreoffice-commits] core.git: basctl/source chart2/source dbaccess/source framework/source include/svx sc/source sd/source sfx2/source svx/source sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 22 18:49:09 UTC 2020
basctl/source/basicide/IDEComboBox.cxx | 2
basctl/source/inc/IDEComboBox.hxx | 7 -
chart2/source/controller/main/ElementSelector.cxx | 9 --
chart2/source/controller/main/ElementSelector.hxx | 2
dbaccess/source/ui/querydesign/limitboxcontroller.cxx | 9 --
framework/source/uielement/FixedImageToolbarController.cxx | 8 -
framework/source/uielement/FixedTextToolbarController.cxx | 8 -
framework/source/uielement/comboboxtoolbarcontroller.cxx | 8 -
framework/source/uielement/dropdownboxtoolbarcontroller.cxx | 8 -
framework/source/uielement/edittoolbarcontroller.cxx | 8 -
framework/source/uielement/spinfieldtoolbarcontroller.cxx | 8 -
include/svx/fillctrl.hxx | 2
sc/source/ui/app/inputwin.cxx | 9 --
sc/source/ui/inc/inputwin.hxx | 1
sd/source/ui/dlg/diactrl.cxx | 9 --
sd/source/ui/dlg/gluectrl.cxx | 9 --
sd/source/ui/inc/diactrl.hxx | 2
sd/source/ui/inc/gluectrl.hxx | 2
sfx2/source/inet/inettbc.cxx | 9 --
sfx2/source/view/classificationcontroller.cxx | 8 -
svx/source/form/tbxform.cxx | 9 --
svx/source/inc/tbxform.hxx | 2
svx/source/sidebar/paragraph/ParaSpacingWindow.cxx | 51 ++----------
svx/source/sidebar/paragraph/ParaSpacingWindow.hxx | 5 -
svx/source/tbxctrls/StylesPreviewWindow.cxx | 2
svx/source/tbxctrls/fillctrl.cxx | 9 --
svx/source/tbxctrls/grafctrl.cxx | 19 ----
svx/source/tbxctrls/itemwin.cxx | 9 --
svx/source/tbxctrls/linemetricbox.hxx | 2
svx/source/tbxctrls/tbcontrl.cxx | 10 --
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 9 --
sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx | 18 ----
sw/source/uibase/inc/inputwin.hxx | 18 ----
sw/source/uibase/ribbar/workctrl.cxx | 17 ----
34 files changed, 65 insertions(+), 243 deletions(-)
New commits:
commit 84522fc8798cf0d89835f58f4b335b0045a50bfb
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jul 22 16:01:17 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jul 22 20:48:24 2020 +0200
merge duplicate GetFocus implementations
Change-Id: Ifc2e3fab6dacb3b0bca74c0584c16170b8b97de4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99234
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/basctl/source/basicide/IDEComboBox.cxx b/basctl/source/basicide/IDEComboBox.cxx
index fc135cf1a3e4..5063eb4f45a9 100644
--- a/basctl/source/basicide/IDEComboBox.cxx
+++ b/basctl/source/basicide/IDEComboBox.cxx
@@ -91,6 +91,8 @@ DocListenerBox::DocListenerBox(vcl::Window* pParent)
, m_xWidget(m_xBuilder->weld_combo_box("combobox"))
, maNotifier(*this)
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_changed(LINK(this, DocListenerBox, SelectHdl));
m_xWidget->connect_key_press(LINK(this, DocListenerBox, KeyInputHdl));
}
diff --git a/basctl/source/inc/IDEComboBox.hxx b/basctl/source/inc/IDEComboBox.hxx
index ade0fd6732cc..220a6f84b1f0 100644
--- a/basctl/source/inc/IDEComboBox.hxx
+++ b/basctl/source/inc/IDEComboBox.hxx
@@ -96,13 +96,6 @@ protected:
virtual void Select() = 0;
virtual void FillBox() = 0;
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
-
/// key strokes the ComboBox receives
virtual bool HandleKeyInput(const KeyEvent& rKEvt);
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index e1ef40a660be..2fa6fa360616 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -56,6 +56,8 @@ SelectorListBox::SelectorListBox(vcl::Window* pParent)
, m_xWidget(m_xBuilder->weld_combo_box("combobox"))
, m_bReleaseFocus(true)
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_key_press(LINK(this, SelectorListBox, KeyInputHdl));
m_xWidget->connect_changed(LINK(this, SelectorListBox, SelectHdl));
m_xWidget->connect_focus_out(LINK(this, SelectorListBox, FocusOutHdl));
@@ -72,13 +74,6 @@ void SelectorListBox::dispose()
InterimItemWindow::dispose();
}
-void SelectorListBox::GetFocus()
-{
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
-}
-
SelectorListBox::~SelectorListBox()
{
disposeOnce();
diff --git a/chart2/source/controller/main/ElementSelector.hxx b/chart2/source/controller/main/ElementSelector.hxx
index 01cfd273c3ba..17938e30e12f 100644
--- a/chart2/source/controller/main/ElementSelector.hxx
+++ b/chart2/source/controller/main/ElementSelector.hxx
@@ -49,8 +49,6 @@ public:
virtual void dispose() override;
virtual ~SelectorListBox() override;
- virtual void GetFocus() override;
-
void ReleaseFocus_Impl();
void SetChartController( const css::uno::Reference< css::frame::XController >& xChartController );
diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
index 74d01b71134c..8b3677cee7ce 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
@@ -57,6 +57,8 @@ public:
, m_pControl( pCtrl )
, m_xWidget(m_xBuilder->weld_combo_box("limit"))
{
+ InitControlBase(m_xWidget.get());
+
LoadDefaultLimits();
m_xWidget->connect_key_press(LINK(this, LimitBox, KeyInputHdl));
@@ -83,13 +85,6 @@ public:
m_xWidget->set_sensitive(bSensitive);
}
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
-
void set_value(int nLimit)
{
if (nLimit < 0)
diff --git a/framework/source/uielement/FixedImageToolbarController.cxx b/framework/source/uielement/FixedImageToolbarController.cxx
index a666261b0f03..49377db5e555 100644
--- a/framework/source/uielement/FixedImageToolbarController.cxx
+++ b/framework/source/uielement/FixedImageToolbarController.cxx
@@ -43,12 +43,6 @@ public:
FixedImageControl(vcl::Window* pParent, const OUString& rCommand);
virtual ~FixedImageControl() override;
virtual void dispose() override;
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
DECL_LINK(KeyInputHdl, const ::KeyEvent&, bool);
private:
@@ -59,6 +53,8 @@ FixedImageControl::FixedImageControl(vcl::Window* pParent, const OUString& rComm
: InterimItemWindow(pParent, "svt/ui/fixedimagecontrol.ui", "FixedImageControl")
, m_xWidget(m_xBuilder->weld_image("image"))
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_key_press(LINK(this, FixedImageControl, KeyInputHdl));
bool bBigImages(SvtMiscOptions().AreCurrentSymbolsLarge());
diff --git a/framework/source/uielement/FixedTextToolbarController.cxx b/framework/source/uielement/FixedTextToolbarController.cxx
index a6bb5d25ad88..32b486379178 100644
--- a/framework/source/uielement/FixedTextToolbarController.cxx
+++ b/framework/source/uielement/FixedTextToolbarController.cxx
@@ -39,12 +39,6 @@ public:
FixedTextControl(vcl::Window* pParent);
virtual ~FixedTextControl() override;
virtual void dispose() override;
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
OUString get_label() const { return m_xWidget->get_label(); }
void set_label(const OUString& rLabel) { return m_xWidget->set_label(rLabel); }
DECL_LINK(KeyInputHdl, const ::KeyEvent&, bool);
@@ -57,6 +51,8 @@ FixedTextControl::FixedTextControl(vcl::Window* pParent)
: InterimItemWindow(pParent, "svt/ui/fixedtextcontrol.ui", "FixedTextControl")
, m_xWidget(m_xBuilder->weld_label("label"))
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_key_press(LINK(this, FixedTextControl, KeyInputHdl));
}
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index 9f200b2cd838..4fd3fca717bb 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -47,12 +47,6 @@ public:
ComboBoxControl(vcl::Window* pParent, ComboboxToolbarController* pComboboxToolbarController);
virtual ~ComboBoxControl() override;
virtual void dispose() override;
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
void set_active_or_entry_text(const OUString& rText);
OUString get_active_text() const { return m_xWidget->get_active_text(); }
@@ -80,6 +74,8 @@ ComboBoxControl::ComboBoxControl(vcl::Window* pParent, ComboboxToolbarController
, m_xWidget(m_xBuilder->weld_combo_box("combobox"))
, m_pComboboxToolbarController(pComboboxToolbarController)
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_focus_in(LINK(this, ComboBoxControl, FocusInHdl));
m_xWidget->connect_focus_out(LINK(this, ComboBoxControl, FocusOutHdl));
m_xWidget->connect_changed(LINK(this, ComboBoxControl, ModifyHdl));
diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
index 8c50d7229232..b694bca18ed6 100644
--- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
@@ -47,12 +47,6 @@ public:
ListBoxControl(vcl::Window* pParent, DropdownToolbarController* pListBoxListener);
virtual ~ListBoxControl() override;
virtual void dispose() override;
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
void set_active(int nPos) { m_xWidget->set_active(nPos); }
void append_text(const OUString& rStr) { m_xWidget->append_text(rStr); }
@@ -78,6 +72,8 @@ ListBoxControl::ListBoxControl(vcl::Window* pParent, DropdownToolbarController*
, m_xWidget(m_xBuilder->weld_combo_box("listbox"))
, m_pListBoxListener( pListBoxListener )
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_focus_in(LINK(this, ListBoxControl, FocusInHdl));
m_xWidget->connect_focus_out(LINK(this, ListBoxControl, FocusOutHdl));
m_xWidget->connect_changed(LINK(this, ListBoxControl, ModifyHdl));
diff --git a/framework/source/uielement/edittoolbarcontroller.cxx b/framework/source/uielement/edittoolbarcontroller.cxx
index 89ff08598fce..152b0336347c 100644
--- a/framework/source/uielement/edittoolbarcontroller.cxx
+++ b/framework/source/uielement/edittoolbarcontroller.cxx
@@ -46,12 +46,6 @@ public:
EditControl(vcl::Window* pParent, EditToolbarController* pEditToolbarController);
virtual ~EditControl() override;
virtual void dispose() override;
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
OUString get_text() const { return m_xWidget->get_text(); }
void set_text(const OUString& rText) { m_xWidget->set_text(rText); }
@@ -72,6 +66,8 @@ EditControl::EditControl(vcl::Window* pParent, EditToolbarController* pEditToolb
, m_xWidget(m_xBuilder->weld_entry("entry"))
, m_pEditToolbarController(pEditToolbarController)
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_focus_in(LINK(this, EditControl, FocusInHdl));
m_xWidget->connect_focus_out(LINK(this, EditControl, FocusOutHdl));
m_xWidget->connect_changed(LINK(this, EditControl, ModifyHdl));
diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
index dfcd5a6c4342..235fb62675f3 100644
--- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx
+++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
@@ -53,12 +53,6 @@ public:
SpinfieldControl(vcl::Window* pParent, SpinfieldToolbarController* pSpinfieldToolbarController);
virtual ~SpinfieldControl() override;
virtual void dispose() override;
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
Formatter& GetFormatter()
{
@@ -86,6 +80,8 @@ SpinfieldControl::SpinfieldControl(vcl::Window* pParent, SpinfieldToolbarControl
, m_xWidget(m_xBuilder->weld_formatted_spin_button("spinbutton"))
, m_pSpinfieldToolbarController(pSpinfieldToolbarController)
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_focus_in(LINK(this, SpinfieldControl, FocusInHdl));
m_xWidget->connect_focus_out(LINK(this, SpinfieldControl, FocusOutHdl));
Formatter& rFormatter = m_xWidget->GetFormatter();
diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx
index b81dfb417086..7155d261a090 100644
--- a/include/svx/fillctrl.hxx
+++ b/include/svx/fillctrl.hxx
@@ -102,8 +102,6 @@ public:
FillControl(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rFrame);
virtual void dispose() override;
virtual ~FillControl() override;
-
- virtual void GetFocus() override;
};
#endif // INCLUDED_SVX_FILLCTRL_HXX
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index ebca73d2f9f8..65d6bd4fbdc8 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2107,7 +2107,6 @@ void ScTextWnd::TextGrabFocus()
}
// Position window
-
ScPosWnd::ScPosWnd(vcl::Window* pParent)
: InterimItemWindow(pParent, "modules/scalc/ui/posbox.ui", "PosBox")
, m_xWidget(m_xBuilder->weld_combo_box("pos_window"))
@@ -2115,6 +2114,7 @@ ScPosWnd::ScPosWnd(vcl::Window* pParent)
, nTipVisible(nullptr)
, bFormulaMode(false)
{
+ InitControlBase(m_xWidget.get());
// Use calculation according to tdf#132338 to align combobox width to width of fontname combobox within formatting toolbar;
// formatting toolbar is placed above formulabar when using multiple toolbars typically
@@ -2135,13 +2135,6 @@ ScPosWnd::ScPosWnd(vcl::Window* pParent)
m_xWidget->connect_focus_out(LINK(this, ScPosWnd, FocusOutHdl));
}
-void ScPosWnd::GetFocus()
-{
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
-}
-
ScPosWnd::~ScPosWnd()
{
disposeOnce();
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index c461c8fdb732..7fc620eb22c1 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -166,7 +166,6 @@ public:
ScPosWnd( vcl::Window* pParent );
virtual ~ScPosWnd() override;
virtual void dispose() override;
- virtual void GetFocus() override;
void SetPos( const OUString& rPosStr ); // Displayed Text
void SetFormulaMode( bool bSet );
diff --git a/sd/source/ui/dlg/diactrl.cxx b/sd/source/ui/dlg/diactrl.cxx
index cbc7590cc9c8..aa4cff712d63 100644
--- a/sd/source/ui/dlg/diactrl.cxx
+++ b/sd/source/ui/dlg/diactrl.cxx
@@ -53,6 +53,8 @@ SdPagesField::SdPagesField( vcl::Window* pParent,
, m_xWidget(m_xBuilder->weld_spin_button("pagesfield"))
, m_xFrame(rFrame)
{
+ InitControlBase(m_xWidget.get());
+
// set parameter of MetricFields
m_xWidget->set_digits(0);
m_xWidget->set_range(1, 15);
@@ -81,13 +83,6 @@ void SdPagesField::dispose()
InterimItemWindow::dispose();
}
-void SdPagesField::GetFocus()
-{
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
-}
-
SdPagesField::~SdPagesField()
{
disposeOnce();
diff --git a/sd/source/ui/dlg/gluectrl.cxx b/sd/source/ui/dlg/gluectrl.cxx
index a52df56c78e6..8e4389dd8983 100644
--- a/sd/source/ui/dlg/gluectrl.cxx
+++ b/sd/source/ui/dlg/gluectrl.cxx
@@ -54,6 +54,8 @@ GlueEscDirLB::GlueEscDirLB(vcl::Window* pParent, const Reference<XFrame>& rFrame
, m_xFrame(rFrame)
, m_xWidget(m_xBuilder->weld_combo_box("gluetype"))
{
+ InitControlBase(m_xWidget.get());
+
Fill();
m_xWidget->connect_changed(LINK(this, GlueEscDirLB, SelectHdl));
@@ -70,13 +72,6 @@ void GlueEscDirLB::dispose()
InterimItemWindow::dispose();
}
-void GlueEscDirLB::GetFocus()
-{
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
-}
-
GlueEscDirLB::~GlueEscDirLB()
{
disposeOnce();
diff --git a/sd/source/ui/inc/diactrl.hxx b/sd/source/ui/inc/diactrl.hxx
index b9a54d62e9d0..dae2ec2def26 100644
--- a/sd/source/ui/inc/diactrl.hxx
+++ b/sd/source/ui/inc/diactrl.hxx
@@ -45,8 +45,6 @@ public:
void set_sensitive(bool bSensitive);
virtual ~SdPagesField() override;
- virtual void GetFocus() override;
-
void UpdatePagesField( const SfxUInt16Item* pItem );
};
diff --git a/sd/source/ui/inc/gluectrl.hxx b/sd/source/ui/inc/gluectrl.hxx
index 632f37604491..3b837a78b284 100644
--- a/sd/source/ui/inc/gluectrl.hxx
+++ b/sd/source/ui/inc/gluectrl.hxx
@@ -42,8 +42,6 @@ public:
virtual void dispose() override;
virtual ~GlueEscDirLB() override;
- virtual void GetFocus() override;
-
void set_active(int nPos) { m_xWidget->set_active(nPos); }
void set_sensitive(bool bSensitive);
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
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index 9103f200a7e6..1a070374f3a9 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -38,6 +38,8 @@ SvxFmAbsRecWin::SvxFmAbsRecWin(vcl::Window* pParent, SfxToolBoxControl* pControl
, m_xWidget(m_xBuilder->weld_entry("entry"))
, m_pController(pController)
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_key_press(LINK(this, SvxFmAbsRecWin, KeyInputHdl));
m_xWidget->connect_activate(LINK(this, SvxFmAbsRecWin, ActivatedHdl));
m_xWidget->connect_focus_out(LINK(this, SvxFmAbsRecWin, FocusOutHdl));
@@ -51,13 +53,6 @@ void SvxFmAbsRecWin::dispose()
InterimItemWindow::dispose();
}
-void SvxFmAbsRecWin::GetFocus()
-{
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
-}
-
SvxFmAbsRecWin::~SvxFmAbsRecWin()
{
disposeOnce();
diff --git a/svx/source/inc/tbxform.hxx b/svx/source/inc/tbxform.hxx
index 35471e9f1645..153fc0c74631 100644
--- a/svx/source/inc/tbxform.hxx
+++ b/svx/source/inc/tbxform.hxx
@@ -31,8 +31,6 @@ public:
void set_text(const OUString& rText) { m_xWidget->set_text(rText); }
- virtual void GetFocus() override;
-
private:
std::unique_ptr<weld::Entry> m_xWidget;
diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
index d887a942d6c1..f08211984dd0 100644
--- a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
+++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
@@ -105,43 +105,30 @@ IMPL_LINK_NOARG(ParaULSpacingWindow, ModifySpacingHdl, weld::MetricSpinButton&,
}
// ParaAboveSpacingWindow
-
ParaAboveSpacingWindow::ParaAboveSpacingWindow(vcl::Window* pParent)
: ParaULSpacingWindow(pParent)
{
+ InitControlBase(&m_xAboveSpacing->get_widget());
+
m_xAboveContainer->show();
m_xBelowContainer->hide();
SetSizePixel(get_preferred_size());
}
-void ParaAboveSpacingWindow::GetFocus()
-{
- if (m_xAboveSpacing)
- m_xAboveSpacing->grab_focus();
- ParaULSpacingWindow::GetFocus();
-}
-
// ParaBelowSpacingWindow
-
ParaBelowSpacingWindow::ParaBelowSpacingWindow(vcl::Window* pParent)
: ParaULSpacingWindow(pParent)
{
+ InitControlBase(&m_xBelowSpacing->get_widget());
+
m_xAboveContainer->hide();
m_xBelowContainer->show();
SetSizePixel(get_preferred_size());
}
-void ParaBelowSpacingWindow::GetFocus()
-{
- if (m_xBelowSpacing)
- m_xBelowSpacing->grab_focus();
- ParaULSpacingWindow::GetFocus();
-}
-
// ParaLRSpacingWindow
-
ParaLRSpacingWindow::ParaLRSpacingWindow(vcl::Window* pParent)
: InterimItemWindow(pParent, "svx/ui/paralrspacing.ui", "ParaLRSpacingWindow")
, m_eUnit(MapUnit::MapTwip)
@@ -309,10 +296,11 @@ IMPL_LINK_NOARG(ParaLRSpacingWindow, ModifySpacingHdl, weld::MetricSpinButton&,
}
// ParaLeftSpacingWindow
-
ParaLeftSpacingWindow::ParaLeftSpacingWindow(vcl::Window* pParent)
: ParaLRSpacingWindow(pParent)
{
+ InitControlBase(&m_xBeforeSpacing->get_widget());
+
m_xBeforeContainer->show();
m_xAfterContainer->hide();
m_xFirstLineContainer->hide();
@@ -320,18 +308,12 @@ ParaLeftSpacingWindow::ParaLeftSpacingWindow(vcl::Window* pParent)
SetSizePixel(get_preferred_size());
}
-void ParaLeftSpacingWindow::GetFocus()
-{
- if (m_xBeforeSpacing)
- m_xBeforeSpacing->grab_focus();
- ParaLRSpacingWindow::GetFocus();
-}
-
// ParaRightSpacingWindow
-
ParaRightSpacingWindow::ParaRightSpacingWindow(vcl::Window* pParent)
: ParaLRSpacingWindow(pParent)
{
+ InitControlBase(&m_xAfterSpacing->get_widget());
+
m_xBeforeContainer->hide();
m_xAfterContainer->show();
m_xFirstLineContainer->hide();
@@ -339,18 +321,12 @@ ParaRightSpacingWindow::ParaRightSpacingWindow(vcl::Window* pParent)
SetSizePixel(get_preferred_size());
}
-void ParaRightSpacingWindow::GetFocus()
-{
- if (m_xAfterSpacing)
- m_xAfterSpacing->grab_focus();
- ParaLRSpacingWindow::GetFocus();
-}
-
// ParaFirstLineSpacingWindow
-
ParaFirstLineSpacingWindow::ParaFirstLineSpacingWindow(vcl::Window* pParent)
: ParaLRSpacingWindow(pParent)
{
+ InitControlBase(&m_xFLSpacing->get_widget());
+
m_xBeforeContainer->hide();
m_xAfterContainer->hide();
m_xFirstLineContainer->show();
@@ -358,11 +334,4 @@ ParaFirstLineSpacingWindow::ParaFirstLineSpacingWindow(vcl::Window* pParent)
SetSizePixel(get_preferred_size());
}
-void ParaFirstLineSpacingWindow::GetFocus()
-{
- if (m_xFLSpacing)
- m_xFLSpacing->grab_focus();
- ParaLRSpacingWindow::GetFocus();
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx
index 3f18dbb3e3ad..f1730f93387b 100644
--- a/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx
+++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx
@@ -53,14 +53,12 @@ class ParaAboveSpacingWindow : public ParaULSpacingWindow
{
public:
explicit ParaAboveSpacingWindow(vcl::Window* pParent);
- virtual void GetFocus() override;
};
class ParaBelowSpacingWindow : public ParaULSpacingWindow
{
public:
explicit ParaBelowSpacingWindow(vcl::Window* pParent);
- virtual void GetFocus() override;
};
class ParaLRSpacingWindow : public InterimItemWindow
@@ -94,21 +92,18 @@ class ParaLeftSpacingWindow : public ParaLRSpacingWindow
{
public:
explicit ParaLeftSpacingWindow(vcl::Window* pParent);
- virtual void GetFocus() override;
};
class ParaRightSpacingWindow : public ParaLRSpacingWindow
{
public:
explicit ParaRightSpacingWindow(vcl::Window* pParent);
- virtual void GetFocus() override;
};
class ParaFirstLineSpacingWindow : public ParaLRSpacingWindow
{
public:
explicit ParaFirstLineSpacingWindow(vcl::Window* pParent);
- virtual void GetFocus() override;
};
}
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index 7861467422d1..ce09f25cefc3 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -507,4 +507,4 @@ void StylesPreviewWindow_Impl::dispose()
void StylesPreviewWindow_Impl::SetOptimalSize() { SetSizePixel(get_preferred_size()); }
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index fcdd67efbe38..af236864034a 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -566,6 +566,8 @@ FillControl::FillControl(vcl::Window* pParent, const css::uno::Reference<css::fr
, mnTypeCurPos(0)
, mnAttrCurPos(0)
{
+ InitControlBase(mxLbFillType.get());
+
mxLbFillAttr->connect_key_press(LINK(this, FillControl, AttrKeyInputHdl));
mxLbFillType->connect_key_press(LINK(this, FillControl, TypeKeyInputHdl));
mxToolBoxColor->connect_key_press(LINK(this, FillControl, ColorKeyInputHdl));
@@ -647,13 +649,6 @@ IMPL_LINK(FillControl, ColorKeyInputHdl, const KeyEvent&, rKEvt, bool)
return ChildKeyInput(rKEvt);
}
-void FillControl::GetFocus()
-{
- if (mxLbFillType)
- mxLbFillType->grab_focus();
- InterimItemWindow::GetFocus();
-}
-
FillControl::~FillControl()
{
disposeOnce();
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 1db6225da1e3..91a9a2db11cd 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -83,7 +83,6 @@ public:
virtual ~ImplGrafControl() override;
virtual void dispose() override;
- virtual void GetFocus() override;
void Update( const SfxPoolItem* pItem );
void set_field_text(const OUString& rStr) { mxField->set_text(rStr); }
void set_sensitive(bool bSensitive)
@@ -201,6 +200,8 @@ ImplGrafControl::ImplGrafControl(
, mxImage(m_xBuilder->weld_image("image"))
, mxField(m_xBuilder->weld_metric_spin_button("spinfield", FieldUnit::NONE))
{
+ InitControlBase(&mxField->get_widget());
+
OUString sResId(ImplGetRID(rCmd));
mxImage->set_from_icon_name(sResId);
mxImage->set_toolbar_background();
@@ -251,13 +252,6 @@ void ImplGrafControl::dispose()
InterimItemWindow::dispose();
}
-void ImplGrafControl::GetFocus()
-{
- if (mxField)
- mxField->grab_focus();
- InterimItemWindow::GetFocus();
-}
-
namespace {
class ImplGrafModeControl final : public InterimItemWindow
@@ -278,13 +272,6 @@ public:
virtual void dispose() override;
virtual ~ImplGrafModeControl() override;
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
-
void set_sensitive(bool bSensitive)
{
Enable(bSensitive);
@@ -307,6 +294,8 @@ ImplGrafModeControl::ImplGrafModeControl(vcl::Window* pParent, const Reference<X
, mxFrame(rFrame)
, m_xWidget(m_xBuilder->weld_combo_box("grafmode"))
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->append_text( SvxResId( RID_SVXSTR_GRAFMODE_STANDARD ) );
m_xWidget->append_text( SvxResId( RID_SVXSTR_GRAFMODE_GREYS ) );
m_xWidget->append_text( SvxResId( RID_SVXSTR_GRAFMODE_MONO ) );
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 0b0ee21ee513..07cea3decb46 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -53,6 +53,8 @@ SvxMetricField::SvxMetricField(
, eDlgUnit(SfxModule::GetModuleFieldUnit(rFrame))
, mxFrame(rFrame)
{
+ InitControlBase(&m_xWidget->get_widget());
+
m_xWidget->set_range(0, 5000, FieldUnit::NONE);
m_xWidget->connect_value_changed(LINK(this, SvxMetricField, ModifyHdl));
m_xWidget->connect_focus_in(LINK(this, SvxMetricField, FocusInHdl));
@@ -168,13 +170,6 @@ void SvxMetricField::DataChanged( const DataChangedEvent& rDCEvt )
InterimItemWindow::DataChanged( rDCEvt );
}
-void SvxMetricField::GetFocus()
-{
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
-}
-
void SvxFillTypeBox::Fill(weld::ComboBox& rListBox)
{
rListBox.freeze();
diff --git a/svx/source/tbxctrls/linemetricbox.hxx b/svx/source/tbxctrls/linemetricbox.hxx
index 3596227b0679..1fb65114427b 100644
--- a/svx/source/tbxctrls/linemetricbox.hxx
+++ b/svx/source/tbxctrls/linemetricbox.hxx
@@ -40,8 +40,6 @@ private:
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
- virtual void GetFocus() override;
-
public:
SvxMetricField( vcl::Window* pParent,
const css::uno::Reference< css::frame::XFrame >& rFrame );
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index a0513494409f..3a1aec034b78 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -264,13 +264,7 @@ private:
}
virtual void DataChanged(const DataChangedEvent& rDCEvt) override;
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
- void SetOptimalSize();
+ void SetOptimalSize();
};
class SvxFontNameBox_Impl;
@@ -879,6 +873,8 @@ SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent,
, SvxStyleBox_Base(m_xBuilder->weld_combo_box("applystyle"), rCommand, eFamily,
rDispatchProvider, _xFrame, rClearFormatKey, rMoreKey, bInSpec, rCtrl)
{
+ InitControlBase(m_xWidget.get());
+
set_id("applystyle");
SetOptimalSize();
}
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 730acf5dece1..e8b19f006aa9 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -82,6 +82,8 @@ public:
: InterimItemWindow(pParent, "svx/ui/checkbuttonbox.ui", "CheckButtonBox")
, m_xWidget(m_xBuilder->weld_check_button("checkbutton"))
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_key_press(LINK(this, CheckButtonItemWindow, KeyInputHdl));
m_xWidget->set_label(rLabel);
SetSizePixel(m_xWidget->get_preferred_size());
@@ -103,13 +105,6 @@ public:
disposeOnce();
}
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
-
private:
std::unique_ptr<weld::CheckButton> m_xWidget;
diff --git a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
index e2cff7390d09..00f9a079fbb7 100644
--- a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
+++ b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
@@ -47,6 +47,8 @@ public:
: InterimItemWindow(pParent, "modules/swriter/ui/editbox.ui", "EditBox")
, m_xWidget(m_xBuilder->weld_entry("entry"))
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_key_press(LINK(this, CurrentEdit, KeyInputHdl));
SetSizePixel(m_xWidget->get_preferred_size());
}
@@ -57,13 +59,6 @@ public:
InterimItemWindow::dispose();
}
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
-
void set_sensitive(bool bSensitive)
{
Enable(bSensitive);
@@ -172,6 +167,8 @@ public:
: InterimItemWindow(pParent, "modules/swriter/ui/checkbox.ui", "CheckBox")
, m_xWidget(m_xBuilder->weld_check_button("checkbutton"))
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->set_label(SwResId(ST_EXCLUDE));
m_xWidget->connect_key_press(LINK(this, ExcludeCheckBox, KeyInputHdl));
SetSizePixel(m_xWidget->get_preferred_size());
@@ -183,13 +180,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/sw/source/uibase/inc/inputwin.hxx b/sw/source/uibase/inc/inputwin.hxx
index 6698e192421c..08dcea729fce 100644
--- a/sw/source/uibase/inc/inputwin.hxx
+++ b/sw/source/uibase/inc/inputwin.hxx
@@ -42,6 +42,8 @@ public:
: InterimItemWindow(pParent, "modules/swriter/ui/inputeditbox.ui", "InputEditBox")
, m_xWidget(m_xBuilder->weld_entry("entry"))
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_key_press(LINK(this, InputEdit, KeyInputHdl));
m_xWidget->connect_activate(LINK(this, InputEdit, ActivateHdl));
SetSizePixel(m_xWidget->get_preferred_size());
@@ -55,13 +57,6 @@ public:
InterimItemWindow::dispose();
}
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
-
void set_text(const OUString& rText)
{
m_xWidget->set_text(rText);
@@ -110,6 +105,8 @@ public:
: InterimItemWindow(pParent, "modules/swriter/ui/poseditbox.ui", "PosEditBox")
, m_xWidget(m_xBuilder->weld_entry("entry"))
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_key_press(LINK(this, PosEdit, KeyInputHdl));
SetSizePixel(m_xWidget->get_preferred_size());
}
@@ -120,13 +117,6 @@ public:
InterimItemWindow::dispose();
}
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
-
void set_text(const OUString& rText)
{
m_xWidget->set_text(rText);
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 35f519050763..53c2ae1c07dc 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -295,13 +295,6 @@ public:
InterimItemWindow::dispose();
}
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
-
void save_value()
{
m_xWidget->save_value();
@@ -326,6 +319,8 @@ SwZoomBox_Impl::SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot)
, nSlotId(nSlot)
, bRelease(true)
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->set_help_id(HID_PVIEW_ZOOM_LB);
m_xWidget->set_entry_completion(false);
m_xWidget->connect_changed(LINK(this, SwZoomBox_Impl, SelectHdl));
@@ -505,12 +500,6 @@ public:
m_xWidget.reset();
InterimItemWindow::dispose();
}
- virtual void GetFocus() override
- {
- if (m_xWidget)
- m_xWidget->grab_focus();
- InterimItemWindow::GetFocus();
- }
virtual ~SwJumpToSpecificBox_Impl() override
{
disposeOnce();
@@ -529,6 +518,8 @@ SwJumpToSpecificBox_Impl::SwJumpToSpecificBox_Impl(vcl::Window* pParent, sal_uIn
, m_xWidget(m_xBuilder->weld_entry("jumppos"))
, nSlotId(nSlot)
{
+ InitControlBase(m_xWidget.get());
+
m_xWidget->connect_key_press(LINK(this, SwJumpToSpecificBox_Impl, KeyInputHdl));
m_xWidget->connect_activate(LINK(this, SwJumpToSpecificBox_Impl, SelectHdl));
More information about the Libreoffice-commits
mailing list