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