xref: /AOO41X/main/sd/source/ui/view/drviewse.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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_sd.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <com/sun/star/presentation/XPresentation2.hpp>
32*cdf0e10cSrcweir #include <com/sun/star/form/FormButtonType.hpp>
33*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
34*cdf0e10cSrcweir #include <com/sun/star/i18n/TransliterationModules.hpp>
35*cdf0e10cSrcweir #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #include "undo/undomanager.hxx"
40*cdf0e10cSrcweir #include <vcl/waitobj.hxx>
41*cdf0e10cSrcweir #include <svl/aeitem.hxx>
42*cdf0e10cSrcweir #include <editeng/editstat.hxx>
43*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
44*cdf0e10cSrcweir #include <svl/urlbmk.hxx>
45*cdf0e10cSrcweir #include <svx/svdpagv.hxx>
46*cdf0e10cSrcweir #include <svx/fmshell.hxx>
47*cdf0e10cSrcweir #include <vcl/scrbar.hxx>
48*cdf0e10cSrcweir #include <svx/svdopath.hxx>
49*cdf0e10cSrcweir #include <svx/svdundo.hxx>
50*cdf0e10cSrcweir #include <svx/svdorect.hxx>
51*cdf0e10cSrcweir #include <svx/svdograf.hxx>
52*cdf0e10cSrcweir #include <svl/eitem.hxx>
53*cdf0e10cSrcweir #include <editeng/eeitem.hxx>
54*cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
55*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
56*cdf0e10cSrcweir #include <sfx2/request.hxx>
57*cdf0e10cSrcweir #include <svx/svxids.hrc>
58*cdf0e10cSrcweir #include <editeng/flditem.hxx>
59*cdf0e10cSrcweir #include <svx/ruler.hxx>
60*cdf0e10cSrcweir #include <svx/obj3d.hxx>
61*cdf0e10cSrcweir #include <svx/fmglob.hxx>
62*cdf0e10cSrcweir #include <svx/svdouno.hxx>
63*cdf0e10cSrcweir #include <svx/dataaccessdescriptor.hxx>
64*cdf0e10cSrcweir #include <tools/urlobj.hxx>
65*cdf0e10cSrcweir #include <svl/slstitm.hxx>
66*cdf0e10cSrcweir #include <sfx2/ipclient.hxx>
67*cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx>
68*cdf0e10cSrcweir #include <avmedia/mediawindow.hxx>
69*cdf0e10cSrcweir #include <svl/urihelper.hxx>
70*cdf0e10cSrcweir #include <sfx2/docfile.hxx>
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir #include "DrawViewShell.hxx"
73*cdf0e10cSrcweir #include "slideshow.hxx"
74*cdf0e10cSrcweir #include "ViewShellImplementation.hxx"
75*cdf0e10cSrcweir #include "ViewShellHint.hxx"
76*cdf0e10cSrcweir #include "framework/FrameworkHelper.hxx"
77*cdf0e10cSrcweir #include "app.hrc"
78*cdf0e10cSrcweir #include "glob.hrc"
79*cdf0e10cSrcweir #include "strings.hrc"
80*cdf0e10cSrcweir #include "res_bmp.hrc"
81*cdf0e10cSrcweir #include "drawdoc.hxx"
82*cdf0e10cSrcweir #include "fusel.hxx"
83*cdf0e10cSrcweir #include "futext.hxx"
84*cdf0e10cSrcweir #include "fuconrec.hxx"
85*cdf0e10cSrcweir #include "fuconcs.hxx"
86*cdf0e10cSrcweir #include "fuconuno.hxx"
87*cdf0e10cSrcweir #include "fuconbez.hxx"
88*cdf0e10cSrcweir #include "fuediglu.hxx"
89*cdf0e10cSrcweir #include "fuconarc.hxx"
90*cdf0e10cSrcweir #include "fucon3d.hxx"
91*cdf0e10cSrcweir #include "sdresid.hxx"
92*cdf0e10cSrcweir #include "slideshow.hxx"
93*cdf0e10cSrcweir #include "Outliner.hxx"
94*cdf0e10cSrcweir #include "PresentationViewShell.hxx"
95*cdf0e10cSrcweir #include "sdpage.hxx"
96*cdf0e10cSrcweir #include "FrameView.hxx"
97*cdf0e10cSrcweir #include "zoomlist.hxx"
98*cdf0e10cSrcweir #include "drawview.hxx"
99*cdf0e10cSrcweir #include "DrawDocShell.hxx"
100*cdf0e10cSrcweir #include "sdattr.hxx"
101*cdf0e10cSrcweir #include "ViewShellBase.hxx"
102*cdf0e10cSrcweir #include "ToolBarManager.hxx"
103*cdf0e10cSrcweir #include "anminfo.hxx"
104*cdf0e10cSrcweir #include "optsitem.hxx"
105*cdf0e10cSrcweir #include "Window.hxx"
106*cdf0e10cSrcweir #include "fuformatpaintbrush.hxx"
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir using ::rtl::OUString;
109*cdf0e10cSrcweir using namespace ::com::sun::star;
110*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
111*cdf0e10cSrcweir using namespace ::com::sun::star::presentation;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir namespace sd {
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir #ifdef _MSC_VER
116*cdf0e10cSrcweir #pragma optimize ( "", off )
117*cdf0e10cSrcweir #endif
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir /*************************************************************************
120*cdf0e10cSrcweir |*
121*cdf0e10cSrcweir |* Permanente Funktionen
122*cdf0e10cSrcweir |*
123*cdf0e10cSrcweir \************************************************************************/
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir void ImpAddPrintableCharactersToTextEdit(SfxRequest& rReq, ::sd::View* pView)
126*cdf0e10cSrcweir {
127*cdf0e10cSrcweir 	// #98198# evtl. feed characters to activated textedit
128*cdf0e10cSrcweir 	const SfxItemSet* pSet = rReq.GetArgs();
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir 	if(pSet)
131*cdf0e10cSrcweir 	{
132*cdf0e10cSrcweir 		String aInputString;
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 		if(SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR))
135*cdf0e10cSrcweir 			aInputString = ((SfxStringItem&)pSet->Get(SID_ATTR_CHAR)).GetValue();
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 		if(aInputString.Len())
138*cdf0e10cSrcweir 		{
139*cdf0e10cSrcweir 			OutlinerView* pOLV = pView->GetTextEditOutlinerView();
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir 			if(pOLV)
142*cdf0e10cSrcweir 			{
143*cdf0e10cSrcweir 				for(sal_uInt16 a(0); a < aInputString.Len(); a++)
144*cdf0e10cSrcweir 				{
145*cdf0e10cSrcweir 					sal_Char aChar = (sal_Char)aInputString.GetChar(a);
146*cdf0e10cSrcweir 					KeyCode aKeyCode;
147*cdf0e10cSrcweir 					KeyEvent aKeyEvent(aChar, aKeyCode);
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 					// add actual character
150*cdf0e10cSrcweir 					pOLV->PostKeyEvent(aKeyEvent);
151*cdf0e10cSrcweir 				}
152*cdf0e10cSrcweir 			}
153*cdf0e10cSrcweir 		}
154*cdf0e10cSrcweir 	}
155*cdf0e10cSrcweir }
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir void DrawViewShell::FuPermanent(SfxRequest& rReq)
158*cdf0e10cSrcweir {
159*cdf0e10cSrcweir 	// Waehrend einer Native-Diashow wird nichts ausgefuehrt!
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir 	if (SlideShow::IsRunning(GetViewShellBase()))
162*cdf0e10cSrcweir 		return;
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir 	sal_uInt16 nSId = rReq.GetSlot();
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir 	if( HasCurrentFunction() &&
167*cdf0e10cSrcweir 		( nSId == SID_TEXTEDIT || nSId == SID_ATTR_CHAR || nSId == SID_TEXT_FITTOSIZE ||
168*cdf0e10cSrcweir 		  nSId == SID_ATTR_CHAR_VERTICAL || nSId == SID_TEXT_FITTOSIZE_VERTICAL ) )
169*cdf0e10cSrcweir 	{
170*cdf0e10cSrcweir 		FunctionReference xFunc( GetCurrentFunction() );
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir 		FuText* pFuText = dynamic_cast< FuText* >( xFunc.get() );
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir 		if( pFuText )
175*cdf0e10cSrcweir 		{
176*cdf0e10cSrcweir 			pFuText->SetPermanent(sal_True);
177*cdf0e10cSrcweir 			xFunc->ReceiveRequest( rReq );
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 			MapSlot( nSId );
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir 			Invalidate();
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir 			Invalidate();
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 			// #98198# evtl. feed characters to activated textedit
186*cdf0e10cSrcweir 			if(SID_ATTR_CHAR == nSId && GetView() && GetView()->IsTextEdit())
187*cdf0e10cSrcweir 				ImpAddPrintableCharactersToTextEdit(rReq, GetView());
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir 			rReq.Done();
190*cdf0e10cSrcweir 			return;
191*cdf0e10cSrcweir 		}
192*cdf0e10cSrcweir 	}
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir 	CheckLineTo (rReq);
195*cdf0e10cSrcweir     sal_uInt16 nOldSId = 0;
196*cdf0e10cSrcweir     sal_Bool bPermanent = sal_False;
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir 	if( !mpDrawView )
199*cdf0e10cSrcweir 		return;
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir 	if(HasCurrentFunction())
202*cdf0e10cSrcweir 	{
203*cdf0e10cSrcweir 		if( (nSId == SID_FORMATPAINTBRUSH) && (GetCurrentFunction()->GetSlotID() == SID_TEXTEDIT) )
204*cdf0e10cSrcweir 		{
205*cdf0e10cSrcweir 			// save text edit mode for format paintbrush!
206*cdf0e10cSrcweir 			SetOldFunction( GetCurrentFunction() );
207*cdf0e10cSrcweir 		}
208*cdf0e10cSrcweir 		else
209*cdf0e10cSrcweir 		{
210*cdf0e10cSrcweir 			if(GetOldFunction() == GetCurrentFunction())
211*cdf0e10cSrcweir 			{
212*cdf0e10cSrcweir 				SetOldFunction(0);
213*cdf0e10cSrcweir 			}
214*cdf0e10cSrcweir 		}
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir 		if ( nSId != SID_TEXTEDIT && nSId != SID_ATTR_CHAR && nSId != SID_TEXT_FITTOSIZE &&
217*cdf0e10cSrcweir 			 nSId != SID_ATTR_CHAR_VERTICAL && nSId != SID_TEXT_FITTOSIZE_VERTICAL &&
218*cdf0e10cSrcweir 			 nSId != SID_FORMATPAINTBRUSH &&
219*cdf0e10cSrcweir 			 mpDrawView->IsTextEdit() )
220*cdf0e10cSrcweir 		{
221*cdf0e10cSrcweir 			mpDrawView->SdrEndTextEdit();
222*cdf0e10cSrcweir 		}
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir 		if( HasCurrentFunction() )
225*cdf0e10cSrcweir 		{
226*cdf0e10cSrcweir 			nOldSId = GetCurrentFunction()->GetSlotID();
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir 			if (nOldSId == nSId ||
229*cdf0e10cSrcweir 				((nOldSId == SID_TEXTEDIT || nOldSId == SID_ATTR_CHAR || nOldSId == SID_TEXT_FITTOSIZE ||
230*cdf0e10cSrcweir 				nOldSId == SID_ATTR_CHAR_VERTICAL || nOldSId == SID_TEXT_FITTOSIZE_VERTICAL) &&
231*cdf0e10cSrcweir 				(nSId == SID_TEXTEDIT || nSId == SID_ATTR_CHAR || nSId == SID_TEXT_FITTOSIZE ||
232*cdf0e10cSrcweir 				nSId == SID_ATTR_CHAR_VERTICAL || nSId == SID_TEXT_FITTOSIZE_VERTICAL )))
233*cdf0e10cSrcweir 			{
234*cdf0e10cSrcweir 				bPermanent = sal_True;
235*cdf0e10cSrcweir 			}
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir 			GetCurrentFunction()->Deactivate();
238*cdf0e10cSrcweir 		}
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir 		SetCurrentFunction(0);
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 		SfxBindings& rBind = GetViewFrame()->GetBindings();
243*cdf0e10cSrcweir         rBind.Invalidate(nOldSId);
244*cdf0e10cSrcweir         rBind.Update(nOldSId);
245*cdf0e10cSrcweir 	}
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir 	// Slot wird gemapped (ToolboxImages/-Slots)
248*cdf0e10cSrcweir 	MapSlot( nSId );
249*cdf0e10cSrcweir 
250*cdf0e10cSrcweir     switch ( nSId )
251*cdf0e10cSrcweir 	{
252*cdf0e10cSrcweir 		case SID_TEXTEDIT:	// BASIC ???
253*cdf0e10cSrcweir 		case SID_ATTR_CHAR:
254*cdf0e10cSrcweir 		case SID_ATTR_CHAR_VERTICAL:
255*cdf0e10cSrcweir 		case SID_TEXT_FITTOSIZE:
256*cdf0e10cSrcweir 		case SID_TEXT_FITTOSIZE_VERTICAL:
257*cdf0e10cSrcweir 		{
258*cdf0e10cSrcweir 			SetCurrentFunction( FuText::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
259*cdf0e10cSrcweir 			GetCurrentFunction()->DoExecute(rReq);
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir 			SfxBindings& rBindings = GetViewFrame()->GetBindings();
262*cdf0e10cSrcweir 			rBindings.Invalidate( SID_ATTR_CHAR );
263*cdf0e10cSrcweir 			rBindings.Invalidate( SID_ATTR_CHAR_VERTICAL );
264*cdf0e10cSrcweir 			rBindings.Invalidate( SID_TEXT_FITTOSIZE );
265*cdf0e10cSrcweir 			rBindings.Invalidate( SID_TEXT_FITTOSIZE_VERTICAL );
266*cdf0e10cSrcweir 
267*cdf0e10cSrcweir 			// #98198# evtl. feed characters to activated textedit
268*cdf0e10cSrcweir 			if(SID_ATTR_CHAR == nSId && GetView() && GetView()->IsTextEdit())
269*cdf0e10cSrcweir 				ImpAddPrintableCharactersToTextEdit(rReq, GetView());
270*cdf0e10cSrcweir 
271*cdf0e10cSrcweir 			rReq.Done();
272*cdf0e10cSrcweir 		}
273*cdf0e10cSrcweir 		break;
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir 		case SID_FM_CREATE_CONTROL:
276*cdf0e10cSrcweir 		{
277*cdf0e10cSrcweir 			SetCurrentFunction( FuConstructUnoControl::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
278*cdf0e10cSrcweir 			rReq.Done();
279*cdf0e10cSrcweir 		}
280*cdf0e10cSrcweir 		break;
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir 		// #98721#
283*cdf0e10cSrcweir 		case SID_FM_CREATE_FIELDCONTROL:
284*cdf0e10cSrcweir 		{
285*cdf0e10cSrcweir 			SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False );
286*cdf0e10cSrcweir 			DBG_ASSERT( pDescriptorItem, "DrawViewShell::FuPermanent(SID_FM_CREATE_FIELDCONTROL): invalid request args!" );
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir 			if(pDescriptorItem)
289*cdf0e10cSrcweir 			{
290*cdf0e10cSrcweir 				// get the form view
291*cdf0e10cSrcweir 				FmFormView* pFormView = PTR_CAST(FmFormView, mpDrawView);
292*cdf0e10cSrcweir 				SdrPageView* pPageView = pFormView ? pFormView->GetSdrPageView() : NULL;
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir 				if(pPageView)
295*cdf0e10cSrcweir 				{
296*cdf0e10cSrcweir 					::svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue());
297*cdf0e10cSrcweir 					SdrObject* pNewDBField = pFormView->CreateFieldControl(aDescriptor);
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir 					if(pNewDBField)
300*cdf0e10cSrcweir 					{
301*cdf0e10cSrcweir 						Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel()));
302*cdf0e10cSrcweir 						Point aObjPos(aVisArea.Center());
303*cdf0e10cSrcweir 						Size aObjSize(pNewDBField->GetLogicRect().GetSize());
304*cdf0e10cSrcweir 						aObjPos.X() -= aObjSize.Width() / 2;
305*cdf0e10cSrcweir 						aObjPos.Y() -= aObjSize.Height() / 2;
306*cdf0e10cSrcweir 						Rectangle aNewObjectRectangle(aObjPos, aObjSize);
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir 						pNewDBField->SetLogicRect(aNewObjectRectangle);
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir 						GetView()->InsertObjectAtView(pNewDBField, *pPageView);
311*cdf0e10cSrcweir 					}
312*cdf0e10cSrcweir 				}
313*cdf0e10cSrcweir 			}
314*cdf0e10cSrcweir 			rReq.Done();
315*cdf0e10cSrcweir 		}
316*cdf0e10cSrcweir 		break;
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir 		case SID_OBJECT_SELECT:
319*cdf0e10cSrcweir 		case SID_OBJECT_ROTATE:
320*cdf0e10cSrcweir 		case SID_OBJECT_MIRROR:
321*cdf0e10cSrcweir 		case SID_OBJECT_CROP:
322*cdf0e10cSrcweir 		case SID_OBJECT_TRANSPARENCE:
323*cdf0e10cSrcweir 		case SID_OBJECT_GRADIENT:
324*cdf0e10cSrcweir 		case SID_OBJECT_SHEAR:
325*cdf0e10cSrcweir 		case SID_OBJECT_CROOK_ROTATE:
326*cdf0e10cSrcweir 		case SID_OBJECT_CROOK_SLANT:
327*cdf0e10cSrcweir 		case SID_OBJECT_CROOK_STRETCH:
328*cdf0e10cSrcweir         case SID_CONVERT_TO_3D_LATHE:
329*cdf0e10cSrcweir 		{
330*cdf0e10cSrcweir 			short nSlotId = rReq.GetSlot();
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir 			if( nSlotId == SID_OBJECT_ROTATE )
333*cdf0e10cSrcweir 			{
334*cdf0e10cSrcweir 				// togle rotation
335*cdf0e10cSrcweir 				if( nOldSId == nSlotId )
336*cdf0e10cSrcweir 				{
337*cdf0e10cSrcweir 					nSlotId = SID_OBJECT_SELECT;
338*cdf0e10cSrcweir 					rReq.SetSlot( nSlotId );
339*cdf0e10cSrcweir 				}
340*cdf0e10cSrcweir 			}
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir 			if (nSlotId == SID_OBJECT_CROOK_ROTATE ||
343*cdf0e10cSrcweir 				nSlotId == SID_OBJECT_CROOK_SLANT ||
344*cdf0e10cSrcweir 				nSlotId == SID_OBJECT_CROOK_STRETCH)
345*cdf0e10cSrcweir 			{
346*cdf0e10cSrcweir 				if ( mpDrawView->GetMarkedObjectList().GetMarkCount() > 0 &&
347*cdf0e10cSrcweir 				    !mpDrawView->IsCrookAllowed( mpDrawView->IsCrookNoContortion() ) )
348*cdf0e10cSrcweir 				{
349*cdf0e10cSrcweir 					if ( mpDrawView->IsPresObjSelected() )
350*cdf0e10cSrcweir 					{
351*cdf0e10cSrcweir                         ::sd::Window* pWindow = GetActiveWindow();
352*cdf0e10cSrcweir                         InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
353*cdf0e10cSrcweir 					}
354*cdf0e10cSrcweir 					else if ( QueryBox(GetActiveWindow(), WB_YES_NO,
355*cdf0e10cSrcweir                                       String(SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) )
356*cdf0e10cSrcweir 									  ).Execute() == RET_YES )
357*cdf0e10cSrcweir 					{
358*cdf0e10cSrcweir 						// Implizite Wandlung in Bezier
359*cdf0e10cSrcweir                         WaitObject aWait( (Window*)GetActiveWindow() );
360*cdf0e10cSrcweir 						mpDrawView->ConvertMarkedToPathObj(sal_False);
361*cdf0e10cSrcweir 					}
362*cdf0e10cSrcweir 				}
363*cdf0e10cSrcweir 			}
364*cdf0e10cSrcweir 			else if (nSlotId == SID_OBJECT_SHEAR)
365*cdf0e10cSrcweir 			{
366*cdf0e10cSrcweir                 sal_uLong i = 0;
367*cdf0e10cSrcweir                 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
368*cdf0e10cSrcweir                 sal_uLong nMarkCnt = rMarkList.GetMarkCount();
369*cdf0e10cSrcweir                 sal_Bool b3DObjMarked = sal_False;
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir                 while (i < nMarkCnt && !b3DObjMarked)
372*cdf0e10cSrcweir                 {
373*cdf0e10cSrcweir                     if (rMarkList.GetMark(i)->GetMarkedSdrObj()->ISA(E3dObject))
374*cdf0e10cSrcweir                     {
375*cdf0e10cSrcweir                         b3DObjMarked = sal_True;
376*cdf0e10cSrcweir                     }
377*cdf0e10cSrcweir                     else
378*cdf0e10cSrcweir                     {
379*cdf0e10cSrcweir                         i++;
380*cdf0e10cSrcweir                     }
381*cdf0e10cSrcweir                 }
382*cdf0e10cSrcweir 
383*cdf0e10cSrcweir                 if ( nMarkCnt > 0 && !b3DObjMarked &&
384*cdf0e10cSrcweir                      (!mpDrawView->IsShearAllowed() || !mpDrawView->IsDistortAllowed()) )
385*cdf0e10cSrcweir 				{
386*cdf0e10cSrcweir 					if ( mpDrawView->IsPresObjSelected() )
387*cdf0e10cSrcweir 					{
388*cdf0e10cSrcweir                         ::sd::Window* pWindow = GetActiveWindow();
389*cdf0e10cSrcweir                         InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
390*cdf0e10cSrcweir 					}
391*cdf0e10cSrcweir 					else if ( QueryBox(GetActiveWindow(), WB_YES_NO,
392*cdf0e10cSrcweir                                       String(SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) )
393*cdf0e10cSrcweir 									  ).Execute() == RET_YES )
394*cdf0e10cSrcweir 					{
395*cdf0e10cSrcweir 						// Implizite Wandlung in Bezier
396*cdf0e10cSrcweir                         WaitObject aWait( (Window*)GetActiveWindow() );
397*cdf0e10cSrcweir 						mpDrawView->ConvertMarkedToPathObj(sal_False);
398*cdf0e10cSrcweir 					}
399*cdf0e10cSrcweir 				}
400*cdf0e10cSrcweir 			}
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir 			SetCurrentFunction( FuSelection::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
403*cdf0e10cSrcweir 			rReq.Done();
404*cdf0e10cSrcweir 			Invalidate( SID_OBJECT_SELECT );
405*cdf0e10cSrcweir 		}
406*cdf0e10cSrcweir 		break;
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir 		case SID_DRAW_LINE:
409*cdf0e10cSrcweir 		case SID_DRAW_XLINE:
410*cdf0e10cSrcweir         case SID_DRAW_MEASURELINE:
411*cdf0e10cSrcweir 		case SID_LINE_ARROW_START:
412*cdf0e10cSrcweir 		case SID_LINE_ARROW_END:
413*cdf0e10cSrcweir 		case SID_LINE_ARROWS:
414*cdf0e10cSrcweir 		case SID_LINE_ARROW_CIRCLE:
415*cdf0e10cSrcweir 		case SID_LINE_CIRCLE_ARROW:
416*cdf0e10cSrcweir 		case SID_LINE_ARROW_SQUARE:
417*cdf0e10cSrcweir 		case SID_LINE_SQUARE_ARROW:
418*cdf0e10cSrcweir 
419*cdf0e10cSrcweir 		case SID_DRAW_RECT:
420*cdf0e10cSrcweir 		case SID_DRAW_RECT_NOFILL:
421*cdf0e10cSrcweir 		case SID_DRAW_RECT_ROUND:
422*cdf0e10cSrcweir 		case SID_DRAW_RECT_ROUND_NOFILL:
423*cdf0e10cSrcweir 		case SID_DRAW_SQUARE:
424*cdf0e10cSrcweir 		case SID_DRAW_SQUARE_NOFILL:
425*cdf0e10cSrcweir 		case SID_DRAW_SQUARE_ROUND:
426*cdf0e10cSrcweir 		case SID_DRAW_SQUARE_ROUND_NOFILL:
427*cdf0e10cSrcweir 		case SID_DRAW_ELLIPSE:
428*cdf0e10cSrcweir 		case SID_DRAW_ELLIPSE_NOFILL:
429*cdf0e10cSrcweir 		case SID_DRAW_CIRCLE:
430*cdf0e10cSrcweir 		case SID_DRAW_CIRCLE_NOFILL:
431*cdf0e10cSrcweir 		case SID_DRAW_CAPTION:
432*cdf0e10cSrcweir 		case SID_DRAW_CAPTION_VERTICAL:
433*cdf0e10cSrcweir 		case SID_TOOL_CONNECTOR:
434*cdf0e10cSrcweir         case SID_CONNECTOR_ARROW_START:
435*cdf0e10cSrcweir         case SID_CONNECTOR_ARROW_END:
436*cdf0e10cSrcweir         case SID_CONNECTOR_ARROWS:
437*cdf0e10cSrcweir         case SID_CONNECTOR_CIRCLE_START:
438*cdf0e10cSrcweir         case SID_CONNECTOR_CIRCLE_END:
439*cdf0e10cSrcweir         case SID_CONNECTOR_CIRCLES:
440*cdf0e10cSrcweir         case SID_CONNECTOR_LINE:
441*cdf0e10cSrcweir         case SID_CONNECTOR_LINE_ARROW_START:
442*cdf0e10cSrcweir         case SID_CONNECTOR_LINE_ARROW_END:
443*cdf0e10cSrcweir         case SID_CONNECTOR_LINE_ARROWS:
444*cdf0e10cSrcweir         case SID_CONNECTOR_LINE_CIRCLE_START:
445*cdf0e10cSrcweir         case SID_CONNECTOR_LINE_CIRCLE_END:
446*cdf0e10cSrcweir         case SID_CONNECTOR_LINE_CIRCLES:
447*cdf0e10cSrcweir         case SID_CONNECTOR_CURVE:
448*cdf0e10cSrcweir         case SID_CONNECTOR_CURVE_ARROW_START:
449*cdf0e10cSrcweir         case SID_CONNECTOR_CURVE_ARROW_END:
450*cdf0e10cSrcweir         case SID_CONNECTOR_CURVE_ARROWS:
451*cdf0e10cSrcweir         case SID_CONNECTOR_CURVE_CIRCLE_START:
452*cdf0e10cSrcweir         case SID_CONNECTOR_CURVE_CIRCLE_END:
453*cdf0e10cSrcweir         case SID_CONNECTOR_CURVE_CIRCLES:
454*cdf0e10cSrcweir         case SID_CONNECTOR_LINES:
455*cdf0e10cSrcweir         case SID_CONNECTOR_LINES_ARROW_START:
456*cdf0e10cSrcweir         case SID_CONNECTOR_LINES_ARROW_END:
457*cdf0e10cSrcweir         case SID_CONNECTOR_LINES_ARROWS:
458*cdf0e10cSrcweir         case SID_CONNECTOR_LINES_CIRCLE_START:
459*cdf0e10cSrcweir         case SID_CONNECTOR_LINES_CIRCLE_END:
460*cdf0e10cSrcweir         case SID_CONNECTOR_LINES_CIRCLES:
461*cdf0e10cSrcweir         {
462*cdf0e10cSrcweir 			SetCurrentFunction( FuConstructRectangle::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
463*cdf0e10cSrcweir             rReq.Done();
464*cdf0e10cSrcweir 		}
465*cdf0e10cSrcweir 		break;
466*cdf0e10cSrcweir 		case SID_DRAW_POLYGON:
467*cdf0e10cSrcweir 		case SID_DRAW_POLYGON_NOFILL:
468*cdf0e10cSrcweir 		case SID_DRAW_XPOLYGON:
469*cdf0e10cSrcweir 		case SID_DRAW_XPOLYGON_NOFILL:
470*cdf0e10cSrcweir         case SID_DRAW_FREELINE:
471*cdf0e10cSrcweir         case SID_DRAW_FREELINE_NOFILL:
472*cdf0e10cSrcweir         case SID_DRAW_BEZIER_FILL:          // BASIC
473*cdf0e10cSrcweir         case SID_DRAW_BEZIER_NOFILL:        // BASIC
474*cdf0e10cSrcweir 		{
475*cdf0e10cSrcweir 			SetCurrentFunction( FuConstructBezierPolygon::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent) );
476*cdf0e10cSrcweir             rReq.Done();
477*cdf0e10cSrcweir 		}
478*cdf0e10cSrcweir 		break;
479*cdf0e10cSrcweir 
480*cdf0e10cSrcweir         case SID_GLUE_EDITMODE:
481*cdf0e10cSrcweir 		{
482*cdf0e10cSrcweir             if (nOldSId != SID_GLUE_EDITMODE)
483*cdf0e10cSrcweir             {
484*cdf0e10cSrcweir 				SetCurrentFunction( FuEditGluePoints::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
485*cdf0e10cSrcweir             }
486*cdf0e10cSrcweir             else
487*cdf0e10cSrcweir             {
488*cdf0e10cSrcweir 				GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
489*cdf0e10cSrcweir             }
490*cdf0e10cSrcweir 
491*cdf0e10cSrcweir 			rReq.Done();
492*cdf0e10cSrcweir 		}
493*cdf0e10cSrcweir 		break;
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir 		case SID_DRAW_ARC:
496*cdf0e10cSrcweir 		case SID_DRAW_CIRCLEARC:
497*cdf0e10cSrcweir 		case SID_DRAW_PIE:
498*cdf0e10cSrcweir 		case SID_DRAW_PIE_NOFILL:
499*cdf0e10cSrcweir 		case SID_DRAW_CIRCLEPIE:
500*cdf0e10cSrcweir 		case SID_DRAW_CIRCLEPIE_NOFILL:
501*cdf0e10cSrcweir 		case SID_DRAW_ELLIPSECUT:
502*cdf0e10cSrcweir 		case SID_DRAW_ELLIPSECUT_NOFILL:
503*cdf0e10cSrcweir 		case SID_DRAW_CIRCLECUT:
504*cdf0e10cSrcweir 		case SID_DRAW_CIRCLECUT_NOFILL:
505*cdf0e10cSrcweir 		{
506*cdf0e10cSrcweir 			SetCurrentFunction( FuConstructArc::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent) );
507*cdf0e10cSrcweir             rReq.Done();
508*cdf0e10cSrcweir 		}
509*cdf0e10cSrcweir 		break;
510*cdf0e10cSrcweir 
511*cdf0e10cSrcweir 		case SID_3D_CUBE:
512*cdf0e10cSrcweir 		case SID_3D_SHELL:
513*cdf0e10cSrcweir 		case SID_3D_SPHERE:
514*cdf0e10cSrcweir 		case SID_3D_TORUS:
515*cdf0e10cSrcweir 		case SID_3D_HALF_SPHERE:
516*cdf0e10cSrcweir 		case SID_3D_CYLINDER:
517*cdf0e10cSrcweir 		case SID_3D_CONE:
518*cdf0e10cSrcweir 		case SID_3D_PYRAMID:
519*cdf0e10cSrcweir 		{
520*cdf0e10cSrcweir 			SetCurrentFunction( FuConstruct3dObject::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
521*cdf0e10cSrcweir             rReq.Done();
522*cdf0e10cSrcweir 		}
523*cdf0e10cSrcweir 		break;
524*cdf0e10cSrcweir 
525*cdf0e10cSrcweir 		case SID_DRAWTBX_CS_BASIC :
526*cdf0e10cSrcweir 		case SID_DRAWTBX_CS_SYMBOL :
527*cdf0e10cSrcweir 		case SID_DRAWTBX_CS_ARROW :
528*cdf0e10cSrcweir 		case SID_DRAWTBX_CS_FLOWCHART :
529*cdf0e10cSrcweir 		case SID_DRAWTBX_CS_CALLOUT :
530*cdf0e10cSrcweir 		case SID_DRAWTBX_CS_STAR :
531*cdf0e10cSrcweir 		case SID_DRAW_CS_ID :
532*cdf0e10cSrcweir 		{
533*cdf0e10cSrcweir 			SetCurrentFunction( FuConstructCustomShape::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
534*cdf0e10cSrcweir             rReq.Done();
535*cdf0e10cSrcweir 
536*cdf0e10cSrcweir             if ( nSId != SID_DRAW_CS_ID )
537*cdf0e10cSrcweir             {
538*cdf0e10cSrcweir                 SfxBindings& rBind = GetViewFrame()->GetBindings();
539*cdf0e10cSrcweir                 rBind.Invalidate( nSId );
540*cdf0e10cSrcweir                 rBind.Update( nSId );
541*cdf0e10cSrcweir             }
542*cdf0e10cSrcweir 		}
543*cdf0e10cSrcweir 		break;
544*cdf0e10cSrcweir 
545*cdf0e10cSrcweir         case SID_FORMATPAINTBRUSH:
546*cdf0e10cSrcweir         {
547*cdf0e10cSrcweir     		SetCurrentFunction( FuFormatPaintBrush::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
548*cdf0e10cSrcweir     		rReq.Done();
549*cdf0e10cSrcweir             SfxBindings& rBind = GetViewFrame()->GetBindings();
550*cdf0e10cSrcweir             rBind.Invalidate( nSId );
551*cdf0e10cSrcweir             rBind.Update( nSId );
552*cdf0e10cSrcweir             break;
553*cdf0e10cSrcweir         }
554*cdf0e10cSrcweir 
555*cdf0e10cSrcweir         default:
556*cdf0e10cSrcweir    		break;
557*cdf0e10cSrcweir 	}
558*cdf0e10cSrcweir 
559*cdf0e10cSrcweir 	if(HasOldFunction())
560*cdf0e10cSrcweir 	{
561*cdf0e10cSrcweir 		sal_uInt16 nSlotId = GetOldFunction()->GetSlotID();
562*cdf0e10cSrcweir 
563*cdf0e10cSrcweir 		GetOldFunction()->Deactivate();
564*cdf0e10cSrcweir 		SetOldFunction(0);
565*cdf0e10cSrcweir 
566*cdf0e10cSrcweir 		SfxBindings& rBind = GetViewFrame()->GetBindings();
567*cdf0e10cSrcweir 		rBind.Invalidate( nSlotId );
568*cdf0e10cSrcweir 		rBind.Update( nSlotId );
569*cdf0e10cSrcweir 	}
570*cdf0e10cSrcweir 
571*cdf0e10cSrcweir 	if(HasCurrentFunction())
572*cdf0e10cSrcweir 	{
573*cdf0e10cSrcweir 		GetCurrentFunction()->Activate();
574*cdf0e10cSrcweir 		SetOldFunction( GetCurrentFunction() );
575*cdf0e10cSrcweir 
576*cdf0e10cSrcweir 		SetHelpId( GetCurrentFunction()->GetSlotID() );
577*cdf0e10cSrcweir 	}
578*cdf0e10cSrcweir 
579*cdf0e10cSrcweir 	// Shell wird invalidiert, schneller als einzeln (laut MI)
580*cdf0e10cSrcweir 	// Jetzt explizit der letzte Slot incl. Update()
581*cdf0e10cSrcweir 	Invalidate();
582*cdf0e10cSrcweir 
583*cdf0e10cSrcweir 	// #97016# III CTRL-SID_OBJECT_SELECT -> select first draw object if none is selected yet
584*cdf0e10cSrcweir 	if(SID_OBJECT_SELECT == nSId && HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
585*cdf0e10cSrcweir 	{
586*cdf0e10cSrcweir 		if(!GetView()->AreObjectsMarked())
587*cdf0e10cSrcweir 		{
588*cdf0e10cSrcweir 			// select first object
589*cdf0e10cSrcweir 			GetView()->UnmarkAllObj();
590*cdf0e10cSrcweir 			GetView()->MarkNextObj(sal_True);
591*cdf0e10cSrcweir 
592*cdf0e10cSrcweir 			// ...and make it visible
593*cdf0e10cSrcweir 			if(GetView()->AreObjectsMarked())
594*cdf0e10cSrcweir 				GetView()->MakeVisible(GetView()->GetAllMarkedRect(), *GetActiveWindow());
595*cdf0e10cSrcweir 		}
596*cdf0e10cSrcweir 	}
597*cdf0e10cSrcweir 
598*cdf0e10cSrcweir 	// #97016# with qualifier construct directly
599*cdf0e10cSrcweir 	if(HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
600*cdf0e10cSrcweir 	{
601*cdf0e10cSrcweir 		// get SdOptions
602*cdf0e10cSrcweir 		SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
603*cdf0e10cSrcweir 		sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth());
604*cdf0e10cSrcweir 		sal_uInt32 nDefaultObjectSizeHeight(pOptions->GetDefaultObjectSizeHeight());
605*cdf0e10cSrcweir 
606*cdf0e10cSrcweir 		// calc position and size
607*cdf0e10cSrcweir 		Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel()));
608*cdf0e10cSrcweir 		Point aPagePos = aVisArea.Center();
609*cdf0e10cSrcweir 		aPagePos.X() -= nDefaultObjectSizeWidth / 2;
610*cdf0e10cSrcweir 		aPagePos.Y() -= nDefaultObjectSizeHeight / 2;
611*cdf0e10cSrcweir 		Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
612*cdf0e10cSrcweir 		SdrPageView* pPageView = mpDrawView->GetSdrPageView();
613*cdf0e10cSrcweir 
614*cdf0e10cSrcweir 		if(pPageView)
615*cdf0e10cSrcweir 		{
616*cdf0e10cSrcweir 			// create the default object
617*cdf0e10cSrcweir 			SdrObject* pObj = GetCurrentFunction()->CreateDefaultObject(nSId, aNewObjectRectangle);
618*cdf0e10cSrcweir 
619*cdf0e10cSrcweir 			if(pObj)
620*cdf0e10cSrcweir 			{
621*cdf0e10cSrcweir 				// insert into page
622*cdf0e10cSrcweir 				GetView()->InsertObjectAtView(pObj, *pPageView);
623*cdf0e10cSrcweir 
624*cdf0e10cSrcweir                 // Now that pFuActual has done what it was created for we
625*cdf0e10cSrcweir                 // can switch on the edit mode for callout objects.
626*cdf0e10cSrcweir                 switch (nSId)
627*cdf0e10cSrcweir                 {
628*cdf0e10cSrcweir                     case SID_DRAW_CAPTION:
629*cdf0e10cSrcweir                     case SID_DRAW_CAPTION_VERTICAL:
630*cdf0e10cSrcweir                     {
631*cdf0e10cSrcweir                         // Make FuText the current function.
632*cdf0e10cSrcweir                         SfxUInt16Item aItem (SID_TEXTEDIT, 1);
633*cdf0e10cSrcweir                         GetViewFrame()->GetDispatcher()->
634*cdf0e10cSrcweir                             Execute(SID_TEXTEDIT, SFX_CALLMODE_SYNCHRON |
635*cdf0e10cSrcweir                                 SFX_CALLMODE_RECORD, &aItem, 0L);
636*cdf0e10cSrcweir                         // Put text object into edit mode.
637*cdf0e10cSrcweir                         GetView()->SdrBeginTextEdit(static_cast<SdrTextObj*>(pObj), pPageView);
638*cdf0e10cSrcweir                         break;
639*cdf0e10cSrcweir                     }
640*cdf0e10cSrcweir                 }
641*cdf0e10cSrcweir 			}
642*cdf0e10cSrcweir 		}
643*cdf0e10cSrcweir 	}
644*cdf0e10cSrcweir }
645*cdf0e10cSrcweir 
646*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
647*cdf0e10cSrcweir // service routine for Undo/Redo implementation
648*cdf0e10cSrcweir extern SfxUndoManager* ImpGetUndoManagerFromViewShell(DrawViewShell& rDViewShell);
649*cdf0e10cSrcweir 
650*cdf0e10cSrcweir /*************************************************************************
651*cdf0e10cSrcweir |*
652*cdf0e10cSrcweir |* SfxRequests fuer Support-Funktionen
653*cdf0e10cSrcweir |*
654*cdf0e10cSrcweir \************************************************************************/
655*cdf0e10cSrcweir 
656*cdf0e10cSrcweir void DrawViewShell::FuSupport(SfxRequest& rReq)
657*cdf0e10cSrcweir {
658*cdf0e10cSrcweir 	if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs())
659*cdf0e10cSrcweir 		GetDocSh()->SetStyleFamily(((SfxUInt16Item&)rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue());
660*cdf0e10cSrcweir 
661*cdf0e10cSrcweir 	// Waehrend einer Native-Diashow wird nichts ausgefuehrt!
662*cdf0e10cSrcweir 	if(SlideShow::IsRunning(GetViewShellBase()) &&
663*cdf0e10cSrcweir 		(rReq.GetSlot() != SID_PRESENTATION_END &&
664*cdf0e10cSrcweir          rReq.GetSlot() != SID_SIZE_PAGE))
665*cdf0e10cSrcweir 		return;
666*cdf0e10cSrcweir 
667*cdf0e10cSrcweir 	CheckLineTo (rReq);
668*cdf0e10cSrcweir 
669*cdf0e10cSrcweir 	if( !mpDrawView )
670*cdf0e10cSrcweir 		return;
671*cdf0e10cSrcweir 
672*cdf0e10cSrcweir 	sal_uInt16 nSId = rReq.GetSlot();
673*cdf0e10cSrcweir 
674*cdf0e10cSrcweir 	// Slot wird evtl. gemapped (ToolboxImages/-Slots)
675*cdf0e10cSrcweir 	MapSlot( nSId );
676*cdf0e10cSrcweir 
677*cdf0e10cSrcweir 	switch ( nSId )
678*cdf0e10cSrcweir 	{
679*cdf0e10cSrcweir 		case SID_CLEAR_UNDO_STACK:
680*cdf0e10cSrcweir 		{
681*cdf0e10cSrcweir 			GetDocSh()->ClearUndoBuffer();
682*cdf0e10cSrcweir             rReq.Ignore ();
683*cdf0e10cSrcweir 		}
684*cdf0e10cSrcweir 		break;
685*cdf0e10cSrcweir 
686*cdf0e10cSrcweir         // Slots der ToolboxController gemapped ausfuehren
687*cdf0e10cSrcweir         case SID_OBJECT_CHOOSE_MODE:
688*cdf0e10cSrcweir         case SID_POSITION:
689*cdf0e10cSrcweir         case SID_OBJECT_ALIGN:
690*cdf0e10cSrcweir         case SID_ZOOM_TOOLBOX:
691*cdf0e10cSrcweir         case SID_DRAWTBX_TEXT:
692*cdf0e10cSrcweir         case SID_DRAWTBX_RECTANGLES:
693*cdf0e10cSrcweir         case SID_DRAWTBX_ELLIPSES:
694*cdf0e10cSrcweir         case SID_DRAWTBX_LINES:
695*cdf0e10cSrcweir         case SID_DRAWTBX_ARROWS:
696*cdf0e10cSrcweir         case SID_DRAWTBX_3D_OBJECTS:
697*cdf0e10cSrcweir         case SID_DRAWTBX_CONNECTORS:
698*cdf0e10cSrcweir         case SID_DRAWTBX_INSERT:
699*cdf0e10cSrcweir         {
700*cdf0e10cSrcweir             sal_uInt16 nMappedSlot = GetMappedSlot( nSId );
701*cdf0e10cSrcweir             if( nMappedSlot > 0 )
702*cdf0e10cSrcweir             {
703*cdf0e10cSrcweir                 SfxRequest aReq( nMappedSlot, 0, GetDoc()->GetItemPool() );
704*cdf0e10cSrcweir                 ExecuteSlot( aReq );
705*cdf0e10cSrcweir             }
706*cdf0e10cSrcweir         }
707*cdf0e10cSrcweir         break;
708*cdf0e10cSrcweir 
709*cdf0e10cSrcweir 		case SID_PRESENTATION:
710*cdf0e10cSrcweir 		case SID_REHEARSE_TIMINGS:
711*cdf0e10cSrcweir 		{
712*cdf0e10cSrcweir 			Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
713*cdf0e10cSrcweir 			if( xPresentation.is() )
714*cdf0e10cSrcweir 			{
715*cdf0e10cSrcweir 				if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
716*cdf0e10cSrcweir 					xPresentation->start();
717*cdf0e10cSrcweir 				else
718*cdf0e10cSrcweir 					xPresentation->rehearseTimings();
719*cdf0e10cSrcweir 			}
720*cdf0e10cSrcweir 			rReq.Ignore ();
721*cdf0e10cSrcweir         }
722*cdf0e10cSrcweir 		break;
723*cdf0e10cSrcweir 
724*cdf0e10cSrcweir 		case SID_PRESENTATION_END:
725*cdf0e10cSrcweir 		{
726*cdf0e10cSrcweir             StopSlideShow(true);
727*cdf0e10cSrcweir 
728*cdf0e10cSrcweir             rReq.Ignore ();
729*cdf0e10cSrcweir 		}
730*cdf0e10cSrcweir 		break;
731*cdf0e10cSrcweir 
732*cdf0e10cSrcweir 		case SID_BEZIER_EDIT:
733*cdf0e10cSrcweir 		{
734*cdf0e10cSrcweir             mpDrawView->SetFrameDragSingles(!mpDrawView->IsFrameDragSingles());
735*cdf0e10cSrcweir 
736*cdf0e10cSrcweir             /******************************************************************
737*cdf0e10cSrcweir             * ObjectBar einschalten
738*cdf0e10cSrcweir             ******************************************************************/
739*cdf0e10cSrcweir             if( dynamic_cast< FuSelection* >( GetCurrentFunction().get() ) || dynamic_cast< FuConstructBezierPolygon* >( GetCurrentFunction().get() ) )
740*cdf0e10cSrcweir             {
741*cdf0e10cSrcweir                 // Tell the tool bar manager about the context change.
742*cdf0e10cSrcweir 				GetViewShellBase().GetToolBarManager()->SelectionHasChanged(*this,*mpDrawView);
743*cdf0e10cSrcweir             }
744*cdf0e10cSrcweir 
745*cdf0e10cSrcweir             Invalidate(SID_BEZIER_EDIT);
746*cdf0e10cSrcweir             rReq.Ignore();
747*cdf0e10cSrcweir         }
748*cdf0e10cSrcweir         break;
749*cdf0e10cSrcweir 
750*cdf0e10cSrcweir 		case SID_OBJECT_CLOSE:
751*cdf0e10cSrcweir 		{
752*cdf0e10cSrcweir 			const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
753*cdf0e10cSrcweir 			if ( rMarkList.GetMark(0) && !mpDrawView->IsAction() )
754*cdf0e10cSrcweir 			{
755*cdf0e10cSrcweir 				SdrPathObj* pPathObj = (SdrPathObj*) rMarkList.GetMark(0)->GetMarkedSdrObj();
756*cdf0e10cSrcweir 				const bool bUndo = mpDrawView->IsUndoEnabled();
757*cdf0e10cSrcweir 				if( bUndo )
758*cdf0e10cSrcweir 					mpDrawView->BegUndo(String(SdResId(STR_UNDO_BEZCLOSE)));
759*cdf0e10cSrcweir 
760*cdf0e10cSrcweir 				mpDrawView->UnmarkAllPoints();
761*cdf0e10cSrcweir 
762*cdf0e10cSrcweir 				if( bUndo )
763*cdf0e10cSrcweir 					mpDrawView->AddUndo(new SdrUndoGeoObj(*pPathObj));
764*cdf0e10cSrcweir 
765*cdf0e10cSrcweir 				pPathObj->ToggleClosed();
766*cdf0e10cSrcweir 
767*cdf0e10cSrcweir 				if( bUndo )
768*cdf0e10cSrcweir 					mpDrawView->EndUndo();
769*cdf0e10cSrcweir 			}
770*cdf0e10cSrcweir 			rReq.Done();
771*cdf0e10cSrcweir 		}
772*cdf0e10cSrcweir 		break;
773*cdf0e10cSrcweir 
774*cdf0e10cSrcweir 		case SID_CUT:
775*cdf0e10cSrcweir 		{
776*cdf0e10cSrcweir 			if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
777*cdf0e10cSrcweir 			{
778*cdf0e10cSrcweir                 ::sd::Window* pWindow = GetActiveWindow();
779*cdf0e10cSrcweir                 InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
780*cdf0e10cSrcweir 			}
781*cdf0e10cSrcweir 			else
782*cdf0e10cSrcweir 			{
783*cdf0e10cSrcweir 				if(HasCurrentFunction())
784*cdf0e10cSrcweir 				{
785*cdf0e10cSrcweir 					GetCurrentFunction()->DoCut();
786*cdf0e10cSrcweir 				}
787*cdf0e10cSrcweir 				else if(mpDrawView)
788*cdf0e10cSrcweir 				{
789*cdf0e10cSrcweir 					mpDrawView->DoCut();
790*cdf0e10cSrcweir 				}
791*cdf0e10cSrcweir 			}
792*cdf0e10cSrcweir 			rReq.Ignore ();
793*cdf0e10cSrcweir 		}
794*cdf0e10cSrcweir 		break;
795*cdf0e10cSrcweir 
796*cdf0e10cSrcweir 		case SID_COPY:
797*cdf0e10cSrcweir 		{
798*cdf0e10cSrcweir 			if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
799*cdf0e10cSrcweir 			{
800*cdf0e10cSrcweir                 ::sd::Window* pWindow = GetActiveWindow();
801*cdf0e10cSrcweir                 InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
802*cdf0e10cSrcweir 			}
803*cdf0e10cSrcweir 			else
804*cdf0e10cSrcweir 			{
805*cdf0e10cSrcweir 				if(HasCurrentFunction())
806*cdf0e10cSrcweir 				{
807*cdf0e10cSrcweir 					GetCurrentFunction()->DoCopy();
808*cdf0e10cSrcweir 				}
809*cdf0e10cSrcweir 				else if( mpDrawView )
810*cdf0e10cSrcweir 				{
811*cdf0e10cSrcweir 					mpDrawView->DoCopy();
812*cdf0e10cSrcweir 				}
813*cdf0e10cSrcweir 			}
814*cdf0e10cSrcweir 			rReq.Ignore ();
815*cdf0e10cSrcweir 		}
816*cdf0e10cSrcweir 		break;
817*cdf0e10cSrcweir 
818*cdf0e10cSrcweir 		case SID_PASTE:
819*cdf0e10cSrcweir 		{
820*cdf0e10cSrcweir 			WaitObject aWait( (Window*)GetActiveWindow() );
821*cdf0e10cSrcweir 
822*cdf0e10cSrcweir 			if(HasCurrentFunction())
823*cdf0e10cSrcweir 			{
824*cdf0e10cSrcweir 				GetCurrentFunction()->DoPaste();
825*cdf0e10cSrcweir 			}
826*cdf0e10cSrcweir 			else if(mpDrawView)
827*cdf0e10cSrcweir 			{
828*cdf0e10cSrcweir 				mpDrawView->DoPaste();
829*cdf0e10cSrcweir 			}
830*cdf0e10cSrcweir 
831*cdf0e10cSrcweir 			rReq.Ignore ();
832*cdf0e10cSrcweir 		}
833*cdf0e10cSrcweir 		break;
834*cdf0e10cSrcweir 
835*cdf0e10cSrcweir         case SID_CLIPBOARD_FORMAT_ITEMS:
836*cdf0e10cSrcweir         {
837*cdf0e10cSrcweir 			WaitObject              aWait( (Window*)GetActiveWindow() );
838*cdf0e10cSrcweir 	        TransferableDataHelper  aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) );
839*cdf0e10cSrcweir             const SfxItemSet*       pReqArgs = rReq.GetArgs();
840*cdf0e10cSrcweir             sal_uInt32                  nFormat = 0;
841*cdf0e10cSrcweir 
842*cdf0e10cSrcweir             if( pReqArgs )
843*cdf0e10cSrcweir             {
844*cdf0e10cSrcweir                 SFX_REQUEST_ARG( rReq, pIsActive, SfxUInt32Item, SID_CLIPBOARD_FORMAT_ITEMS, sal_False );
845*cdf0e10cSrcweir                 nFormat = pIsActive->GetValue();
846*cdf0e10cSrcweir             }
847*cdf0e10cSrcweir 
848*cdf0e10cSrcweir 
849*cdf0e10cSrcweir 	        if( nFormat && aDataHelper.GetTransferable().is() )
850*cdf0e10cSrcweir 	        {
851*cdf0e10cSrcweir 		        sal_Int8 nAction = DND_ACTION_COPY;
852*cdf0e10cSrcweir 
853*cdf0e10cSrcweir                 if( !mpDrawView->InsertData( aDataHelper,
854*cdf0e10cSrcweir 						                  GetActiveWindow()->PixelToLogic( Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ),
855*cdf0e10cSrcweir 						                  nAction, sal_False, nFormat ) )
856*cdf0e10cSrcweir                 {
857*cdf0e10cSrcweir 			        INetBookmark    aINetBookmark( aEmptyStr, aEmptyStr );
858*cdf0e10cSrcweir 
859*cdf0e10cSrcweir 			        if( ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) &&
860*cdf0e10cSrcweir 				          aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) ) ||
861*cdf0e10cSrcweir 				        ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) &&
862*cdf0e10cSrcweir 				          aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, aINetBookmark ) ) ||
863*cdf0e10cSrcweir 				        ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) &&
864*cdf0e10cSrcweir 				          aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) )
865*cdf0e10cSrcweir 			        {
866*cdf0e10cSrcweir 				        InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL );
867*cdf0e10cSrcweir 			        }
868*cdf0e10cSrcweir                 }
869*cdf0e10cSrcweir 	        }
870*cdf0e10cSrcweir         }
871*cdf0e10cSrcweir         break;
872*cdf0e10cSrcweir 
873*cdf0e10cSrcweir 		case SID_DELETE:
874*cdf0e10cSrcweir 		{
875*cdf0e10cSrcweir 			if ( mpDrawView->IsTextEdit() )
876*cdf0e10cSrcweir 			{
877*cdf0e10cSrcweir 				OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
878*cdf0e10cSrcweir 
879*cdf0e10cSrcweir 				if (pOLV)
880*cdf0e10cSrcweir 				{
881*cdf0e10cSrcweir 					KeyCode aKCode(KEY_DELETE);
882*cdf0e10cSrcweir 					KeyEvent aKEvt( 0, aKCode);
883*cdf0e10cSrcweir 					pOLV->PostKeyEvent(aKEvt);
884*cdf0e10cSrcweir 				}
885*cdf0e10cSrcweir 			}
886*cdf0e10cSrcweir 			else if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
887*cdf0e10cSrcweir 			{
888*cdf0e10cSrcweir                 ::sd::Window* pWindow = GetActiveWindow();
889*cdf0e10cSrcweir                 InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
890*cdf0e10cSrcweir 			}
891*cdf0e10cSrcweir 			else
892*cdf0e10cSrcweir 			{
893*cdf0e10cSrcweir 				KeyCode aKCode(KEY_DELETE);
894*cdf0e10cSrcweir 				KeyEvent aKEvt( 0, aKCode);
895*cdf0e10cSrcweir 
896*cdf0e10cSrcweir 				bool bConsumed = mpDrawView && mpDrawView->getSmartTags().KeyInput( aKEvt );
897*cdf0e10cSrcweir 
898*cdf0e10cSrcweir 				if( !bConsumed && HasCurrentFunction() )
899*cdf0e10cSrcweir 					bConsumed = GetCurrentFunction()->KeyInput(aKEvt);
900*cdf0e10cSrcweir 
901*cdf0e10cSrcweir 				if( !bConsumed && mpDrawView )
902*cdf0e10cSrcweir 					mpDrawView->DeleteMarked();
903*cdf0e10cSrcweir 			}
904*cdf0e10cSrcweir 			rReq.Ignore ();
905*cdf0e10cSrcweir 		}
906*cdf0e10cSrcweir 		break;
907*cdf0e10cSrcweir 
908*cdf0e10cSrcweir         case SID_NOTESMODE:
909*cdf0e10cSrcweir 		case SID_HANDOUTMODE:
910*cdf0e10cSrcweir 			// AutoLayouts have to be ready.
911*cdf0e10cSrcweir 			GetDoc()->StopWorkStartupDelay();
912*cdf0e10cSrcweir             // Fall through to following case statements.
913*cdf0e10cSrcweir 
914*cdf0e10cSrcweir         case SID_DRAWINGMODE:
915*cdf0e10cSrcweir 		case SID_DIAMODE:
916*cdf0e10cSrcweir         case SID_OUTLINEMODE:
917*cdf0e10cSrcweir             // Let the sub-shell manager handle the slot handling.
918*cdf0e10cSrcweir             framework::FrameworkHelper::Instance(GetViewShellBase())->HandleModeChangeSlot(
919*cdf0e10cSrcweir                 nSId,
920*cdf0e10cSrcweir                 rReq);
921*cdf0e10cSrcweir 			rReq.Ignore ();
922*cdf0e10cSrcweir             break;
923*cdf0e10cSrcweir 
924*cdf0e10cSrcweir         case SID_MASTERPAGE:          // BASIC
925*cdf0e10cSrcweir         case SID_SLIDE_MASTERPAGE:    // BASIC
926*cdf0e10cSrcweir         case SID_TITLE_MASTERPAGE:    // BASIC
927*cdf0e10cSrcweir         case SID_NOTES_MASTERPAGE:    // BASIC
928*cdf0e10cSrcweir         case SID_HANDOUT_MASTERPAGE:  // BASIC
929*cdf0e10cSrcweir 		{
930*cdf0e10cSrcweir 			// AutoLayouts muessen fertig sein
931*cdf0e10cSrcweir 			GetDoc()->StopWorkStartupDelay();
932*cdf0e10cSrcweir 
933*cdf0e10cSrcweir 			const SfxItemSet* pReqArgs = rReq.GetArgs();
934*cdf0e10cSrcweir 
935*cdf0e10cSrcweir 			if ( pReqArgs )
936*cdf0e10cSrcweir 			{
937*cdf0e10cSrcweir 				SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_MASTERPAGE, sal_False);
938*cdf0e10cSrcweir 				mbIsLayerModeActive = pIsActive->GetValue ();
939*cdf0e10cSrcweir 			}
940*cdf0e10cSrcweir 
941*cdf0e10cSrcweir             Broadcast (
942*cdf0e10cSrcweir                 ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
943*cdf0e10cSrcweir 
944*cdf0e10cSrcweir             if (nSId == SID_MASTERPAGE                                       ||
945*cdf0e10cSrcweir                 (nSId == SID_SLIDE_MASTERPAGE   && mePageKind == PK_STANDARD) ||
946*cdf0e10cSrcweir                 (nSId == SID_TITLE_MASTERPAGE   && mePageKind == PK_STANDARD) ||
947*cdf0e10cSrcweir                 (nSId == SID_NOTES_MASTERPAGE   && mePageKind == PK_NOTES)    ||
948*cdf0e10cSrcweir                 (nSId == SID_HANDOUT_MASTERPAGE && mePageKind == PK_HANDOUT))
949*cdf0e10cSrcweir             {
950*cdf0e10cSrcweir                 if (nSId == SID_TITLE_MASTERPAGE ||
951*cdf0e10cSrcweir 					nSId == SID_SLIDE_MASTERPAGE)
952*cdf0e10cSrcweir                 {
953*cdf0e10cSrcweir                     // Gibt es eine Seite mit dem AutoLayout "Titel"?
954*cdf0e10cSrcweir                     sal_Bool bFound = sal_False;
955*cdf0e10cSrcweir                     sal_uInt16 i = 0;
956*cdf0e10cSrcweir                     sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
957*cdf0e10cSrcweir 
958*cdf0e10cSrcweir                     while (i < nCount && !bFound)
959*cdf0e10cSrcweir                     {
960*cdf0e10cSrcweir                         SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD);
961*cdf0e10cSrcweir 
962*cdf0e10cSrcweir                         if (nSId == SID_TITLE_MASTERPAGE && pPage->GetAutoLayout() == AUTOLAYOUT_TITLE)
963*cdf0e10cSrcweir                         {
964*cdf0e10cSrcweir                             bFound = sal_True;
965*cdf0e10cSrcweir                             SwitchPage((pPage->GetPageNum() - 1) / 2);
966*cdf0e10cSrcweir                         }
967*cdf0e10cSrcweir                         else if (nSId == SID_SLIDE_MASTERPAGE && pPage->GetAutoLayout() != AUTOLAYOUT_TITLE)
968*cdf0e10cSrcweir                         {
969*cdf0e10cSrcweir                             bFound = sal_True;
970*cdf0e10cSrcweir                             SwitchPage((pPage->GetPageNum() - 1) / 2);
971*cdf0e10cSrcweir                         }
972*cdf0e10cSrcweir 
973*cdf0e10cSrcweir                         i++;
974*cdf0e10cSrcweir                     }
975*cdf0e10cSrcweir                 }
976*cdf0e10cSrcweir 
977*cdf0e10cSrcweir                 // Default-Layer der MasterPage einschalten
978*cdf0e10cSrcweir                 mpDrawView->SetActiveLayer( String( SdResId(STR_LAYER_BCKGRNDOBJ) ) );
979*cdf0e10cSrcweir 
980*cdf0e10cSrcweir                 ChangeEditMode(EM_MASTERPAGE, mbIsLayerModeActive);
981*cdf0e10cSrcweir 
982*cdf0e10cSrcweir                 if(HasCurrentFunction(SID_BEZIER_EDIT))
983*cdf0e10cSrcweir 					GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
984*cdf0e10cSrcweir             }
985*cdf0e10cSrcweir             else
986*cdf0e10cSrcweir             {
987*cdf0e10cSrcweir                 // Switch to requested ViewShell.
988*cdf0e10cSrcweir                 ::OUString sRequestedView;
989*cdf0e10cSrcweir                 PageKind ePageKind;
990*cdf0e10cSrcweir                 switch (nSId)
991*cdf0e10cSrcweir                 {
992*cdf0e10cSrcweir                     case SID_SLIDE_MASTERPAGE:
993*cdf0e10cSrcweir                     case SID_TITLE_MASTERPAGE:
994*cdf0e10cSrcweir                     default:
995*cdf0e10cSrcweir                         sRequestedView = framework::FrameworkHelper::msImpressViewURL;
996*cdf0e10cSrcweir                         ePageKind = PK_STANDARD;
997*cdf0e10cSrcweir                         break;
998*cdf0e10cSrcweir 
999*cdf0e10cSrcweir                     case SID_NOTES_MASTERPAGE:
1000*cdf0e10cSrcweir                         sRequestedView = framework::FrameworkHelper::msNotesViewURL;
1001*cdf0e10cSrcweir                         ePageKind = PK_NOTES;
1002*cdf0e10cSrcweir                         break;
1003*cdf0e10cSrcweir 
1004*cdf0e10cSrcweir                     case SID_HANDOUT_MASTERPAGE:
1005*cdf0e10cSrcweir                         sRequestedView = framework::FrameworkHelper::msHandoutViewURL;
1006*cdf0e10cSrcweir                         ePageKind = PK_HANDOUT;
1007*cdf0e10cSrcweir                         break;
1008*cdf0e10cSrcweir                 }
1009*cdf0e10cSrcweir 
1010*cdf0e10cSrcweir                 mpFrameView->SetViewShEditMode(EM_MASTERPAGE, ePageKind);
1011*cdf0e10cSrcweir                 mpFrameView->SetLayerMode(mbIsLayerModeActive);
1012*cdf0e10cSrcweir                 framework::FrameworkHelper::Instance(GetViewShellBase())->RequestView(
1013*cdf0e10cSrcweir                     sRequestedView,
1014*cdf0e10cSrcweir                     framework::FrameworkHelper::msCenterPaneURL);
1015*cdf0e10cSrcweir             }
1016*cdf0e10cSrcweir             Broadcast (
1017*cdf0e10cSrcweir                 ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END));
1018*cdf0e10cSrcweir 
1019*cdf0e10cSrcweir 			InvalidateWindows();
1020*cdf0e10cSrcweir 			Invalidate();
1021*cdf0e10cSrcweir 
1022*cdf0e10cSrcweir 			rReq.Done();
1023*cdf0e10cSrcweir 		}
1024*cdf0e10cSrcweir 		break;
1025*cdf0e10cSrcweir 
1026*cdf0e10cSrcweir 
1027*cdf0e10cSrcweir         case SID_CLOSE_MASTER_VIEW:
1028*cdf0e10cSrcweir         {
1029*cdf0e10cSrcweir             Broadcast (
1030*cdf0e10cSrcweir                 ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
1031*cdf0e10cSrcweir 
1032*cdf0e10cSrcweir             // Switch page back to the first one.  Not doing so leads to a
1033*cdf0e10cSrcweir             // crash.  This seems to be some bug in the edit mode switching
1034*cdf0e10cSrcweir             // and page switching methods.
1035*cdf0e10cSrcweir 			SwitchPage (0);
1036*cdf0e10cSrcweir             ChangeEditMode(EM_PAGE, IsLayerModeActive());
1037*cdf0e10cSrcweir             Broadcast (
1038*cdf0e10cSrcweir                 ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END));
1039*cdf0e10cSrcweir 
1040*cdf0e10cSrcweir             if(HasCurrentFunction(SID_BEZIER_EDIT))
1041*cdf0e10cSrcweir             {
1042*cdf0e10cSrcweir                 GetViewFrame()->GetDispatcher()->Execute(
1043*cdf0e10cSrcweir                     SID_OBJECT_SELECT,
1044*cdf0e10cSrcweir                     SFX_CALLMODE_ASYNCHRON);
1045*cdf0e10cSrcweir             }
1046*cdf0e10cSrcweir 
1047*cdf0e10cSrcweir 
1048*cdf0e10cSrcweir 			rReq.Done();
1049*cdf0e10cSrcweir         }
1050*cdf0e10cSrcweir         break;
1051*cdf0e10cSrcweir 
1052*cdf0e10cSrcweir 
1053*cdf0e10cSrcweir 		case SID_RULER:
1054*cdf0e10cSrcweir         {
1055*cdf0e10cSrcweir 			const SfxItemSet* pReqArgs = rReq.GetArgs();
1056*cdf0e10cSrcweir 
1057*cdf0e10cSrcweir 			// #97516# Remember old ruler state
1058*cdf0e10cSrcweir 			sal_Bool bOldHasRuler(HasRuler());
1059*cdf0e10cSrcweir 
1060*cdf0e10cSrcweir 			if ( pReqArgs )
1061*cdf0e10cSrcweir 			{
1062*cdf0e10cSrcweir 				SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_RULER, sal_False);
1063*cdf0e10cSrcweir 				SetRuler (pIsActive->GetValue ());
1064*cdf0e10cSrcweir 			}
1065*cdf0e10cSrcweir 			else SetRuler (!HasRuler());
1066*cdf0e10cSrcweir 
1067*cdf0e10cSrcweir 			// #97516# Did ruler state change? Tell that to SdOptions, too.
1068*cdf0e10cSrcweir 			sal_Bool bHasRuler(HasRuler());
1069*cdf0e10cSrcweir 
1070*cdf0e10cSrcweir 			if(bOldHasRuler != bHasRuler)
1071*cdf0e10cSrcweir 			{
1072*cdf0e10cSrcweir 				SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
1073*cdf0e10cSrcweir 
1074*cdf0e10cSrcweir 				if(pOptions && pOptions->IsRulerVisible() != bHasRuler)
1075*cdf0e10cSrcweir 				{
1076*cdf0e10cSrcweir 					pOptions->SetRulerVisible(bHasRuler);
1077*cdf0e10cSrcweir 				}
1078*cdf0e10cSrcweir 			}
1079*cdf0e10cSrcweir 
1080*cdf0e10cSrcweir             Invalidate (SID_RULER);
1081*cdf0e10cSrcweir             Resize();
1082*cdf0e10cSrcweir             rReq.Done ();
1083*cdf0e10cSrcweir         }
1084*cdf0e10cSrcweir         break;
1085*cdf0e10cSrcweir 
1086*cdf0e10cSrcweir 		case SID_SIZE_PAGE:
1087*cdf0e10cSrcweir 		case SID_SIZE_PAGE_WIDTH:  // BASIC
1088*cdf0e10cSrcweir 		{
1089*cdf0e10cSrcweir 			mbZoomOnPage = ( rReq.GetSlot() == SID_SIZE_PAGE );
1090*cdf0e10cSrcweir 
1091*cdf0e10cSrcweir 			SdrPageView* pPageView = mpDrawView->GetSdrPageView();
1092*cdf0e10cSrcweir 
1093*cdf0e10cSrcweir 			if ( pPageView )
1094*cdf0e10cSrcweir 			{
1095*cdf0e10cSrcweir 				Point aPagePos(0, 0); // = pPageView->GetOffset();
1096*cdf0e10cSrcweir 				Size aPageSize = pPageView->GetPage()->GetSize();
1097*cdf0e10cSrcweir 
1098*cdf0e10cSrcweir 				aPagePos.X() += aPageSize.Width()  / 2;
1099*cdf0e10cSrcweir                 aPageSize.Width() = (long) (aPageSize.Width() * 1.03);
1100*cdf0e10cSrcweir 
1101*cdf0e10cSrcweir                 if( rReq.GetSlot() == SID_SIZE_PAGE )
1102*cdf0e10cSrcweir 				{
1103*cdf0e10cSrcweir 					aPagePos.Y() += aPageSize.Height() / 2;
1104*cdf0e10cSrcweir                     aPageSize.Height() = (long) (aPageSize.Height() * 1.03);
1105*cdf0e10cSrcweir 					aPagePos.Y() -= aPageSize.Height() / 2;
1106*cdf0e10cSrcweir 				}
1107*cdf0e10cSrcweir 				else
1108*cdf0e10cSrcweir 				{
1109*cdf0e10cSrcweir 					Point aPt = GetActiveWindow()->PixelToLogic( Point( 0, GetActiveWindow()->GetSizePixel().Height() / 2 ) );
1110*cdf0e10cSrcweir 					aPagePos.Y() += aPt.Y();
1111*cdf0e10cSrcweir 					aPageSize.Height() = 2;
1112*cdf0e10cSrcweir 				}
1113*cdf0e10cSrcweir 
1114*cdf0e10cSrcweir 				aPagePos.X() -= aPageSize.Width()  / 2;
1115*cdf0e10cSrcweir 
1116*cdf0e10cSrcweir 				SetZoomRect( Rectangle( aPagePos, aPageSize ) );
1117*cdf0e10cSrcweir 
1118*cdf0e10cSrcweir 				Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1119*cdf0e10cSrcweir 											  GetActiveWindow()->GetOutputSizePixel()) );
1120*cdf0e10cSrcweir 				mpZoomList->InsertZoomRect(aVisAreaWin);
1121*cdf0e10cSrcweir 			}
1122*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_IN );
1123*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_OUT );
1124*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_PANNING );
1125*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_TOOLBOX );
1126*cdf0e10cSrcweir 			rReq.Done ();
1127*cdf0e10cSrcweir 		}
1128*cdf0e10cSrcweir 		break;
1129*cdf0e10cSrcweir 
1130*cdf0e10cSrcweir 		case SID_SIZE_REAL:  // BASIC
1131*cdf0e10cSrcweir 		{
1132*cdf0e10cSrcweir 			mbZoomOnPage = sal_False;
1133*cdf0e10cSrcweir 			SetZoom( 100 );
1134*cdf0e10cSrcweir 			Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1135*cdf0e10cSrcweir 											  GetActiveWindow()->GetOutputSizePixel()) );
1136*cdf0e10cSrcweir 			mpZoomList->InsertZoomRect(aVisAreaWin);
1137*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_IN );
1138*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_OUT );
1139*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_PANNING );
1140*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_TOOLBOX );
1141*cdf0e10cSrcweir 			rReq.Done ();
1142*cdf0e10cSrcweir 		}
1143*cdf0e10cSrcweir 		break;
1144*cdf0e10cSrcweir 
1145*cdf0e10cSrcweir 		case SID_ZOOM_IN:  // BASIC
1146*cdf0e10cSrcweir 		{
1147*cdf0e10cSrcweir 			mbZoomOnPage = sal_False;
1148*cdf0e10cSrcweir 			SetZoom( Max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) );
1149*cdf0e10cSrcweir 			Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1150*cdf0e10cSrcweir 											  GetActiveWindow()->GetOutputSizePixel()) );
1151*cdf0e10cSrcweir 			mpZoomList->InsertZoomRect(aVisAreaWin);
1152*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_IN );
1153*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_OUT );
1154*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_PANNING );
1155*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_TOOLBOX );
1156*cdf0e10cSrcweir 			rReq.Done ();
1157*cdf0e10cSrcweir 		}
1158*cdf0e10cSrcweir 		break;
1159*cdf0e10cSrcweir 
1160*cdf0e10cSrcweir 		case SID_SIZE_VISAREA:
1161*cdf0e10cSrcweir 		{
1162*cdf0e10cSrcweir 			Rectangle aVisArea = mpFrameView->GetVisArea();
1163*cdf0e10cSrcweir 			Size aVisAreaSize = aVisArea.GetSize();
1164*cdf0e10cSrcweir 
1165*cdf0e10cSrcweir 			if (aVisAreaSize.Height()!=0 && aVisAreaSize.Width()!=0)
1166*cdf0e10cSrcweir 			{
1167*cdf0e10cSrcweir 				mbZoomOnPage = sal_False;
1168*cdf0e10cSrcweir 				SetZoomRect(aVisArea);
1169*cdf0e10cSrcweir 				Invalidate( SID_ZOOM_IN );
1170*cdf0e10cSrcweir 				Invalidate( SID_ZOOM_OUT );
1171*cdf0e10cSrcweir 				Invalidate( SID_ZOOM_PANNING );
1172*cdf0e10cSrcweir 				Invalidate( SID_ZOOM_TOOLBOX );
1173*cdf0e10cSrcweir 			}
1174*cdf0e10cSrcweir 			rReq.Done ();
1175*cdf0e10cSrcweir 		}
1176*cdf0e10cSrcweir 		break;
1177*cdf0e10cSrcweir 
1178*cdf0e10cSrcweir 		// Namensverwirrung: SID_SIZE_OPTIMAL -> Zoom auf selektierte Objekte
1179*cdf0e10cSrcweir 		// --> Wird als Objektzoom im Programm angeboten
1180*cdf0e10cSrcweir 		case SID_SIZE_OPTIMAL:	// BASIC
1181*cdf0e10cSrcweir 		{
1182*cdf0e10cSrcweir 			mbZoomOnPage = sal_False;
1183*cdf0e10cSrcweir 			if ( mpDrawView->AreObjectsMarked() )
1184*cdf0e10cSrcweir 			{
1185*cdf0e10cSrcweir                 maMarkRect = mpDrawView->GetAllMarkedRect();
1186*cdf0e10cSrcweir                 long nW = (long) (maMarkRect.GetWidth()  * 1.03);
1187*cdf0e10cSrcweir                 long nH = (long) (maMarkRect.GetHeight() * 1.03);
1188*cdf0e10cSrcweir 				Point aPos = maMarkRect.Center();
1189*cdf0e10cSrcweir 				aPos.X() -= nW / 2;
1190*cdf0e10cSrcweir 				aPos.Y() -= nH / 2;
1191*cdf0e10cSrcweir 				if ( nW && nH )
1192*cdf0e10cSrcweir 				{
1193*cdf0e10cSrcweir 					SetZoomRect(Rectangle(aPos, Size(nW, nH)));
1194*cdf0e10cSrcweir 
1195*cdf0e10cSrcweir 					Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1196*cdf0e10cSrcweir 											  GetActiveWindow()->GetOutputSizePixel()) );
1197*cdf0e10cSrcweir 					mpZoomList->InsertZoomRect(aVisAreaWin);
1198*cdf0e10cSrcweir 				}
1199*cdf0e10cSrcweir 			}
1200*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_IN );
1201*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_OUT );
1202*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_PANNING );
1203*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_TOOLBOX );
1204*cdf0e10cSrcweir 			rReq.Done ();
1205*cdf0e10cSrcweir 		}
1206*cdf0e10cSrcweir 		break;
1207*cdf0e10cSrcweir 
1208*cdf0e10cSrcweir 		// Namensverwirrung: SID_SIZE_ALL -> Zoom auf alle Objekte
1209*cdf0e10cSrcweir 		// --> Wird als Optimal im Programm angeboten
1210*cdf0e10cSrcweir 		case SID_SIZE_ALL:	// BASIC
1211*cdf0e10cSrcweir 		{
1212*cdf0e10cSrcweir 			mbZoomOnPage = sal_False;
1213*cdf0e10cSrcweir 			SdrPageView* pPageView = mpDrawView->GetSdrPageView();
1214*cdf0e10cSrcweir 
1215*cdf0e10cSrcweir 			if( pPageView )
1216*cdf0e10cSrcweir 			{
1217*cdf0e10cSrcweir 				Rectangle aBoundRect( pPageView->GetObjList()->GetAllObjBoundRect() );
1218*cdf0e10cSrcweir 
1219*cdf0e10cSrcweir                 long nW = (long) (aBoundRect.GetWidth() * 1.03);
1220*cdf0e10cSrcweir                 long nH = (long) (aBoundRect.GetHeight() * 1.03);
1221*cdf0e10cSrcweir 				Point aPos = aBoundRect.Center();
1222*cdf0e10cSrcweir 				aPos.X() -= nW / 2;
1223*cdf0e10cSrcweir 				aPos.Y() -= nH / 2;
1224*cdf0e10cSrcweir 				if ( nW && nH )
1225*cdf0e10cSrcweir 				{
1226*cdf0e10cSrcweir 					SetZoomRect( Rectangle( aPos, Size( nW, nH ) ) );
1227*cdf0e10cSrcweir 
1228*cdf0e10cSrcweir 					Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1229*cdf0e10cSrcweir 											  GetActiveWindow()->GetOutputSizePixel()) );
1230*cdf0e10cSrcweir 					mpZoomList->InsertZoomRect(aVisAreaWin);
1231*cdf0e10cSrcweir 				}
1232*cdf0e10cSrcweir 
1233*cdf0e10cSrcweir 				Invalidate( SID_ZOOM_IN );
1234*cdf0e10cSrcweir 				Invalidate( SID_ZOOM_OUT );
1235*cdf0e10cSrcweir 				Invalidate( SID_ZOOM_PANNING );
1236*cdf0e10cSrcweir 				Invalidate( SID_ZOOM_TOOLBOX );
1237*cdf0e10cSrcweir 			}
1238*cdf0e10cSrcweir 			rReq.Done ();
1239*cdf0e10cSrcweir 		}
1240*cdf0e10cSrcweir 		break;
1241*cdf0e10cSrcweir 
1242*cdf0e10cSrcweir 		case SID_ZOOM_PREV:
1243*cdf0e10cSrcweir 		{
1244*cdf0e10cSrcweir 			if (mpDrawView->IsTextEdit())
1245*cdf0e10cSrcweir 			{
1246*cdf0e10cSrcweir 				mpDrawView->SdrEndTextEdit();
1247*cdf0e10cSrcweir 			}
1248*cdf0e10cSrcweir 
1249*cdf0e10cSrcweir 			if (mpZoomList->IsPreviousPossible())
1250*cdf0e10cSrcweir 			{
1251*cdf0e10cSrcweir 				// Vorheriges ZoomRect einstellen
1252*cdf0e10cSrcweir 				SetZoomRect(mpZoomList->GetPreviousZoomRect());
1253*cdf0e10cSrcweir 			}
1254*cdf0e10cSrcweir 			rReq.Done ();
1255*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_TOOLBOX );
1256*cdf0e10cSrcweir 		}
1257*cdf0e10cSrcweir 		break;
1258*cdf0e10cSrcweir 
1259*cdf0e10cSrcweir 		case SID_ZOOM_NEXT:
1260*cdf0e10cSrcweir 		{
1261*cdf0e10cSrcweir 			if (mpDrawView->IsTextEdit())
1262*cdf0e10cSrcweir 			{
1263*cdf0e10cSrcweir 				mpDrawView->SdrEndTextEdit();
1264*cdf0e10cSrcweir 			}
1265*cdf0e10cSrcweir 
1266*cdf0e10cSrcweir 			if (mpZoomList->IsNextPossible())
1267*cdf0e10cSrcweir 			{
1268*cdf0e10cSrcweir 				// Naechstes ZoomRect einstellen
1269*cdf0e10cSrcweir 				SetZoomRect(mpZoomList->GetNextZoomRect());
1270*cdf0e10cSrcweir 			}
1271*cdf0e10cSrcweir 			rReq.Done ();
1272*cdf0e10cSrcweir 			Invalidate( SID_ZOOM_TOOLBOX );
1273*cdf0e10cSrcweir 		}
1274*cdf0e10cSrcweir 		break;
1275*cdf0e10cSrcweir 
1276*cdf0e10cSrcweir 		case SID_GLUE_INSERT_POINT:
1277*cdf0e10cSrcweir 		case SID_GLUE_PERCENT:
1278*cdf0e10cSrcweir 		case SID_GLUE_ESCDIR:
1279*cdf0e10cSrcweir 		case SID_GLUE_ESCDIR_LEFT:
1280*cdf0e10cSrcweir 		case SID_GLUE_ESCDIR_RIGHT:
1281*cdf0e10cSrcweir 		case SID_GLUE_ESCDIR_TOP:
1282*cdf0e10cSrcweir 		case SID_GLUE_ESCDIR_BOTTOM:
1283*cdf0e10cSrcweir 		case SID_GLUE_HORZALIGN_CENTER:
1284*cdf0e10cSrcweir 		case SID_GLUE_HORZALIGN_LEFT:
1285*cdf0e10cSrcweir 		case SID_GLUE_HORZALIGN_RIGHT:
1286*cdf0e10cSrcweir 		case SID_GLUE_VERTALIGN_CENTER:
1287*cdf0e10cSrcweir 		case SID_GLUE_VERTALIGN_TOP:
1288*cdf0e10cSrcweir 		case SID_GLUE_VERTALIGN_BOTTOM:
1289*cdf0e10cSrcweir 		{
1290*cdf0e10cSrcweir 			FunctionReference xFunc( GetCurrentFunction() );
1291*cdf0e10cSrcweir 			FuEditGluePoints* pFunc = dynamic_cast< FuEditGluePoints* >( xFunc.get() );
1292*cdf0e10cSrcweir 
1293*cdf0e10cSrcweir 			if(pFunc)
1294*cdf0e10cSrcweir 				pFunc->ReceiveRequest(rReq);
1295*cdf0e10cSrcweir 
1296*cdf0e10cSrcweir 			rReq.Done();
1297*cdf0e10cSrcweir 		}
1298*cdf0e10cSrcweir 		break;
1299*cdf0e10cSrcweir 
1300*cdf0e10cSrcweir #ifdef DBG_UTIL
1301*cdf0e10cSrcweir 		case SID_SHOW_ITEMBROWSER:
1302*cdf0e10cSrcweir 		{
1303*cdf0e10cSrcweir 			mpDrawView->ShowItemBrowser( !mpDrawView->IsItemBrowserVisible() );
1304*cdf0e10cSrcweir 			rReq.Done ();
1305*cdf0e10cSrcweir 		}
1306*cdf0e10cSrcweir 		break;
1307*cdf0e10cSrcweir #endif
1308*cdf0e10cSrcweir 
1309*cdf0e10cSrcweir         case SID_AUTOSPELL_CHECK:
1310*cdf0e10cSrcweir 		{
1311*cdf0e10cSrcweir             sal_Bool bOnlineSpell = !GetDoc()->GetOnlineSpell();
1312*cdf0e10cSrcweir             GetDoc()->SetOnlineSpell(bOnlineSpell);
1313*cdf0e10cSrcweir 
1314*cdf0e10cSrcweir             ::Outliner* pOL = mpDrawView->GetTextEditOutliner();
1315*cdf0e10cSrcweir 
1316*cdf0e10cSrcweir             if (pOL)
1317*cdf0e10cSrcweir             {
1318*cdf0e10cSrcweir                 sal_uLong nCntrl = pOL->GetControlWord();
1319*cdf0e10cSrcweir 
1320*cdf0e10cSrcweir                 if (bOnlineSpell)
1321*cdf0e10cSrcweir                     nCntrl |= EE_CNTRL_ONLINESPELLING;
1322*cdf0e10cSrcweir                 else
1323*cdf0e10cSrcweir                     nCntrl &= ~EE_CNTRL_ONLINESPELLING;
1324*cdf0e10cSrcweir 
1325*cdf0e10cSrcweir                 pOL->SetControlWord(nCntrl);
1326*cdf0e10cSrcweir             }
1327*cdf0e10cSrcweir 
1328*cdf0e10cSrcweir             GetActiveWindow()->Invalidate();
1329*cdf0e10cSrcweir 			rReq.Done ();
1330*cdf0e10cSrcweir 		}
1331*cdf0e10cSrcweir 		break;
1332*cdf0e10cSrcweir 
1333*cdf0e10cSrcweir         case SID_CONVERT_TO_1BIT_THRESHOLD:
1334*cdf0e10cSrcweir         case SID_CONVERT_TO_1BIT_MATRIX:
1335*cdf0e10cSrcweir         case SID_CONVERT_TO_4BIT_GRAYS:
1336*cdf0e10cSrcweir         case SID_CONVERT_TO_4BIT_COLORS:
1337*cdf0e10cSrcweir         case SID_CONVERT_TO_8BIT_GRAYS:
1338*cdf0e10cSrcweir         case SID_CONVERT_TO_8BIT_COLORS:
1339*cdf0e10cSrcweir         case SID_CONVERT_TO_24BIT:
1340*cdf0e10cSrcweir         {
1341*cdf0e10cSrcweir             BmpConversion eBmpConvert = BMP_CONVERSION_NONE;
1342*cdf0e10cSrcweir 
1343*cdf0e10cSrcweir             switch( nSId )
1344*cdf0e10cSrcweir             {
1345*cdf0e10cSrcweir                 case SID_CONVERT_TO_1BIT_THRESHOLD:
1346*cdf0e10cSrcweir                     eBmpConvert = BMP_CONVERSION_1BIT_THRESHOLD;
1347*cdf0e10cSrcweir                     break;
1348*cdf0e10cSrcweir 
1349*cdf0e10cSrcweir                 case SID_CONVERT_TO_1BIT_MATRIX:
1350*cdf0e10cSrcweir                     eBmpConvert = BMP_CONVERSION_1BIT_MATRIX;
1351*cdf0e10cSrcweir                     break;
1352*cdf0e10cSrcweir 
1353*cdf0e10cSrcweir                 case SID_CONVERT_TO_4BIT_GRAYS:
1354*cdf0e10cSrcweir                     eBmpConvert = BMP_CONVERSION_4BIT_GREYS;
1355*cdf0e10cSrcweir                     break;
1356*cdf0e10cSrcweir 
1357*cdf0e10cSrcweir                 case SID_CONVERT_TO_4BIT_COLORS:
1358*cdf0e10cSrcweir                     eBmpConvert = BMP_CONVERSION_4BIT_COLORS;
1359*cdf0e10cSrcweir                     break;
1360*cdf0e10cSrcweir 
1361*cdf0e10cSrcweir                 case SID_CONVERT_TO_8BIT_GRAYS:
1362*cdf0e10cSrcweir                     eBmpConvert = BMP_CONVERSION_8BIT_GREYS;
1363*cdf0e10cSrcweir                     break;
1364*cdf0e10cSrcweir 
1365*cdf0e10cSrcweir                 case SID_CONVERT_TO_8BIT_COLORS:
1366*cdf0e10cSrcweir                     eBmpConvert = BMP_CONVERSION_8BIT_COLORS;
1367*cdf0e10cSrcweir                     break;
1368*cdf0e10cSrcweir 
1369*cdf0e10cSrcweir                 case SID_CONVERT_TO_24BIT:
1370*cdf0e10cSrcweir                     eBmpConvert = BMP_CONVERSION_24BIT;
1371*cdf0e10cSrcweir                     break;
1372*cdf0e10cSrcweir             }
1373*cdf0e10cSrcweir 
1374*cdf0e10cSrcweir             mpDrawView->BegUndo(String(SdResId(STR_UNDO_COLORRESOLUTION)));
1375*cdf0e10cSrcweir             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
1376*cdf0e10cSrcweir 
1377*cdf0e10cSrcweir             for (sal_uLong i=0; i<rMarkList.GetMarkCount(); i++)
1378*cdf0e10cSrcweir             {
1379*cdf0e10cSrcweir                 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1380*cdf0e10cSrcweir 
1381*cdf0e10cSrcweir                 if (pObj->GetObjInventor() == SdrInventor)
1382*cdf0e10cSrcweir                 {
1383*cdf0e10cSrcweir                     if (pObj->GetObjIdentifier() == OBJ_GRAF && !((SdrGrafObj*) pObj)->IsLinkedGraphic())
1384*cdf0e10cSrcweir                     {
1385*cdf0e10cSrcweir                         const Graphic& rGraphic = ((SdrGrafObj*) pObj)->GetGraphic();
1386*cdf0e10cSrcweir 
1387*cdf0e10cSrcweir                         if( rGraphic.GetType() == GRAPHIC_BITMAP )
1388*cdf0e10cSrcweir                         {
1389*cdf0e10cSrcweir                             SdrGrafObj*	pNewObj = (SdrGrafObj*) pObj->Clone();
1390*cdf0e10cSrcweir 
1391*cdf0e10cSrcweir 							if( rGraphic.IsAnimated() )
1392*cdf0e10cSrcweir 							{
1393*cdf0e10cSrcweir 								Animation aAnim( rGraphic.GetAnimation() );
1394*cdf0e10cSrcweir 								aAnim.Convert( eBmpConvert );
1395*cdf0e10cSrcweir 	                            pNewObj->SetGraphic( aAnim );
1396*cdf0e10cSrcweir 							}
1397*cdf0e10cSrcweir 							else
1398*cdf0e10cSrcweir 							{
1399*cdf0e10cSrcweir 								BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
1400*cdf0e10cSrcweir 								aBmpEx.Convert( eBmpConvert );
1401*cdf0e10cSrcweir 	                            pNewObj->SetGraphic( aBmpEx );
1402*cdf0e10cSrcweir 							}
1403*cdf0e10cSrcweir 
1404*cdf0e10cSrcweir                             mpDrawView->ReplaceObjectAtView( pObj, *mpDrawView->GetSdrPageView(), pNewObj );
1405*cdf0e10cSrcweir                         }
1406*cdf0e10cSrcweir                     }
1407*cdf0e10cSrcweir                 }
1408*cdf0e10cSrcweir             }
1409*cdf0e10cSrcweir 
1410*cdf0e10cSrcweir             mpDrawView->EndUndo();
1411*cdf0e10cSrcweir 			rReq.Done ();
1412*cdf0e10cSrcweir 		}
1413*cdf0e10cSrcweir 		break;
1414*cdf0e10cSrcweir 
1415*cdf0e10cSrcweir         case SID_TRANSLITERATE_SENTENCE_CASE:
1416*cdf0e10cSrcweir         case SID_TRANSLITERATE_TITLE_CASE:
1417*cdf0e10cSrcweir         case SID_TRANSLITERATE_TOGGLE_CASE:
1418*cdf0e10cSrcweir 		case SID_TRANSLITERATE_UPPER:
1419*cdf0e10cSrcweir 		case SID_TRANSLITERATE_LOWER:
1420*cdf0e10cSrcweir 		case SID_TRANSLITERATE_HALFWIDTH:
1421*cdf0e10cSrcweir 		case SID_TRANSLITERATE_FULLWIDTH:
1422*cdf0e10cSrcweir 		case SID_TRANSLITERATE_HIRAGANA:
1423*cdf0e10cSrcweir 		case SID_TRANSLITERATE_KATAGANA:
1424*cdf0e10cSrcweir 		{
1425*cdf0e10cSrcweir 			OutlinerView* pOLV = GetView()->GetTextEditOutlinerView();
1426*cdf0e10cSrcweir 			if( pOLV )
1427*cdf0e10cSrcweir 			{
1428*cdf0e10cSrcweir 				using namespace ::com::sun::star::i18n;
1429*cdf0e10cSrcweir 				sal_Int32 nType = 0;
1430*cdf0e10cSrcweir 
1431*cdf0e10cSrcweir 				switch( nSId )
1432*cdf0e10cSrcweir 				{
1433*cdf0e10cSrcweir                     case SID_TRANSLITERATE_SENTENCE_CASE:
1434*cdf0e10cSrcweir                         nType = TransliterationModulesExtra::SENTENCE_CASE;
1435*cdf0e10cSrcweir                         break;
1436*cdf0e10cSrcweir                     case SID_TRANSLITERATE_TITLE_CASE:
1437*cdf0e10cSrcweir                         nType = TransliterationModulesExtra::TITLE_CASE;
1438*cdf0e10cSrcweir                         break;
1439*cdf0e10cSrcweir                     case SID_TRANSLITERATE_TOGGLE_CASE:
1440*cdf0e10cSrcweir                         nType = TransliterationModulesExtra::TOGGLE_CASE;
1441*cdf0e10cSrcweir                         break;
1442*cdf0e10cSrcweir 					case SID_TRANSLITERATE_UPPER:
1443*cdf0e10cSrcweir 						nType = TransliterationModules_LOWERCASE_UPPERCASE;
1444*cdf0e10cSrcweir 						break;
1445*cdf0e10cSrcweir 					case SID_TRANSLITERATE_LOWER:
1446*cdf0e10cSrcweir 						nType = TransliterationModules_UPPERCASE_LOWERCASE;
1447*cdf0e10cSrcweir 						break;
1448*cdf0e10cSrcweir 					case SID_TRANSLITERATE_HALFWIDTH:
1449*cdf0e10cSrcweir 						nType = TransliterationModules_FULLWIDTH_HALFWIDTH;
1450*cdf0e10cSrcweir 						break;
1451*cdf0e10cSrcweir 					case SID_TRANSLITERATE_FULLWIDTH:
1452*cdf0e10cSrcweir 						nType = TransliterationModules_HALFWIDTH_FULLWIDTH;
1453*cdf0e10cSrcweir 						break;
1454*cdf0e10cSrcweir 					case SID_TRANSLITERATE_HIRAGANA:
1455*cdf0e10cSrcweir 						nType = TransliterationModules_KATAKANA_HIRAGANA;
1456*cdf0e10cSrcweir 						break;
1457*cdf0e10cSrcweir 					case SID_TRANSLITERATE_KATAGANA:
1458*cdf0e10cSrcweir 						nType = TransliterationModules_HIRAGANA_KATAKANA;
1459*cdf0e10cSrcweir 						break;
1460*cdf0e10cSrcweir 				}
1461*cdf0e10cSrcweir 
1462*cdf0e10cSrcweir 				pOLV->TransliterateText( nType );
1463*cdf0e10cSrcweir 			}
1464*cdf0e10cSrcweir 
1465*cdf0e10cSrcweir 			rReq.Done();
1466*cdf0e10cSrcweir 		}
1467*cdf0e10cSrcweir 		break;
1468*cdf0e10cSrcweir 
1469*cdf0e10cSrcweir 		// #UndoRedo#
1470*cdf0e10cSrcweir 		case SID_UNDO :
1471*cdf0e10cSrcweir 		{
1472*cdf0e10cSrcweir 			// #96090# moved implementation to BaseClass
1473*cdf0e10cSrcweir 			ImpSidUndo(sal_True, rReq);
1474*cdf0e10cSrcweir 		}
1475*cdf0e10cSrcweir 		break;
1476*cdf0e10cSrcweir 		case SID_REDO :
1477*cdf0e10cSrcweir 		{
1478*cdf0e10cSrcweir 			// #96090# moved implementation to BaseClass
1479*cdf0e10cSrcweir 			ImpSidRedo(sal_True, rReq);
1480*cdf0e10cSrcweir 		}
1481*cdf0e10cSrcweir 		break;
1482*cdf0e10cSrcweir 
1483*cdf0e10cSrcweir         default:
1484*cdf0e10cSrcweir 		break;
1485*cdf0e10cSrcweir 	}
1486*cdf0e10cSrcweir }
1487*cdf0e10cSrcweir 
1488*cdf0e10cSrcweir /*************************************************************************
1489*cdf0e10cSrcweir |*
1490*cdf0e10cSrcweir |* URL-Feld einfuegen
1491*cdf0e10cSrcweir |*
1492*cdf0e10cSrcweir \************************************************************************/
1493*cdf0e10cSrcweir 
1494*cdf0e10cSrcweir void DrawViewShell::InsertURLField(const String& rURL, const String& rText,
1495*cdf0e10cSrcweir 									 const String& rTarget, const Point* pPos)
1496*cdf0e10cSrcweir {
1497*cdf0e10cSrcweir     OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
1498*cdf0e10cSrcweir 
1499*cdf0e10cSrcweir     if (pOLV)
1500*cdf0e10cSrcweir 	{
1501*cdf0e10cSrcweir         ESelection aSel( pOLV->GetSelection() );
1502*cdf0e10cSrcweir         SvxFieldItem aURLItem( SvxURLField( rURL, rText, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD );
1503*cdf0e10cSrcweir         pOLV->InsertField( aURLItem );
1504*cdf0e10cSrcweir         if ( aSel.nStartPos <= aSel.nEndPos )
1505*cdf0e10cSrcweir 		    aSel.nEndPos = aSel.nStartPos + 1;
1506*cdf0e10cSrcweir         else
1507*cdf0e10cSrcweir             aSel.nStartPos = aSel.nEndPos + 1;
1508*cdf0e10cSrcweir         pOLV->SetSelection( aSel );
1509*cdf0e10cSrcweir 	}
1510*cdf0e10cSrcweir 	else
1511*cdf0e10cSrcweir 	{
1512*cdf0e10cSrcweir 		Outliner* pOutl = GetDoc()->GetInternalOutliner();
1513*cdf0e10cSrcweir 		pOutl->Init( OUTLINERMODE_TEXTOBJECT );
1514*cdf0e10cSrcweir 		sal_uInt16 nOutlMode = pOutl->GetMode();
1515*cdf0e10cSrcweir 
1516*cdf0e10cSrcweir 		SvxURLField aURLField(rURL, rText, SVXURLFORMAT_REPR);
1517*cdf0e10cSrcweir 		aURLField.SetTargetFrame(rTarget);
1518*cdf0e10cSrcweir         SvxFieldItem aURLItem(aURLField, EE_FEATURE_FIELD);
1519*cdf0e10cSrcweir 		pOutl->QuickInsertField( aURLItem, ESelection() );
1520*cdf0e10cSrcweir 		OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
1521*cdf0e10cSrcweir 
1522*cdf0e10cSrcweir 		SdrRectObj* pRectObj = new SdrRectObj(OBJ_TEXT);
1523*cdf0e10cSrcweir 
1524*cdf0e10cSrcweir 		pOutl->UpdateFields();
1525*cdf0e10cSrcweir 		pOutl->SetUpdateMode( sal_True );
1526*cdf0e10cSrcweir 		Size aSize(pOutl->CalcTextSize());
1527*cdf0e10cSrcweir 		pOutl->SetUpdateMode( sal_False );
1528*cdf0e10cSrcweir 
1529*cdf0e10cSrcweir 		Point aPos;
1530*cdf0e10cSrcweir 
1531*cdf0e10cSrcweir 		if (pPos)
1532*cdf0e10cSrcweir 		{
1533*cdf0e10cSrcweir 			aPos = *pPos;
1534*cdf0e10cSrcweir 		}
1535*cdf0e10cSrcweir 		else
1536*cdf0e10cSrcweir 		{
1537*cdf0e10cSrcweir 			Rectangle aRect(aPos, GetActiveWindow()->GetOutputSizePixel() );
1538*cdf0e10cSrcweir 			aPos = aRect.Center();
1539*cdf0e10cSrcweir 			aPos = GetActiveWindow()->PixelToLogic(aPos);
1540*cdf0e10cSrcweir 			aPos.X() -= aSize.Width() / 2;
1541*cdf0e10cSrcweir 			aPos.Y() -= aSize.Height() / 2;
1542*cdf0e10cSrcweir 		}
1543*cdf0e10cSrcweir 
1544*cdf0e10cSrcweir 		Rectangle aLogicRect(aPos, aSize);
1545*cdf0e10cSrcweir 		pRectObj->SetLogicRect(aLogicRect);
1546*cdf0e10cSrcweir 		pRectObj->SetOutlinerParaObject( pOutlParaObject );
1547*cdf0e10cSrcweir 		mpDrawView->InsertObjectAtView(pRectObj, *mpDrawView->GetSdrPageView());
1548*cdf0e10cSrcweir 		pOutl->Init( nOutlMode );
1549*cdf0e10cSrcweir 	}
1550*cdf0e10cSrcweir }
1551*cdf0e10cSrcweir 
1552*cdf0e10cSrcweir /*************************************************************************
1553*cdf0e10cSrcweir |*
1554*cdf0e10cSrcweir |* URL-Button einfuegen
1555*cdf0e10cSrcweir |*
1556*cdf0e10cSrcweir \************************************************************************/
1557*cdf0e10cSrcweir 
1558*cdf0e10cSrcweir void DrawViewShell::InsertURLButton(const String& rURL, const String& rText,
1559*cdf0e10cSrcweir 									  const String& rTarget, const Point* pPos)
1560*cdf0e10cSrcweir {
1561*cdf0e10cSrcweir     sal_Bool bNewObj = sal_True;
1562*cdf0e10cSrcweir 
1563*cdf0e10cSrcweir     const OUString sTargetURL( ::URIHelper::SmartRel2Abs( INetURLObject( GetDocSh()->GetMedium()->GetBaseURL() ), rURL, URIHelper::GetMaybeFileHdl(), true, false,
1564*cdf0e10cSrcweir 																INetURLObject::WAS_ENCODED,
1565*cdf0e10cSrcweir 																INetURLObject::DECODE_UNAMBIGUOUS ) );
1566*cdf0e10cSrcweir     if (mpDrawView->GetMarkedObjectList().GetMarkCount() > 0)
1567*cdf0e10cSrcweir     {
1568*cdf0e10cSrcweir         SdrObject* pMarkedObj = mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
1569*cdf0e10cSrcweir         if( pMarkedObj ) try
1570*cdf0e10cSrcweir         {
1571*cdf0e10cSrcweir             // change first marked object
1572*cdf0e10cSrcweir             if( (FmFormInventor == pMarkedObj->GetObjInventor() && pMarkedObj->GetObjIdentifier() == OBJ_FM_BUTTON) )
1573*cdf0e10cSrcweir             {
1574*cdf0e10cSrcweir                 bNewObj = sal_False;
1575*cdf0e10cSrcweir 
1576*cdf0e10cSrcweir 	            SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pMarkedObj );
1577*cdf0e10cSrcweir 
1578*cdf0e10cSrcweir                 Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), UNO_QUERY_THROW );
1579*cdf0e10cSrcweir 			    Reference< beans::XPropertySet > xPropSet( xControlModel, UNO_QUERY_THROW );
1580*cdf0e10cSrcweir 
1581*cdf0e10cSrcweir                 xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), Any( OUString( rText ) ) );
1582*cdf0e10cSrcweir                 xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" )), Any( sTargetURL ) );
1583*cdf0e10cSrcweir 
1584*cdf0e10cSrcweir 			    if( rTarget.Len() )
1585*cdf0e10cSrcweir                     xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" )), Any( OUString( rTarget ) ) );
1586*cdf0e10cSrcweir 
1587*cdf0e10cSrcweir                 xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" )), Any( form::FormButtonType_URL ) );
1588*cdf0e10cSrcweir 			    if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
1589*cdf0e10cSrcweir 			    {
1590*cdf0e10cSrcweir 				    // #105638# OJ
1591*cdf0e10cSrcweir                     xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), Any( sal_True ) );
1592*cdf0e10cSrcweir 			    }
1593*cdf0e10cSrcweir             }
1594*cdf0e10cSrcweir             else
1595*cdf0e10cSrcweir             {
1596*cdf0e10cSrcweir                 // add url as interaction for first selected shape
1597*cdf0e10cSrcweir                 bNewObj = sal_False;
1598*cdf0e10cSrcweir 
1599*cdf0e10cSrcweir                 SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pMarkedObj, true);
1600*cdf0e10cSrcweir                 pInfo->meClickAction = presentation::ClickAction_DOCUMENT;
1601*cdf0e10cSrcweir                 pInfo->SetBookmark( sTargetURL );
1602*cdf0e10cSrcweir             }
1603*cdf0e10cSrcweir         }
1604*cdf0e10cSrcweir         catch( uno::Exception& )
1605*cdf0e10cSrcweir         {
1606*cdf0e10cSrcweir         }
1607*cdf0e10cSrcweir     }
1608*cdf0e10cSrcweir 
1609*cdf0e10cSrcweir     if (bNewObj) try
1610*cdf0e10cSrcweir     {
1611*cdf0e10cSrcweir         SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( SdrObjFactory::MakeNewObject(FmFormInventor, OBJ_FM_BUTTON,
1612*cdf0e10cSrcweir                                 mpDrawView->GetSdrPageView()->GetPage(), GetDoc()) );
1613*cdf0e10cSrcweir 
1614*cdf0e10cSrcweir         Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), uno::UNO_QUERY_THROW );
1615*cdf0e10cSrcweir 		Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW );
1616*cdf0e10cSrcweir 
1617*cdf0e10cSrcweir         xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), Any( OUString( rText ) ) );
1618*cdf0e10cSrcweir 		xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" )), Any( sTargetURL ) );
1619*cdf0e10cSrcweir 
1620*cdf0e10cSrcweir 		if( rTarget.Len() )
1621*cdf0e10cSrcweir 			xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" )), Any( OUString( rTarget ) ) );
1622*cdf0e10cSrcweir 
1623*cdf0e10cSrcweir 		xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" )), Any(  form::FormButtonType_URL ) );
1624*cdf0e10cSrcweir 		// #105638# OJ
1625*cdf0e10cSrcweir 		if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
1626*cdf0e10cSrcweir 			xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), Any( sal_True ) );
1627*cdf0e10cSrcweir 
1628*cdf0e10cSrcweir         Point aPos;
1629*cdf0e10cSrcweir 
1630*cdf0e10cSrcweir         if (pPos)
1631*cdf0e10cSrcweir         {
1632*cdf0e10cSrcweir             aPos = *pPos;
1633*cdf0e10cSrcweir         }
1634*cdf0e10cSrcweir         else
1635*cdf0e10cSrcweir         {
1636*cdf0e10cSrcweir             aPos = Rectangle(aPos, GetActiveWindow()->GetOutputSizePixel()).Center();
1637*cdf0e10cSrcweir             aPos = GetActiveWindow()->PixelToLogic(aPos);
1638*cdf0e10cSrcweir         }
1639*cdf0e10cSrcweir 
1640*cdf0e10cSrcweir         Size aSize(4000, 1000);
1641*cdf0e10cSrcweir         aPos.X() -= aSize.Width() / 2;
1642*cdf0e10cSrcweir         aPos.Y() -= aSize.Height() / 2;
1643*cdf0e10cSrcweir         pUnoCtrl->SetLogicRect(Rectangle(aPos, aSize));
1644*cdf0e10cSrcweir 
1645*cdf0e10cSrcweir         sal_uLong nOptions = SDRINSERT_SETDEFLAYER;
1646*cdf0e10cSrcweir 
1647*cdf0e10cSrcweir         OSL_ASSERT (GetViewShell()!=NULL);
1648*cdf0e10cSrcweir         SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient();
1649*cdf0e10cSrcweir         if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive())
1650*cdf0e10cSrcweir         {
1651*cdf0e10cSrcweir             nOptions |= SDRINSERT_DONTMARK;
1652*cdf0e10cSrcweir         }
1653*cdf0e10cSrcweir 
1654*cdf0e10cSrcweir         mpDrawView->InsertObjectAtView(pUnoCtrl, *mpDrawView->GetSdrPageView(), nOptions);
1655*cdf0e10cSrcweir     }
1656*cdf0e10cSrcweir     catch( Exception& )
1657*cdf0e10cSrcweir     {
1658*cdf0e10cSrcweir     }
1659*cdf0e10cSrcweir }
1660*cdf0e10cSrcweir 
1661*cdf0e10cSrcweir /*************************************************************************
1662*cdf0e10cSrcweir |*
1663*cdf0e10cSrcweir |*
1664*cdf0e10cSrcweir |*
1665*cdf0e10cSrcweir \************************************************************************/
1666*cdf0e10cSrcweir 
1667*cdf0e10cSrcweir void DrawViewShell::ShowUIControls (bool bVisible)
1668*cdf0e10cSrcweir {
1669*cdf0e10cSrcweir     ViewShell::ShowUIControls (bVisible);
1670*cdf0e10cSrcweir 
1671*cdf0e10cSrcweir     //AF: The LayerDialogChildWindow is not used anymore (I hope).
1672*cdf0e10cSrcweir     //    GetViewFrame()->SetChildWindow(
1673*cdf0e10cSrcweir     //        LayerDialogChildWindow::GetChildWindowId(),
1674*cdf0e10cSrcweir     //        IsLayerModeActive() && bVisible);
1675*cdf0e10cSrcweir     maTabControl.Show (bVisible);
1676*cdf0e10cSrcweir }
1677*cdf0e10cSrcweir 
1678*cdf0e10cSrcweir void DrawViewShell::StopSlideShow (bool /*bCloseFrame*/)
1679*cdf0e10cSrcweir {
1680*cdf0e10cSrcweir 	Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
1681*cdf0e10cSrcweir     if(xPresentation.is() && xPresentation->isRunning())
1682*cdf0e10cSrcweir     {
1683*cdf0e10cSrcweir         if( mpDrawView->IsTextEdit() )
1684*cdf0e10cSrcweir             mpDrawView->SdrEndTextEdit();
1685*cdf0e10cSrcweir 
1686*cdf0e10cSrcweir 		xPresentation->end();
1687*cdf0e10cSrcweir     }
1688*cdf0e10cSrcweir }
1689*cdf0e10cSrcweir 
1690*cdf0e10cSrcweir #ifdef _MSC_VER
1691*cdf0e10cSrcweir #pragma optimize ( "", on )
1692*cdf0e10cSrcweir #endif
1693*cdf0e10cSrcweir 
1694*cdf0e10cSrcweir } // end of namespace sd
1695