summaryrefslogtreecommitdiff
path: root/sw/source/ui/dbui
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-01-26 14:45:09 +0100
committerMichael Stahl <mst@openoffice.org>2010-01-26 14:45:09 +0100
commitdd19343634909cc3ee030087f1d0e84731853d68 (patch)
tree4baf8405ad2df703a69c028dfe672428c76b4547 /sw/source/ui/dbui
parent35933081fda3551db61a81c9af5ac393fb5fc80e (diff)
parentfdde737ea0caf7450a6676f46651f78ee05321ab (diff)
merge DEV300_m70
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx4
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx12
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx510
-rw-r--r--sw/source/ui/dbui/maildispatcher.cxx11
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx2
-rw-r--r--sw/source/ui/dbui/mmconfigitem.cxx8
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx2
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx4
-rw-r--r--sw/source/ui/dbui/mmmergepage.cxx2
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx25
11 files changed, 129 insertions, 453 deletions
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 91248fa1e422..ec8ad0dc1473 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -67,8 +67,8 @@
#include <com/sun/star/frame/XStorable.hpp>
#include <swunohelper.hxx>
#include <vcl/waitobj.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/urihelper.hxx>
+#include <unotools/pathoptions.hxx>
+#include <svl/urihelper.hxx>
#include <addresslistdialog.hrc>
#include <dbui.hrc>
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 3f7484932010..dc96002db759 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -42,7 +42,7 @@
#ifndef _SVT_CONTROLDIMS_HRC_
#include <svtools/controldims.hrc>
#endif
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/fcontnr.hxx>
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index cb815a93f1a6..30e886008da7 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -64,19 +64,19 @@
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <comphelper/processfactory.hxx>
#include <svx/langitem.hxx>
-#include <svtools/numuno.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/numuno.hxx>
+#include <svl/stritem.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#ifndef __SV_MNEMONIC_HXX
#include <vcl/mnemonic.hxx>
#endif
-#include <svtools/style.hxx>
-#include <svtools/zformat.hxx>
+#include <svl/style.hxx>
+#include <svl/zformat.hxx>
#include <svx/htmlmode.hxx>
#include <svx/unolingu.hxx>
#include <sfx2/app.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/brshitem.hxx>
#include <svx/boxitem.hxx>
#include <svx/rulritem.hxx>
@@ -1651,6 +1651,8 @@ static rtl::OUString lcl_CreateUniqueName(const Sequence<rtl::OUString>& aNames)
/* -----------------------------05.12.00 15:00--------------------------------
---------------------------------------------------------------------------*/
+void SwInsertDBColAutoPilot::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
+
void SwInsertDBColAutoPilot::Commit()
{
Sequence <rtl::OUString> aNames = GetNodeNames(rtl::OUString());
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 09d6330e263b..07ba1564c5ef 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -63,17 +63,17 @@
#include <pagedesc.hxx>
#include <vcl/lstbox.hxx>
#include <unotools/tempfile.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/urihelper.hxx>
+#include <unotools/pathoptions.hxx>
+#include <svl/urihelper.hxx>
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
-#include <svtools/zforlist.hxx>
-#include <svtools/zformat.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/eitem.hxx>
-#include <sfx2/printer.hxx>
+#include <svl/zforlist.hxx>
+#include <svl/zformat.hxx>
+#include <svl/stritem.hxx>
+#include <svl/eitem.hxx>
+#include <vcl/oldprintadaptor.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/progress.hxx>
#include <sfx2/dispatch.hxx>
@@ -120,7 +120,7 @@
#include <i18npool/mslangid.hxx>
#include <com/sun/star/util/XNumberFormatTypes.hpp>
#include <svx/langitem.hxx>
-#include <svtools/numuno.hxx>
+#include <svl/numuno.hxx>
#include <unomailmerge.hxx>
#include <sfx2/event.hxx>
@@ -454,80 +454,7 @@ BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
bRet = Merge(&rMergeDesc.rSh); // Mischen
break;
- case DBMGR_MERGE_MAILMERGE: // Serienbrief
- {
- SwView& rView = rMergeDesc.rSh.GetView();
- SfxDispatcher *pDis = rView.GetViewFrame()->GetDispatcher();
- SfxItemSet aPrintArgs( rView.GetPool(),
- SID_SILENT, SID_SILENT, //5528
- SID_ASYNCHRON, SID_ASYNCHRON, //5811
- SID_PRINT_FIRST_PAGE, SID_PRINT_FIRST_PAGE, // 5001
- SID_PRINT_LAST_PAGE, SID_PRINT_LAST_PAGE, // 5002
- SID_PRINT_COPIES, SID_PRINT_COPIES, // 5003
- SID_PRINTER_NAME, SID_PRINTER_NAME, //5322
- SID_SELECTION, SID_SELECTION, //5346
- SID_FILE_NAME, SID_FILE_NAME, // 5507
- SID_PRINT_PAGES, SID_PRINT_PAGES, //6589
- SID_PRINT_COLLATE, SID_PRINT_COLLATE, //6590
- FN_QRY_MERGE, FN_QRY_MERGE,
- 0 );
- aPrintArgs.Put(SfxBoolItem(FN_QRY_MERGE, TRUE) );
-
- // !! Currently (Jan-2003) silent is defined by supplying *any*
- // !! item!! (Thus according to OS it would be silent even when
- // !! other items then SID_SILENT would be supplied!)
- // !! Therefore it has to be the 0 pointer when not silent.
- if(IsMergeSilent())
- {
- aPrintArgs.Put( SfxBoolItem(SID_SILENT, TRUE) );
- // #i25686# printing should be done asynchronously to prevent dangling offices
- // when mail merge is called as command line macro
- // #i52629# aynchronous printing should only be done in silent mode - otherwise
- // the printer dialog does not come up
- aPrintArgs.Put( SfxBoolItem( SID_ASYNCHRON, rMergeDesc.bPrintAsync ));
- }
- // convert PropertyValues
- const beans::PropertyValue* pPrintOptions = rMergeDesc.aPrintOptions.getConstArray();
- for( sal_Int32 nOption = 0; nOption < rMergeDesc.aPrintOptions.getLength(); ++nOption)
- {
- if( pPrintOptions[nOption].Name.equalsAscii( "CopyCount" ))
- {
- sal_Int16 nCopies = 0;
- if((pPrintOptions[nOption].Value >>= nCopies) && nCopies > 0)
- aPrintArgs.Put( SfxInt16Item( SID_PRINT_COPIES, nCopies ));
- }
- else if( pPrintOptions[nOption].Name.equalsAscii( "FileName" ))
- {
- ::rtl::OUString sFileName;
- if( (pPrintOptions[nOption].Value >>= sFileName) && sFileName.getLength() > 0)
- aPrintArgs.Put( SfxStringItem( SID_FILE_NAME, sFileName ));
- }
- else if( pPrintOptions[nOption].Name.equalsAscii( "Collate" ))
- {
- sal_Bool bCollate = sal_False;
- if( pPrintOptions[nOption].Value >>= bCollate )
- aPrintArgs.Put( SfxBoolItem( SID_PRINT_COLLATE, bCollate ));
- }
- else if( pPrintOptions[nOption].Name.equalsAscii( "Pages" ))
- {
- ::rtl::OUString sPages;
- if( (pPrintOptions[nOption].Value >>= sPages) && sPages.getLength() )
- aPrintArgs.Put( SfxStringItem( SID_PRINT_PAGES, sPages ));
- }
- else if( pPrintOptions[nOption].Name.equalsAscii( "Wait" ))
- {
- sal_Bool bWait = sal_False;
- if( pPrintOptions[nOption].Value >>= bWait )
- aPrintArgs.Put( SfxBoolItem( SID_ASYNCHRON, !bWait ));
- }
-
- }
- pDis->Execute( SID_PRINTDOC,
- SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
- aPrintArgs );
- }
- break;
-
+ case DBMGR_MERGE_MAILMERGE: // printing merge from 'old' merge dialog or from UNO-component
case DBMGR_MERGE_MAILING:
case DBMGR_MERGE_MAILFILES:
case DBMGR_MERGE_SINGLE_FILE:
@@ -853,323 +780,6 @@ SwNewDBMgr::~SwNewDBMgr()
}
delete pImpl;
}
-/*--------------------------------------------------------------------
- Beschreibung: Serienbrief drucken
- --------------------------------------------------------------------*/
-
-
-BOOL SwNewDBMgr::MergePrint( SwView& rView,
- SwPrtOptions& rOpt, SfxProgress& rProgress, BOOL bIsAPI )
-{
- SwWrtShell* pSh = &rView.GetWrtShell();
- //check if the doc is synchronized and contains at least one linked section
- BOOL bSynchronizedDoc = pSh->IsLabelDoc() && pSh->GetSectionFmtCount() > 1;
- //merge source is already open
- rOpt.nMergeCnt = 0;
- //#i56195# no field update while printing mail merge documents
- rOpt.bUpdateFieldsInPrinting = sal_False;
- if(pImpl->pMergeData)
- {
- if(pImpl->pMergeData->aSelection.getLength())
- rOpt.nMergeCnt = pImpl->pMergeData->aSelection.getLength();
- else if(pImpl->pMergeData->xResultSet.is())
- {
- sal_Int32 nCount;
- if( lcl_getCountFromResultSet( nCount, pImpl->pMergeData->xResultSet ) )
- rOpt.nMergeCnt = (ULONG)nCount;
- }
- }
-
- SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
- pModOpt->SetSinglePrintJob(rOpt.IsPrintSingleJobs());
-
- SfxPrinter *pPrt = pSh->getIDocumentDeviceAccess()->getPrinter( false );
- Link aSfxSaveLnk = pPrt->GetEndPrintHdl();
- if( rOpt.IsPrintSingleJobs() )
- pPrt->SetEndPrintHdl( Link() );
-
- BOOL bUserBreak = FALSE,
- bRet = FALSE;
- long nStartRow, nEndRow;
- //calculate number of data sets to be printed
-
- Sequence<PropertyValue> aViewProperties(16);
- PropertyValue* pViewProperties = aViewProperties.getArray();
- pViewProperties[0].Name = C2U("MailMergeCount");
- pViewProperties[0].Value <<= (sal_Int32)rOpt.nMergeCnt;
- pViewProperties[1].Name = C2U("PrintGraphics");
- pViewProperties[1].Value <<= (sal_Bool)rOpt.IsPrintGraphic();
- pViewProperties[2].Name = C2U("PrintTables");
- pViewProperties[2].Value <<= (sal_Bool)rOpt.IsPrintTable();
- pViewProperties[3].Name = C2U("PrintDrawings");
- pViewProperties[3].Value <<= (sal_Bool)rOpt.IsPrintDraw();
- pViewProperties[4].Name = C2U("PrintLeftPages");
- pViewProperties[4].Value <<= (sal_Bool)rOpt.IsPrintLeftPage();
- pViewProperties[5].Name = C2U("PrintRightPages");
- pViewProperties[5].Value <<= (sal_Bool)rOpt.IsPrintRightPage();
- pViewProperties[6].Name = C2U("PrintControls");
- pViewProperties[6].Value <<= (sal_Bool)rOpt.IsPrintControl();
- pViewProperties[7].Name = C2U("PrintReversed");
- pViewProperties[7].Value <<= (sal_Bool)rOpt.IsPrintReverse();
- pViewProperties[8].Name = C2U("PrintPaperFromSetup");
- pViewProperties[8].Value <<= (sal_Bool)rOpt.IsPaperFromSetup();
- pViewProperties[9].Name = C2U("PrintFaxName");
- pViewProperties[9].Value <<= rOpt.GetFaxName();
- pViewProperties[10].Name = C2U("PrintAnnotationMode");
- pViewProperties[10].Value <<= (text::NotePrintMode) rOpt.GetPrintPostIts();
- pViewProperties[11].Name = C2U("PrintProspect");
- pViewProperties[11].Value <<= (sal_Bool)rOpt.IsPrintProspect();
- pViewProperties[12].Name = C2U("PrintPageBackground");
- pViewProperties[12].Value <<= (sal_Bool)rOpt.IsPrintPageBackground();
- pViewProperties[13].Name = C2U("PrintBlackFonts");
- pViewProperties[13].Value <<= (sal_Bool)rOpt.IsPrintBlackFont();
- pViewProperties[14].Name = C2U("IsSinglePrintJob");
- pViewProperties[14].Value <<= (sal_Bool)rOpt.IsPrintSingleJobs();
- pViewProperties[15].Name = C2U("PrintEmptyPages");
- pViewProperties[15].Value <<= (sal_Bool)rOpt.IsPrintEmptyPages();
-
- rView.SetAdditionalPrintOptions(aViewProperties);
- do {
- nStartRow = pImpl->pMergeData ? pImpl->pMergeData->xResultSet->getRow() : 0;
- {
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE), pSh->GetView().GetViewFrame()->GetObjectShell()));
- pSh->ViewShell::UpdateFlds();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), pSh->GetView().GetViewFrame()->GetObjectShell()));
- ++rOpt.nMergeAct;
-
- // launch MailMergeEvent if required
- const SwXMailMerge *pEvtSrc = GetMailMergeEvtSrc();
- if (pEvtSrc)
- {
- uno::Reference< XInterface > xRef( (XMailMergeBroadcaster *) pEvtSrc );
- text::MailMergeEvent aEvt( xRef, rView.GetDocShell()->GetModel() );
- pEvtSrc->LaunchMailMergeEvent( aEvt );
- }
-
- rView.SfxViewShell::Print( rProgress, bIsAPI ); // ggf Basic-Macro ausfuehren
- if( rOpt.IsPrintSingleJobs() && bRet )
- {
- //rOpt.bJobStartet = FALSE;
- bRet = FALSE;
- }
-
- bMergeLock = TRUE;
- if(rOpt.IsPrintProspect())
- {
- if( ! pPrt->IsJobActive() )
- {
- pPrt->SetJobValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ),
- String( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
- pPrt->StartJob( rOpt.GetJobName() );
- }
- if( pPrt->IsJobActive() )
- {
- pSh->PrintProspect( rOpt, rProgress, rOpt.IsPrintProspect_RTL() );
- bRet = TRUE;
- }
- }
- else if( pSh->Prt( rOpt, &rProgress ) )
- bRet = TRUE;
- bMergeLock = FALSE;
-
- if( !pPrt->IsJobActive() )
- {
- bUserBreak = TRUE;
- bRet = FALSE;
- break;
- }
- if( !rOpt.IsPrintSingleJobs() )
- {
- String& rJNm = (String&)rOpt.GetJobName();
- rJNm.Erase();
- }
- }
- nEndRow = pImpl->pMergeData ? pImpl->pMergeData->xResultSet->getRow() : 0;
- } while( bSynchronizedDoc && (nStartRow != nEndRow)? ExistsNextRecord() : ToNextMergeRecord());
-
- if( rOpt.IsPrintSingleJobs() )
- {
- SfxPrinter* pTmpPrinter = pSh->getIDocumentDeviceAccess()->getPrinter( true );
- pTmpPrinter->SetEndPrintHdl( aSfxSaveLnk );
- if ( !bUserBreak && !pTmpPrinter->IsJobActive() ) //Schon zu spaet?
- aSfxSaveLnk.Call( pTmpPrinter );
- }
-
- rOpt.nMergeCnt = 0;
- rOpt.nMergeAct = 0;
-
- nMergeType = DBMGR_INSERT;
-
- SwDocShell* pDocSh = rView.GetDocShell();
- SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(pDocSh);
-
- while (pTmpFrm) // Alle Views Invalidieren
- {
- SwView *pVw = PTR_CAST(SwView, pTmpFrm->GetViewShell());
- if (pVw)
- pVw->GetEditWin().Invalidate();
- pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, pDocSh);
- }
-
- return bRet;
-}
-/*-- 21.06.2004 09:08:16---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-BOOL SwNewDBMgr::MergePrintDocuments( SwView& rView,
- SwPrtOptions& rOpt, SfxProgress& rProgress, BOOL bIsAPI )
-{
- SwWrtShell* pSh = &rView.GetWrtShell();
- //check if the doc is synchronized and contains at least one linked section
- //merge source is already open
- rOpt.nMergeCnt = 0;
- rOpt.SetPrintSingleJobs( sal_True );
-
- SfxPrinter *pPrt = pSh->getIDocumentDeviceAccess()->getPrinter( false );
- Link aSfxSaveLnk = pPrt->GetEndPrintHdl();
- if( rOpt.IsPrintSingleJobs() )
- pPrt->SetEndPrintHdl( Link() );
-
- BOOL bUserBreak = FALSE,
- bRet = FALSE;
- //calculate number of data sets to be printed
-
- Sequence<PropertyValue> aViewProperties(16);
- PropertyValue* pViewProperties = aViewProperties.getArray();
- pViewProperties[0].Name = C2U("MailMergeCount");
- pViewProperties[0].Value <<= (sal_Int32)rOpt.nMergeCnt;
- pViewProperties[1].Name = C2U("PrintGraphics");
- pViewProperties[1].Value <<= (sal_Bool)rOpt.IsPrintGraphic();
- pViewProperties[2].Name = C2U("PrintTables");
- pViewProperties[2].Value <<= (sal_Bool)rOpt.IsPrintTable();
- pViewProperties[3].Name = C2U("PrintDrawings");
- pViewProperties[3].Value <<= (sal_Bool)rOpt.IsPrintDraw();
- pViewProperties[4].Name = C2U("PrintLeftPages");
- pViewProperties[4].Value <<= (sal_Bool)rOpt.IsPrintLeftPage();
- pViewProperties[5].Name = C2U("PrintRightPages");
- pViewProperties[5].Value <<= (sal_Bool)rOpt.IsPrintRightPage();
- pViewProperties[6].Name = C2U("PrintControls");
- pViewProperties[6].Value <<= (sal_Bool)rOpt.IsPrintControl();
- pViewProperties[7].Name = C2U("PrintReversed");
- pViewProperties[7].Value <<= (sal_Bool)rOpt.IsPrintReverse();
- pViewProperties[8].Name = C2U("PrintPaperFromSetup");
- pViewProperties[8].Value <<= (sal_Bool)rOpt.IsPaperFromSetup();
- pViewProperties[9].Name = C2U("PrintFaxName");
- pViewProperties[9].Value <<= rOpt.GetFaxName();
- pViewProperties[10].Name = C2U("PrintAnnotationMode");
- pViewProperties[10].Value <<= (text::NotePrintMode) rOpt.GetPrintPostIts();
- pViewProperties[11].Name = C2U("PrintProspect");
- pViewProperties[11].Value <<= (sal_Bool)rOpt.IsPrintProspect();
- pViewProperties[12].Name = C2U("PrintPageBackground");
- pViewProperties[12].Value <<= (sal_Bool)rOpt.IsPrintPageBackground();
- pViewProperties[13].Name = C2U("PrintBlackFonts");
- pViewProperties[13].Value <<= (sal_Bool)rOpt.IsPrintBlackFont();
- pViewProperties[14].Name = C2U("IsSinglePrintJob");
- pViewProperties[14].Value <<= (sal_Bool)rOpt.IsPrintSingleJobs();
- pViewProperties[15].Name = C2U("PrintEmptyPages");
- pViewProperties[15].Value <<= (sal_Bool)rOpt.IsPrintEmptyPages();
-
- rView.SetAdditionalPrintOptions(aViewProperties);
-
- SwMailMergeConfigItem* pConfigItem = rView.GetMailMergeConfigItem();
- DBG_ASSERT(pConfigItem, "mail merge config item is missing");
- if(!pConfigItem)
- return sal_False;
-
- USHORT nDocStart = pConfigItem->GetPrintRangeStart();
- USHORT nDocEnd = pConfigItem->GetPrintRangeEnd();
- DBG_ASSERT(nDocStart < nDocEnd && nDocEnd <= pConfigItem->GetMergedDocumentCount(),
- "merge print settings are not correct");
-
- for( sal_uInt32 nPrintDocument = nDocStart; nPrintDocument < nDocEnd; ++nPrintDocument)
- {
- SwDocMergeInfo& rDocInfo = pConfigItem->GetDocumentMergeInfo(nPrintDocument);
- rOpt.aMulti.SelectAll(FALSE);
- rOpt.aMulti.Select(Range( rDocInfo.nStartPageInTarget, rDocInfo.nEndPageInTarget ), TRUE );
-
- ++rOpt.nMergeAct;
-
- // launch MailMergeEvent if required
- const SwXMailMerge *pEvtSrc = GetMailMergeEvtSrc();
- if (pEvtSrc)
- {
- uno::Reference< XInterface > xRef( (XMailMergeBroadcaster *) pEvtSrc );
- text::MailMergeEvent aEvt( xRef, rView.GetDocShell()->GetModel() );
- pEvtSrc->LaunchMailMergeEvent( aEvt );
- }
-
- String aTmp;
- aTmp += String::CreateFromInt32( rDocInfo.nStartPageInTarget );
- aTmp += '-';
- aTmp += String::CreateFromInt32( rDocInfo.nEndPageInTarget );
-
- Sequence<PropertyValue> aAddViewProperties(1);
- PropertyValue* pAddViewProperties = aAddViewProperties.getArray();
- pAddViewProperties[0].Name = C2U("Pages");
- pAddViewProperties[0].Value <<= ::rtl::OUString( aTmp );
- rView.SetAdditionalPrintOptions(aAddViewProperties);
-
- rView.SfxViewShell::Print( rProgress, bIsAPI ); // ggf Basic-Macro ausfuehren
- if( rOpt.IsPrintSingleJobs() && bRet )
- {
- //rOpt.bJobStartet = FALSE;
- bRet = FALSE;
- }
-
- bMergeLock = TRUE;
- if(rOpt.IsPrintProspect())
- {
- if( pPrt->IsJobActive() || pPrt->StartJob( rOpt.GetJobName() ))
- {
- pSh->PrintProspect( rOpt, rProgress, rOpt.IsPrintProspect_RTL() );
- bRet = TRUE;
- }
- }
- else if( pSh->Prt( rOpt, &rProgress ) )
- bRet = TRUE;
- bMergeLock = FALSE;
-
- if( !pPrt->IsJobActive() )
- {
- bUserBreak = TRUE;
- bRet = FALSE;
- break;
- }
- if( !rOpt.IsPrintSingleJobs() )
- {
- String& rJNm = (String&)rOpt.GetJobName();
- rJNm.Erase();
- }
- }
-
- if( rOpt.IsPrintSingleJobs() )
- {
- SfxPrinter* pTmpPrinter = pSh->getIDocumentDeviceAccess()->getPrinter( true );
- pTmpPrinter->SetEndPrintHdl( aSfxSaveLnk );
- if ( !bUserBreak && !pTmpPrinter->IsJobActive() ) //Schon zu spaet?
- aSfxSaveLnk.Call( pTmpPrinter );
- }
-
- rOpt.nMergeCnt = 0;
- rOpt.nMergeAct = 0;
-
- nMergeType = DBMGR_INSERT;
-
- SwDocShell* pDocSh = rView.GetDocShell();
- SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(pDocSh);
-
- while (pTmpFrm) // Alle Views Invalidieren
- {
- SwView *pVw = PTR_CAST(SwView, pTmpFrm->GetViewShell());
- if (pVw)
- pVw->GetEditWin().Invalidate();
- pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, pDocSh);
- }
-
- return bRet;
-}
-
-
/*--------------------------------------------------------------------
Beschreibung: Serienbriefe als einzelne Dokumente speichern
@@ -1317,6 +927,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
// in case of creating a single resulting file this has to be created here
SwWrtShell* pTargetShell = 0;
SfxObjectShellRef xTargetDocShell;
+ SwView* pTargetView = 0;
std::auto_ptr< utl::TempFile > aTempFile;
String sModifiedStartingPageDesc;
String sStartingPageDesc;
@@ -1329,7 +940,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
xTargetDocShell->DoInitNew( 0 );
SfxViewFrame* pTargetFrame = SfxViewFrame::CreateViewFrame( *xTargetDocShell, 0, TRUE );
- SwView* pTargetView = static_cast<SwView*>( pTargetFrame->GetViewShell() );
+ pTargetView = static_cast<SwView*>( pTargetFrame->GetViewShell() );
//initiate SelectShell() to create sub shells
pTargetView->AttrChangedNotify( &pTargetView->GetWrtShell() );
@@ -1650,27 +1261,83 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
// save the single output document
if(rMergeDescriptor.bCreateSingleFile || bAsSingleFile)
{
- DBG_ASSERT( aTempFile.get(), "Temporary file not available" );
- INetURLObject aTempFileURL(bAsSingleFile ? sSubject : aTempFile->GetURL());
- SfxMedium* pDstMed = new SfxMedium(
- aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ),
- STREAM_STD_READWRITE, TRUE );
- pDstMed->SetFilter( pStoreToFilter );
- if(pDstMed->GetItemSet())
+ if( rMergeDescriptor.nMergeType != DBMGR_MERGE_MAILMERGE )
{
- if(pStoreToFilterOptions )
- pDstMed->GetItemSet()->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, *pStoreToFilterOptions));
- if(rMergeDescriptor.aSaveToFilterData.getLength())
- pDstMed->GetItemSet()->Put(SfxUsrAnyItem(SID_FILTER_DATA, makeAny(rMergeDescriptor.aSaveToFilterData)));
- }
+ DBG_ASSERT( aTempFile.get(), "Temporary file not available" );
+ INetURLObject aTempFileURL(bAsSingleFile ? sSubject : aTempFile->GetURL());
+ SfxMedium* pDstMed = new SfxMedium(
+ aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ),
+ STREAM_STD_READWRITE, TRUE );
+ pDstMed->SetFilter( pStoreToFilter );
+ if(pDstMed->GetItemSet())
+ {
+ if(pStoreToFilterOptions )
+ pDstMed->GetItemSet()->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, *pStoreToFilterOptions));
+ if(rMergeDescriptor.aSaveToFilterData.getLength())
+ pDstMed->GetItemSet()->Put(SfxUsrAnyItem(SID_FILTER_DATA, makeAny(rMergeDescriptor.aSaveToFilterData)));
+ }
- xTargetDocShell->DoSaveAs(*pDstMed);
- xTargetDocShell->DoSaveCompleted(pDstMed);
- if( xTargetDocShell->GetError() )
+ xTargetDocShell->DoSaveAs(*pDstMed);
+ xTargetDocShell->DoSaveCompleted(pDstMed);
+ if( xTargetDocShell->GetError() )
+ {
+ // error message ??
+ ErrorHandler::HandleError( xTargetDocShell->GetError() );
+ bLoop = FALSE;
+ }
+ }
+ else if( pTargetView ) // must be available!
{
- // error message ??
- ErrorHandler::HandleError( xTargetDocShell->GetError() );
- bLoop = FALSE;
+ //print the target document
+ #if OSL_DEBUG_LEVEL > 1
+ sal_Bool _bVal;
+ sal_Int16 _nVal;
+ rtl::OUString _sVal;
+ const beans::PropertyValue* pDbgPrintOptions = rMergeDescriptor.aPrintOptions.getConstArray();
+ for( sal_Int32 nOption = 0; nOption < rMergeDescriptor.aPrintOptions.getLength(); ++nOption)
+ {
+ rtl::OUString aName( pDbgPrintOptions[nOption].Name );
+ uno::Any aVal( pDbgPrintOptions[nOption].Value );
+ aVal >>= _bVal;
+ aVal >>= _nVal;
+ aVal >>= _sVal;
+ }
+ #endif
+ // printing should be done synchronously otherwise the document
+ // might already become invalid during the process
+ uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions );
+ const sal_Int32 nOpts = aOptions.getLength();
+ aOptions.realloc( nOpts + 1 );
+ aOptions[ nOpts ].Name = rtl::OUString::createFromAscii( "Wait" );
+ aOptions[ nOpts ].Value <<= sal_True ;
+// aPrintArgs.Put(SfxBoolItem(FN_QRY_MERGE, TRUE) );
+// // #i52629# aynchronous printing should only be done in silent mode - otherwise
+// // the printer dialog does not come up
+// aPrintArgs.Put( SfxBoolItem( SID_ASYNCHRON, rMergeDescriptor.bPrintAsync ));
+ // move print options
+ const beans::PropertyValue* pPrintOptions = rMergeDescriptor.aPrintOptions.getConstArray();
+ for( sal_Int32 nOption = 0; nOption < rMergeDescriptor.aPrintOptions.getLength(); ++nOption)
+ {
+ if( pPrintOptions[nOption].Name.equalsAscii( "CopyCount" )
+ ||( pPrintOptions[nOption].Name.equalsAscii( "FileName" ))
+ ||( pPrintOptions[nOption].Name.equalsAscii( "Collate" ))
+ ||( pPrintOptions[nOption].Name.equalsAscii( "Pages" ))
+ ||( pPrintOptions[nOption].Name.equalsAscii( "Wait" )))
+ {
+ aOptions.realloc( nOpts + 1 );
+ aOptions[ nOpts ].Name = pPrintOptions[nOption].Name;
+ aOptions[ nOpts ].Value = pPrintOptions[nOption].Value ;
+ }
+ }
+
+// const SwModuleOptions * pModOpt = SW_MOD()->GetModuleConfig();
+// if (pModOpt->IsSinglePrintJob())
+// {
+// }
+// else
+// {
+ pTargetView->ExecPrint( aOptions, IsMergeSilent(), rMergeDescriptor.bPrintAsync );
+// }
}
xTargetDocShell->DoClose();
}
@@ -2902,6 +2569,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
SwMergeDescriptor aMergeDesc( pImpl->pMergeDialog->GetMergeType(), pView->GetWrtShell(), aDescriptor );
aMergeDesc.sSaveToFilter = pImpl->pMergeDialog->GetSaveFilter();
+ aMergeDesc.bCreateSingleFile= true;
MergeNew(aMergeDesc);
pWorkDoc->SetNewDBMgr( pWorkDBMgr );
@@ -3255,8 +2923,8 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
pWorkDoc->EmbedAllLinks();
if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds())
rWorkShell.Undo();
- // #i69485# lock fields to prevent access to the result set while calculating layout
- rWorkShell.LockExpFlds();
+ // #i69485# lock fields to prevent access to the result set while calculating layout
+ rWorkShell.LockExpFlds();
// create a layout
rWorkShell.CalcLayout();
rWorkShell.UnlockExpFlds();
diff --git a/sw/source/ui/dbui/maildispatcher.cxx b/sw/source/ui/dbui/maildispatcher.cxx
index e49c5c68fccb..81dabd052042 100644
--- a/sw/source/ui/dbui/maildispatcher.cxx
+++ b/sw/source/ui/dbui/maildispatcher.cxx
@@ -110,8 +110,7 @@ namespace /* private */
MailDispatcher::MailDispatcher(uno::Reference<mail::XSmtpService> mailserver) :
mailserver_ (mailserver),
run_(false),
- shutdown_requested_(false),
- bIsInRun(false)
+ shutdown_requested_(false)
{
wakening_call_.reset();
mail_dispatcher_active_.reset();
@@ -206,12 +205,6 @@ bool MailDispatcher::isStarted() const
return run_;
}
-bool MailDispatcher::isRunning() const
-{
- return bIsInRun;
-}
-
-
void MailDispatcher::addListener(::rtl::Reference<IMailDispatcherListener> listener)
{
OSL_PRECOND(!shutdown_requested_, "MailDispatcher thread is shuting down already");
@@ -267,7 +260,6 @@ void MailDispatcher::run()
// signal that the mail dispatcher thread is now alive
mail_dispatcher_active_.set();
- bIsInRun = true;
for(;;)
{
wakening_call_.wait();
@@ -295,7 +287,6 @@ void MailDispatcher::run()
std::for_each(listeners_cloned.begin(), listeners_cloned.end(), GenericEventNotifier(&IMailDispatcherListener::idle, this));
}
} // end for SSH ALI
- bIsInRun = false;
}
/*-- 27.08.2004 12:04:46---------------------------------------------------
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index 7d6c3ae81718..c56b5535bfa4 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -43,7 +43,7 @@
#include <svtools/headbar.hxx>
#include <svtools/svtreebx.hxx>
#include <vcl/combobox.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
class SwMailMergeWizard;
class SwMailMergeConfigItem;
/*-- 13.04.2004 15:50:37---------------------------------------------------
diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx
index 7438988a88fd..b4e4eb06e75e 100644
--- a/sw/source/ui/dbui/mmconfigitem.cxx
+++ b/sw/source/ui/dbui/mmconfigitem.cxx
@@ -63,7 +63,7 @@
#include <unomid.h>
#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
using namespace utl;
using ::rtl::OUString;
@@ -183,8 +183,8 @@ public:
SwMailMergeConfigItem_Impl();
~SwMailMergeConfigItem_Impl();
- virtual void Commit();
-
+ virtual void Commit();
+ virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
const Sequence< ::rtl::OUString>
GetAddressBlocks(sal_Bool bConvertToConfig = sal_False) const;
void SetAddressBlocks(
@@ -538,6 +538,8 @@ const Sequence<OUString>& SwMailMergeConfigItem_Impl::GetPropertyNames()
/*-- 15.04.2004 08:48:39---------------------------------------------------
-----------------------------------------------------------------------*/
+void SwMailMergeConfigItem_Impl::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
+
void SwMailMergeConfigItem_Impl::Commit()
{
Sequence<OUString> aNames = GetPropertyNames();
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 7bef5c752be6..423185fb0ba3 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -35,7 +35,7 @@
#endif
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/new.hxx>
#include <sfx2/docfilt.hxx>
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 450311349694..6b802ad12797 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -45,7 +45,7 @@
#include <view.hxx>
#include <swundo.hxx>
#include <sfx2/dispatch.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/stritem.hxx>
#include <sfx2/docfilt.hxx>
#include <com/sun/star/text/XParagraphCursor.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
@@ -63,7 +63,7 @@
#include <fmtornt.hxx>
#include <fmtfsize.hxx>
#include <svx/boxitem.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <shellio.hxx>
#include <osl/file.hxx>
#include <unoprnms.hxx>
diff --git a/sw/source/ui/dbui/mmmergepage.cxx b/sw/source/ui/dbui/mmmergepage.cxx
index d6083d1fc712..74a647f755bd 100644
--- a/sw/source/ui/dbui/mmmergepage.cxx
+++ b/sw/source/ui/dbui/mmmergepage.cxx
@@ -44,7 +44,7 @@
#include <mmmergepage.hrc>
#include <svx/srchitem.hxx>
#include <sfx2/dispatch.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <swabstdlg.hxx>
/*-- 02.04.2004 16:38:45---------------------------------------------------
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index eb1f75d57979..331589570246 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -53,8 +53,8 @@
#include <hintids.hxx>
#include <svx/scripttypeitem.hxx>
#include <svx/langitem.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/itemset.hxx>
+#include <svl/stritem.hxx>
#include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx>
#include <vcl/msgbox.hxx>
@@ -68,7 +68,7 @@
//#include <sfx2/docfilt.hxx>
//#endif
#include <tools/urlobj.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#ifndef _VCL_PRINT_HXX
#include <vcl/print.hxx>
#endif
@@ -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);