1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sw.hxx"
30*cdf0e10cSrcweir #ifdef SW_DLLIMPLEMENTATION
31*cdf0e10cSrcweir #undef SW_DLLIMPLEMENTATION
32*cdf0e10cSrcweir #endif
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include <mailmergewizard.hxx>
36*cdf0e10cSrcweir #include <mmdocselectpage.hxx>
37*cdf0e10cSrcweir #include <mmoutputtypepage.hxx>
38*cdf0e10cSrcweir #include <mmaddressblockpage.hxx>
39*cdf0e10cSrcweir #include <mmpreparemergepage.hxx>
40*cdf0e10cSrcweir #include <mmmergepage.hxx>
41*cdf0e10cSrcweir #include <mmgreetingspage.hxx>
42*cdf0e10cSrcweir #include <mmoutputpage.hxx>
43*cdf0e10cSrcweir #include <mmlayoutpage.hxx>
44*cdf0e10cSrcweir #include <mmconfigitem.hxx>
45*cdf0e10cSrcweir #include <swabstdlg.hxx>
46*cdf0e10cSrcweir #ifndef _DBUI_HRC
47*cdf0e10cSrcweir #include <dbui.hrc>
48*cdf0e10cSrcweir #endif
49*cdf0e10cSrcweir #include <view.hxx>
50*cdf0e10cSrcweir #ifndef _DBMGR_HXX
51*cdf0e10cSrcweir #include <dbmgr.hxx>
52*cdf0e10cSrcweir #endif
53*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
54*cdf0e10cSrcweir #include <wrtsh.hxx>
55*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
56*cdf0e10cSrcweir #include "vcl/msgbox.hxx" // RET_CANCEL
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir #include <helpid.h>
59*cdf0e10cSrcweir #include <dbui.hrc>
60*cdf0e10cSrcweir #include <mailmergewizard.hrc>
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir using namespace svt;
63*cdf0e10cSrcweir using namespace ::com::sun::star;
64*cdf0e10cSrcweir /*-- 01.04.2004 16:52:49---------------------------------------------------
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
67*cdf0e10cSrcweir SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem) :
68*cdf0e10cSrcweir         RoadmapWizard(&rView.GetViewFrame()->GetWindow(),
69*cdf0e10cSrcweir                         SW_RES(DLG_MAILMERGEWIZARD),
70*cdf0e10cSrcweir                         WZB_NEXT|WZB_PREVIOUS|WZB_FINISH|WZB_CANCEL|WZB_HELP),
71*cdf0e10cSrcweir         m_pSwView(&rView),
72*cdf0e10cSrcweir         m_bDocumentLoad( false ),
73*cdf0e10cSrcweir         m_rConfigItem(rItem),
74*cdf0e10cSrcweir         m_sStarting(        SW_RES( ST_STARTING      )),
75*cdf0e10cSrcweir         m_sDocumentType(    SW_RES( ST_DOCUMETNTYPE   )),
76*cdf0e10cSrcweir         m_sAddressBlock(    SW_RES( ST_ADDRESSBLOCK   )),
77*cdf0e10cSrcweir         m_sAddressList(     SW_RES( ST_ADDRESSLIST )),
78*cdf0e10cSrcweir         m_sGreetingsLine(   SW_RES( ST_GREETINGSLINE   )),
79*cdf0e10cSrcweir         m_sLayout(          SW_RES( ST_LAYOUT        )),
80*cdf0e10cSrcweir         m_sPrepareMerge(    SW_RES( ST_PREPAREMERGE )),
81*cdf0e10cSrcweir         m_sMerge(           SW_RES( ST_MERGE        )),
82*cdf0e10cSrcweir         m_sOutput(          SW_RES( ST_OUTPUT       )),
83*cdf0e10cSrcweir         m_sFinish(          SW_RES( ST_FINISH       )),
84*cdf0e10cSrcweir         m_nRestartPage( MM_DOCUMENTSELECTPAGE )
85*cdf0e10cSrcweir {
86*cdf0e10cSrcweir     FreeResource();
87*cdf0e10cSrcweir     ShowButtonFixedLine(sal_True);
88*cdf0e10cSrcweir     defaultButton(WZB_NEXT);
89*cdf0e10cSrcweir     enableButtons(WZB_FINISH, sal_False);
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir     m_pFinish->SetText(m_sFinish);
92*cdf0e10cSrcweir     m_pNextPage->SetHelpId(HID_MM_NEXT_PAGE);
93*cdf0e10cSrcweir     m_pPrevPage->SetHelpId(HID_MM_PREV_PAGE);
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir     //#i51949# no output type page visible if e-Mail is not supported
96*cdf0e10cSrcweir     if(rItem.IsMailAvailable())
97*cdf0e10cSrcweir         declarePath(
98*cdf0e10cSrcweir             0,
99*cdf0e10cSrcweir             MM_DOCUMENTSELECTPAGE,
100*cdf0e10cSrcweir             MM_OUTPUTTYPETPAGE,
101*cdf0e10cSrcweir             MM_ADDRESSBLOCKPAGE,
102*cdf0e10cSrcweir             MM_GREETINGSPAGE,
103*cdf0e10cSrcweir             MM_LAYOUTPAGE,
104*cdf0e10cSrcweir             MM_PREPAREMERGEPAGE,
105*cdf0e10cSrcweir             MM_MERGEPAGE,
106*cdf0e10cSrcweir             MM_OUTPUTPAGE,
107*cdf0e10cSrcweir             WZS_INVALID_STATE
108*cdf0e10cSrcweir         );
109*cdf0e10cSrcweir     else
110*cdf0e10cSrcweir         declarePath(
111*cdf0e10cSrcweir             0,
112*cdf0e10cSrcweir             MM_DOCUMENTSELECTPAGE,
113*cdf0e10cSrcweir             MM_ADDRESSBLOCKPAGE,
114*cdf0e10cSrcweir             MM_GREETINGSPAGE,
115*cdf0e10cSrcweir             MM_LAYOUTPAGE,
116*cdf0e10cSrcweir             MM_PREPAREMERGEPAGE,
117*cdf0e10cSrcweir             MM_MERGEPAGE,
118*cdf0e10cSrcweir             MM_OUTPUTPAGE,
119*cdf0e10cSrcweir             WZS_INVALID_STATE
120*cdf0e10cSrcweir         );
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir     ActivatePage();
123*cdf0e10cSrcweir     UpdateRoadmap();
124*cdf0e10cSrcweir }
125*cdf0e10cSrcweir /*-- 01.04.2004 16:52:53---------------------------------------------------
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
128*cdf0e10cSrcweir SwMailMergeWizard::~SwMailMergeWizard()
129*cdf0e10cSrcweir {
130*cdf0e10cSrcweir }
131*cdf0e10cSrcweir /*-- 01.04.2004 16:52:53---------------------------------------------------
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
134*cdf0e10cSrcweir OWizardPage*    SwMailMergeWizard::createPage(WizardState _nState)
135*cdf0e10cSrcweir {
136*cdf0e10cSrcweir     OWizardPage* pRet = 0;
137*cdf0e10cSrcweir     switch(_nState)
138*cdf0e10cSrcweir     {
139*cdf0e10cSrcweir         case MM_DOCUMENTSELECTPAGE : pRet = new SwMailMergeDocSelectPage(this);     break;
140*cdf0e10cSrcweir         case MM_OUTPUTTYPETPAGE : pRet = new SwMailMergeOutputTypePage(this);       break;
141*cdf0e10cSrcweir         case MM_ADDRESSBLOCKPAGE  : pRet = new SwMailMergeAddressBlockPage(this);     break;
142*cdf0e10cSrcweir         case MM_GREETINGSPAGE     : pRet = new SwMailMergeGreetingsPage(this);      break;
143*cdf0e10cSrcweir         case MM_LAYOUTPAGE        : pRet = new SwMailMergeLayoutPage(this);     break;
144*cdf0e10cSrcweir         case MM_PREPAREMERGEPAGE  : pRet = new SwMailMergePrepareMergePage(this);   break;
145*cdf0e10cSrcweir         case MM_MERGEPAGE         : pRet = new SwMailMergeMergePage(this);          break;
146*cdf0e10cSrcweir         case MM_OUTPUTPAGE       :  pRet = new SwMailMergeOutputPage(this);         break;
147*cdf0e10cSrcweir     }
148*cdf0e10cSrcweir     DBG_ASSERT(pRet, "no page created in ::createPage");
149*cdf0e10cSrcweir     return pRet;
150*cdf0e10cSrcweir }
151*cdf0e10cSrcweir /*-- 04.06.2004 13:18:47---------------------------------------------------
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
154*cdf0e10cSrcweir void SwMailMergeWizard::enterState( WizardState _nState )
155*cdf0e10cSrcweir {
156*cdf0e10cSrcweir     ::svt::RoadmapWizard::enterState( _nState );
157*cdf0e10cSrcweir /*
158*cdf0e10cSrcweir     entering a page after the layoutpage requires the insertion
159*cdf0e10cSrcweir     of greeting and address block - if not yet done
160*cdf0e10cSrcweir     entering the merge or output page requires to create the output document
161*cdf0e10cSrcweir */
162*cdf0e10cSrcweir     if(_nState > MM_LAYOUTPAGE && m_rConfigItem.GetSourceView() &&
163*cdf0e10cSrcweir             ((m_rConfigItem.IsAddressBlock() && !m_rConfigItem.IsAddressInserted()) ||
164*cdf0e10cSrcweir              (m_rConfigItem.IsGreetingLine(sal_False) && !m_rConfigItem.IsGreetingInserted() )))
165*cdf0e10cSrcweir     {
166*cdf0e10cSrcweir         SwMailMergeLayoutPage::InsertAddressAndGreeting(m_rConfigItem.GetSourceView(),
167*cdf0e10cSrcweir                                 m_rConfigItem, Point(-1, -1), true);
168*cdf0e10cSrcweir     }
169*cdf0e10cSrcweir     if(_nState >= MM_MERGEPAGE && !m_rConfigItem.GetTargetView())
170*cdf0e10cSrcweir     {
171*cdf0e10cSrcweir         CreateTargetDocument();
172*cdf0e10cSrcweir         m_nRestartPage = _nState;
173*cdf0e10cSrcweir         EndDialog(RET_TARGET_CREATED);
174*cdf0e10cSrcweir         return;
175*cdf0e10cSrcweir     }
176*cdf0e10cSrcweir     else if(_nState < MM_MERGEPAGE && m_rConfigItem.GetTargetView())
177*cdf0e10cSrcweir     {
178*cdf0e10cSrcweir         //close the dialog, remove the target view, show the source view
179*cdf0e10cSrcweir         m_nRestartPage = _nState;
180*cdf0e10cSrcweir         //set ResultSet back to start
181*cdf0e10cSrcweir         m_rConfigItem.MoveResultSet(1);
182*cdf0e10cSrcweir         EndDialog(RET_REMOVE_TARGET);
183*cdf0e10cSrcweir         return;
184*cdf0e10cSrcweir     }
185*cdf0e10cSrcweir     bool bEnablePrev = true;
186*cdf0e10cSrcweir     bool bEnableNext = true;
187*cdf0e10cSrcweir     switch(_nState)
188*cdf0e10cSrcweir     {
189*cdf0e10cSrcweir         case MM_DOCUMENTSELECTPAGE :
190*cdf0e10cSrcweir             bEnablePrev = false;
191*cdf0e10cSrcweir         break;
192*cdf0e10cSrcweir         case MM_ADDRESSBLOCKPAGE  :
193*cdf0e10cSrcweir             bEnableNext = m_rConfigItem.GetResultSet().is();
194*cdf0e10cSrcweir         break;
195*cdf0e10cSrcweir         case MM_OUTPUTPAGE       :
196*cdf0e10cSrcweir             bEnableNext = false;
197*cdf0e10cSrcweir         break;
198*cdf0e10cSrcweir     }
199*cdf0e10cSrcweir     enableButtons( WZB_PREVIOUS, bEnablePrev);
200*cdf0e10cSrcweir     enableButtons( WZB_NEXT, bEnableNext);
201*cdf0e10cSrcweir 
202*cdf0e10cSrcweir     UpdateRoadmap();
203*cdf0e10cSrcweir }
204*cdf0e10cSrcweir /*-- 04.06.2004 12:54:13---------------------------------------------------
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
207*cdf0e10cSrcweir String  SwMailMergeWizard::getStateDisplayName( WizardState _nState ) const
208*cdf0e10cSrcweir {
209*cdf0e10cSrcweir     String sRet;
210*cdf0e10cSrcweir     switch(_nState)
211*cdf0e10cSrcweir     {
212*cdf0e10cSrcweir         case MM_DOCUMENTSELECTPAGE :sRet = m_sStarting;      break;
213*cdf0e10cSrcweir         case MM_OUTPUTTYPETPAGE :   sRet = m_sDocumentType;  break;
214*cdf0e10cSrcweir         case MM_ADDRESSBLOCKPAGE  :
215*cdf0e10cSrcweir             sRet =  m_rConfigItem.IsOutputToLetter() ?
216*cdf0e10cSrcweir                     m_sAddressBlock : m_sAddressList;
217*cdf0e10cSrcweir 
218*cdf0e10cSrcweir         break;
219*cdf0e10cSrcweir         case MM_GREETINGSPAGE     : sRet = m_sGreetingsLine; break;
220*cdf0e10cSrcweir         case MM_LAYOUTPAGE        : sRet = m_sLayout;        break;
221*cdf0e10cSrcweir         case MM_PREPAREMERGEPAGE  : sRet = m_sPrepareMerge;  break;
222*cdf0e10cSrcweir         case MM_MERGEPAGE         : sRet = m_sMerge;         break;
223*cdf0e10cSrcweir         case MM_OUTPUTPAGE       : sRet = m_sOutput;        break;
224*cdf0e10cSrcweir     }
225*cdf0e10cSrcweir     return sRet;
226*cdf0e10cSrcweir }
227*cdf0e10cSrcweir /*-- 24.06.2004 09:24:45---------------------------------------------------
228*cdf0e10cSrcweir     enables/disables pages in the roadmap depending on the current
229*cdf0e10cSrcweir     page and state
230*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
231*cdf0e10cSrcweir void SwMailMergeWizard::UpdateRoadmap()
232*cdf0e10cSrcweir {
233*cdf0e10cSrcweir /*
234*cdf0e10cSrcweir     MM_DOCUMENTSELECTPAGE       > inactive after the layoutpage
235*cdf0e10cSrcweir     MM_OUTPUTTYPETPAGE :        > inactive after the layoutpage
236*cdf0e10cSrcweir     MM_ADDRESSBLOCKPAGE         > inactive after the layoutpage
237*cdf0e10cSrcweir     MM_GREETINGSPAGE            > inactive after the layoutpage
238*cdf0e10cSrcweir     MM_LAYOUTPAGE               >   inactive after the layoutpage
239*cdf0e10cSrcweir                                     inactive if address block and greeting are switched off
240*cdf0e10cSrcweir                                     or are already inserted into the source document
241*cdf0e10cSrcweir     MM_PREPAREMERGEPAGE         > only active if address data has been selected
242*cdf0e10cSrcweir                                     inactive after preparemerge page
243*cdf0e10cSrcweir     MM_MERGEPAGE                > only active if address data has been selected
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir     MM_OUTPUTPAGE               > only active if address data has been selected
246*cdf0e10cSrcweir */
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir     // enableState( <page id>, false );
249*cdf0e10cSrcweir     const sal_uInt16 nCurPage = GetCurLevel();
250*cdf0e10cSrcweir     TabPage* pCurPage = GetPage( nCurPage );
251*cdf0e10cSrcweir     if(!pCurPage)
252*cdf0e10cSrcweir         return;
253*cdf0e10cSrcweir     bool bEnable = false;
254*cdf0e10cSrcweir     bool bAddressFieldsConfigured = !m_rConfigItem.IsOutputToLetter() ||
255*cdf0e10cSrcweir                 !m_rConfigItem.IsAddressBlock() ||
256*cdf0e10cSrcweir                 m_rConfigItem.IsAddressFieldsAssigned();
257*cdf0e10cSrcweir     bool bGreetingFieldsConfigured = !m_rConfigItem.IsGreetingLine(sal_False) ||
258*cdf0e10cSrcweir             !m_rConfigItem.IsIndividualGreeting(sal_False)||
259*cdf0e10cSrcweir                     m_rConfigItem.IsGreetingFieldsAssigned();
260*cdf0e10cSrcweir     //#i97436# if a document has to be loaded then enable output type page only
261*cdf0e10cSrcweir     m_bDocumentLoad = false;
262*cdf0e10cSrcweir     bool bEnableOutputTypePage = (nCurPage != MM_DOCUMENTSELECTPAGE) ||
263*cdf0e10cSrcweir         static_cast<svt::OWizardPage*>(pCurPage)->commitPage( ::svt::WizardTypes::eValidate );
264*cdf0e10cSrcweir 
265*cdf0e10cSrcweir     for(sal_uInt16 nPage = MM_DOCUMENTSELECTPAGE; nPage <= MM_OUTPUTPAGE; ++nPage)
266*cdf0e10cSrcweir     {
267*cdf0e10cSrcweir         switch(nPage)
268*cdf0e10cSrcweir         {
269*cdf0e10cSrcweir             case MM_DOCUMENTSELECTPAGE :
270*cdf0e10cSrcweir                 bEnable = sal_True;
271*cdf0e10cSrcweir             break;
272*cdf0e10cSrcweir             case MM_OUTPUTTYPETPAGE :
273*cdf0e10cSrcweir                 bEnable = bEnableOutputTypePage;
274*cdf0e10cSrcweir             break;
275*cdf0e10cSrcweir             case MM_ADDRESSBLOCKPAGE  :
276*cdf0e10cSrcweir                 bEnable = !m_bDocumentLoad && bEnableOutputTypePage;
277*cdf0e10cSrcweir             break;
278*cdf0e10cSrcweir             case MM_GREETINGSPAGE     :
279*cdf0e10cSrcweir                 bEnable = !m_bDocumentLoad && bEnableOutputTypePage &&
280*cdf0e10cSrcweir                     m_rConfigItem.GetResultSet().is() &&
281*cdf0e10cSrcweir                             bAddressFieldsConfigured;
282*cdf0e10cSrcweir             break;
283*cdf0e10cSrcweir             case MM_PREPAREMERGEPAGE  :
284*cdf0e10cSrcweir             case MM_MERGEPAGE         :
285*cdf0e10cSrcweir             case MM_OUTPUTPAGE       :
286*cdf0e10cSrcweir             case MM_LAYOUTPAGE        :
287*cdf0e10cSrcweir                 bEnable = !m_bDocumentLoad && bEnableOutputTypePage &&
288*cdf0e10cSrcweir                             m_rConfigItem.GetResultSet().is() &&
289*cdf0e10cSrcweir                             bAddressFieldsConfigured &&
290*cdf0e10cSrcweir                             bGreetingFieldsConfigured;
291*cdf0e10cSrcweir                 if(MM_LAYOUTPAGE == nPage)
292*cdf0e10cSrcweir                     bEnable &=
293*cdf0e10cSrcweir                         ((m_rConfigItem.IsAddressBlock() && !m_rConfigItem.IsAddressInserted()) ||
294*cdf0e10cSrcweir                             (m_rConfigItem.IsGreetingLine(sal_False) && !m_rConfigItem.IsGreetingInserted() ));
295*cdf0e10cSrcweir             break;
296*cdf0e10cSrcweir         }
297*cdf0e10cSrcweir         enableState( nPage, bEnable );
298*cdf0e10cSrcweir     }
299*cdf0e10cSrcweir }
300*cdf0e10cSrcweir /*-- 24.06.2004 09:24:45---------------------------------------------------
301*cdf0e10cSrcweir     enables/disables pages in the roadmap depending on the current
302*cdf0e10cSrcweir     page and state
303*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
304*cdf0e10cSrcweir void SwMailMergeWizard::CreateTargetDocument()
305*cdf0e10cSrcweir {
306*cdf0e10cSrcweir     GetSwView()->GetWrtShell().GetNewDBMgr()->
307*cdf0e10cSrcweir                 MergeDocuments( m_rConfigItem, *GetSwView() );
308*cdf0e10cSrcweir     m_rConfigItem.SetMergeDone();
309*cdf0e10cSrcweir     if( m_rConfigItem.GetTargetView() )
310*cdf0e10cSrcweir         m_rConfigItem.GetTargetView()->GetViewFrame()->GetFrame().Appear();
311*cdf0e10cSrcweir }
312*cdf0e10cSrcweir /*-- 23.08.2004 08:51:36---------------------------------------------------
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
315*cdf0e10cSrcweir void SwMailMergeWizard::updateRoadmapItemLabel( WizardState _nState )
316*cdf0e10cSrcweir {
317*cdf0e10cSrcweir     svt::RoadmapWizard::updateRoadmapItemLabel( _nState );
318*cdf0e10cSrcweir }
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir // ------------------------------------------------------------------------
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir short SwMailMergeWizard::Execute()
323*cdf0e10cSrcweir {
324*cdf0e10cSrcweir     DBG_ERROR( "SwMailMergeWizard cannot be executed via Dialog::Execute!\n"
325*cdf0e10cSrcweir                "It creates a thread (MailDispatcher instance) that will call"
326*cdf0e10cSrcweir                "back to VCL apartment => deadlock!\n"
327*cdf0e10cSrcweir                "Use Dialog::StartExecuteModal to execute the dialog!" );
328*cdf0e10cSrcweir     return RET_CANCEL;
329*cdf0e10cSrcweir }
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir // ------------------------------------------------------------------------
332*cdf0e10cSrcweir 
333*cdf0e10cSrcweir void SwMailMergeWizard::StartExecuteModal( const Link& rEndDialogHdl )
334*cdf0e10cSrcweir {
335*cdf0e10cSrcweir     ::svt::RoadmapWizard::StartExecuteModal( rEndDialogHdl );
336*cdf0e10cSrcweir }
337