summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-10-11 23:19:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-12 06:42:36 +0000
commiteadfda64c14f8c78b5d6a30c21432148c41d5651 (patch)
treed36f5425f775bcf6d58e63ce7999ff3108075259 /sw
parent41683b9a8581445fef09e7a25ad35e58fc5602be (diff)
convert macro to local function
Change-Id: Iebe97b505c2583211f0bfda55d183fb37753457d Reviewed-on: https://gerrit.libreoffice.org/29718 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 2bf4ed906eb8..2f742929733b 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -155,10 +155,6 @@ const sal_Char cDataSourceName[] = "DataSourceName";
const sal_Char cSelection[] = "Selection";
const sal_Char cActiveConnection[] = "ActiveConnection";
-#define EMIT_SW_EVENT(type, shell) \
- SfxGetpApp()->NotifyEvent(SfxEventHint(SW_EVENT_##type, \
- SwDocShell::GetEventName(STR_SW_EVENT_##type), shell))
-
namespace {
void rescheduleGui() {
@@ -166,6 +162,13 @@ void rescheduleGui() {
Application::Reschedule();
}
+void lcl_emitEvent(sal_uInt16 nEventId, sal_Int32 nStrId, SfxObjectShell* pDocShell)
+{
+ SfxGetpApp()->NotifyEvent(SfxEventHint(nEventId,
+ SwDocShell::GetEventName(nStrId),
+ pDocShell));
+}
+
}
enum class SwDBNextRecord { NEXT, FIRST };
@@ -1395,7 +1398,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
pWorkShell->CalcLayout();
}
- EMIT_SW_EVENT(FIELD_MERGE, xWorkDocSh);
+ lcl_emitEvent(SW_EVENT_FIELD_MERGE, STR_SW_EVENT_FIELD_MERGE, xWorkDocSh);
// tdf#92324: Allow ExpFields update only by explicit instruction to avoid
// database cursor movement on any other fields update, for example during
@@ -1405,7 +1408,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
pWorkShell->SwViewShell::UpdateFields();
pWorkShell->LockExpFields();
- EMIT_SW_EVENT(FIELD_MERGE_FINISHED, xWorkDocSh);
+ lcl_emitEvent(SW_EVENT_FIELD_MERGE_FINISHED, STR_SW_EVENT_FIELD_MERGE_FINISHED, xWorkDocSh);
// also emit MailMergeEvent on XInterface if possible
const SwXMailMerge *pEvtSrc = GetMailMergeEvtSrc();
@@ -2865,7 +2868,7 @@ void SwDBManager::ExecuteFormLetter( SwWrtShell& rSh,
// SfxObjectShellRef is ok, since there should be no control over the document lifetime here
SfxObjectShellRef xDocShell = rSh.GetView().GetViewFrame()->GetObjectShell();
- EMIT_SW_EVENT(MAIL_MERGE, xDocShell.get());
+ lcl_emitEvent(SW_EVENT_MAIL_MERGE, STR_SW_EVENT_MAIL_MERGE, xDocShell.get());
// prepare mail merge descriptor
SwMergeDescriptor aMergeDesc( pImpl->pMergeDialog->GetMergeType(), rSh, aDescriptor );
@@ -2879,7 +2882,7 @@ void SwDBManager::ExecuteFormLetter( SwWrtShell& rSh,
Merge( aMergeDesc );
- EMIT_SW_EVENT(MAIL_MERGE_END, xDocShell.get());
+ lcl_emitEvent(SW_EVENT_MAIL_MERGE_END, STR_SW_EVENT_MAIL_MERGE_END, xDocShell.get());
// reset the cursor inside
xResSet = nullptr;