From b5f2f32defd22c8ec0c47c0100836a8d5bb132ea Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 22 Aug 2019 17:15:44 +0100 Subject: weld SwMailMergeAddressBlockPage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib3383f1ae590766ecb1371cab2ccdb7c835c95a8 Reviewed-on: https://gerrit.libreoffice.org/77971 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- extras/source/glade/libreoffice-catalog.xml.in | 3 - solenv/bin/native-code.py | 1 - sw/source/ui/dbui/mailmergewizard.cxx | 2 +- sw/source/ui/dbui/mmaddressblockpage.cxx | 201 ++++++++++++------------- sw/source/ui/dbui/mmaddressblockpage.hxx | 59 ++++---- sw/source/uibase/dbui/mailmergehelper.cxx | 9 ++ sw/source/uibase/inc/mailmergehelper.hxx | 5 + sw/uiconfig/swriter/ui/mmaddressblockpage.ui | 38 ++++- 8 files changed, 181 insertions(+), 137 deletions(-) diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index eef7bdd744b6..a86845bd17d1 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -159,9 +159,6 @@ - diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index a58a30654a06..45a3fee13118 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -512,7 +512,6 @@ custom_widgets = [ 'SvxRelativeField', 'SvxTextEncodingBox', 'SvxTextEncodingBox', - 'SwAddressPreview', 'SwNavHelpToolBox', 'TableValueSet', 'TemplateDefaultView', diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 49ea7c661fc9..6ca8822cbfc3 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -106,7 +106,7 @@ VclPtr SwMailMergeWizard::createPage(WizardState _nState) SetRoadmapHelpId("modules/swriter/ui/mmoutputtypepage/MMOutputTypePage"); break; case MM_ADDRESSBLOCKPAGE : - pRet = VclPtr::Create(this); + pRet = VclPtr::Create(this, TabPageParent(this)); SetRoadmapHelpId("modules/swriter/ui/mmaddressblockpage/MMAddressBlockPage"); break; case MM_GREETINGSPAGE : diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index dd12860e54ca..0edb9bddee1f 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -57,46 +57,46 @@ using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; -SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pParent) : - vcl::OWizardPage(_pParent, "MMAddressBlockPage", - "modules/swriter/ui/mmaddressblockpage.ui") - , m_pWizard(_pParent) -{ - get(m_pAddressListPB, "addresslist"); - get(m_pCurrentAddressFI, "currentaddress"); - get(m_pStep2, "step2"); - get(m_pStep3, "step3"); - get(m_pStep4, "step4"); - get(m_pSettingsFI, "settingsft"); - get(m_pAddressCB, "address"); - get(m_pSettingsWIN, "settingspreview"); +SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage(SwMailMergeWizard* pWizard, TabPageParent pParent) + : vcl::OWizardPage(pParent, "modules/swriter/ui/mmaddressblockpage.ui", "MMAddressBlockPage") + , m_pWizard(pWizard) + , m_xAddressListPB(m_xBuilder->weld_button("addresslist")) + , m_xCurrentAddressFI(m_xBuilder->weld_label("currentaddress")) + , m_xStep2(m_xBuilder->weld_container("step2")) + , m_xStep3(m_xBuilder->weld_container("step3")) + , m_xStep4(m_xBuilder->weld_container("step4")) + , m_xSettingsFI(m_xBuilder->weld_label("settingsft")) + , m_xAddressCB(m_xBuilder->weld_check_button("address")) + , m_xSettingsPB(m_xBuilder->weld_button("settings")) + , m_xHideEmptyParagraphsCB(m_xBuilder->weld_check_button("hideempty")) + , m_xAssignPB(m_xBuilder->weld_button("assign")) + , m_xDocumentIndexFI(m_xBuilder->weld_label("documentindex")) + , m_xPrevSetIB(m_xBuilder->weld_button("prev")) + , m_xNextSetIB(m_xBuilder->weld_button("next")) + , m_xDifferentlist(m_xBuilder->weld_label("differentlist")) + , m_xSettings(new AddressPreview(m_xBuilder->weld_scrolled_window("settingspreviewwin"))) + , m_xPreview(new AddressPreview(m_xBuilder->weld_scrolled_window("addresspreviewwin"))) + , m_xSettingsWIN(new weld::CustomWeld(*m_xBuilder, "settingspreview", *m_xSettings)) + , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "addresspreview", *m_xPreview)) +{ Size aSize(LogicToPixel(Size(164 , 45), MapMode(MapUnit::MapAppFont))); - m_pSettingsWIN->set_width_request(aSize.Width()); - m_pSettingsWIN->set_height_request(aSize.Height()); - get(m_pSettingsPB, "settings"); - get(m_pHideEmptyParagraphsCB, "hideempty"); - get(m_pAssignPB, "assign"); - get(m_pPreviewWIN, "addresspreview"); + m_xSettingsWIN->set_size_request(aSize.Width(), aSize.Height()); aSize = LogicToPixel(Size(176, 46), MapMode(MapUnit::MapAppFont)); - m_pPreviewWIN->set_width_request(aSize.Width()); - m_pPreviewWIN->set_height_request(aSize.Height()); - get(m_pDocumentIndexFI, "documentindex"); - get(m_pPrevSetIB, "prev"); - get(m_pNextSetIB, "next"); - m_sDocument = m_pDocumentIndexFI->GetText(); - m_sChangeAddress = get