[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Oct 18 13:09:40 UTC 2018
sw/source/ui/dbui/mailmergewizard.cxx | 2 -
sw/source/ui/dbui/mmoutputtypepage.cxx | 41 +++++++++++++--------------------
sw/source/ui/dbui/mmoutputtypepage.hxx | 17 ++++++-------
3 files changed, 26 insertions(+), 34 deletions(-)
New commits:
commit de09774238831ad43ec6e7ec7778db4d6a88fe3e
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 18 09:33:49 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 18 15:08:19 2018 +0200
weld SwMailMergeOutputTypePage
Change-Id: I4177bfd48b6af1cfc526e5ff43f00f1405ea647f
Reviewed-on: https://gerrit.libreoffice.org/61911
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx
index 43234669beef..5883c910dce0 100644
--- a/sw/source/ui/dbui/mailmergewizard.cxx
+++ b/sw/source/ui/dbui/mailmergewizard.cxx
@@ -102,7 +102,7 @@ VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState)
SetRoadmapHelpId("modules/swriter/ui/mmselectpage/MMSelectPage");
break;
case MM_OUTPUTTYPETPAGE :
- pRet = VclPtr<SwMailMergeOutputTypePage>::Create(this);
+ pRet = VclPtr<SwMailMergeOutputTypePage>::Create(this, TabPageParent(this));
SetRoadmapHelpId("modules/swriter/ui/mmoutputtypepage/MMOutputTypePage");
break;
case MM_ADDRESSBLOCKPAGE :
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 78328fe95788..ae0171148c8a 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -39,26 +39,24 @@
using namespace ::com::sun::star;
-SwMailMergeOutputTypePage::SwMailMergeOutputTypePage(SwMailMergeWizard* pParent)
- : svt::OWizardPage(pParent, "MMOutputTypePage",
- "modules/swriter/ui/mmoutputtypepage.ui")
- , m_pWizard(pParent)
+SwMailMergeOutputTypePage::SwMailMergeOutputTypePage(SwMailMergeWizard* pWizard, TabPageParent pParent)
+ : svt::OWizardPage(pParent, "modules/swriter/ui/mmoutputtypepage.ui", "MMOutputTypePage")
+ , m_pWizard(pWizard)
+ , m_xLetterRB(m_xBuilder->weld_radio_button("letter"))
+ , m_xMailRB(m_xBuilder->weld_radio_button("email"))
+ , m_xLetterHint(m_xBuilder->weld_label("letterft"))
+ , m_xMailHint(m_xBuilder->weld_label("emailft"))
{
- get(m_pLetterRB, "letter");
- get(m_pMailRB, "email");
- get(m_pLetterHint, "letterft");
- get(m_pMailHint, "emailft");
-
- Link<Button*,void> aLink = LINK(this, SwMailMergeOutputTypePage, TypeHdl_Impl);
- m_pLetterRB->SetClickHdl(aLink);
- m_pMailRB->SetClickHdl(aLink);
+ Link<weld::ToggleButton&,void> aLink = LINK(this, SwMailMergeOutputTypePage, TypeHdl_Impl);
+ m_xLetterRB->connect_toggled(aLink);
+ m_xMailRB->connect_toggled(aLink);
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
if(rConfigItem.IsOutputToLetter())
- m_pLetterRB->Check();
+ m_xLetterRB->set_active(true);
else
- m_pMailRB->Check();
- TypeHdl_Impl(m_pLetterRB);
+ m_xMailRB->set_active(true);
+ TypeHdl_Impl(*m_xLetterRB);
}
SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage()
@@ -68,20 +66,15 @@ SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage()
void SwMailMergeOutputTypePage::dispose()
{
- m_pLetterRB.clear();
- m_pMailRB.clear();
- m_pLetterHint.clear();
- m_pMailHint.clear();
m_pWizard.clear();
svt::OWizardPage::dispose();
}
-
-IMPL_LINK_NOARG(SwMailMergeOutputTypePage, TypeHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SwMailMergeOutputTypePage, TypeHdl_Impl, weld::ToggleButton&, void)
{
- bool bLetter = m_pLetterRB->IsChecked();
- m_pLetterHint->Show(bLetter);
- m_pMailHint->Show(!bLetter);
+ bool bLetter = m_xLetterRB->get_active();
+ m_xLetterHint->show(bLetter);
+ m_xMailHint->show(!bLetter);
m_pWizard->GetConfigItem().SetOutputToLetter(bLetter);
m_pWizard->updateRoadmapItemLabel( MM_ADDRESSBLOCKPAGE );
m_pWizard->UpdateRoadmap();
diff --git a/sw/source/ui/dbui/mmoutputtypepage.hxx b/sw/source/ui/dbui/mmoutputtypepage.hxx
index 99a4e4185068..258a2a03695c 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.hxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.hxx
@@ -20,24 +20,23 @@
#define INCLUDED_SW_SOURCE_UI_DBUI_MMOUTPUTTYPEPAGE_HXX
#include <svtools/wizardmachine.hxx>
-#include <vcl/button.hxx>
+#include <vcl/weld.hxx>
#include <mailmergehelper.hxx>
class SwMailMergeWizard;
class SwMailMergeOutputTypePage : public svt::OWizardPage
{
- VclPtr<RadioButton> m_pLetterRB;
- VclPtr<RadioButton> m_pMailRB;
-
- VclPtr<FixedText> m_pLetterHint;
- VclPtr<FixedText> m_pMailHint;
-
VclPtr<SwMailMergeWizard> m_pWizard;
- DECL_LINK(TypeHdl_Impl, Button*, void);
+ std::unique_ptr<weld::RadioButton> m_xLetterRB;
+ std::unique_ptr<weld::RadioButton> m_xMailRB;
+ std::unique_ptr<weld::Label> m_xLetterHint;
+ std::unique_ptr<weld::Label> m_xMailHint;
+
+ DECL_LINK(TypeHdl_Impl, weld::ToggleButton&, void);
public:
- SwMailMergeOutputTypePage( SwMailMergeWizard* _pParent);
+ SwMailMergeOutputTypePage(SwMailMergeWizard* pWizard, TabPageParent pParent);
virtual ~SwMailMergeOutputTypePage() override;
virtual void dispose() override;
};
More information about the Libreoffice-commits
mailing list