summaryrefslogtreecommitdiff
path: root/sw/source/ui/dbui/mmoutputpage.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/dbui/mmoutputpage.cxx')
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 1106a1ac62fe..331589570246 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -991,6 +991,13 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG)
nEnd = rConfigItem.GetMergedDocumentCount();
}
rConfigItem.SetPrintRange( (USHORT)nBegin, (USHORT)nEnd );
+ SwDocMergeInfo& rStartInfo = rConfigItem.GetDocumentMergeInfo(nBegin);
+ SwDocMergeInfo& rEndInfo = rConfigItem.GetDocumentMergeInfo(nEnd - 1);
+
+ rtl::OUString sPages(rtl::OUString::valueOf( rStartInfo.nStartPageInTarget ));
+ sPages += rtl::OUString::createFromAscii( " - ");
+ sPages += rtl::OUString::valueOf( rEndInfo.nEndPageInTarget );
+
SwWrtShell& rSh = pTargetView->GetWrtShell();
pTargetView->SetMailMergeConfigItem(&rConfigItem, 0, sal_False);
if(m_pTempPrinter)
@@ -1002,11 +1009,17 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG)
SfxObjectShell* pObjSh = pTargetView->GetViewFrame()->GetObjectShell();
SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), pObjSh));
rSh.GetNewDBMgr()->SetMergeType( DBMGR_MERGE_DOCUMENTS );
- SfxDispatcher *pDis = pTargetView->GetViewFrame()->GetDispatcher();
+ //SfxDispatcher *pDis = pTargetView->GetViewFrame()->GetDispatcher();
SfxBoolItem aMergeSilent(SID_SILENT, sal_False);
m_pWizard->enableButtons(WZB_CANCEL, sal_False);
- pDis->Execute(SID_PRINTDOCDIRECT,
- SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aMergeSilent, 0L);
+
+ uno::Sequence < beans::PropertyValue > aProps( 2 );
+ aProps[0]. Name = rtl::OUString::createFromAscii("MonitorVisible");
+ aProps[0].Value <<= sal_True;
+ aProps[1]. Name = rtl::OUString::createFromAscii("Pages");
+ aProps[1]. Value <<= sPages;
+
+ pTargetView->ExecPrint( aProps, false, true );
SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), pObjSh));
pTargetView->SetMailMergeConfigItem(0, 0, sal_False);