xref: /aoo41x/main/sw/source/ui/uiview/viewprt.cxx (revision cdf0e10c)
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 
31*cdf0e10cSrcweir #include <com/sun/star/text/NotePrintMode.hpp>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #if STLPORT_VERSION>=321
34*cdf0e10cSrcweir #include <cstdarg>
35*cdf0e10cSrcweir #endif
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #ifndef _CMDID_H
38*cdf0e10cSrcweir #include <cmdid.h>
39*cdf0e10cSrcweir #endif
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #ifndef _SVSTDARR_HXX
42*cdf0e10cSrcweir #define _SVSTDARR_STRINGSDTOR
43*cdf0e10cSrcweir #include <svl/svstdarr.hxx>
44*cdf0e10cSrcweir #endif
45*cdf0e10cSrcweir #include <sfx2/request.hxx>
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir #include <sfx2/progress.hxx>
48*cdf0e10cSrcweir #include <sfx2/app.hxx>
49*cdf0e10cSrcweir #include <svl/flagitem.hxx>
50*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
51*cdf0e10cSrcweir #include <vcl/oldprintadaptor.hxx>
52*cdf0e10cSrcweir #include <sfx2/printer.hxx>
53*cdf0e10cSrcweir #include <sfx2/prnmon.hxx>
54*cdf0e10cSrcweir #include <editeng/paperinf.hxx>
55*cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
56*cdf0e10cSrcweir #include <unotools/misccfg.hxx>
57*cdf0e10cSrcweir #include <svx/prtqry.hxx>
58*cdf0e10cSrcweir #include <svx/svdview.hxx>
59*cdf0e10cSrcweir #include <svl/eitem.hxx>
60*cdf0e10cSrcweir #include <svl/stritem.hxx>
61*cdf0e10cSrcweir #include <svl/intitem.hxx>
62*cdf0e10cSrcweir #include <svl/flagitem.hxx>
63*cdf0e10cSrcweir #include <sfx2/linkmgr.hxx>
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir #include <modcfg.hxx>
66*cdf0e10cSrcweir #include <edtwin.hxx>
67*cdf0e10cSrcweir #include <view.hxx>
68*cdf0e10cSrcweir #include <wrtsh.hxx>
69*cdf0e10cSrcweir #include <docsh.hxx>
70*cdf0e10cSrcweir #include <viewopt.hxx>
71*cdf0e10cSrcweir #include <prtopt.hxx>
72*cdf0e10cSrcweir #include <fontcfg.hxx>
73*cdf0e10cSrcweir #include <cfgitems.hxx>
74*cdf0e10cSrcweir #include <dbmgr.hxx>
75*cdf0e10cSrcweir #include <docstat.hxx>
76*cdf0e10cSrcweir #include <viewfunc.hxx>
77*cdf0e10cSrcweir #include <swmodule.hxx>
78*cdf0e10cSrcweir #include <wview.hxx>
79*cdf0e10cSrcweir #include <doc.hxx>
80*cdf0e10cSrcweir #include <fldbas.hxx>
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir #include <globals.hrc>
83*cdf0e10cSrcweir #include <view.hrc>
84*cdf0e10cSrcweir #include <app.hrc>
85*cdf0e10cSrcweir #include <svl/eitem.hxx>
86*cdf0e10cSrcweir #include <swwrtshitem.hxx>
87*cdf0e10cSrcweir #include "swabstdlg.hxx"
88*cdf0e10cSrcweir #include <svl/slstitm.hxx>
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir #include <unomid.h>
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir using namespace ::com::sun::star;
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir /*--------------------------------------------------------------------
96*cdf0e10cSrcweir 	Beschreibung:	Drucker an Sfx uebergeben
97*cdf0e10cSrcweir  --------------------------------------------------------------------*/
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir SfxPrinter* __EXPORT SwView::GetPrinter( sal_Bool bCreate )
101*cdf0e10cSrcweir {
102*cdf0e10cSrcweir     const IDocumentDeviceAccess* pIDDA = GetWrtShell().getIDocumentDeviceAccess();
103*cdf0e10cSrcweir     SfxPrinter *pOld = pIDDA->getPrinter( false );
104*cdf0e10cSrcweir     SfxPrinter *pPrt = pIDDA->getPrinter( bCreate );
105*cdf0e10cSrcweir 	if ( pOld != pPrt )
106*cdf0e10cSrcweir 	{
107*cdf0e10cSrcweir 		sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
108*cdf0e10cSrcweir 		::SetAppPrintOptions( &GetWrtShell(), bWeb );
109*cdf0e10cSrcweir 	}
110*cdf0e10cSrcweir 	return pPrt;
111*cdf0e10cSrcweir }
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir /*--------------------------------------------------------------------
114*cdf0e10cSrcweir 	Beschreibung:	Druckerwechsel weitermelden
115*cdf0e10cSrcweir  --------------------------------------------------------------------*/
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, sal_Bool bWeb )
118*cdf0e10cSrcweir {
119*cdf0e10cSrcweir 	SwPrintOptions* pOpt = SW_MOD()->GetPrtOptions(bWeb);
120*cdf0e10cSrcweir 	if( !pOpt)
121*cdf0e10cSrcweir 		return;
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir 	// Applikationseigene Druckoptionen aus SfxPrinter auslesen
124*cdf0e10cSrcweir 	const SfxItemSet& rSet = pNew->GetOptions();
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 	const SwAddPrinterItem* pAddPrinterAttr;
127*cdf0e10cSrcweir 	if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, sal_False,
128*cdf0e10cSrcweir 		(const SfxPoolItem**)&pAddPrinterAttr ) )
129*cdf0e10cSrcweir 	{
130*cdf0e10cSrcweir         if( pIDDA )
131*cdf0e10cSrcweir             pIDDA->setPrintData( *pAddPrinterAttr );
132*cdf0e10cSrcweir         if( pAddPrinterAttr->GetFax().getLength() )
133*cdf0e10cSrcweir 			pOpt->SetFaxName(pAddPrinterAttr->GetFax());
134*cdf0e10cSrcweir 	}
135*cdf0e10cSrcweir }
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir sal_uInt16 __EXPORT SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool  )
139*cdf0e10cSrcweir {
140*cdf0e10cSrcweir 	SwWrtShell &rSh = GetWrtShell();
141*cdf0e10cSrcweir     SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false );
142*cdf0e10cSrcweir     if ( pOld && pOld->IsPrinting() )
143*cdf0e10cSrcweir         return SFX_PRINTERROR_BUSY;
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir 	if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags )
146*cdf0e10cSrcweir 	{
147*cdf0e10cSrcweir         rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true );
148*cdf0e10cSrcweir         if ( nDiffFlags & SFX_PRINTER_PRINTER )
149*cdf0e10cSrcweir 			rSh.SetModified();
150*cdf0e10cSrcweir 	}
151*cdf0e10cSrcweir 	sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
152*cdf0e10cSrcweir 	if ( nDiffFlags & SFX_PRINTER_OPTIONS )
153*cdf0e10cSrcweir 		::SetPrinter( rSh.getIDocumentDeviceAccess(), pNew, bWeb );
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir 	const sal_Bool bChgOri = nDiffFlags & SFX_PRINTER_CHG_ORIENTATION ? sal_True : sal_False;
156*cdf0e10cSrcweir 	const sal_Bool bChgSize= nDiffFlags & SFX_PRINTER_CHG_SIZE ? sal_True : sal_False;
157*cdf0e10cSrcweir 	if ( bChgOri || bChgSize )
158*cdf0e10cSrcweir 	{
159*cdf0e10cSrcweir 		rSh.StartAllAction();
160*cdf0e10cSrcweir 		if ( bChgOri )
161*cdf0e10cSrcweir 			rSh.ChgAllPageOrientation( sal_uInt16(pNew->GetOrientation()) );
162*cdf0e10cSrcweir 		if ( bChgSize )
163*cdf0e10cSrcweir 		{
164*cdf0e10cSrcweir 			Size aSz( SvxPaperInfo::GetPaperSize( pNew ) );
165*cdf0e10cSrcweir 			rSh.ChgAllPageSize( aSz );
166*cdf0e10cSrcweir 		}
167*cdf0e10cSrcweir 		rSh.SetModified();
168*cdf0e10cSrcweir 		rSh.EndAllAction();
169*cdf0e10cSrcweir 		InvalidateRulerPos();
170*cdf0e10cSrcweir 	}
171*cdf0e10cSrcweir 	return 0;
172*cdf0e10cSrcweir }
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir /*--------------------------------------------------------------------
175*cdf0e10cSrcweir 	Beschreibung:	TabPage fuer applikationsspezifische Druckoptionen
176*cdf0e10cSrcweir  --------------------------------------------------------------------*/
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir SfxTabPage* __EXPORT SwView::CreatePrintOptionsPage(Window* pParent,
179*cdf0e10cSrcweir 													const SfxItemSet& rSet)
180*cdf0e10cSrcweir {
181*cdf0e10cSrcweir 	return ::CreatePrintOptionsPage( pParent, rSet, sal_False );
182*cdf0e10cSrcweir }
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir /*--------------------------------------------------------------------
185*cdf0e10cSrcweir 	Beschreibung:	Print-Dispatcher
186*cdf0e10cSrcweir  --------------------------------------------------------------------*/
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir void __EXPORT SwView::ExecutePrint(SfxRequest& rReq)
189*cdf0e10cSrcweir {
190*cdf0e10cSrcweir 	sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
191*cdf0e10cSrcweir 	::SetAppPrintOptions( &GetWrtShell(), bWeb );
192*cdf0e10cSrcweir 	switch (rReq.GetSlot())
193*cdf0e10cSrcweir 	{
194*cdf0e10cSrcweir 		case FN_FAX:
195*cdf0e10cSrcweir 		{
196*cdf0e10cSrcweir             SwPrintOptions* pPrintOptions = SW_MOD()->GetPrtOptions(bWeb);
197*cdf0e10cSrcweir             String sFaxName(pPrintOptions->GetFaxName());
198*cdf0e10cSrcweir 			if (sFaxName.Len())
199*cdf0e10cSrcweir 			{
200*cdf0e10cSrcweir 				SfxStringItem aPrinterName(SID_PRINTER_NAME, sFaxName);
201*cdf0e10cSrcweir 				SfxBoolItem aSilent( SID_SILENT, sal_True );
202*cdf0e10cSrcweir 				GetViewFrame()->GetDispatcher()->Execute( SID_PRINTDOC,
203*cdf0e10cSrcweir 							SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
204*cdf0e10cSrcweir 							&aPrinterName, &aSilent, 0L );
205*cdf0e10cSrcweir 			}
206*cdf0e10cSrcweir 			else
207*cdf0e10cSrcweir 			{
208*cdf0e10cSrcweir 				InfoBox aInfoBox(&GetEditWin(), SW_RES(MSG_ERR_NO_FAX));
209*cdf0e10cSrcweir 				String sMsg = aInfoBox.GetMessText();
210*cdf0e10cSrcweir 				sal_uInt16 nResNo = bWeb ? STR_WEBOPTIONS : STR_TEXTOPTIONS;
211*cdf0e10cSrcweir 				sMsg.SearchAndReplace(String::CreateFromAscii("%1"), String(SW_RES(nResNo)));
212*cdf0e10cSrcweir 				aInfoBox.SetMessText(sMsg);
213*cdf0e10cSrcweir 				aInfoBox.Execute();
214*cdf0e10cSrcweir 				SfxUInt16Item aDefPage(SID_SW_EDITOPTIONS, TP_OPTPRINT_PAGE);
215*cdf0e10cSrcweir 				GetViewFrame()->GetDispatcher()->Execute(SID_SW_EDITOPTIONS,
216*cdf0e10cSrcweir 							SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
217*cdf0e10cSrcweir 							&aDefPage, 0L );
218*cdf0e10cSrcweir 			}
219*cdf0e10cSrcweir 		}
220*cdf0e10cSrcweir 		break;
221*cdf0e10cSrcweir 		case SID_PRINTDOC:
222*cdf0e10cSrcweir 		case SID_PRINTDOCDIRECT:
223*cdf0e10cSrcweir 		{
224*cdf0e10cSrcweir 			SwWrtShell* pSh = &GetWrtShell();
225*cdf0e10cSrcweir             SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, sal_False);
226*cdf0e10cSrcweir             sal_Bool bSilent = pSilentItem ? pSilentItem->GetValue() : sal_False;
227*cdf0e10cSrcweir             SFX_REQUEST_ARG(rReq, pPrintFromMergeItem, SfxBoolItem, FN_QRY_MERGE, sal_False);
228*cdf0e10cSrcweir 			if(pPrintFromMergeItem)
229*cdf0e10cSrcweir 				rReq.RemoveItem(FN_QRY_MERGE);
230*cdf0e10cSrcweir             sal_Bool bFromMerge = pPrintFromMergeItem ? pPrintFromMergeItem->GetValue() : sal_False;
231*cdf0e10cSrcweir             SwMiscConfig aMiscConfig;
232*cdf0e10cSrcweir             bool bPrintSelection = false;
233*cdf0e10cSrcweir             if(!bSilent && !bFromMerge &&
234*cdf0e10cSrcweir                     SW_MOD()->GetModuleConfig()->IsAskForMailMerge() && pSh->IsAnyDatabaseFieldInDoc())
235*cdf0e10cSrcweir             {
236*cdf0e10cSrcweir                 QueryBox aBox( &GetEditWin(), SW_RES( MSG_PRINT_AS_MERGE ));
237*cdf0e10cSrcweir                 short nRet = aBox.Execute();
238*cdf0e10cSrcweir                 if(RET_YES == nRet)
239*cdf0e10cSrcweir                 {
240*cdf0e10cSrcweir                     SfxBoolItem aBool(FN_QRY_MERGE, sal_True);
241*cdf0e10cSrcweir                     GetViewFrame()->GetDispatcher()->Execute(
242*cdf0e10cSrcweir                                 FN_QRY_MERGE, SFX_CALLMODE_ASYNCHRON, &aBool, 0L);
243*cdf0e10cSrcweir                     rReq.Ignore();
244*cdf0e10cSrcweir 					return;
245*cdf0e10cSrcweir                 }
246*cdf0e10cSrcweir             }
247*cdf0e10cSrcweir             else if( rReq.GetSlot() == SID_PRINTDOCDIRECT && ! bSilent )
248*cdf0e10cSrcweir             {
249*cdf0e10cSrcweir                 if( /*!bIsAPI && */
250*cdf0e10cSrcweir                    ( pSh->IsSelection() || pSh->IsFrmSelected() || pSh->IsObjSelected() ) )
251*cdf0e10cSrcweir                 {
252*cdf0e10cSrcweir                     short nBtn = SvxPrtQryBox(&GetEditWin()).Execute();
253*cdf0e10cSrcweir                     if( RET_CANCEL == nBtn )
254*cdf0e10cSrcweir                         return;;
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir                     if( RET_OK == nBtn )
257*cdf0e10cSrcweir                         bPrintSelection = true;
258*cdf0e10cSrcweir                 }
259*cdf0e10cSrcweir             }
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir             //#i61455# if master documentes are printed silently without loaded links then update the links now
262*cdf0e10cSrcweir             if( bSilent && pSh->IsGlobalDoc() && !pSh->IsGlblDocSaveLinks() )
263*cdf0e10cSrcweir             {
264*cdf0e10cSrcweir                 pSh->GetLinkManager().UpdateAllLinks( sal_False, sal_False, sal_False, 0 );
265*cdf0e10cSrcweir             }
266*cdf0e10cSrcweir             SfxRequest aReq( rReq );
267*cdf0e10cSrcweir             SfxBoolItem aBool(SID_SELECTION, bPrintSelection);
268*cdf0e10cSrcweir             aReq.AppendItem( aBool );
269*cdf0e10cSrcweir 			SfxViewShell::ExecuteSlot( aReq, SfxViewShell::GetInterface() );
270*cdf0e10cSrcweir 			return;
271*cdf0e10cSrcweir 		}
272*cdf0e10cSrcweir 		default:
273*cdf0e10cSrcweir 			ASSERT(!this, falscher Dispatcher);
274*cdf0e10cSrcweir 			return;
275*cdf0e10cSrcweir 	}
276*cdf0e10cSrcweir }
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir /*--------------------------------------------------------------------
279*cdf0e10cSrcweir 	Beschreibung:	Page Drucker/Zusaetze erzeugen fuer SwView und
280*cdf0e10cSrcweir 					SwPagePreview
281*cdf0e10cSrcweir  --------------------------------------------------------------------*/
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir SfxTabPage* CreatePrintOptionsPage( Window *pParent,
284*cdf0e10cSrcweir 								const SfxItemSet &rOptions, sal_Bool bPreview )
285*cdf0e10cSrcweir {
286*cdf0e10cSrcweir 	SfxTabPage* pPage = NULL;
287*cdf0e10cSrcweir 	SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
288*cdf0e10cSrcweir 	if ( pFact )
289*cdf0e10cSrcweir 	{
290*cdf0e10cSrcweir 		::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( TP_OPTPRINT_PAGE );
291*cdf0e10cSrcweir 		if ( fnCreatePage )
292*cdf0e10cSrcweir 			pPage = (*fnCreatePage)( pParent, rOptions );
293*cdf0e10cSrcweir 	}
294*cdf0e10cSrcweir 	SfxAllItemSet aSet(*(rOptions.GetPool()));
295*cdf0e10cSrcweir 	aSet.Put (SfxBoolItem(SID_PREVIEWFLAG_TYPE, bPreview));
296*cdf0e10cSrcweir 	aSet.Put (SfxBoolItem(SID_FAX_LIST, sal_True));
297*cdf0e10cSrcweir 	pPage->PageCreated(aSet);
298*cdf0e10cSrcweir 	return pPage;
299*cdf0e10cSrcweir }
300*cdf0e10cSrcweir 
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir void SetAppPrintOptions( ViewShell* pSh, sal_Bool bWeb )
303*cdf0e10cSrcweir {
304*cdf0e10cSrcweir     const IDocumentDeviceAccess* pIDDA = pSh->getIDocumentDeviceAccess();
305*cdf0e10cSrcweir     SwPrintData aPrtData = pIDDA->getPrintData();
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir     if( pIDDA->getPrinter( false ) )
308*cdf0e10cSrcweir 	{
309*cdf0e10cSrcweir 		// Applikationseigene Druckoptionen in SfxPrinter schiessen
310*cdf0e10cSrcweir         SwAddPrinterItem aAddPrinterItem (FN_PARAM_ADDPRINTER, aPrtData);
311*cdf0e10cSrcweir 		SfxItemSet aSet( pSh->GetAttrPool(),
312*cdf0e10cSrcweir 					FN_PARAM_ADDPRINTER, 		FN_PARAM_ADDPRINTER,
313*cdf0e10cSrcweir 					SID_HTML_MODE,				SID_HTML_MODE,
314*cdf0e10cSrcweir 					SID_PRINTER_NOTFOUND_WARN, 	SID_PRINTER_NOTFOUND_WARN,
315*cdf0e10cSrcweir 					SID_PRINTER_CHANGESTODOC, 	SID_PRINTER_CHANGESTODOC,
316*cdf0e10cSrcweir 					0 );
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir         utl::MiscCfg aMisc;
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir 		if(bWeb)
321*cdf0e10cSrcweir 			aSet.Put(SfxUInt16Item(SID_HTML_MODE,
322*cdf0e10cSrcweir 					::GetHtmlMode(((SwWrtShell*)pSh)->GetView().GetDocShell())));
323*cdf0e10cSrcweir 		aSet.Put(SfxBoolItem(SID_PRINTER_NOTFOUND_WARN,
324*cdf0e10cSrcweir 						aMisc.IsNotFoundWarning() ));
325*cdf0e10cSrcweir 		aSet.Put(aAddPrinterItem);
326*cdf0e10cSrcweir 		aSet.Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC,
327*cdf0e10cSrcweir 			(aMisc.IsPaperSizeWarning() ? SFX_PRINTER_CHG_SIZE : 0)   |
328*cdf0e10cSrcweir             (aMisc.IsPaperOrientationWarning()  ? SFX_PRINTER_CHG_ORIENTATION : 0 )));
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir         pIDDA->getPrinter( true )->SetOptions( aSet );
331*cdf0e10cSrcweir 	}
332*cdf0e10cSrcweir 
333*cdf0e10cSrcweir }
334