xref: /aoo41x/main/sd/source/ui/view/drviews6.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sd.hxx"
30 
31 #include "DrawViewShell.hxx"
32 #include <vcl/metaact.hxx>
33 #include <sfx2/request.hxx>
34 #include <sfx2/dispatch.hxx>
35 #include <vcl/msgbox.hxx>
36 #include <sfx2/viewfrm.hxx>
37 #include <svx/svdograf.hxx>
38 #ifndef _SVXIDS_HXX
39 #include <svx/svxids.hrc>
40 #endif
41 #ifndef _FONTWORK_HXX
42 #include <svx/fontwork.hxx>
43 #endif
44 #ifndef _BMPMASK_HXX
45 #include <svx/bmpmask.hxx>
46 #endif
47 #ifndef _SVX_GALBRWS_HXX
48 #include <svx/galbrws.hxx>
49 #endif
50 #ifndef _IMAPDLG_HXX
51 #include <svx/imapdlg.hxx>
52 #endif
53 #include <svx/xftsfit.hxx>
54 #include <svx/colrctrl.hxx>
55 #include <svx/f3dchild.hxx>
56 #include "optsitem.hxx"
57 #include <svx/extrusionbar.hxx>
58 #include <svx/fontworkbar.hxx>
59 #include <svx/tbxcustomshapes.hxx>
60 #ifndef _AVMEDIA_MEDIAPLAYER_HXX
61 #include <avmedia/mediaplayer.hxx>
62 #endif
63 
64 #include "app.hrc"
65 #include "strings.hrc"
66 #include "glob.hrc"
67 
68 #include "app.hxx"
69 #include "animobjs.hxx"
70 #include "AnimationChildWindow.hxx"
71 #include "NavigatorChildWindow.hxx"
72 #include "LayerDialogChildWindow.hxx"
73 #include "sdresid.hxx"
74 #include "fupoor.hxx"
75 #include "fusldlg.hxx"
76 #include "drawdoc.hxx"
77 #include "fuexpand.hxx"
78 #include "fusumry.hxx"
79 #include "fucushow.hxx"
80 #include "drawview.hxx"
81 #include "FrameView.hxx"
82 #include "Window.hxx"
83 #include "DrawDocShell.hxx"
84 #include "framework/FrameworkHelper.hxx"
85 
86 namespace sd {
87 
88 /*************************************************************************
89 |*
90 |* SfxRequests fuer FontWork bearbeiten
91 |*
92 \************************************************************************/
93 
94 void DrawViewShell::ExecFormText(SfxRequest& rReq)
95 {
96 	// waehrend einer Diashow wird nichts ausgefuehrt!
97 	if(HasCurrentFunction(SID_PRESENTATION))
98 		return;
99 
100 	CheckLineTo (rReq);
101 
102 	const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
103 
104 	if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() &&
105 		 mpDrawView && !mpDrawView->IsPresObjSelected() )
106 	{
107 		const SfxItemSet& rSet = *rReq.GetArgs();
108 		const SfxPoolItem* pItem;
109 
110 		if ( mpDrawView->IsTextEdit() )
111 			mpDrawView->SdrEndTextEdit();
112 
113 		if ( rSet.GetItemState(XATTR_FORMTXTSTDFORM, sal_True, &pItem) ==
114 			 SFX_ITEM_SET &&
115 			((const XFormTextStdFormItem*) pItem)->GetValue() != XFTFORM_NONE )
116 		{
117 
118 			sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
119 
120 			SvxFontWorkDialog* pDlg = (SvxFontWorkDialog*)GetViewFrame()->
121 										GetChildWindow(nId)->GetWindow();
122 
123 			pDlg->CreateStdFormObj(*mpDrawView, *mpDrawView->GetSdrPageView(),
124 									rSet, *rMarkList.GetMark(0)->GetMarkedSdrObj(),
125 								   ((const XFormTextStdFormItem*) pItem)->
126 								   GetValue());
127 
128 			if(HasCurrentFunction(SID_BEZIER_EDIT))
129 			{	// ggf. die richtige Editfunktion aktivieren
130 				GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT,
131 									SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
132 			}
133 		}
134 		else
135 			mpDrawView->SetAttributes(rSet);
136 	}
137 }
138 
139 /*************************************************************************
140 |*
141 |* Statuswerte fuer FontWork zurueckgeben
142 |*
143 \************************************************************************/
144 
145 void DrawViewShell::GetFormTextState(SfxItemSet& rSet)
146 {
147 	const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
148 	const SdrObject* pObj = NULL;
149 	SvxFontWorkDialog* pDlg = NULL;
150 
151 	sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
152 
153 	if ( GetViewFrame()->HasChildWindow(nId) )
154 		pDlg = (SvxFontWorkDialog*)(GetViewFrame()->GetChildWindow(nId)->GetWindow());
155 
156 	if ( rMarkList.GetMarkCount() == 1 )
157 		pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
158 
159 	if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
160 		!((SdrTextObj*) pObj)->HasText() )
161 	{
162 // automatisches Auf/Zuklappen des FontWork-Dialog; erstmal deaktiviert
163 //		if ( pDlg )
164 //			pDlg->SetActive(sal_False);
165 
166 		rSet.DisableItem(XATTR_FORMTXTSTYLE);
167 		rSet.DisableItem(XATTR_FORMTXTADJUST);
168 		rSet.DisableItem(XATTR_FORMTXTDISTANCE);
169 		rSet.DisableItem(XATTR_FORMTXTSTART);
170 		rSet.DisableItem(XATTR_FORMTXTMIRROR);
171 		rSet.DisableItem(XATTR_FORMTXTSTDFORM);
172 		rSet.DisableItem(XATTR_FORMTXTHIDEFORM);
173 		rSet.DisableItem(XATTR_FORMTXTOUTLINE);
174 		rSet.DisableItem(XATTR_FORMTXTSHADOW);
175 		rSet.DisableItem(XATTR_FORMTXTSHDWCOLOR);
176 		rSet.DisableItem(XATTR_FORMTXTSHDWXVAL);
177 		rSet.DisableItem(XATTR_FORMTXTSHDWYVAL);
178 	}
179 	else
180 	{
181 		if ( pDlg )
182 		{
183 //			pDlg->SetActive();
184 			pDlg->SetColorTable(GetDoc()->GetColorTable());
185 		}
186 
187 		SfxItemSet aSet( GetDoc()->GetPool() );
188 		mpDrawView->GetAttributes( aSet );
189 		rSet.Set( aSet );
190 	}
191 }
192 
193 /*************************************************************************
194 |*
195 |* SfxRequests fuer Animator bearbeiten
196 |*
197 \************************************************************************/
198 
199 void DrawViewShell::ExecAnimationWin( SfxRequest& rReq )
200 {
201 	// waehrend einer Diashow wird nichts ausgefuehrt!
202 	if (HasCurrentFunction(SID_PRESENTATION))
203 		return;
204 
205 	CheckLineTo (rReq);
206 
207 	sal_uInt16 nSId = rReq.GetSlot();
208 
209 	switch( nSId )
210 	{
211 		case SID_ANIMATOR_INIT:
212 		case SID_ANIMATOR_ADD:
213 		case SID_ANIMATOR_CREATE:
214 		{
215 			AnimationWindow* pAnimWin;
216 			sal_uInt16 nId = AnimationChildWindow::GetChildWindowId();
217 			//((const SfxUInt16Item&)(rReq.GetArgs()->Get(nSId))).GetValue();
218 
219 			pAnimWin = static_cast<AnimationWindow*>(
220                 GetViewFrame()->GetChildWindow(nId)->GetWindow());
221 
222 			if ( pAnimWin )
223 			{
224                 if( nSId == SID_ANIMATOR_ADD )
225 					pAnimWin->AddObj( *mpDrawView );
226 				else if( nSId == SID_ANIMATOR_CREATE )
227 					pAnimWin->CreateAnimObj( *mpDrawView );
228 			}
229 		}
230 		break;
231 
232 		default:
233 		break;
234 	}
235 }
236 
237 /*************************************************************************
238 |*
239 |* Statuswerte fuer Animator zurueckgeben
240 |*
241 |* nValue == 0 -> Kein Button
242 |* nValue == 1 -> Button 'uebernehmen'
243 |* nValue == 2 -> Button 'einzeln uebernehmen'
244 |* nValue == 3 -> Buttons 'uebernehmen' und 'einzeln uebernehmen'
245 |*
246 \************************************************************************/
247 
248 void DrawViewShell::GetAnimationWinState( SfxItemSet& rSet )
249 {
250 	// Hier koennten Buttons etc. disabled werden
251 	sal_uInt16 nValue;
252 
253 	const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
254 	sal_uLong nMarkCount = rMarkList.GetMarkCount();
255 
256 	if( nMarkCount == 0 )
257 		nValue = 0;
258 	else if( nMarkCount > 1 )
259 		nValue = 3;
260 	else // 1 Objekt
261 	{
262 		const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
263 		sal_uInt32 nInv = pObj->GetObjInventor();
264 		sal_uInt16 nId	= pObj->GetObjIdentifier();
265 		// 1 selektiertes Gruppenobjekt
266 		if( nInv == SdrInventor && nId == OBJ_GRUP )
267 			nValue = 3;
268 		else if( nInv == SdrInventor && nId == OBJ_GRAF ) // Anim. GIF ?
269 		{
270 			sal_uInt16 nCount = 0;
271 
272 			if( ( (SdrGrafObj*) pObj )->IsAnimated() )
273 				nCount = ( (SdrGrafObj*) pObj )->GetGraphic().GetAnimation().Count();
274 			if( nCount > 0 )
275 				nValue = 2;
276 			else
277 				nValue = 1;
278 		}
279 		else
280 			nValue = 1;
281 	}
282 	rSet.Put( SfxUInt16Item( SID_ANIMATOR_STATE, nValue ) );
283 }
284 
285 /*************************************************************************
286 |*
287 |* Statuswerte fuer SfxChildWindows setzen
288 |*
289 \************************************************************************/
290 
291 void DrawViewShell::SetChildWindowState( SfxItemSet& rSet )
292 {
293 	// Stati der SfxChild-Windows (Animator, Fontwork etc.)
294 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_FONTWORK ) )
295 	{
296 		sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
297 		rSet.Put(SfxBoolItem(SID_FONTWORK, GetViewFrame()->HasChildWindow(nId)));
298 	}
299 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_COLOR_CONTROL ) )
300 	{
301 		sal_uInt16 nId = SvxColorChildWindow::GetChildWindowId();
302 		rSet.Put(SfxBoolItem(SID_COLOR_CONTROL, GetViewFrame()->HasChildWindow(nId)));
303 	}
304 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ANIMATION_OBJECTS ) )
305 	{
306 		sal_uInt16 nId = AnimationChildWindow::GetChildWindowId();
307 		rSet.Put( SfxBoolItem( SID_ANIMATION_OBJECTS, GetViewFrame()->HasChildWindow( nId ) ) );
308 	}
309 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_NAVIGATOR ) )
310 	{
311 		sal_uInt16 nId = SID_NAVIGATOR;
312 		rSet.Put( SfxBoolItem( SID_NAVIGATOR, GetViewFrame()->HasChildWindow( nId ) ) );
313 	}
314 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BMPMASK ) )
315 	{
316 		sal_uInt16 nId = SvxBmpMaskChildWindow::GetChildWindowId();
317 		rSet.Put( SfxBoolItem( SID_BMPMASK, GetViewFrame()->HasChildWindow( nId ) ) );
318 	}
319 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_GALLERY ) )
320 	{
321 		sal_uInt16 nId = GalleryChildWindow::GetChildWindowId();
322 		rSet.Put( SfxBoolItem( SID_GALLERY, GetViewFrame()->HasChildWindow( nId ) ) );
323 	}
324 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_IMAP ) )
325 	{
326 		sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
327 		rSet.Put( SfxBoolItem( SID_IMAP, GetViewFrame()->HasChildWindow( nId ) ) );
328 	}
329 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_LAYER_DIALOG_WIN ) )
330 	{
331 		sal_uInt16 nId = LayerDialogChildWindow::GetChildWindowId();
332 		rSet.Put( SfxBoolItem( SID_LAYER_DIALOG_WIN, GetViewFrame()->HasChildWindow( nId ) ) );
333 	}
334 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_3D_WIN ) )
335 	{
336 		sal_uInt16 nId = Svx3DChildWindow::GetChildWindowId();
337 		rSet.Put( SfxBoolItem( SID_3D_WIN, GetViewFrame()->HasChildWindow( nId ) ) );
338 	}
339 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_AVMEDIA_PLAYER ) )
340 	{
341 		sal_uInt16 nId = ::avmedia::MediaPlayer::GetChildWindowId();
342 		rSet.Put( SfxBoolItem( SID_AVMEDIA_PLAYER, GetViewFrame()->HasChildWindow( nId ) ) );
343 	}
344 }
345 
346 
347 /*************************************************************************
348 |*
349 |* SfxRequests fuer Pipette bearbeiten
350 |*
351 \************************************************************************/
352 
353 void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
354 {
355 	// waehrend einer Diashow wird nichts ausgefuehrt!
356 	if (HasCurrentFunction(SID_PRESENTATION))
357 		return;
358 
359 	switch ( rReq.GetSlot() )
360 	{
361 		case ( SID_BMPMASK_PIPETTE ) :
362 		{
363 			mbPipette = ( (const SfxBoolItem&) ( rReq.GetArgs()->
364 					   Get( SID_BMPMASK_PIPETTE ) ) ).GetValue();
365 		}
366 		break;
367 
368 		case ( SID_BMPMASK_EXEC ) :
369 		{
370 			SdrGrafObj* pObj = 0;
371 			if( mpDrawView && mpDrawView->GetMarkedObjectList().GetMarkCount() )
372 				pObj = dynamic_cast< SdrGrafObj* >( mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() );
373 
374 			if ( pObj && !mpDrawView->IsTextEdit() )
375 			{
376 				SdrGrafObj*	pNewObj = (SdrGrafObj*) pObj->Clone();
377 				sal_Bool		bCont = sal_True;
378 
379 				if( pNewObj->IsLinkedGraphic() )
380 				{
381 					QueryBox aQBox( (Window*) GetActiveWindow(), WB_YES_NO | WB_DEF_YES,
382 									String( SdResId( STR_RELEASE_GRAPHICLINK ) ) );
383 
384 					if( RET_YES == aQBox.Execute() )
385 						pNewObj->ReleaseGraphicLink();
386 					else
387 					{
388 						delete pNewObj;
389 						bCont = sal_False;
390 					}
391 				}
392 
393 				if( bCont )
394 				{
395 					const Graphic&	rOldGraphic = pNewObj->GetGraphic();
396 					const Graphic	aNewGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow(
397 												 SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
398 												 Mask( rOldGraphic ) );
399 
400 					if( aNewGraphic != rOldGraphic )
401 					{
402 						SdrPageView* pPV = mpDrawView->GetSdrPageView();
403 
404 						pNewObj->SetEmptyPresObj( sal_False );
405 						pNewObj->SetGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow(
406 											 SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
407 											 Mask( pNewObj->GetGraphic() ) );
408 
409 						String aStr( mpDrawView->GetDescriptionOfMarkedObjects() );
410 						aStr += (sal_Unicode)( ' ' ), aStr += String( SdResId( STR_EYEDROPPER ) );
411 
412 						mpDrawView->BegUndo( aStr );
413 						mpDrawView->ReplaceObjectAtView( pObj, *pPV, pNewObj );
414 						mpDrawView->EndUndo();
415 					}
416 				}
417 			}
418 		}
419 		break;
420 
421 		default:
422 		break;
423 	}
424 }
425 
426 /*************************************************************************
427 |*
428 |*
429 |*
430 \************************************************************************/
431 
432 void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet )
433 {
434 	const SdrMarkList&	rMarkList = mpDrawView->GetMarkedObjectList();
435 	const SdrObject*	pObj = NULL;
436 	sal_uInt16				nId = SvxBmpMaskChildWindow::GetChildWindowId();
437 	SvxBmpMask* 		pDlg = NULL;
438 	sal_Bool				bEnable = sal_False;
439 
440 	if ( GetViewFrame()->HasChildWindow( nId ) )
441 	{
442 		pDlg = (SvxBmpMask*) ( GetViewFrame()->GetChildWindow( nId )->GetWindow() );
443 
444 		if ( pDlg->NeedsColorTable() )
445 			pDlg->SetColorTable( GetDoc()->GetColorTable() );
446 	}
447 
448 	if ( rMarkList.GetMarkCount() == 1 )
449 		pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
450 
451 	// valid graphic object?
452 	if( pObj && pObj->ISA( SdrGrafObj ) &&
453         !( ((SdrGrafObj*) pObj)->IsEPS() || ((SdrGrafObj*) pObj)->IsRenderGraphic() ) &&
454         !mpDrawView->IsTextEdit() )
455     {
456 		bEnable = sal_True;
457     }
458 
459 	// put value
460 	rSet.Put( SfxBoolItem( SID_BMPMASK_EXEC, bEnable ) );
461 }
462 
463 /*************************************************************************
464 |*
465 |* SfxRequests fuer temporaere Funktionen
466 |*
467 \************************************************************************/
468 
469 void DrawViewShell::FuTemp04(SfxRequest& rReq)
470 {
471 	sal_uInt16 nSId = rReq.GetSlot();
472 	switch( nSId )
473 	{
474 		case SID_FONTWORK:
475 		{
476 			if ( rReq.GetArgs() )
477 			{
478 				GetViewFrame()->SetChildWindow(SvxFontWorkChildWindow::GetChildWindowId(),
479 										((const SfxBoolItem&) (rReq.GetArgs()->
480 										Get(SID_FONTWORK))).GetValue());
481 			}
482 			else
483 			{
484 				GetViewFrame()->ToggleChildWindow( SvxFontWorkChildWindow::GetChildWindowId() );
485 			}
486 
487 			GetViewFrame()->GetBindings().Invalidate(SID_FONTWORK);
488 			Cancel();
489 			rReq.Ignore ();
490 		}
491 		break;
492 
493 		case SID_COLOR_CONTROL:
494 		{
495 			if ( rReq.GetArgs() )
496 				GetViewFrame()->SetChildWindow(SvxColorChildWindow::GetChildWindowId(),
497 										((const SfxBoolItem&) (rReq.GetArgs()->
498 										Get(SID_COLOR_CONTROL))).GetValue());
499 			else
500 				GetViewFrame()->ToggleChildWindow(SvxColorChildWindow::GetChildWindowId() );
501 
502 			GetViewFrame()->GetBindings().Invalidate(SID_COLOR_CONTROL);
503 			Cancel();
504 			rReq.Ignore ();
505 		}
506 		break;
507 
508 		case SID_EXTRUSION_TOOGLE:
509 		case SID_EXTRUSION_TILT_DOWN:
510 		case SID_EXTRUSION_TILT_UP:
511 		case SID_EXTRUSION_TILT_LEFT:
512 		case SID_EXTRUSION_TILT_RIGHT:
513 		case SID_EXTRUSION_3D_COLOR:
514 		case SID_EXTRUSION_DEPTH:
515 		case SID_EXTRUSION_DIRECTION:
516 		case SID_EXTRUSION_PROJECTION:
517 		case SID_EXTRUSION_LIGHTING_DIRECTION:
518 		case SID_EXTRUSION_LIGHTING_INTENSITY:
519 		case SID_EXTRUSION_SURFACE:
520 		case SID_EXTRUSION_DEPTH_FLOATER:
521 		case SID_EXTRUSION_DIRECTION_FLOATER:
522 		case SID_EXTRUSION_LIGHTING_FLOATER:
523 		case SID_EXTRUSION_SURFACE_FLOATER:
524 		case SID_EXTRUSION_DEPTH_DIALOG:
525 			svx::ExtrusionBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
526 			Cancel();
527 			rReq.Ignore ();
528 			break;
529 
530 		case SID_FONTWORK_SHAPE:
531 		case SID_FONTWORK_SHAPE_TYPE:
532 		case SID_FONTWORK_ALIGNMENT:
533 		case SID_FONTWORK_SAME_LETTER_HEIGHTS:
534 		case SID_FONTWORK_CHARACTER_SPACING:
535 		case SID_FONTWORK_KERN_CHARACTER_PAIRS:
536 		case SID_FONTWORK_GALLERY_FLOATER:
537 		case SID_FONTWORK_CHARACTER_SPACING_FLOATER:
538 		case SID_FONTWORK_ALIGNMENT_FLOATER:
539 		case SID_FONTWORK_CHARACTER_SPACING_DIALOG:
540 			svx::FontworkBar::execute( mpDrawView, rReq, GetViewFrame()->GetBindings() );
541 			Cancel();
542 			rReq.Ignore ();
543 			break;
544 
545 		case SID_BMPMASK:
546 		{
547 			GetViewFrame()->ToggleChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() );
548 			GetViewFrame()->GetBindings().Invalidate( SID_BMPMASK );
549 
550 			Cancel();
551 			rReq.Ignore ();
552 		}
553 		break;
554 
555 		case SID_GALLERY:
556 		{
557 			GetViewFrame()->ToggleChildWindow( GalleryChildWindow::GetChildWindowId() );
558 			GetViewFrame()->GetBindings().Invalidate( SID_GALLERY );
559 
560 			Cancel();
561 			rReq.Ignore ();
562 		}
563 		break;
564 
565 		case SID_NAVIGATOR:
566 		{
567 			if ( rReq.GetArgs() )
568 				GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
569 										((const SfxBoolItem&) (rReq.GetArgs()->
570 										Get(SID_NAVIGATOR))).GetValue());
571 			else
572 				GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
573 
574 			GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
575 			Cancel();
576 			rReq.Ignore ();
577 		}
578 		break;
579 
580 		case SID_ANIMATION_OBJECTS:
581 		{
582 			if ( rReq.GetArgs() )
583 				GetViewFrame()->SetChildWindow(
584                     AnimationChildWindow::GetChildWindowId(),
585                     ((const SfxBoolItem&) (rReq.GetArgs()->
586                         Get(SID_ANIMATION_OBJECTS))).GetValue());
587 			else
588 				GetViewFrame()->ToggleChildWindow(
589                     AnimationChildWindow::GetChildWindowId() );
590 
591 			GetViewFrame()->GetBindings().Invalidate(SID_ANIMATION_OBJECTS);
592 			Cancel();
593 			rReq.Ignore ();
594 		}
595 		break;
596 
597 		case SID_CUSTOM_ANIMATION_PANEL:
598 		{
599             // Make the slide transition panel visible (expand it) in the
600             // tool pane.
601             framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
602                 framework::FrameworkHelper::msCustomAnimationTaskPanelURL);
603 
604 			Cancel();
605 			rReq.Done ();
606 		}
607 		break;
608 
609 		case SID_SLIDE_TRANSITIONS_PANEL:
610 		{
611             // Make the slide transition panel visible (expand it) in the
612             // tool pane.
613             framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
614                 framework::FrameworkHelper::msSlideTransitionTaskPanelURL);
615 
616 			Cancel();
617 			rReq.Done ();
618 		}
619 		break;
620 
621 		case SID_3D_WIN:
622 		{
623 			if ( rReq.GetArgs() )
624 				GetViewFrame()->SetChildWindow( Svx3DChildWindow::GetChildWindowId(),
625 										((const SfxBoolItem&) (rReq.GetArgs()->
626 										Get( SID_3D_WIN ))).GetValue());
627 			else
628 				GetViewFrame()->ToggleChildWindow( Svx3DChildWindow::GetChildWindowId() );
629 
630 			GetViewFrame()->GetBindings().Invalidate( SID_3D_WIN );
631 			Cancel();
632 			rReq.Ignore ();
633 		}
634 		break;
635 
636 		case SID_CONVERT_TO_3D_LATHE_FAST:
637 		{
638 			// Der Aufruf ist ausreichend. Die Initialisierung per Start3DCreation und CreateMirrorPolygons
639 			// ist nicht mehr noetig, falls der Parameter sal_True uebergeben wird. Dann wird sofort und
640 			// ohne Benutzereingriff ein gekippter Rotationskoerper mit einer Achse links neben dem
641 			// Umschliessenden Rechteck der slektierten Objekte gezeichnet.
642 			mpDrawView->SdrEndTextEdit();
643 			if(GetActiveWindow())
644 				GetActiveWindow()->EnterWait();
645 			mpDrawView->End3DCreation(sal_True);
646 			Cancel();
647 			rReq.Ignore();
648 			if(GetActiveWindow())
649 				GetActiveWindow()->LeaveWait();
650 		}
651 		break;
652 
653 		case SID_PRESENTATION_DLG:
654 		{
655 			SetCurrentFunction( FuSlideShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
656 			Cancel();
657 		}
658 		break;
659 
660 		case SID_CUSTOMSHOW_DLG:
661 		{
662 			SetCurrentFunction( FuCustomShowDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
663 			Cancel();
664 		}
665 		break;
666 
667 		case SID_EXPAND_PAGE:
668 		{
669 			SetCurrentFunction( FuExpandPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
670 			Cancel();
671 		}
672 		break;
673 
674 		case SID_SUMMARY_PAGE:
675 		{
676 			mpDrawView->SdrEndTextEdit();
677 			SetCurrentFunction( FuSummaryPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
678 			Cancel();
679 		}
680 		break;
681 
682 		case SID_AVMEDIA_PLAYER:
683 		{
684 			GetViewFrame()->ToggleChildWindow( ::avmedia::MediaPlayer::GetChildWindowId() );
685 			GetViewFrame()->GetBindings().Invalidate( SID_AVMEDIA_PLAYER );
686 			Cancel();
687 			rReq.Ignore ();
688 		}
689 		break;
690 
691 		case SID_LAYER_DIALOG_WIN:
692 		{
693 			if ( rReq.GetArgs() )
694 			{
695 				GetViewFrame()->SetChildWindow(
696                     LayerDialogChildWindow::GetChildWindowId(),
697                     ((const SfxBoolItem&) (rReq.GetArgs()->
698                         Get(SID_LAYER_DIALOG_WIN))).GetValue());
699 			}
700 			else
701 			{
702 				GetViewFrame()->ToggleChildWindow(
703                     LayerDialogChildWindow::GetChildWindowId());
704 			}
705 
706 			GetViewFrame()->GetBindings().Invalidate(SID_LAYER_DIALOG_WIN);
707 			Cancel();
708 			rReq.Ignore ();
709 		}
710 		break;
711 
712         case SID_DISPLAY_MASTER_BACKGROUND:
713         case SID_DISPLAY_MASTER_OBJECTS:
714         {
715             // Determine current page and toggle visibility of layers
716             // associated with master page background or master page shapes.
717             SdPage* pPage = GetActualPage();
718             if (pPage != NULL
719                 && GetDoc() != NULL)
720             {
721                 SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
722                 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
723                 sal_uInt8 aLayerId;
724                 if (nSId == SID_DISPLAY_MASTER_BACKGROUND)
725                     aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
726                 else
727                     aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
728                 aVisibleLayers.Set(aLayerId, !aVisibleLayers.IsSet(aLayerId));
729                 pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
730             }
731             Cancel();
732             rReq.Ignore ();
733         }
734         break;
735 
736 		default:
737 		{
738 			DBG_ASSERT( 0, "Slot ohne Funktion" );
739 			Cancel();
740 			rReq.Ignore ();
741 		}
742 		break;
743 	}
744 }
745 
746 } // end of namespace sd
747