summaryrefslogtreecommitdiff
path: root/sw/source/ui/dbui/dbmgr.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2013-12-22 17:42:20 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2014-08-20 09:40:43 +0200
commit24d0f248136e8e442cc3cc087e6889a487aa525a (patch)
tree6a05a754e44192eb80e9361113bf09878b4b54a9 /sw/source/ui/dbui/dbmgr.cxx
parentdbb1d7c5603affbf65b84077f02450f1be9f9c6d (diff)
Export MailMerge cancel functionality via UNO.
If you start a mail merge jobs via UNO, there is no way to cancel it. But the functionality is already implemented and used by the LO internal mail merge dialogs. This patch adds an optional XCancellable interface to the MailMerge service and implements it in the SwXMailMerge class. As the XJob::execute function already uses the SolarMutex to prevent parallel runs, XCancellable::cancel can be implemented by storing the SwNewDBMgr in the private variable m_pMgr, protected by a mutex. The bCancel member has to be converted from a bitfield value to a real boolean, because otherwise all bitfield values would have to be protected by a mutex. Bitfield assignments aren't atomic as you always have to replace at least a byte. Reviewed-on: https://gerrit.libreoffice.org/7190 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 1a12777f46954045afbe8fffa6dd199b4b338762) Conflicts: sw/inc/dbmgr.hxx sw/source/ui/inc/unomailmerge.hxx Change-Id: I007cc23fdf04ccfca7d3cd6180b0e17e99f53061
Diffstat (limited to 'sw/source/ui/dbui/dbmgr.cxx')
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 70a853248917..36bbfaf49f96 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -1355,10 +1355,15 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
return bNoError;
}
+void SwNewDBMgr::MergeCancel()
+{
+ bCancel = sal_True;
+}
+
IMPL_LINK_INLINE_START( SwNewDBMgr, PrtCancelHdl, Button *, pButton )
{
pButton->GetParent()->Hide();
- bCancel = sal_True;
+ MergeCancel();
return 0;
}
IMPL_LINK_INLINE_END( SwNewDBMgr, PrtCancelHdl, Button *, pButton )