[Libreoffice-commits] core.git: 2 commits - solenv/sanitizers sw/inc sw/source sw/uiconfig vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 7 14:52:15 UTC 2019


 solenv/sanitizers/ui/modules/swriter.suppr |    1 
 sw/inc/strings.hrc                         |    2 
 sw/source/ui/dbui/mmoutputtypepage.cxx     |  202 +++++++++++------------------
 sw/source/ui/dbui/mmresultdialogs.cxx      |   13 +
 sw/source/ui/inc/mmresultdialogs.hxx       |   51 +++----
 sw/uiconfig/swriter/ui/mmsendmails.ui      |   80 ++++++++++-
 vcl/source/window/printdlg.cxx             |    2 
 7 files changed, 183 insertions(+), 168 deletions(-)

New commits:
commit a5b775c638c5631acb16363e37ee9c49d8835d0b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Oct 7 09:29:58 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Oct 7 16:51:26 2019 +0200

    cid#1454629 silence bogus Arguments in wrong order
    
    Change-Id: I7dc06a2754eaa172f112f38a260240f8e2cc0983
    Reviewed-on: https://gerrit.libreoffice.org/80345
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index c9ad27e2e7c1..76924240f575 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -628,11 +628,13 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptr<PrinterC
     if( maPController->getPrinter()->GetOrientation() == Orientation::Landscape )
     {
         maNupLandscapeSize = aNupSize;
+        // coverity[swapped_arguments : FALSE] - this is in the correct order
         maNupPortraitSize = Size( aNupSize.Height(), aNupSize.Width() );
     }
     else
     {
         maNupPortraitSize = aNupSize;
+        // coverity[swapped_arguments : FALSE] - this is in the correct order
         maNupLandscapeSize = Size( aNupSize.Height(), aNupSize.Width() );
     }
 
commit ed200d9f2586b714718aaa7319ea68cf480261ad
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 28 16:01:00 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Oct 7 16:51:13 2019 +0200

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

diff --git a/solenv/sanitizers/ui/modules/swriter.suppr b/solenv/sanitizers/ui/modules/swriter.suppr
index 8fd62f49ff80..97f6e239143f 100644
--- a/solenv/sanitizers/ui/modules/swriter.suppr
+++ b/solenv/sanitizers/ui/modules/swriter.suppr
@@ -163,7 +163,6 @@ sw/uiconfig/swriter/ui/mmsendmails.ui://GtkLabel[@id='transferstatus'] orphan-la
 sw/uiconfig/swriter/ui/mmsendmails.ui://GtkLabel[@id='paused'] orphan-label
 sw/uiconfig/swriter/ui/mmsendmails.ui://GtkProgressBar[@id='progress'] no-labelled-by
 sw/uiconfig/swriter/ui/mmsendmails.ui://GtkLabel[@id='errorstatus'] orphan-label
-sw/uiconfig/swriter/ui/mmsendmails.ui://svtlo-SvSimpleTableContainer[@id='container'] no-labelled-by
 sw/uiconfig/swriter/ui/mmsalutationpage.ui://GtkLabel[@id='documentindex'] orphan-label
 sw/uiconfig/swriter/ui/mmsalutationpage.ui://GtkLabel[@id='femalefi'] orphan-label
 sw/uiconfig/swriter/ui/notebookbar_groups.ui://GtkLabel[@id='filegrouplabel'] orphan-label
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 54323e254cf4..54ef4b1463c7 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1327,8 +1327,6 @@
 #define STR_SAVEACOPY_SRC                       NC_("STR_SAVEACOPY_SRC", "~Export copy of source...")
 
 #define ST_CONTINUE                             NC_("ST_CONTINUE", "~Continue")
-#define ST_TASK                                 NC_("ST_TASK", "Task")
-#define ST_STATUS                               NC_("ST_STATUS", "Status")
 #define ST_SENDINGTO                            NC_("ST_SENDINGTO", "Sending to: %1")
 #define ST_COMPLETED                            NC_("ST_COMPLETED", "Successfully sent")
 #define ST_FAILED                               NC_("ST_FAILED", "Sending failed")
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 5221c096ff6e..cdf6fa59b065 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -27,7 +27,6 @@
 
 #include <rtl/ref.hxx>
 #include <com/sun/star/mail/XSmtpService.hpp>
-#include <vcl/fixed.hxx>
 #include <vcl/idle.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/weld.hxx>
@@ -117,7 +116,7 @@ const SwMailDescriptor* SwSendMailDialog_Impl::GetNextDescriptor()
 
 class SwMailDispatcherListener_Impl : public IMailDispatcherListener
 {
-    VclPtr<SwSendMailDialog> m_pSendMailDialog;
+    SwSendMailDialog& m_rSendMailDialog;
 
 public:
     explicit SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg);
@@ -131,16 +130,15 @@ public:
     static void DeleteAttachments( uno::Reference< mail::XMailMessage > const & xMessage );
 };
 
-SwMailDispatcherListener_Impl::SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg) :
-    m_pSendMailDialog(&rParentDlg)
+SwMailDispatcherListener_Impl::SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg)
+    : m_rSendMailDialog(rParentDlg)
 {
 }
 
 void SwMailDispatcherListener_Impl::idle(::rtl::Reference<MailDispatcher> /*xMailDispatcher*/)
 {
     SolarMutexGuard aGuard;
-    if (!m_pSendMailDialog->isDisposed())
-        m_pSendMailDialog->AllMailsSent();
+    m_rSendMailDialog.AllMailsSent();
 }
 
 void SwMailDispatcherListener_Impl::mailDelivered(
@@ -148,8 +146,7 @@ void SwMailDispatcherListener_Impl::mailDelivered(
                         uno::Reference< mail::XMailMessage> xMailMessage)
 {
     SolarMutexGuard aGuard;
-    if (!m_pSendMailDialog->isDisposed())
-        m_pSendMailDialog->DocumentSent( xMailMessage, true, nullptr );
+    m_rSendMailDialog.DocumentSent( xMailMessage, true, nullptr );
     DeleteAttachments( xMailMessage );
 }
 
@@ -159,8 +156,7 @@ void SwMailDispatcherListener_Impl::mailDeliveryError(
                 const OUString& sErrorMessage)
 {
     SolarMutexGuard aGuard;
-    if (!m_pSendMailDialog->isDisposed())
-        m_pSendMailDialog->DocumentSent( xMailMessage, false, &sErrorMessage );
+    m_rSendMailDialog.DocumentSent( xMailMessage, false, &sErrorMessage );
     DeleteAttachments( xMailMessage );
 }
 
@@ -198,71 +194,50 @@ public:
     }
 };
 
-#define ITEMID_TASK     1
-#define ITEMID_STATUS   2
-
-SwSendMailDialog::SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem& rConfigItem) :
-    Dialog(pParent, "SendMailsDialog", "modules/swriter/ui/mmsendmails.ui"),
-    m_pTransferStatus(get<FixedText>("transferstatus")),
-    m_pPaused(get<FixedText>("paused")),
-    m_pProgressBar(get<ProgressBar>("progress")),
-    m_pErrorStatus(get<FixedText>("errorstatus")),
-    m_pContainer(get<SvSimpleTableContainer>("container")),
-    m_pStop(get<PushButton>("stop")),
-    m_pClose(get<PushButton>("cancel")),
-    m_sContinue(SwResId( ST_CONTINUE )),
-    m_sStop(m_pStop->GetText()),
-    m_sTransferStatus(m_pTransferStatus->GetText()),
-    m_sErrorStatus(   m_pErrorStatus->GetText()),
-    m_sSendingTo(   SwResId(ST_SENDINGTO )),
-    m_sCompleted(   SwResId(ST_COMPLETED )),
-    m_sFailed(      SwResId(ST_FAILED     )),
-    m_bCancel(false),
-    m_bDestructionEnabled(false),
-    m_pImpl(new SwSendMailDialog_Impl),
-    m_pConfigItem(&rConfigItem),
-    m_nExpectedCount(0),
-    m_nSendCount(0),
-    m_nErrorCount(0)
+SwSendMailDialog::SwSendMailDialog(weld::Window *pParent, SwMailMergeConfigItem& rConfigItem)
+    : GenericDialogController(pParent, "modules/swriter/ui/mmsendmails.ui", "SendMailsDialog")
+    , m_sContinue(SwResId( ST_CONTINUE ))
+    , m_sSendingTo(   SwResId(ST_SENDINGTO ))
+    , m_sCompleted(   SwResId(ST_COMPLETED ))
+    , m_sFailed(      SwResId(ST_FAILED     ))
+    , m_bCancel(false)
+    , m_bDestructionEnabled(false)
+    , m_pImpl(new SwSendMailDialog_Impl)
+    , m_pConfigItem(&rConfigItem)
+    , m_nExpectedCount(0)
+    , m_nSendCount(0)
+    , m_nErrorCount(0)
+    , m_xTransferStatus(m_xBuilder->weld_label("transferstatus"))
+    , m_xPaused(m_xBuilder->weld_label("paused"))
+    , m_xProgressBar(m_xBuilder->weld_progress_bar("progress"))
+    , m_xErrorStatus(m_xBuilder->weld_label("errorstatus"))
+    , m_xStatus(m_xBuilder->weld_tree_view("container"))
+    , m_xStop(m_xBuilder->weld_button("stop"))
+    , m_xClose(m_xBuilder->weld_button("cancel"))
+    , m_xExpander(m_xBuilder->weld_expander("details"))
 {
-    Size aSize = m_pContainer->LogicToPixel(Size(226, 80), MapMode(MapUnit::MapAppFont));
-    m_pContainer->set_width_request(aSize.Width());
-    m_pContainer->set_height_request(aSize.Height());
-    m_pStatus = VclPtr<SvSimpleTable>::Create(*m_pContainer);
-    m_pStatusHB = &(m_pStatus->GetTheHeaderBar());
-
-    OUString sTask(SwResId(ST_TASK));
-    OUString sStatus(SwResId(ST_STATUS));
-
-    m_pStop->SetClickHdl(LINK( this, SwSendMailDialog, StopHdl_Impl));
-    m_pClose->SetClickHdl(LINK( this, SwSendMailDialog, CloseHdl_Impl));
-
-    long nPos1 = aSize.Width()/3 * 2;
-    long nPos2 = aSize.Width()/3;
-    m_pStatusHB->InsertItem( ITEMID_TASK, sTask,
-                            nPos1,
-                            HeaderBarItemBits::LEFT );
-    m_pStatusHB->InsertItem( ITEMID_STATUS, sStatus,
-                            nPos2,
-                            HeaderBarItemBits::LEFT );
-
-    static long nTabs[] = {0, nPos1};
-    m_pStatus->SetStyle( m_pStatus->GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
-    m_pStatus->SetSelectionMode( SelectionMode::Single );
-    m_pStatus->SetTabs(SAL_N_ELEMENTS(nTabs), nTabs, MapUnit::MapPixel);
-    m_pStatus->SetSpaceBetweenEntries(3);
-
-    m_pPaused->Show(false);
+    m_sStop = m_xStop->get_label();
+    m_sTransferStatus = m_xTransferStatus->get_label();
+    m_sErrorStatus = m_xErrorStatus->get_label();
+
+    Size aSize(m_xStatus->get_approximate_digit_width() * 28,
+               m_xStatus->get_height_rows(20));
+    m_xStatus->set_size_request(aSize.Width(), aSize.Height());
+
+    m_xStop->connect_clicked(LINK( this, SwSendMailDialog, StopHdl_Impl));
+    m_xClose->connect_clicked(LINK( this, SwSendMailDialog, CloseHdl_Impl));
+
+    std::vector<int> aWidths;
+    aWidths.push_back(m_xStatus->get_checkbox_column_width());
+    aWidths.push_back(aSize.Width()/3 * 2);
+    m_xStatus->set_column_fixed_widths(aWidths);
+
+    m_xPaused->set_visible(false);
     UpdateTransferStatus();
 }
 
 SwSendMailDialog::~SwSendMailDialog()
 {
-    disposeOnce();
-}
-
-void SwSendMailDialog::dispose()
-{
     if(m_pImpl->xMailDispatcher.is())
     {
         try
@@ -284,18 +259,6 @@ void SwSendMailDialog::dispose()
         {
         }
     }
-    m_pImpl.reset();
-    m_pStatus.disposeAndClear();
-    m_pTransferStatus.clear();
-    m_pPaused.clear();
-    m_pProgressBar.clear();
-    m_pErrorStatus.clear();
-    m_pContainer.clear();
-    m_pStatusHB.clear();
-    m_pStop.clear();
-    m_pClose.clear();
-
-    Dialog::dispose();
 }
 
 void SwSendMailDialog::AddDocument( SwMailDescriptor const & rDesc )
@@ -309,7 +272,7 @@ void SwSendMailDialog::AddDocument( SwMailDescriptor const & rDesc )
     }
 }
 
-IMPL_LINK( SwSendMailDialog, StopHdl_Impl, Button*, pButton, void )
+IMPL_LINK( SwSendMailDialog, StopHdl_Impl, weld::Button&, rButton, void )
 {
     m_bCancel = true;
     if(m_pImpl->xMailDispatcher.is())
@@ -317,24 +280,24 @@ IMPL_LINK( SwSendMailDialog, StopHdl_Impl, Button*, pButton, void )
         if(m_pImpl->xMailDispatcher->isStarted())
         {
             m_pImpl->xMailDispatcher->stop();
-            pButton->SetText(m_sContinue);
-            m_pPaused->Show();
+            rButton.set_label(m_sContinue);
+            m_xPaused->show();
         }
         else
         {
             m_pImpl->xMailDispatcher->start();
-            pButton->SetText(m_sStop);
-            m_pPaused->Show(false);
+            rButton.set_label(m_sStop);
+            m_xPaused->hide();
         }
     }
 }
 
-IMPL_LINK_NOARG(SwSendMailDialog, CloseHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SwSendMailDialog, CloseHdl_Impl, weld::Button&, void)
 {
-    Dialog::Show( false );
+    m_xDialog->hide();
 
-    if ( m_bDestructionEnabled )
-        disposeOnce();
+    if (m_bDestructionEnabled)
+        m_xDialog->response(RET_CANCEL);
     else
     {
         m_pImpl->aRemoveIdle.SetInvokeHandler( LINK( this, SwSendMailDialog, RemoveThis ) );
@@ -361,7 +324,7 @@ IMPL_LINK( SwSendMailDialog, RemoveThis, Timer*, pTimer, void )
             (!m_pImpl->xMailDispatcher.is() ||
                     !m_pImpl->xMailDispatcher->isRunning()))
     {
-        disposeOnce();
+        m_xDialog->response(RET_CANCEL);
     }
     else
     {
@@ -376,26 +339,26 @@ IMPL_STATIC_LINK( SwSendMailDialog, StopSendMails, void*, p, void )
         pDialog->m_pImpl->xMailDispatcher->isStarted())
     {
         pDialog->m_pImpl->xMailDispatcher->stop();
-        pDialog->m_pStop->SetText(pDialog->m_sContinue);
-        pDialog->m_pPaused->Show();
+        pDialog->m_xStop->set_label(pDialog->m_sContinue);
+        pDialog->m_xPaused->show();
     }
 }
 
-void  SwSendMailDialog::SendMails()
+void SwSendMailDialog::SendMails()
 {
     if(!m_pConfigItem)
     {
         OSL_FAIL("config item not set");
         return;
     }
-    EnterWait();
+    auto xWait(std::make_unique<weld::WaitObject>(m_xDialog.get()));
     //get a mail server connection
     uno::Reference< mail::XSmtpService > xSmtpServer =
                 SwMailMergeHelper::ConnectToSmtpServer( *m_pConfigItem,
                                             m_pImpl->xConnectedInMailService,
-                                            OUString(), OUString(), GetFrameWeld());
+                                            OUString(), OUString(), m_xDialog.get());
     bool bIsLoggedIn = xSmtpServer.is() && xSmtpServer->isConnected();
-    LeaveWait();
+    xWait.reset();
     if(!bIsLoggedIn)
     {
         OSL_FAIL("create error message");
@@ -416,13 +379,13 @@ void  SwSendMailDialog::IterateMails()
     const SwMailDescriptor* pCurrentMailDescriptor = m_pImpl->GetNextDescriptor();
     while( pCurrentMailDescriptor )
     {
-        if(!SwMailMergeHelper::CheckMailAddress( pCurrentMailDescriptor->sEMail ))
+        if (!SwMailMergeHelper::CheckMailAddress( pCurrentMailDescriptor->sEMail))
         {
-            Image aInsertImg(StockImage::Yes, RID_BMP_FORMULA_CANCEL);
-
             OUString sMessage = m_sSendingTo;
-            OUString sTmp = pCurrentMailDescriptor->sEMail + "\t" + m_sFailed;
-            m_pStatus->InsertEntry( sMessage.replaceFirst("%1", sTmp), aInsertImg, aInsertImg);
+            m_xStatus->append();
+            m_xStatus->set_image(m_nSendCount, RID_BMP_FORMULA_CANCEL, 0);
+            m_xStatus->set_text(m_nSendCount, sMessage.replaceFirst("%1", pCurrentMailDescriptor->sEMail), 1);
+            m_xStatus->set_text(m_nSendCount, m_sFailed, 1);
             ++m_nSendCount;
             ++m_nErrorCount;
             UpdateTransferStatus( );
@@ -483,12 +446,11 @@ void  SwSendMailDialog::IterateMails()
     UpdateTransferStatus();
 }
 
-void SwSendMailDialog::ShowDialog(sal_Int32 nExpectedCount)
+void SwSendMailDialog::StartSend(sal_Int32 nExpectedCount)
 {
     Application::PostUserEvent( LINK( this, SwSendMailDialog,
-                                      StartSendMails ), this, true );
+                                      StartSendMails ), this );
     m_nExpectedCount = nExpectedCount > 0 ? nExpectedCount : 1;
-    Dialog::Show();
 }
 
 void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> const & xMessage,
@@ -500,14 +462,15 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> const &
         m_pImpl->xMailDispatcher.is() && m_pImpl->xMailDispatcher->isStarted())
     {
         Application::PostUserEvent( LINK( this, SwSendMailDialog,
-                                          StopSendMails ), this, true );
+                                          StopSendMails ), this );
     }
-    Image aInsertImg(StockImage::Yes, bResult ? OUString(RID_BMP_FORMULA_APPLY) : OUString(RID_BMP_FORMULA_CANCEL));
+    OUString sInsertImg(bResult ? OUString(RID_BMP_FORMULA_APPLY) : OUString(RID_BMP_FORMULA_CANCEL));
 
     OUString sMessage = m_sSendingTo;
-    OUString sTmp(xMessage->getRecipients()[0]);
-    sTmp += "\t" + (bResult ? m_sCompleted : m_sFailed);
-    m_pStatus->InsertEntry( sMessage.replaceFirst("%1", sTmp), aInsertImg, aInsertImg);
+    m_xStatus->append();
+    m_xStatus->set_image(m_nSendCount, sInsertImg, 0);
+    m_xStatus->set_text(m_nSendCount, sMessage.replaceFirst("%1", xMessage->getRecipients()[0]), 1);
+    m_xStatus->set_text(m_nSendCount, bResult ? m_sCompleted : m_sFailed, 1);
     ++m_nSendCount;
     if(!bResult)
         ++m_nErrorCount;
@@ -516,8 +479,8 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> const &
 
     if (pError)
     {
-        SwSendWarningBox_Impl aDlg(GetFrameWeld(), *pError);
-        (void)aDlg.run();
+        SwSendWarningBox_Impl aDlg(m_xDialog.get(), *pError);
+        aDlg.run();
     }
 }
 
@@ -526,27 +489,28 @@ void SwSendMailDialog::UpdateTransferStatus()
     OUString sStatus( m_sTransferStatus );
     sStatus = sStatus.replaceFirst("%1", OUString::number(m_nSendCount) );
     sStatus = sStatus.replaceFirst("%2", OUString::number(m_nExpectedCount));
-    m_pTransferStatus->SetText(sStatus);
+    m_xTransferStatus->set_label(sStatus);
 
     sStatus = m_sErrorStatus.replaceFirst("%1", OUString::number(m_nErrorCount) );
-    m_pErrorStatus->SetText(sStatus);
+    m_xErrorStatus->set_label(sStatus);
 
     if (!m_pImpl->aDescriptors.empty())
     {
         assert(m_nExpectedCount && "div-by-zero");
-        m_pProgressBar->SetValue(static_cast<sal_uInt16>(m_nSendCount * 100 / m_nExpectedCount));
+        m_xProgressBar->set_percentage(m_nSendCount * 100 / m_nExpectedCount);
     }
     else
-        m_pProgressBar->SetValue(0);
+        m_xProgressBar->set_percentage(0);
 }
 
 void SwSendMailDialog::AllMailsSent()
 {
     // Leave open if some kind of error occurred
-    if ( m_nSendCount == m_nExpectedCount )
+    if (m_nSendCount == m_nExpectedCount)
     {
-        m_pStop->Enable( false );
-        Dialog::Show( false );
+        m_xStop->set_sensitive(false);
+        m_xDialog->hide();
+        m_xDialog->response(RET_CANCEL);
     }
 }
 
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index 2b7d5e2ab2d2..b55fb24df596 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -1050,9 +1050,11 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, SendDocumentsHdl_Impl, weld::Button&, voi
 
     //create the send dialog
     vcl::Window* pParent = Application::GetDefDialogParent();
-    VclPtr<SwSendMailDialog> pDlg = VclPtr<SwSendMailDialog>::Create(pParent, *xConfigItem);
+    std::shared_ptr<SwSendMailDialog> xDlg = std::make_shared<SwSendMailDialog>(pParent ? pParent->GetFrameWeld() : nullptr, *xConfigItem);
+
+    xDlg->StartSend(nEnd - nBegin);
+    weld::DialogController::runAsync(xDlg, [](sal_Int32 /*nResult*/){});
 
-    pDlg->ShowDialog(nEnd - nBegin);
     //help to force painting the dialog
     //TODO/CLEANUP
     //predetermined breaking point
@@ -1198,18 +1200,17 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, SendDocumentsHdl_Impl, weld::Button&, voi
         aDesc.sSubject = m_xSubjectED->get_text();
         aDesc.sCC = m_sCC;
         aDesc.sBCC = m_sBCC;
-        pDlg->AddDocument( aDesc );
+        xDlg->AddDocument( aDesc );
         //help to force painting the dialog
         Application::Reschedule( true );
         //stop creating of data when dialog has been closed
-        if(!pDlg->IsVisible())
+        if (!xDlg->getDialog()->get_visible())
         {
             break;
         }
     }
-    pDlg->EnableDestruction();
+    xDlg->EnableDestruction();
     ::osl::File::remove( sTargetTempURL );
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/mmresultdialogs.hxx b/sw/source/ui/inc/mmresultdialogs.hxx
index 70ffb08970f5..4cc719c8fc01 100644
--- a/sw/source/ui/inc/mmresultdialogs.hxx
+++ b/sw/source/ui/inc/mmresultdialogs.hxx
@@ -20,13 +20,8 @@
 #define INCLUDED_SW_SOURCE_UI_DBUI_MMOUTPUTPAGE_HXX
 
 #include <vcl/wizardmachine.hxx>
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/prgsbar.hxx>
 #include <vcl/weld.hxx>
 #include <sfx2/basedlgs.hxx>
-#include <svtools/simptabl.hxx>
-#include <vcl/headbar.hxx>
 #include <mailmergehelper.hxx>
 
 class SwMailMergeWizard;
@@ -140,27 +135,15 @@ struct SwMailDescriptor
 };
 struct SwSendMailDialog_Impl;
 class SwMailMergeConfigItem;
-class SwSendMailDialog : public Dialog
+class SwSendMailDialog : public weld::GenericDialogController
 {
-    VclPtr<FixedText>               m_pTransferStatus;
-    VclPtr<FixedText>               m_pPaused;
-    VclPtr<ProgressBar>             m_pProgressBar;
-    VclPtr<FixedText>               m_pErrorStatus;
-
-    VclPtr<SvSimpleTableContainer>  m_pContainer;
-    VclPtr<HeaderBar>               m_pStatusHB;
-    VclPtr<SvSimpleTable>           m_pStatus;
-
-    VclPtr<PushButton>              m_pStop;
-    VclPtr<PushButton>              m_pClose;
-
-    OUString const          m_sContinue;
-    OUString const          m_sStop;
-    OUString const          m_sTransferStatus;
-    OUString const          m_sErrorStatus;
-    OUString const          m_sSendingTo;
-    OUString const          m_sCompleted;
-    OUString const          m_sFailed;
+    OUString                m_sContinue;
+    OUString                m_sStop;
+    OUString                m_sTransferStatus;
+    OUString                m_sErrorStatus;
+    OUString                m_sSendingTo;
+    OUString                m_sCompleted;
+    OUString                m_sFailed;
 
     bool                    m_bCancel;
     bool                    m_bDestructionEnabled;
@@ -171,8 +154,17 @@ class SwSendMailDialog : public Dialog
     sal_Int32               m_nSendCount;
     sal_Int32               m_nErrorCount;
 
-    DECL_LINK( StopHdl_Impl, Button*, void );
-    DECL_LINK( CloseHdl_Impl, Button* , void);
+    std::unique_ptr<weld::Label> m_xTransferStatus;
+    std::unique_ptr<weld::Label> m_xPaused;
+    std::unique_ptr<weld::ProgressBar> m_xProgressBar;
+    std::unique_ptr<weld::Label> m_xErrorStatus;
+    std::unique_ptr<weld::TreeView> m_xStatus;
+    std::unique_ptr<weld::Button> m_xStop;
+    std::unique_ptr<weld::Button> m_xClose;
+    std::unique_ptr<weld::Expander> m_xExpander;
+
+    DECL_LINK( StopHdl_Impl, weld::Button&, void );
+    DECL_LINK( CloseHdl_Impl, weld::Button& , void);
     DECL_STATIC_LINK( SwSendMailDialog, StartSendMails, void*, void );
     DECL_STATIC_LINK( SwSendMailDialog, StopSendMails, void*, void );
     DECL_LINK( RemoveThis, Timer*, void );
@@ -182,13 +174,12 @@ class SwSendMailDialog : public Dialog
     void        UpdateTransferStatus();
 
 public:
-    SwSendMailDialog( vcl::Window* pParent, SwMailMergeConfigItem& );
+    SwSendMailDialog( weld::Window* pParent, SwMailMergeConfigItem& );
     virtual ~SwSendMailDialog() override;
-    virtual void        dispose() override;
 
     void                AddDocument( SwMailDescriptor const & rDesc );
     void                EnableDestruction() {m_bDestructionEnabled = true;}
-    void                ShowDialog(sal_Int32 nExpectedCount);
+    void                StartSend(sal_Int32 nExpectedCount);
 
     void                DocumentSent( css::uno::Reference< css::mail::XMailMessage> const & xMessage,
                                         bool bResult,
diff --git a/sw/uiconfig/swriter/ui/mmsendmails.ui b/sw/uiconfig/swriter/ui/mmsendmails.ui
index ec42cd29fce1..de8fb2a50962 100644
--- a/sw/uiconfig/swriter/ui/mmsendmails.ui
+++ b/sw/uiconfig/swriter/ui/mmsendmails.ui
@@ -1,15 +1,31 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sw">
   <requires lib="gtk+" version="3.18"/>
-  <requires lib="LibreOffice" version="1.0"/>
+  <object class="GtkTreeStore" id="liststore1">
+    <columns>
+      <!-- column-name image -->
+      <column type="GdkPixbuf"/>
+      <!-- column-name text -->
+      <column type="gchararray"/>
+      <!-- column-name text1 -->
+      <column type="gchararray"/>
+      <!-- column-name id -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkDialog" id="SendMailsDialog">
     <property name="can_focus">False</property>
     <property name="hexpand">True</property>
     <property name="vexpand">True</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="mmsendmails|SendMailsDialog">Sending Email messages</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dock</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
@@ -83,9 +99,9 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="halign">start</property>
+                        <property name="label" translatable="yes" context="mmsendmails|label3">The connection to the outgoing mail server has been established</property>
                         <property name="xalign">0</property>
                         <property name="yalign">0</property>
-                        <property name="label" translatable="yes" context="mmsendmails|label3">The connection to the outgoing mail server has been established</property>
                       </object>
                     </child>
                   </object>
@@ -143,9 +159,9 @@
                                 <property name="can_focus">False</property>
                                 <property name="halign">start</property>
                                 <property name="hexpand">True</property>
+                                <property name="label" translatable="yes" context="mmsendmails|transferstatus">%1 of %2 emails sent</property>
                                 <property name="xalign">0</property>
                                 <property name="yalign">0</property>
-                                <property name="label" translatable="yes" context="mmsendmails|transferstatus">%1 of %2 emails sent</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -159,9 +175,9 @@
                                 <property name="can_focus">False</property>
                                 <property name="halign">start</property>
                                 <property name="hexpand">True</property>
+                                <property name="label" translatable="yes" context="mmsendmails|paused">Sending paused</property>
                                 <property name="xalign">0</property>
                                 <property name="yalign">0</property>
-                                <property name="label" translatable="yes" context="mmsendmails|paused">Sending paused</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -194,9 +210,9 @@
                             <property name="can_focus">False</property>
                             <property name="halign">start</property>
                             <property name="hexpand">True</property>
+                            <property name="label" translatable="yes" context="mmsendmails|errorstatus">Emails not sent: %1</property>
                             <property name="xalign">0</property>
                             <property name="yalign">0</property>
-                            <property name="label" translatable="yes" context="mmsendmails|errorstatus">Emails not sent: %1</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -209,14 +225,58 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <child>
-                              <object class="svtlo-SvSimpleTableContainer" id="container">
+                              <object class="GtkScrolledWindow">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="margin_top">6</property>
                                 <property name="hexpand">True</property>
                                 <property name="vexpand">True</property>
-                                <child internal-child="selection">
-                                  <object class="GtkTreeSelection" id="Simple Table Container-selection"/>
+                                <property name="shadow_type">in</property>
+                                <child>
+                                  <object class="GtkTreeView" id="container">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="hexpand">True</property>
+                                    <property name="vexpand">True</property>
+                                    <property name="model">liststore1</property>
+                                    <property name="headers_clickable">False</property>
+                                    <property name="search_column">0</property>
+                                    <property name="show_expanders">False</property>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection2"/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="treeviewcolumn0">
+                                        <child>
+                                          <object class="GtkCellRendererPixbuf" id="cellrenderertext9"/>
+                                          <attributes>
+                                            <attribute name="pixbuf">0</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+                                        <property name="title" translatable="yes" context="mmsendmails|nameft">Task</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext2"/>
+                                          <attributes>
+                                            <attribute name="text">1</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+                                        <property name="title" translatable="yes" context="mmsendmails|statusft">Status</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext3"/>
+                                          <attributes>
+                                            <attribute name="text">2</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
                                 </child>
                               </object>
                             </child>


More information about the Libreoffice-commits mailing list