summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls
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 /svx/source/tbxctrls
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 'svx/source/tbxctrls')
-rw-r--r--svx/source/tbxctrls/StylesPreviewWindow.cxx2
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx9
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx19
-rw-r--r--svx/source/tbxctrls/itemwin.cxx9
-rw-r--r--svx/source/tbxctrls/linemetricbox.hxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx10
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx9
7 files changed, 14 insertions, 46 deletions
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;