I have a macro which displays a progress bar in the status area based on the MailMergeEventListener. The progress bar should show progress of the sending of my messages - which it does. On completion a "Done" message box should appear which it does.
However, the "Done" message box appears some time after the progress bar has indicated that all the messages have been sent. I have no evidence, but what the progress bar appears to be doing is tracking the mail merge when it should be, I believe, tracking the sending of the merged documents via email.
Steps to reproduce the problem.
Download the files CompanySeedStarted1.odt and CompanySeedTestData1.odb from this bug report. The database CompanySeedTestData1.odb contains 63 entries all with dummy email addresses.
Start LibreOffice writer with the document CompanySeedStarted1.odt downloaded in step 1. Note: this file contains a macro so be mindful that some security steps might need to be taken.
Tools -> Mail Merge Wizard
The "Select starting document" dialog box should appear. The left pane should contain 5 steps. In the right pane select the "Use Current Document" Radio Button. Then press the "Next >>" Button.
The "Select document type" dialog box should appear. Select the "E-mail message" Radio Button. Then press the "Next" Button.
The "Insert address block" dialog box should appear. Press the "Select Different Address List" Button.
The "Select Address List" dialog box should appear. Press the "Add" Button.
The "Open - LibreOffice" dialog should appear. Navigate to directory containing CompanySeedTestData1.odb downloaded in step 1. Once the database has been selected press the "Open" Button.
The "Select Address List" dialog box should re-appear with the database CompanySeedTestData1 and the table tblCompanySeedTestData1 added to the list of available databases. If not already selected - select this database. Press the "OK" Button.
Control should be returned to the "Mail Merge Wizard" dialog. Press the "Finish" Button.
If not already done so. Establish the Mail Merge E-mail settings by navigating from the menu Tools -> Options -> LibreOffice Writer -> Mail Merge E-Mail
The "Options LibreOffice Writer Mail Merge E-Mail" dialog should appear. Enter the senders name you want to be called by, the senders email address, the server name, the port number. If not already checked left click the "Use secure connection (SSL) check box. Push the "Server Authentification" Button.
The "Server Authentification" dialog should appear. Enter the senders email address and the senders password for the smtp server. Push the "OK" button.
Control will be passed back to the "Options LibreOffice Writer Mail Merge E-Mail" dialog. Push the OK Button. Control will return to the open document.
Run the MailMerge macro by navigating from the menu Tools -> Macros - Run Macro.
The "Macro Selector" dialog should appear.
In the left hand "Library" pane navigate to the macro CompanyStarted1.odt -> Standard -> CompanyStarted1
In the right hand "Macro Name" pane select the macro "Email_Test_0001". Press the "Run" button".
Control should be passed back to the document. Progress will be indicated by the progress bar in the status area. Should process 63 of 63 messages. A "Done" message box should appear.
Created attachment 131247 [details]
The database used to repicate #tdf106022
Created attachment 131248 [details]
The seed doument used to replicate #tdf106022
Created attachment 135867 [details]
I've attached the bisect log for this bug.
As the messages are now sent by a dispatcher this code in dbmgr.cxx is in the wrong place
// also emit MailMergeEvent on XInterface if possible
const SwXMailMerge *pEvtSrc = GetMailMergeEvtSrc();
uno::Reference< uno::XInterface > xRef(
text::MailMergeEvent aEvt( xRef, xWorkDocSh->GetModel() );
pEvtSrc->LaunchMailMergeEvent( aEvt );
It is monitoring messages being sent to the dispatcher whereas it should be monitoring messages being sent out by the dispatcher.
Tested this again with LO-126.96.36.199
The problem appears to have been solved.
Thanks for the update! Let's change status to WORKSFORME, as the fixing commit is unknown.