[Libreoffice-commits] core.git: 3 commits - sd/inc sd/qa sd/source sd/uiconfig sw/inc sw/source sw/uiconfig vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 18 13:10:35 UTC 2018


 sd/inc/sdabstdlg.hxx                          |    2 
 sd/qa/unit/dialogs-test.cxx                   |    5 
 sd/source/ui/dlg/prltempl.cxx                 |   69 +---
 sd/source/ui/dlg/sddlgfact.cxx                |   25 +
 sd/source/ui/dlg/sddlgfact.hxx                |   14 
 sd/source/ui/func/fuprobjs.cxx                |    4 
 sd/source/ui/func/futempl.cxx                 |    2 
 sd/source/ui/inc/prltempl.hxx                 |   18 -
 sd/uiconfig/sdraw/ui/drawprtldialog.ui        |  418 +++++++++++++++++++++++++-
 sw/inc/swabstdlg.hxx                          |    4 
 sw/source/ui/dbui/mmresultdialogs.cxx         |  198 +++++-------
 sw/source/ui/dialog/swdlgfact.cxx             |   19 -
 sw/source/ui/dialog/swdlgfact.hxx             |   13 
 sw/source/ui/envelp/mailmrge.cxx              |   14 
 sw/source/ui/inc/mmresultdialogs.hxx          |   58 +--
 sw/source/uibase/app/apphdl.cxx               |    2 
 sw/source/uibase/inc/mailmrge.hxx             |    9 
 sw/source/uibase/uiview/view2.cxx             |    4 
 sw/uiconfig/swriter/ui/mailmergedialog.ui     |   14 
 sw/uiconfig/swriter/ui/mmresultemaildialog.ui |   77 ++--
 vcl/source/window/tabpage.cxx                 |    2 
 21 files changed, 655 insertions(+), 316 deletions(-)

New commits:
commit 0e19bb2583717a0284e95f47b1094a5849dfeeaf
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 18 11:06:12 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 18 15:09:34 2018 +0200

    weld SdPresLayoutTemplateDlg
    
    Change-Id: Ifc4c9a4631e92eee4b7f9b215c41d2bcc12a17d1
    Reviewed-on: https://gerrit.libreoffice.org/61926
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 152ceb9dc556..da3c93f71203 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -182,7 +182,7 @@ public:
     virtual VclPtr<AbstractSdStartPresDlg>     CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
                                                                      const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) = 0;
     virtual VclPtr<VclAbstractDialog>          CreateRemoteDialog( vcl::Window* pWindow ) = 0;
-    virtual VclPtr<SfxAbstractTabDialog>       CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ) = 0;
+    virtual VclPtr<SfxAbstractTabDialog>       CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) = 0;
     virtual VclPtr<AbstractSdPresLayoutDlg>    CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) = 0;
     virtual VclPtr<SfxAbstractTabDialog>       CreateSdTabTemplateDlg(vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0;
     virtual VclPtr<SfxAbstractDialog>          CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index fd863c973eb0..738b84dd0f7f 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -463,16 +463,17 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
         }
         case 15:
         {
-            // CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, vcl::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) override;
+            // CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) override;
             // use STR_PSEUDOSHEET_TITLE configuration, see futempl.cxx for more possible configurations
             // may be nicer on the long run to take a configuration which represents a selected SdrObject
             SfxStyleSheetBasePool* pStyleSheetPool = getDocShell()->GetStyleSheetPool();
             CPPUNIT_ASSERT(pStyleSheetPool);
             SfxStyleSheetBase* pStyleSheet = pStyleSheetPool->First();
             CPPUNIT_ASSERT(pStyleSheet);
+            vcl::Window* pWin = Application::GetDefDialogParent();
             pRetval = getSdAbstractDialogFactory()->CreateSdPresLayoutTemplateDlg(
                 getDocShell(),
-                Application::GetDefDialogParent(),
+                pWin ? pWin->GetFrameWeld() : nullptr,
                 false,
                 *pStyleSheet,
                 PO_TITLE,
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index 030439b41341..4c01aaeb9f57 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -49,19 +49,17 @@
 /**
  * Constructor of Tab dialog: appends pages to the dialog
  */
-SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell const * pDocSh,
-                                vcl::Window* pParent,
+SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg(SfxObjectShell const * pDocSh,
+                                weld::Window* pParent,
                                 bool bBackground,
                                 SfxStyleSheetBase& rStyleBase,
                                 PresentationObjects _ePO,
-                                SfxStyleSheetBasePool* pSSPool ) :
-        SfxTabDialog        ( pParent
-                            , "DrawPRTLDialog"
-                            , "modules/sdraw/ui/drawprtldialog.ui"),
-        mpDocShell          ( pDocSh ),
-        ePO                 ( _ePO ),
-        aInputSet           ( *rStyleBase.GetItemSet().GetPool(), svl::Items<SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL>{} ),
-        pOrgSet             ( &rStyleBase.GetItemSet() )
+                                SfxStyleSheetBasePool* pSSPool)
+    : SfxTabDialogController(pParent, "modules/sdraw/ui/drawprtldialog.ui", "DrawPRTLDialog")
+    , mpDocShell(pDocSh)
+    , ePO(_ePO)
+    , aInputSet(*rStyleBase.GetItemSet().GetPool(), svl::Items<SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL>{})
+    , pOrgSet(&rStyleBase.GetItemSet())
 {
     if( IS_OUTLINE(ePO))
     {
@@ -133,14 +131,14 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell const * pDocSh,
 
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
 
-    mnLine = AddTabPage( "RID_SVXPAGE_LINE", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINE ), nullptr );
-    mnArea = AddTabPage( "RID_SVXPAGE_AREA", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), nullptr );
-    mnShadow = AddTabPage( "RID_SVXPAGE_SHADOW", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_SHADOW ), nullptr );
-    mnTransparency = AddTabPage( "RID_SVXPAGE_TRANSPARENCE", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), nullptr );
-    mnFont = AddTabPage( "RID_SVXPAGE_CHAR_NAME", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), nullptr );
-    mnEffects = AddTabPage( "RID_SVXPAGE_CHAR_EFFECTS", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), nullptr );
+    AddTabPage( "RID_SVXPAGE_LINE", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINE ), nullptr );
+    AddTabPage( "RID_SVXPAGE_AREA", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), nullptr );
+    AddTabPage( "RID_SVXPAGE_SHADOW", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_SHADOW ), nullptr );
+    AddTabPage( "RID_SVXPAGE_TRANSPARENCE", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), nullptr );
+    AddTabPage( "RID_SVXPAGE_CHAR_NAME", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), nullptr );
+    AddTabPage( "RID_SVXPAGE_CHAR_EFFECTS", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), nullptr );
     AddTabPage( "RID_SVXPAGE_STD_PARAGRAPH", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_STD_PARAGRAPH ), nullptr );
-    mnTextAtt = AddTabPage( "RID_SVXPAGE_TEXTATTR", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TEXTATTR ), nullptr );
+    AddTabPage( "RID_SVXPAGE_TEXTATTR", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TEXTATTR ), nullptr );
     AddTabPage( "RID_SVXPAGE_PICK_BULLET", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PICK_BULLET ), nullptr );
     AddTabPage( "RID_SVXPAGE_PICK_SINGLE_NUM", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PICK_SINGLE_NUM ), nullptr );
     AddTabPage( "RID_SVXPAGE_PICK_BMP", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PICK_BMP ), nullptr );
@@ -148,7 +146,7 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell const * pDocSh,
     AddTabPage( "RID_SVXPAGE_TABULATOR", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TABULATOR ), nullptr );
     AddTabPage( "RID_SVXPAGE_PARA_ASIAN", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PARA_ASIAN ), nullptr );
     AddTabPage( "RID_SVXPAGE_ALIGN_PARAGRAPH", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGN_PARAGRAPH ), nullptr );
-    mnBackground = AddTabPage( "RID_SVXPAGE_BACKGROUND", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr);
+    AddTabPage( "RID_SVXPAGE_BACKGROUND", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr);
 
     SvtCJKOptions aCJKOptions;
     if( !aCJKOptions.IsAsianTypographyEnabled() )
@@ -212,25 +210,18 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell const * pDocSh,
             aTitle = SdResId(STR_PSEUDOSHEET_NOTES);
         break;
     }
-    SetText( aTitle );
+    m_xDialog->set_title(aTitle);
 }
 
 SdPresLayoutTemplateDlg::~SdPresLayoutTemplateDlg()
 {
-    disposeOnce();
 }
 
-void SdPresLayoutTemplateDlg::dispose()
-{
-    pOutSet.reset();
-    SfxTabDialog::dispose();
-}
-
-void SdPresLayoutTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+void SdPresLayoutTemplateDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
 {
     SfxAllItemSet aSet(*(aInputSet.GetPool()));
 
-    if (nId == mnLine)
+    if (rId == "RID_SVXPAGE_LINE")
     {
         aSet.Put (SvxColorListItem(pColorTab,SID_COLOR_TABLE));
         aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST));
@@ -238,7 +229,7 @@ void SdPresLayoutTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
         aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
         rPage.PageCreated(aSet);
     }
-    else if (nId == mnArea)
+    else if (rId == "RID_SVXPAGE_AREA")
     {
         aSet.Put (SvxColorListItem(pColorTab,SID_COLOR_TABLE));
         aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST));
@@ -250,35 +241,35 @@ void SdPresLayoutTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
         aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
         rPage.PageCreated(aSet);
     }
-    else if (nId == mnShadow)
+    else if (rId == "RID_SVXPAGE_SHADOW")
     {
         aSet.Put (SvxColorListItem(pColorTab,SID_COLOR_TABLE));
         aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
         aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
         rPage.PageCreated(aSet);
     }
-    else if (nId == mnTransparency)
+    else if (rId == "RID_SVXPAGE_TRANSPARENCE")
     {
         aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
         aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
         rPage.PageCreated(aSet);
     }
-    else if (nId == mnFont)
+    else if (rId == "RID_SVXPAGE_CHAR_NAME")
     {
         SvxFontListItem aItem(*static_cast<const SvxFontListItem*>(mpDocShell->GetItem( SID_ATTR_CHAR_FONTLIST) ) );
         aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
         rPage.PageCreated(aSet);
     }
-    else if (nId == mnEffects)
+    else if (rId == "RID_SVXPAGE_CHAR_EFFECTS")
     {
         rPage.PageCreated(aSet);
     }
-    else if (nId == mnTextAtt)
+    else if (rId == "RID_SVXPAGE_TEXTATTR")
     {
         aSet.Put(CntUInt16Item(SID_SVXTEXTATTRPAGE_OBJKIND, OBJ_TEXT));
         rPage.PageCreated(aSet);
     }
-    else if (nId == mnBackground)
+    else if (rId == "RID_SVXPAGE_BACKGROUND")
     {
         aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
         rPage.PageCreated(aSet);
@@ -287,17 +278,17 @@ void SdPresLayoutTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
 
 const SfxItemSet* SdPresLayoutTemplateDlg::GetOutputItemSet() const
 {
-    if( pOutSet )
+    if (pOutSet)
     {
-        pOutSet->Put( *SfxTabDialog::GetOutputItemSet() );
+        pOutSet->Put(*SfxTabDialogController::GetOutputItemSet());
 
         const SvxNumBulletItem *pSvxNumBulletItem = nullptr;
-        if( SfxItemState::SET == pOutSet->GetItemState(EE_PARA_NUMBULLET, false, reinterpret_cast<const SfxPoolItem**>(&pSvxNumBulletItem) ))
+        if (SfxItemState::SET == pOutSet->GetItemState(EE_PARA_NUMBULLET, false, reinterpret_cast<const SfxPoolItem**>(&pSvxNumBulletItem)))
             SdBulletMapper::MapFontsInNumRule( *pSvxNumBulletItem->GetNumRule(), *pOutSet );
         return pOutSet.get();
     }
     else
-        return SfxTabDialog::GetOutputItemSet();
+        return SfxTabDialogController::GetOutputItemSet();
 }
 
 sal_uInt16 SdPresLayoutTemplateDlg::GetOutlineLevel() const
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 1bf725bdce25..7159bdd27d58 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -65,7 +65,16 @@ short AbstractSdCustomShowDlg_Impl::Execute()
 }
 
 IMPL_ABSTDLG_BASE(SdAbstractTabDialog_Impl);
-IMPL_ABSTDLG_BASE(SdPresLayoutTemplateDlg_Impl);
+
+short SdPresLayoutTemplateDlg_Impl::Execute()
+{
+    return m_xDlg->execute();
+}
+
+bool SdPresLayoutTemplateDlg_Impl::StartExecuteAsync(AsyncContext &rCtx)
+{
+    return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
 
 short AbstractSdModifyFieldDlg_Impl::Execute()
 {
@@ -243,27 +252,27 @@ void AbstractBulletDialog_Impl::SetText( const OUString& rStr )
 
 void SdPresLayoutTemplateDlg_Impl::SetCurPageId( const OString& rName )
 {
-    pDlg->SetCurPageId( rName );
+    m_xDlg->SetCurPageId( rName );
 }
 
 const SfxItemSet* SdPresLayoutTemplateDlg_Impl::GetOutputItemSet() const
 {
-    return pDlg->GetOutputItemSet();
+    return m_xDlg->GetOutputItemSet();
 }
 
 const sal_uInt16* SdPresLayoutTemplateDlg_Impl::GetInputRanges(const SfxItemPool& pItem )
 {
-    return pDlg->GetInputRanges( pItem );
+    return m_xDlg->GetInputRanges( pItem );
 }
 
 void SdPresLayoutTemplateDlg_Impl::SetInputSet( const SfxItemSet* pInSet )
 {
-     pDlg->SetInputSet( pInSet );
+     m_xDlg->SetInputSet( pInSet );
 }
 
 void SdPresLayoutTemplateDlg_Impl::SetText( const OUString& rStr )
 {
-    pDlg->SetText( rStr );
+    m_xDlg->set_title(rStr);
 }
 
 SvxFieldData* AbstractSdModifyFieldDlg_Impl::GetField()
@@ -456,9 +465,9 @@ VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl:
      return VclPtr<SdVclAbstractDialog_Impl>::Create( VclPtr<::sd::RemoteDialog>::Create( pParent ) );
 }
 
-VclPtr<SfxAbstractTabDialog>  SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool )
+VclPtr<SfxAbstractTabDialog>  SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool)
 {
-    return VclPtr<SdPresLayoutTemplateDlg_Impl>::Create( VclPtr<SdPresLayoutTemplateDlg>::Create( pDocSh, pParent, bBackgroundDlg, rStyleBase, ePO, pSSPool ) );
+    return VclPtr<SdPresLayoutTemplateDlg_Impl>::Create(o3tl::make_unique<SdPresLayoutTemplateDlg>(pDocSh, pParent, bBackgroundDlg, rStyleBase, ePO, pSSPool));
 }
 
 VclPtr<AbstractSdPresLayoutDlg> SdAbstractDialogFactory_Impl::CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs)
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 99ad415871e5..959718c4effb 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -176,7 +176,15 @@ public:
 class SdPresLayoutTemplateDlg;
 class SdPresLayoutTemplateDlg_Impl : public SfxAbstractTabDialog
 {
-    DECL_ABSTDLG_BASE( SdPresLayoutTemplateDlg_Impl,SdPresLayoutTemplateDlg )
+protected:
+    std::shared_ptr<SdPresLayoutTemplateDlg> m_xDlg;
+public:
+    explicit SdPresLayoutTemplateDlg_Impl(std::unique_ptr<SdPresLayoutTemplateDlg> p)
+        : m_xDlg(std::move(p))
+    {
+    }
+    virtual short Execute() override;
+    virtual bool  StartExecuteAsync(AsyncContext &rCtx) override;
     virtual void                SetCurPageId( const OString& rName ) override;
     virtual const SfxItemSet*   GetOutputItemSet() const override;
     virtual const sal_uInt16*       GetInputRanges( const SfxItemPool& pItem ) override;
@@ -342,8 +350,8 @@ public:
     virtual VclPtr<SfxAbstractTabDialog>       CreateSdParagraphTabDlg(weld::Window* pParent, const SfxItemSet* pAttr) override;
     virtual VclPtr<AbstractSdStartPresDlg>     CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
                                                                      const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) override;
-    virtual VclPtr<VclAbstractDialog>          CreateRemoteDialog( vcl::Window* pWindow ) override; // ad for RemoteDialog
-    virtual VclPtr<SfxAbstractTabDialog>       CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ) override;
+    virtual VclPtr<VclAbstractDialog>          CreateRemoteDialog( vcl::Window* pWindow ) override; // add for RemoteDialog
+    virtual VclPtr<SfxAbstractTabDialog>       CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) override;
     virtual VclPtr<AbstractSdPresLayoutDlg>    CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) override;
     virtual VclPtr<SfxAbstractTabDialog>       CreateSdTabTemplateDlg(vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) override;
     virtual VclPtr<SfxAbstractDialog>          CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) override;
diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx
index 018d0e0bb559..0b7c4c94a338 100644
--- a/sd/source/ui/func/fuprobjs.cxx
+++ b/sd/source/ui/func/fuprobjs.cxx
@@ -136,8 +136,8 @@ void FuPresentationObjects::DoExecute( SfxRequest& )
             SfxStyleSheetBase& rStyleSheet = *pStyleSheet;
 
             SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
-            ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(),
-                                                                false, rStyleSheet, ePO, pStyleSheetPool ));
+            ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSdPresLayoutTemplateDlg(mpDocSh, mpViewShell->GetFrameWeld(),
+                                                                false, rStyleSheet, ePO, pStyleSheetPool));
             if( pDlg->Execute() == RET_OK )
             {
                 const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index 534939dbb30a..dd41a3a3a1be 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -363,7 +363,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
 
                     if( !bOldDocInOtherLanguage )
                     {
-                        pPresDlg.disposeAndReset(pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh,  mpViewShell->GetActiveWindow(), bBackground, *pStyleSheet, ePO, pSSPool ) : nullptr);
+                        pPresDlg.disposeAndReset(pFact ? pFact->CreateSdPresLayoutTemplateDlg(mpDocSh,  mpViewShell->GetFrameWeld(), bBackground, *pStyleSheet, ePO, pSSPool ) : nullptr);
                     }
                 }
 
diff --git a/sd/source/ui/inc/prltempl.hxx b/sd/source/ui/inc/prltempl.hxx
index e144f655a249..e6d17fdf0f1c 100644
--- a/sd/source/ui/inc/prltempl.hxx
+++ b/sd/source/ui/inc/prltempl.hxx
@@ -32,7 +32,7 @@ class SfxStyleSheetBasePool;
 /**
  * Template-Tab-Dialog
  */
-class SdPresLayoutTemplateDlg : public SfxTabDialog
+class SdPresLayoutTemplateDlg : public SfxTabDialogController
 {
 private:
     const SfxObjectShell*   mpDocShell;
@@ -45,18 +45,9 @@ private:
     XDashListRef          pDashList;
     XLineEndListRef       pLineEndList;
 
-    sal_uInt16            mnLine;
-    sal_uInt16            mnArea;
-    sal_uInt16            mnShadow;
-    sal_uInt16            mnTransparency;
-    sal_uInt16            mnFont;
-    sal_uInt16            mnEffects;
-    sal_uInt16            mnTextAtt;
-    sal_uInt16            mnBackground;
-
     PresentationObjects const ePO;
 
-    virtual void        PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
+    virtual void        PageCreated(const OString& rId, SfxTabPage &rPage) override;
 
     // for mapping with the new SvxNumBulletItem
     SfxItemSet aInputSet;
@@ -65,12 +56,9 @@ private:
 
     sal_uInt16 GetOutlineLevel() const;
 
-    using SfxTabDialog::GetOutputItemSet;
-
 public:
-    SdPresLayoutTemplateDlg( SfxObjectShell const * pDocSh, vcl::Window* pParent, bool bBackground, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool );
+    SdPresLayoutTemplateDlg(SfxObjectShell const * pDocSh, weld::Window* pParent, bool bBackground, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool);
     virtual ~SdPresLayoutTemplateDlg() override;
-    virtual void dispose() override;
 
     const SfxItemSet* GetOutputItemSet() const;
 };
diff --git a/sd/uiconfig/sdraw/ui/drawprtldialog.ui b/sd/uiconfig/sdraw/ui/drawprtldialog.ui
index 64b109be5a9e..84907d49bdc4 100644
--- a/sd/uiconfig/sdraw/ui/drawprtldialog.ui
+++ b/sd/uiconfig/sdraw/ui/drawprtldialog.ui
@@ -1,12 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sd">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkDialog" id="DrawPRTLDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="drawprtldialog|DrawPRTLDialog">Presentation Layout</property>
+    <property name="modal">True</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
@@ -17,12 +23,10 @@
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="ok">
-                <property name="label">gtk-ok</property>
+              <object class="GtkButton" id="reset">
+                <property name="label">gtk-revert-to-saved</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_stock">True</property>
               </object>
@@ -33,10 +37,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="cancel">
-                <property name="label">gtk-cancel</property>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_stock">True</property>
               </object>
@@ -47,8 +53,8 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="help">
-                <property name="label">gtk-help</property>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
@@ -58,12 +64,11 @@
                 <property name="expand">False</property>
                 <property name="fill">True</property>
                 <property name="position">2</property>
-                <property name="secondary">True</property>
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="reset">
-                <property name="label">gtk-revert-to-saved</property>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
@@ -73,6 +78,7 @@
                 <property name="expand">False</property>
                 <property name="fill">True</property>
                 <property name="position">3</property>
+                <property name="secondary">True</property>
               </packing>
             </child>
           </object>
@@ -98,6 +104,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
             </child>
             <child type="tab">
@@ -117,6 +147,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">1</property>
@@ -140,6 +194,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">2</property>
@@ -163,6 +241,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">3</property>
@@ -186,6 +288,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">4</property>
@@ -209,6 +335,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">5</property>
@@ -232,6 +382,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">6</property>
@@ -255,6 +429,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">7</property>
@@ -278,6 +476,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">8</property>
@@ -301,6 +523,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">9</property>
@@ -324,6 +570,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">10</property>
@@ -347,6 +617,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">11</property>
@@ -355,7 +649,7 @@
             <child type="tab">
               <object class="GtkLabel" id="RID_SVXPAGE_NUM_OPTIONS">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can_focus">True</property>
                 <property name="label" translatable="yes" context="drawprtldialog|RID_SVXPAGE_NUM_OPTIONS">Customize</property>
               </object>
               <packing>
@@ -370,6 +664,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">12</property>
@@ -393,6 +711,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">13</property>
@@ -416,6 +758,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">14</property>
@@ -439,6 +805,30 @@
                 <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="position">15</property>
@@ -465,10 +855,10 @@
       </object>
     </child>
     <action-widgets>
+      <action-widget response="101">reset</action-widget>
       <action-widget response="-5">ok</action-widget>
       <action-widget response="-6">cancel</action-widget>
       <action-widget response="-11">help</action-widget>
-      <action-widget response="0">reset</action-widget>
     </action-widgets>
   </object>
 </interface>
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index a9d44ffa20e1..8cfd6243f9fe 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -47,7 +47,7 @@ void TabPage::ImplInit( vcl::Window* pParent, WinBits nStyle )
 void TabPage::ImplInitSettings()
 {
     vcl::Window* pParent = GetParent();
-    if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
+    if (pParent && pParent->IsChildTransparentModeEnabled() && !IsControlBackground())
     {
         EnableChildTransparentMode();
         SetParentClipMode( ParentClipMode::NoClip );
commit f1ca64800074530d95e507f93c764a687310b9eb
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 18 09:52:28 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 18 15:09:12 2018 +0200

    weld SwMMResultEmailDialog
    
    Change-Id: Ib12455751074bbd818cc2da0c813fe984d887571
    Reviewed-on: https://gerrit.libreoffice.org/61920
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index ea8a27fdfcae..59f7e12ad227 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -499,7 +499,7 @@ public:
 
     virtual void ExecuteMMResultSaveDialog(weld::Window* pParent) = 0;
     virtual void ExecuteMMResultPrintDialog(weld::Window* pParent) = 0;
-    virtual void ExecuteMMResultEmailDialog() = 0;
+    virtual void ExecuteMMResultEmailDialog(weld::Window* pParent) = 0;
 
 protected:
     ~SwAbstractDialogFactory() {}
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index d4dc1b1932ac..fe95b26a54ad 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -227,7 +227,7 @@ SwMMResultSaveDialog::SwMMResultSaveDialog(weld::Window* pParent)
     m_xSaveAsOneRB->connect_toggled(aLink);
     m_xSaveIndividualRB->connect_toggled(aLink);
     m_xFromRB->connect_toggled(aLink);
-    // m_pSaveAsOneRB is the default, so disable m_pFromNF and m_pToNF initially.
+    // m_pSaveAsOneRB is the default, so disable m_xFromNF and m_xToNF initially.
     aLink.Call(*m_xSaveAsOneRB);
     SwView* pView = ::GetActiveView();
     std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem();
@@ -264,7 +264,7 @@ SwMMResultPrintDialog::SwMMResultPrintDialog(weld::Window* pParent)
     Link<weld::ToggleButton&,void> aLink = LINK(this, SwMMResultPrintDialog, DocumentSelectionHdl_Impl);
     m_xPrintAllRB->connect_toggled(aLink);
     m_xFromRB->connect_toggled(aLink);
-    // m_pPrintAllRB is the default, so disable m_pFromNF and m_pToNF initially.
+    // m_pPrintAllRB is the default, so disable m_xFromNF and m_xToNF initially.
     aLink.Call(*m_xPrintAllRB);
 
     m_xOKButton->connect_clicked(LINK(this, SwMMResultPrintDialog, PrintHdl_Impl));
@@ -276,67 +276,43 @@ SwMMResultPrintDialog::~SwMMResultPrintDialog()
 {
 }
 
-SwMMResultEmailDialog::SwMMResultEmailDialog()
-    : SfxModalDialog(nullptr, "MMResultEmailDialog", "modules/swriter/ui/mmresultemaildialog.ui"),
-     m_sConfigureMail(SwResId(ST_CONFIGUREMAIL))
+SwMMResultEmailDialog::SwMMResultEmailDialog(weld::Window* pParent)
+    : SfxDialogController(pParent, "modules/swriter/ui/mmresultemaildialog.ui", "MMResultEmailDialog")
+    , m_sConfigureMail(SwResId(ST_CONFIGUREMAIL))
+    , m_xMailToFT(m_xBuilder->weld_label("mailtoft"))
+    , m_xMailToLB(m_xBuilder->weld_combo_box("mailto"))
+    , m_xCopyToPB(m_xBuilder->weld_button("copyto"))
+    , m_xSubjectFT(m_xBuilder->weld_label("subjectft"))
+    , m_xSubjectED(m_xBuilder->weld_entry("subject"))
+    , m_xSendAsFT(m_xBuilder->weld_label("sendasft"))
+    , m_xSendAsLB(m_xBuilder->weld_combo_box("sendas"))
+    , m_xSendAsPB(m_xBuilder->weld_button("sendassettings"))
+    , m_xAttachmentGroup(m_xBuilder->weld_widget("attachgroup"))
+    , m_xAttachmentED(m_xBuilder->weld_entry("attach"))
+    , m_xSendAllRB(m_xBuilder->weld_radio_button("sendallrb"))
+    , m_xFromRB(m_xBuilder->weld_radio_button("fromrb"))
+    , m_xFromNF(m_xBuilder->weld_spin_button("from"))
+    , m_xToFT(m_xBuilder->weld_label("toft"))
+    , m_xToNF(m_xBuilder->weld_spin_button("to"))
+    , m_xOKButton(m_xBuilder->weld_button("ok"))
 {
-    get(m_pMailToFT, "mailtoft");
-    get(m_pMailToLB, "mailto");
-    get(m_pCopyToPB, "copyto");
-    get(m_pSubjectFT, "subjectft");
-    get(m_pSubjectED, "subject");
-    get(m_pSendAsFT, "sendasft");
-    get(m_pSendAsLB, "sendas");
-    get(m_pAttachmentGroup, "attachgroup");
-    get(m_pAttachmentED, "attach");
-    get(m_pSendAsPB, "sendassettings");
-    get(m_pSendAllRB, "sendallrb");
-    get(m_pFromRB, "fromrb");
-    get(m_pFromNF, "from-nospin");
-    get(m_pToFT, "toft");
-    get(m_pToNF, "to-nospin");
-    get(m_pOKButton, "ok");
-
-    m_pCopyToPB->SetClickHdl(LINK(this, SwMMResultEmailDialog, CopyToHdl_Impl));
-    m_pSendAsPB->SetClickHdl(LINK(this, SwMMResultEmailDialog, SendAsHdl_Impl));
-    m_pSendAsLB->SetSelectHdl(LINK(this, SwMMResultEmailDialog, SendTypeHdl_Impl));
-
-    Link<Button*,void> aLink = LINK(this, SwMMResultEmailDialog, DocumentSelectionHdl_Impl);
-    m_pSendAllRB->SetClickHdl(aLink);
-    m_pFromRB->SetClickHdl(aLink);
-    // m_pSendAllRB is the default, so disable m_pFromNF and m_pToNF initially.
-    aLink.Call(m_pSendAllRB);
-
-    m_pOKButton->SetClickHdl(LINK(this, SwMMResultEmailDialog, SendDocumentsHdl_Impl));
+    m_xCopyToPB->connect_clicked(LINK(this, SwMMResultEmailDialog, CopyToHdl_Impl));
+    m_xSendAsPB->connect_clicked(LINK(this, SwMMResultEmailDialog, SendAsHdl_Impl));
+    m_xSendAsLB->connect_changed(LINK(this, SwMMResultEmailDialog, SendTypeHdl_Impl));
+
+    Link<weld::ToggleButton&,void> aLink = LINK(this, SwMMResultEmailDialog, DocumentSelectionHdl_Impl);
+    m_xSendAllRB->connect_toggled(aLink);
+    m_xFromRB->connect_toggled(aLink);
+    // m_xSendAllRB is the default, so disable m_xFromNF and m_xToNF initially.
+    aLink.Call(*m_xSendAllRB);
+
+    m_xOKButton->connect_clicked(LINK(this, SwMMResultEmailDialog, SendDocumentsHdl_Impl));
 
     FillInEmailSettings();
 }
 
 SwMMResultEmailDialog::~SwMMResultEmailDialog()
 {
-    disposeOnce();
-}
-
-void SwMMResultEmailDialog::dispose()
-{
-    m_pMailToFT.clear();
-    m_pMailToLB.clear();
-    m_pCopyToPB.clear();
-    m_pSubjectFT.clear();
-    m_pSubjectED.clear();
-    m_pSendAsFT.clear();
-    m_pSendAsLB.clear();
-    m_pAttachmentGroup.clear();
-    m_pAttachmentED.clear();
-    m_pSendAllRB.clear();
-    m_pFromRB.clear();
-    m_pFromNF.clear();
-    m_pToFT.clear();
-    m_pToNF.clear();
-    m_pOKButton.clear();
-    m_pSendAsPB.clear();
-
-    SfxModalDialog::dispose();
 }
 
 void SwMMResultPrintDialog::FillInPrinterSettings()
@@ -387,21 +363,20 @@ void SwMMResultEmailDialog::FillInEmailSettings()
         if (pDocShell->HasName())
         {
             INetURLObject aTmp(pDocShell->GetMedium()->GetName());
-            m_pAttachmentED->SetText(aTmp.getName(
+            m_xAttachmentED->set_text(aTmp.getName(
                     INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ));
         }
     }
 
-    if (m_pAttachmentED->GetText().isEmpty())
+    if (m_xAttachmentED->get_text().isEmpty())
     {
-        OUString sAttach = "." + lcl_GetExtensionForDocType(
-                    reinterpret_cast<sal_uLong>(m_pSendAsLB->GetSelectedEntryData()));
-        m_pAttachmentED->SetText(sAttach);
+        OUString sAttach = "." + lcl_GetExtensionForDocType(m_xSendAsLB->get_active_id().toUInt32());
+        m_xAttachmentED->set_text(sAttach);
 
     }
 
     //fill mail address ListBox
-    if (m_pMailToLB->GetEntryCount())
+    if (m_xMailToLB->get_count())
         return;
 
     //select first column
@@ -413,50 +388,50 @@ void SwMMResultEmailDialog::FillInEmailSettings()
         aFields = xColAccess->getElementNames();
     const OUString* pFields = aFields.getConstArray();
     for (sal_Int32 nField = 0; nField < aFields.getLength(); ++nField)
-        m_pMailToLB->InsertEntry(pFields[nField]);
+        m_xMailToLB->append_text(pFields[nField]);
 
-    m_pMailToLB->SelectEntryPos(0);
+    m_xMailToLB->set_active(0);
     // then select the right one - may not be available
     const std::vector<std::pair<OUString, int>>& rHeaders = xConfigItem->GetDefaultAddressHeaders();
     OUString sEMailColumn = rHeaders[MM_PART_E_MAIL].first;
     Sequence< OUString> aAssignment = xConfigItem->GetColumnAssignment(xConfigItem->GetCurrentDBData());
     if (aAssignment.getLength() > MM_PART_E_MAIL && !aAssignment[MM_PART_E_MAIL].isEmpty())
         sEMailColumn = aAssignment[MM_PART_E_MAIL];
-    m_pMailToLB->SelectEntry(sEMailColumn);
+    m_xMailToLB->set_active_text(sEMailColumn);
 
     // HTML format pre-selected
-    m_pSendAsLB->SelectEntryPos(3);
-    SendTypeHdl_Impl(*m_pSendAsLB);
+    m_xSendAsLB->set_active(3);
+    SendTypeHdl_Impl(*m_xSendAsLB);
 
 }
 
-IMPL_LINK(SwMMResultSaveDialog, DocumentSelectionHdl_Impl, weld::ToggleButton&, rButton, void)
+IMPL_LINK_NOARG(SwMMResultSaveDialog, DocumentSelectionHdl_Impl, weld::ToggleButton&, void)
 {
-    bool bEnableFromTo = &rButton == m_xFromRB.get();
+    bool bEnableFromTo = m_xFromRB->get_active();
     m_xFromNF->set_sensitive(bEnableFromTo);
     m_xToFT->set_sensitive(bEnableFromTo);
     m_xToNF->set_sensitive(bEnableFromTo);
 }
 
-IMPL_LINK(SwMMResultPrintDialog, DocumentSelectionHdl_Impl, weld::ToggleButton&, rButton, void)
+IMPL_LINK_NOARG(SwMMResultPrintDialog, DocumentSelectionHdl_Impl, weld::ToggleButton&, void)
 {
-    bool bEnableFromTo = &rButton == m_xFromRB.get();
+    bool bEnableFromTo = m_xFromRB->get_active();
     m_xFromNF->set_sensitive(bEnableFromTo);
     m_xToFT->set_sensitive(bEnableFromTo);
     m_xToNF->set_sensitive(bEnableFromTo);
 }
 
-IMPL_LINK(SwMMResultEmailDialog, DocumentSelectionHdl_Impl, Button*, pButton, void)
+IMPL_LINK_NOARG(SwMMResultEmailDialog, DocumentSelectionHdl_Impl, weld::ToggleButton&, void)
 {
-    bool bEnableFromTo = pButton == m_pFromRB;
-    m_pFromNF->Enable(bEnableFromTo);
-    m_pToFT->Enable(bEnableFromTo);
-    m_pToNF->Enable(bEnableFromTo);
+    bool bEnableFromTo = m_xFromRB->get_active();
+    m_xFromNF->set_sensitive(bEnableFromTo);
+    m_xToFT->set_sensitive(bEnableFromTo);
+    m_xToNF->set_sensitive(bEnableFromTo);
 }
 
-IMPL_LINK_NOARG(SwMMResultEmailDialog, CopyToHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SwMMResultEmailDialog, CopyToHdl_Impl, weld::Button&, void)
 {
-    SwCopyToDialog aDlg(GetFrameWeld());
+    SwCopyToDialog aDlg(m_xDialog.get());
     aDlg.SetCC(m_sCC );
     aDlg.SetBCC(m_sBCC);
     if (aDlg.run() == RET_OK)
@@ -511,15 +486,6 @@ int documentEndPageNumber(SwMailMergeConfigItem* pConfigItem, int document, bool
     return page;
 }
 
-void endDialog(Button* pButton)
-{
-    vcl::Window* pParent = getNonLayoutParent(pButton);
-    Dialog *pDialog = dynamic_cast<Dialog*>(pParent);
-
-    if (pDialog && pDialog->IsInExecute())
-        pDialog->EndDialog(RET_OK);
-}
-
 } // anonymous namespace
 
 IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, weld::Button&, void)
@@ -824,16 +790,16 @@ IMPL_LINK_NOARG(SwMMResultPrintDialog, PrinterSetupHdl_Impl, weld::Button&, void
         m_pTempPrinter->Setup(m_xDialog.get());
 }
 
-IMPL_LINK(SwMMResultEmailDialog, SendTypeHdl_Impl, ListBox&, rBox, void)
+IMPL_LINK(SwMMResultEmailDialog, SendTypeHdl_Impl, weld::ComboBox&, rBox, void)
 {
-    sal_uLong nDocType = reinterpret_cast<sal_uLong>(rBox.GetSelectedEntryData());
+    auto nDocType = rBox.get_active_id().toUInt32();
     bool bEnable = MM_DOCTYPE_HTML != nDocType && MM_DOCTYPE_TEXT != nDocType;
-    m_pSendAsPB->Enable( bEnable );
-    m_pAttachmentGroup->Enable( bEnable );
+    m_xSendAsPB->set_sensitive(bEnable);
+    m_xAttachmentGroup->set_sensitive(bEnable);
     if(bEnable)
     {
         //add the correct extension
-        OUString sAttach(m_pAttachmentED->GetText());
+        OUString sAttach(m_xAttachmentED->get_text());
         //do nothing if the user has removed the name - the warning will come early enough
         if (!sAttach.isEmpty())
         {
@@ -844,14 +810,14 @@ IMPL_LINK(SwMMResultEmailDialog, SendTypeHdl_Impl, ListBox&, rBox, void)
                 ++nTokenCount;
             }
             sAttach = comphelper::string::setToken(sAttach, nTokenCount - 1, '.', lcl_GetExtensionForDocType( nDocType ));
-            m_pAttachmentED->SetText(sAttach);
+            m_xAttachmentED->set_text(sAttach);
         }
     }
 }
 
-IMPL_LINK_NOARG(SwMMResultEmailDialog, SendAsHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SwMMResultEmailDialog, SendAsHdl_Impl, weld::Button&, void)
 {
-    SwMailBodyDialog aDlg(GetFrameWeld());
+    SwMailBodyDialog aDlg(m_xDialog.get());
     aDlg.SetBody(m_sBody);
     if (RET_OK == aDlg.run())
     {
@@ -860,7 +826,7 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, SendAsHdl_Impl, Button*, void)
 }
 
 // Send documents as e-mail
-IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
+IMPL_LINK_NOARG(SwMMResultEmailDialog, SendDocumentsHdl_Impl, weld::Button&, void)
 {
     SwView* pView = ::GetActiveView();
     std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem();
@@ -875,7 +841,7 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
     if (xConfigItem->GetMailServer().isEmpty() ||
             !SwMailMergeHelper::CheckMailAddress(xConfigItem->GetMailAddress()) )
     {
-        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pButton->GetFrameWeld(),
+        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(m_xDialog.get(),
                                                        VclMessageType::Question, VclButtonsType::YesNo,
                                                        m_sConfigureMail));
         xQueryBox->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
@@ -884,7 +850,7 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
         {
             SwView* pConfigView = pTargetView ? pTargetView : pView;
             SfxAllItemSet aSet(pConfigView->GetPool());
-            SwMailConfigDlg aDlg(pButton->GetFrameWeld(), aSet);
+            SwMailConfigDlg aDlg(m_xDialog.get(), aSet);
             nRet = aDlg.run();
         }
 
@@ -894,15 +860,15 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
     //add the documents
     sal_uInt32 nBegin = 0;
     sal_uInt32 nEnd = 0;
-    if(m_pSendAllRB->IsChecked())
+    if (m_xSendAllRB->get_active())
     {
         nBegin = 0;
         nEnd = xConfigItem->GetMergedDocumentCount();
     }
     else
     {
-        nBegin  = static_cast< sal_Int32 >(m_pFromNF->GetValue() - 1);
-        nEnd    = static_cast< sal_Int32 >(m_pToNF->GetValue());
+        nBegin  = static_cast< sal_Int32 >(m_xFromNF->get_value() - 1);
+        nEnd    = static_cast< sal_Int32 >(m_xToNF->get_value());
         if(nEnd > xConfigItem->GetMergedDocumentCount())
             nEnd = xConfigItem->GetMergedDocumentCount();
     }
@@ -910,7 +876,7 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
     rtl_TextEncoding eEncoding = ::osl_getThreadTextEncoding();
     SfxFilterContainer* pFilterContainer = SwDocShell::Factory().GetFilterContainer();
     std::shared_ptr<const SfxFilter> pSfxFlt;
-    sal_uLong nDocType = reinterpret_cast<sal_uLong>(m_pSendAsLB->GetSelectedEntryData());
+    auto nDocType = m_xSendAsLB->get_active_id().toUInt32();
     OUString sExtension = lcl_GetExtensionForDocType(nDocType);
     switch( nDocType )
     {
@@ -969,28 +935,28 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
 
     if(!pSfxFlt)
     {
-        endDialog(pButton);
+        m_xDialog->response(RET_OK);
         return;
     }
     OUString sMimeType = pSfxFlt->GetMimeType();
 
-    if(m_pSubjectED->GetText().isEmpty())
+    if (m_xSubjectED->get_text().isEmpty())
     {
-        std::unique_ptr<SwSendQueryBox_Impl> xQuery(new SwSendQueryBox_Impl(pButton->GetFrameWeld(), "SubjectDialog",
+        std::unique_ptr<SwSendQueryBox_Impl> xQuery(new SwSendQueryBox_Impl(m_xDialog.get(), "SubjectDialog",
                                                          "modules/swriter/ui/subjectdialog.ui"));
         xQuery->SetIsEmptyTextAllowed(true);
         xQuery->SetValue("");
         if(RET_OK == xQuery->run())
         {
-            if(!xQuery->GetValue().isEmpty())
-                m_pSubjectED->SetText(xQuery->GetValue());
+            if (!xQuery->GetValue().isEmpty())
+                m_xSubjectED->set_text(xQuery->GetValue());
         }
         else
             return; // back to the dialog
     }
-    if(!bAsBody && m_pAttachmentED->GetText().isEmpty())
+    if(!bAsBody && m_xAttachmentED->get_text().isEmpty())
     {
-        std::unique_ptr<SwSendQueryBox_Impl> xQuery(new SwSendQueryBox_Impl(pButton->GetFrameWeld(), "AttachNameDialog",
+        std::unique_ptr<SwSendQueryBox_Impl> xQuery(new SwSendQueryBox_Impl(m_xDialog.get(), "AttachNameDialog",
                                                          "modules/swriter/ui/attachnamedialog.ui"));
         xQuery->SetIsEmptyTextAllowed(false);
         if (RET_OK == xQuery->run())
@@ -1003,19 +969,19 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
                 ++nTokenCount;
             }
             sAttach = comphelper::string::setToken(sAttach, nTokenCount - 1, '.', lcl_GetExtensionForDocType(
-                     reinterpret_cast<sal_uLong>(m_pSendAsLB->GetSelectedEntryData())));
-            m_pAttachmentED->SetText(sAttach);
+                                                   m_xSendAsLB->get_active_id().toUInt32()));
+            m_xAttachmentED->set_text(sAttach);
         }
         else
             return; // back to the dialog
     }
-    OUString sEMailColumn = m_pMailToLB->GetSelectedEntry();
+    OUString sEMailColumn = m_xMailToLB->get_active_text();
     OSL_ENSURE( !sEMailColumn.isEmpty(), "No email column selected");
     Reference< sdbcx::XColumnsSupplier > xColsSupp( xConfigItem->GetResultSet(), UNO_QUERY);
     Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : nullptr;
     if(sEMailColumn.isEmpty() || !xColAccess.is() || !xColAccess->hasByName(sEMailColumn))
     {
-        endDialog(pButton);
+        m_xDialog->response(RET_OK);
         return;
     }
 
@@ -1058,7 +1024,7 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
     //TODO/CLEANUP
     //predetermined breaking point
     Application::Reschedule( true );
-    endDialog(pButton);
+    m_xDialog->response(RET_OK);
     for(sal_uInt32 nDoc = nBegin; nDoc < nEnd; ++nDoc)
     {
         SwDocMergeInfo& rInfo = xConfigItem->GetDocumentMergeInfo(nDoc);
@@ -1145,7 +1111,7 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
         {
             sBody = m_sBody;
             aDesc.sAttachmentURL = aName.GetValue();
-            OUString sAttachment(m_pAttachmentED->GetText());
+            OUString sAttachment(m_xAttachmentED->get_text());
             sal_Int32 nTokenCount = comphelper::string::getTokenCount(sAttachment, '.');
             if (2 > nTokenCount)
             {
@@ -1196,7 +1162,7 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
         else
             aDesc.sBodyMimeType = "text/plain; charset=UTF-8; format=flowed";
 
-        aDesc.sSubject = m_pSubjectED->GetText();
+        aDesc.sSubject = m_xSubjectED->get_text();
         aDesc.sCC = m_sCC;
         aDesc.sBCC = m_sBCC;
         pDlg->AddDocument( aDesc );
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 963343952275..371c7e0be8e0 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1218,10 +1218,10 @@ void SwAbstractDialogFactory_Impl::ExecuteMMResultPrintDialog(weld::Window* pPar
     aDialog.run();
 }
 
-void SwAbstractDialogFactory_Impl::ExecuteMMResultEmailDialog()
+void SwAbstractDialogFactory_Impl::ExecuteMMResultEmailDialog(weld::Window* pParent)
 {
-    ScopedVclPtrInstance<SwMMResultEmailDialog> pDialog;
-    pDialog->Execute();
+    SwMMResultEmailDialog aDialog(pParent);
+    aDialog.run();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 993d0aa7cb8f..3943fb159bce 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -722,7 +722,7 @@ public:
 
     virtual void ExecuteMMResultSaveDialog(weld::Window* pParent) override;
     virtual void ExecuteMMResultPrintDialog(weld::Window* pParent) override;
-    virtual void ExecuteMMResultEmailDialog() override;
+    virtual void ExecuteMMResultEmailDialog(weld::Window* pParent) override;
 };
 
 #endif
diff --git a/sw/source/ui/inc/mmresultdialogs.hxx b/sw/source/ui/inc/mmresultdialogs.hxx
index 7f7dad562b9a..a26ee9fa8b6f 100644
--- a/sw/source/ui/inc/mmresultdialogs.hxx
+++ b/sw/source/ui/inc/mmresultdialogs.hxx
@@ -92,51 +92,41 @@ public:
 };
 
 /// Dialog implementing the sending as email of the result document.
-class SwMMResultEmailDialog : public SfxModalDialog
+class SwMMResultEmailDialog : public SfxDialogController
 {
-    VclPtr<FixedText>      m_pMailToFT;
-    VclPtr<ListBox>        m_pMailToLB;
-    VclPtr<PushButton>     m_pCopyToPB;
-
-    VclPtr<FixedText>      m_pSubjectFT;
-    VclPtr<Edit>           m_pSubjectED;
-
-    VclPtr<FixedText>      m_pSendAsFT;
-    VclPtr<ListBox>        m_pSendAsLB;
-    VclPtr<PushButton>     m_pSendAsPB;
-
-    VclPtr<VclContainer>   m_pAttachmentGroup;
-    VclPtr<Edit>           m_pAttachmentED;
-
-    VclPtr<RadioButton>    m_pSendAllRB;
-
-    VclPtr<RadioButton>    m_pFromRB;
-    VclPtr<NumericField>   m_pFromNF;
-    VclPtr<FixedText>      m_pToFT;
-    VclPtr<NumericField>   m_pToNF;
-
-    VclPtr<Button>         m_pOKButton;
-
     OUString const  m_sConfigureMail;
-
     OUString        m_sCC;
     OUString        m_sBCC;
-
     OUString        m_sBody;
 
-    DECL_LINK(CopyToHdl_Impl, Button*, void);
-    DECL_LINK(SendTypeHdl_Impl, ListBox&, void);
-    DECL_LINK(SendAsHdl_Impl, Button*, void);
-    DECL_LINK(SendDocumentsHdl_Impl, Button*, void);
-    DECL_LINK(DocumentSelectionHdl_Impl, Button*, void);
+    std::unique_ptr<weld::Label> m_xMailToFT;
+    std::unique_ptr<weld::ComboBox> m_xMailToLB;
+    std::unique_ptr<weld::Button> m_xCopyToPB;
+    std::unique_ptr<weld::Label> m_xSubjectFT;
+    std::unique_ptr<weld::Entry> m_xSubjectED;
+    std::unique_ptr<weld::Label> m_xSendAsFT;
+    std::unique_ptr<weld::ComboBox> m_xSendAsLB;
+    std::unique_ptr<weld::Button> m_xSendAsPB;
+    std::unique_ptr<weld::Widget> m_xAttachmentGroup;
+    std::unique_ptr<weld::Entry> m_xAttachmentED;
+    std::unique_ptr<weld::RadioButton> m_xSendAllRB;
+    std::unique_ptr<weld::RadioButton> m_xFromRB;
+    std::unique_ptr<weld::SpinButton> m_xFromNF;
+    std::unique_ptr<weld::Label> m_xToFT;
+    std::unique_ptr<weld::SpinButton> m_xToNF;
+    std::unique_ptr<weld::Button> m_xOKButton;
+
+    DECL_LINK(CopyToHdl_Impl, weld::Button&, void);
+    DECL_LINK(SendTypeHdl_Impl, weld::ComboBox&, void);
+    DECL_LINK(SendAsHdl_Impl, weld::Button&, void);
+    DECL_LINK(SendDocumentsHdl_Impl, weld::Button&, void);
+    DECL_LINK(DocumentSelectionHdl_Impl, weld::ToggleButton&, void);
 
     void FillInEmailSettings();
 
 public:
-    SwMMResultEmailDialog();
+    SwMMResultEmailDialog(weld::Window *pParent);
     virtual ~SwMMResultEmailDialog() override;
-
-    virtual void dispose() override;
 };
 
 struct SwMailDescriptor
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 89a99f79d727..fb6270a91958 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -768,7 +768,7 @@ void SwModule::ExecOther(SfxRequest& rReq)
             {
                 case FN_MAILMERGE_SAVE_DOCUMENTS: pFact->ExecuteMMResultSaveDialog(rReq.GetFrameWeld()); break;
                 case FN_MAILMERGE_PRINT_DOCUMENTS: pFact->ExecuteMMResultPrintDialog(rReq.GetFrameWeld()); break;
-                case FN_MAILMERGE_EMAIL_DOCUMENTS: pFact->ExecuteMMResultEmailDialog(); break;
+                case FN_MAILMERGE_EMAIL_DOCUMENTS: pFact->ExecuteMMResultEmailDialog(rReq.GetFrameWeld()); break;
             }
         }
         break;
diff --git a/sw/uiconfig/swriter/ui/mmresultemaildialog.ui b/sw/uiconfig/swriter/ui/mmresultemaildialog.ui
index 08f5bfc142f6..5f10bf7dd4aa 100644
--- a/sw/uiconfig/swriter/ui/mmresultemaildialog.ui
+++ b/sw/uiconfig/swriter/ui/mmresultemaildialog.ui
@@ -1,42 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sw">
   <requires lib="gtk+" version="3.18"/>
-  <object class="GtkListStore" id="liststore1">
-    <columns>
-      <!-- column-name gchararray1 -->
-      <column type="gchararray"/>
-      <!-- column-name gint1 -->
-      <column type="gint"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes" context="mmresultemaildialog|liststore1">OpenDocument Text</col>
-        <col id="1">1</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes" context="mmresultemaildialog|liststore1">Adobe PDF-Document</col>
-        <col id="1">2</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes" context="mmresultemaildialog|liststore1">Microsoft Word Document</col>
-        <col id="1">3</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes" context="mmresultemaildialog|liststore1">HTML Message</col>
-        <col id="1">4</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes" context="mmresultemaildialog|liststore1">Plain Text</col>
-        <col id="1">5</col>
-      </row>
-    </data>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="upper">16000</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment2">
+    <property name="upper">16000</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
   </object>
   <object class="GtkDialog" id="MMResultEmailDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="mmresultemaildialog|MMResultEmailDialog">E-Mail merged document</property>
+    <property name="modal">True</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
@@ -129,10 +115,10 @@
                           <object class="GtkLabel" id="mailtoft">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
                             <property name="label" translatable="yes" context="mmresultemaildialog|mailtoft">T_o</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">mailto</property>
+                            <property name="xalign">0</property>
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
@@ -167,10 +153,10 @@
                           <object class="GtkLabel" id="subjectft">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
                             <property name="label" translatable="yes" context="mmresultemaildialog|subjectft">S_ubject</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">subject</property>
+                            <property name="xalign">0</property>
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
@@ -192,10 +178,10 @@
                           <object class="GtkLabel" id="sendasft">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
                             <property name="label" translatable="yes" context="mmresultemaildialog|sendasft">Sen_d as</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">sendas</property>
+                            <property name="xalign">0</property>
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
@@ -203,11 +189,17 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkComboBox" id="sendas">
+                          <object class="GtkComboBoxText" id="sendas">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
-                            <property name="model">liststore1</property>
+                            <items>
+                              <item id="1" translatable="yes" context="mmresultemaildialog|liststore1">OpenDocument Text</item>
+                              <item id="2" translatable="yes" context="mmresultemaildialog|liststore1">Adobe PDF-Document</item>
+                              <item id="3" translatable="yes" context="mmresultemaildialog|liststore1">Microsoft Word Document</item>
+                              <item id="4" translatable="yes" context="mmresultemaildialog|liststore1">HTML Message</item>
+                              <item id="5" translatable="yes" context="mmresultemaildialog|liststore1">Plain Text</item>
+                            </items>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -261,10 +253,10 @@
                           <object class="GtkLabel" id="attachft">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
                             <property name="label" translatable="yes" context="mmresultemaildialog|attachft">Name of the a_ttachment</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">attach</property>
+                            <property name="xalign">0</property>
                           </object>
                         </child>
                       </object>
@@ -321,7 +313,6 @@
                         <property name="xalign">0</property>
                         <property name="active">True</property>
                         <property name="draw_indicator">True</property>
-                        <property name="group">fromrb</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -345,7 +336,7 @@
                             <property name="draw_indicator">True</property>
                             <property name="group">sendallrb</property>
                             <accessibility>
-                              <relation type="label-for" target="from-nospin"/>
+                              <relation type="label-for" target="from"/>
                             </accessibility>
                           </object>
                           <packing>
@@ -359,7 +350,7 @@
                             <property name="can_focus">False</property>
                             <property name="label" translatable="yes" context="mmresultemaildialog|toft">_To</property>
                             <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">to-nospin</property>
+                            <property name="mnemonic_widget">to</property>
                           </object>
                           <packing>
                             <property name="left_attach">2</property>
@@ -367,10 +358,11 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkSpinButton" id="from-nospin">
+                          <object class="GtkSpinButton" id="from">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="text" translatable="no">1</property>
+                            <property name="text">1</property>
+                            <property name="adjustment">adjustment2</property>
                             <accessibility>
                               <relation type="labelled-by" target="fromrb"/>
                             </accessibility>
@@ -381,10 +373,11 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkSpinButton" id="to-nospin">
+                          <object class="GtkSpinButton" id="to">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="text">1</property>
+                            <property name="adjustment">adjustment1</property>
                           </object>
                           <packing>
                             <property name="left_attach">3</property>
commit 9c6a4d1f542ad687e72037ac55547241f519097b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 18 09:58:03 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 18 15:08:37 2018 +0200

    weld SwMailMergeCreateFromDlg
    
    Change-Id: I9885881bfc6baffe1184d52c207d8f5d81a4a3b4
    Reviewed-on: https://gerrit.libreoffice.org/61919
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index fdd6a431544f..ea8a27fdfcae 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -459,7 +459,7 @@ public:
                                                 const OUString& rTableName,
                                                 sal_Int32 nCommandType,
                                                 const css::uno::Reference< css::sdbc::XConnection>& xConnection ) = 0;
-    virtual VclPtr<AbstractMailMergeCreateFromDlg>   CreateMailMergeCreateFromDlg(vcl::Window* pParent) = 0;
+    virtual VclPtr<AbstractMailMergeCreateFromDlg>   CreateMailMergeCreateFromDlg(weld::Window* pParent) = 0;
     virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) = 0;
     virtual VclPtr<VclAbstractDialog>          CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr) = 0;
     virtual VclPtr<SfxAbstractTabDialog>       CreateOutlineTabDialog(weld::Window* pParent,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 6dca63b32f43..963343952275 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -213,7 +213,11 @@ short AbstractJavaEditDialog_Impl::Execute()
 }
 
 IMPL_ABSTDLG_BASE(AbstractMailMergeDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractMailMergeCreateFromDlg_Impl);
+
+short AbstractMailMergeCreateFromDlg_Impl::Execute()
+{
+    return m_xDlg->run();
+}
 
 short AbstractMailMergeFieldConnectionsDlg_Impl::Execute()
 {
@@ -637,7 +641,7 @@ OUString AbstractMailMergeDlg_Impl::GetTargetURL() const
 
 bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const
 {
-    return pDlg->IsThisDocument();
+    return m_xDlg->IsThisDocument();
 }
 
 bool AbstractMailMergeFieldConnectionsDlg_Impl::IsUseExistingConnections() const
@@ -1039,10 +1043,9 @@ VclPtr<AbstractMailMergeDlg> SwAbstractDialogFactory_Impl::CreateMailMergeDlg(
     return VclPtr<AbstractMailMergeDlg_Impl>::Create( pDlg );
 }
 
-VclPtr<AbstractMailMergeCreateFromDlg> SwAbstractDialogFactory_Impl::CreateMailMergeCreateFromDlg(vcl::Window* pParent)
+VclPtr<AbstractMailMergeCreateFromDlg> SwAbstractDialogFactory_Impl::CreateMailMergeCreateFromDlg(weld::Window* pParent)
 {
-    VclPtr<SwMailMergeCreateFromDlg> pDlg = VclPtr<SwMailMergeCreateFromDlg>::Create(pParent);
-    return VclPtr<AbstractMailMergeCreateFromDlg_Impl>::Create(pDlg);
+    return VclPtr<AbstractMailMergeCreateFromDlg_Impl>::Create(o3tl::make_unique<SwMailMergeCreateFromDlg>(pParent));
 }
 
 VclPtr<AbstractMailMergeFieldConnectionsDlg> SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(weld::Window* pParent)
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 07953242d358..993d0aa7cb8f 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -501,7 +501,14 @@ class AbstractMailMergeDlg_Impl : public AbstractMailMergeDlg
 class SwMailMergeCreateFromDlg;
 class AbstractMailMergeCreateFromDlg_Impl : public AbstractMailMergeCreateFromDlg
 {
-    DECL_ABSTDLG_BASE(AbstractMailMergeCreateFromDlg_Impl,SwMailMergeCreateFromDlg)
+protected:
+    std::unique_ptr<SwMailMergeCreateFromDlg> m_xDlg;
+public:
+    explicit AbstractMailMergeCreateFromDlg_Impl(std::unique_ptr<SwMailMergeCreateFromDlg> p)
+        : m_xDlg(std::move(p))
+    {
+    }
+    virtual short Execute() override;
     virtual bool    IsThisDocument() const override ;
 };
 
@@ -676,7 +683,7 @@ public:
                                                 const OUString& rTableName,
                                                 sal_Int32 nCommandType,
                                                 const css::uno::Reference< css::sdbc::XConnection>& xConnection ) override;
-    virtual VclPtr<AbstractMailMergeCreateFromDlg>     CreateMailMergeCreateFromDlg(vcl::Window* pParent) override;
+    virtual VclPtr<AbstractMailMergeCreateFromDlg>     CreateMailMergeCreateFromDlg(weld::Window* pParent) override;
     virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) override;
     virtual VclPtr<VclAbstractDialog>          CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr) override;
     virtual VclPtr<SfxAbstractTabDialog>       CreateOutlineTabDialog(weld::Window* pParent, const SfxItemSet* pSwItemSet,
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 9bcd53d6c206..f896e3b52f73 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -616,22 +616,14 @@ uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const
     return xResSetClone;
 }
 
-SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(vcl::Window* pParent)
-    : ModalDialog(pParent, "MailMergeDialog",
-                  "modules/swriter/ui/mailmergedialog.ui")
+SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(weld::Window* pParent)
+    : GenericDialogController(pParent, "modules/swriter/ui/mailmergedialog.ui", "MailMergeDialog")
+    , m_xThisDocRB(m_xBuilder->weld_radio_button("document"))
 {
-    get(m_pThisDocRB, "document");
 }
 
 SwMailMergeCreateFromDlg::~SwMailMergeCreateFromDlg()
 {
-    disposeOnce();
-}
-
-void SwMailMergeCreateFromDlg::dispose()
-{
-    m_pThisDocRB.clear();
-    ModalDialog::dispose();
 }
 
 SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(weld::Window* pParent)
diff --git a/sw/source/uibase/inc/mailmrge.hxx b/sw/source/uibase/inc/mailmrge.hxx
index 23f51e363d8d..cbb9a9465936 100644
--- a/sw/source/uibase/inc/mailmrge.hxx
+++ b/sw/source/uibase/inc/mailmrge.hxx
@@ -139,16 +139,15 @@ public:
 
 };
 
-class SwMailMergeCreateFromDlg : public ModalDialog
+class SwMailMergeCreateFromDlg : public weld::GenericDialogController
 {
-    VclPtr<RadioButton> m_pThisDocRB;
+    std::unique_ptr<weld::RadioButton> m_xThisDocRB;
 public:
-    SwMailMergeCreateFromDlg(vcl::Window* pParent);
+    SwMailMergeCreateFromDlg(weld::Window* pParent);
     virtual ~SwMailMergeCreateFromDlg() override;
-    virtual void dispose() override;
     bool IsThisDocument() const
     {
-        return m_pThisDocRB->IsChecked();
+        return m_xThisDocRB->get_active();
     }
 };
 
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 93bc535e9b31..f54eb93a897a 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1116,8 +1116,8 @@ void SwView::Execute(SfxRequest &rReq)
             {
                 SfxViewFrame* pTmpFrame = GetViewFrame();
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                ScopedVclPtr<AbstractMailMergeCreateFromDlg> pDlg( pFact->CreateMailMergeCreateFromDlg(&pTmpFrame->GetWindow()) );
-                if(RET_OK == pDlg->Execute())
+                ScopedVclPtr<AbstractMailMergeCreateFromDlg> pDlg(pFact->CreateMailMergeCreateFromDlg(pTmpFrame->GetWindow().GetFrameWeld()));
+                if (RET_OK == pDlg->Execute())
                     bUseCurrentDocument = pDlg->IsThisDocument();
                 else
                     break;
diff --git a/sw/uiconfig/swriter/ui/mailmergedialog.ui b/sw/uiconfig/swriter/ui/mailmergedialog.ui
index 4120cb8b4620..dfef7d97303e 100644
--- a/sw/uiconfig/swriter/ui/mailmergedialog.ui
+++ b/sw/uiconfig/swriter/ui/mailmergedialog.ui
@@ -1,11 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sw">
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.18"/>
   <object class="GtkDialog" id="MailMergeDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="mailmergedialog|MailMergeDialog">Mail Merge</property>
+    <property name="modal">True</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
@@ -98,13 +105,10 @@
                         <property name="xalign">0</property>
                         <property name="active">True</property>
                         <property name="draw_indicator">True</property>
-                        <property name="group">template</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -121,8 +125,6 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                   </object>


More information about the Libreoffice-commits mailing list