[Libreoffice-commits] core.git: svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Feb 14 08:59:21 UTC 2020
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
New commits:
commit 3f893b52e726d96cb5dfebbc9afc88c28f0a8463
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Feb 13 17:06:04 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Feb 14 09:58:49 2020 +0100
de-duplicate some code
Change-Id: I5900ee56cf5c80f00743060d1d22dfd3d383f1eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88622
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index b786b03fc2da..1c620ef7da3e 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -80,23 +80,15 @@ static const sal_Int32 REMEMBER_SIZE = 10;
class CheckButtonItemWindow final : public InterimItemWindow
{
public:
- CheckButtonItemWindow(vcl::Window* pParent)
+ CheckButtonItemWindow(vcl::Window* pParent, const OUString& rLabel)
: InterimItemWindow(pParent, "svx/ui/checkbuttonbox.ui", "CheckButtonBox")
, m_xWidget(m_xBuilder->weld_check_button("checkbutton"))
{
m_xWidget->connect_key_press(LINK(this, CheckButtonItemWindow, KeyInputHdl));
- }
-
- void SetOptimalSize()
- {
+ m_xWidget->set_label(rLabel);
SetSizePixel(m_xWidget->get_preferred_size());
}
- void set_label(const OUString& rText)
- {
- m_xWidget->set_label(rText);
- }
-
bool get_active() const
{
return m_xWidget->get_active();
@@ -926,9 +918,7 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL MatchCaseToolboxController::cr
if ( pParent )
{
ToolBox* pToolbar = static_cast<ToolBox*>(pParent.get());
- m_xMatchCaseControl = VclPtr<CheckButtonItemWindow>::Create(pToolbar);
- m_xMatchCaseControl->set_label(SvxResId(RID_SVXSTR_FINDBAR_MATCHCASE));
- m_xMatchCaseControl->SetOptimalSize();
+ m_xMatchCaseControl = VclPtr<CheckButtonItemWindow>::Create(pToolbar, SvxResId(RID_SVXSTR_FINDBAR_MATCHCASE));
}
xItemWindow = VCLUnoHelper::GetInterface(m_xMatchCaseControl);
@@ -1044,9 +1034,7 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL SearchFormattedToolboxControll
if ( pParent )
{
ToolBox* pToolbar = static_cast<ToolBox*>(pParent.get());
- m_xSearchFormattedControl = VclPtr<CheckButtonItemWindow>::Create(pToolbar);
- m_xSearchFormattedControl->set_label(SvxResId(RID_SVXSTR_FINDBAR_SEARCHFORMATTED));
- m_xSearchFormattedControl->SetOptimalSize();
+ m_xSearchFormattedControl = VclPtr<CheckButtonItemWindow>::Create(pToolbar, SvxResId(RID_SVXSTR_FINDBAR_SEARCHFORMATTED));
}
xItemWindow = VCLUnoHelper::GetInterface(m_xSearchFormattedControl);
More information about the Libreoffice-commits
mailing list