xref: /AOO41X/main/sd/source/ui/func/fusel.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sd.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include "fusel.hxx"
33*cdf0e10cSrcweir #include <vos/process.hxx>
34*cdf0e10cSrcweir #include <basic/sbstar.hxx>
35*cdf0e10cSrcweir #include <svx/svdpagv.hxx>
36*cdf0e10cSrcweir #include <svx/svdogrp.hxx>
37*cdf0e10cSrcweir #include <svx/polysc3d.hxx>
38*cdf0e10cSrcweir #include "drawview.hxx"
39*cdf0e10cSrcweir #include <svtools/imapobj.hxx>
40*cdf0e10cSrcweir #include <svl/urihelper.hxx>
41*cdf0e10cSrcweir #include <unotools/localfilehelper.hxx>
42*cdf0e10cSrcweir #include <svx/svxids.hrc>
43*cdf0e10cSrcweir #include <svx/xfillit0.hxx>
44*cdf0e10cSrcweir #include <sfx2/app.hxx>
45*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
46*cdf0e10cSrcweir #include <svl/aeitem.hxx>
47*cdf0e10cSrcweir #include <svl/stritem.hxx>
48*cdf0e10cSrcweir #include <svl/intitem.hxx>
49*cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
50*cdf0e10cSrcweir #include <tools/urlobj.hxx>
51*cdf0e10cSrcweir #include <sfx2/docfile.hxx>
52*cdf0e10cSrcweir #include <tools/debug.hxx>
53*cdf0e10cSrcweir #include <editeng/eeitem.hxx>
54*cdf0e10cSrcweir #include <editeng/flditem.hxx>
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir #include <svx/svdotable.hxx>
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir #include "app.hrc"
59*cdf0e10cSrcweir #include "strings.hrc"
60*cdf0e10cSrcweir #include "res_bmp.hrc"
61*cdf0e10cSrcweir #include "GraphicDocShell.hxx"
62*cdf0e10cSrcweir #include "app.hxx"
63*cdf0e10cSrcweir #include "DrawDocShell.hxx"
64*cdf0e10cSrcweir #include "stlpool.hxx"
65*cdf0e10cSrcweir #include "anmdef.hxx"
66*cdf0e10cSrcweir #include "anminfo.hxx"
67*cdf0e10cSrcweir #include "fudraw.hxx"
68*cdf0e10cSrcweir #include "ViewShell.hxx"
69*cdf0e10cSrcweir #include "ViewShellBase.hxx"
70*cdf0e10cSrcweir #ifndef SD_FRAMW_VIEW_HXX
71*cdf0e10cSrcweir #include "FrameView.hxx"
72*cdf0e10cSrcweir #endif
73*cdf0e10cSrcweir #include "View.hxx"
74*cdf0e10cSrcweir #ifndef SD_WINDOW_SHELL_HXX
75*cdf0e10cSrcweir #include "Window.hxx"
76*cdf0e10cSrcweir #endif
77*cdf0e10cSrcweir #include "drawdoc.hxx"
78*cdf0e10cSrcweir #include "sdpage.hxx"
79*cdf0e10cSrcweir #include "DrawViewShell.hxx"
80*cdf0e10cSrcweir #include "ToolBarManager.hxx"
81*cdf0e10cSrcweir #include "pgjump.hxx"
82*cdf0e10cSrcweir #include <svx/globl3d.hxx>
83*cdf0e10cSrcweir #include "Client.hxx"
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir #include "slideshow.hxx"
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir // #108981#
88*cdf0e10cSrcweir #include <svx/svdundo.hxx>
89*cdf0e10cSrcweir #include <avmedia/mediawindow.hxx>
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir #include <svx/sdrhittesthelper.hxx>
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir using namespace ::com::sun::star;
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir namespace sd {
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir TYPEINIT1( FuSelection, FuDraw );
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir /*************************************************************************
100*cdf0e10cSrcweir |*
101*cdf0e10cSrcweir |* Konstruktor
102*cdf0e10cSrcweir |*
103*cdf0e10cSrcweir \************************************************************************/
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir FuSelection::FuSelection (
106*cdf0e10cSrcweir     ViewShell* pViewSh,
107*cdf0e10cSrcweir     ::sd::Window* pWin,
108*cdf0e10cSrcweir     ::sd::View* pView,
109*cdf0e10cSrcweir     SdDrawDocument* pDoc,
110*cdf0e10cSrcweir     SfxRequest& rReq)
111*cdf0e10cSrcweir     : FuDraw(pViewSh, pWin, pView, pDoc, rReq),
112*cdf0e10cSrcweir       bTempRotation(sal_False),
113*cdf0e10cSrcweir       bSelectionChanged(sal_False),
114*cdf0e10cSrcweir       bHideAndAnimate(sal_False),
115*cdf0e10cSrcweir       pHdl(NULL),
116*cdf0e10cSrcweir       bSuppressChangesOfSelection(sal_False),
117*cdf0e10cSrcweir       bMirrorSide0(sal_False),
118*cdf0e10cSrcweir       nEditMode(SID_BEZIER_MOVE),
119*cdf0e10cSrcweir       pWaterCanCandidate(NULL)
120*cdf0e10cSrcweir {
121*cdf0e10cSrcweir }
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir FunctionReference FuSelection::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
124*cdf0e10cSrcweir {
125*cdf0e10cSrcweir 	FunctionReference xFunc( new FuSelection( pViewSh, pWin, pView, pDoc, rReq ) );
126*cdf0e10cSrcweir 	xFunc->DoExecute(rReq);
127*cdf0e10cSrcweir 	return xFunc;
128*cdf0e10cSrcweir }
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir void FuSelection::DoExecute( SfxRequest& rReq )
131*cdf0e10cSrcweir {
132*cdf0e10cSrcweir 	FuDraw::DoExecute( rReq );
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir     // Objektbar auswaehlen
135*cdf0e10cSrcweir     SelectionHasChanged();
136*cdf0e10cSrcweir }
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir /*************************************************************************
139*cdf0e10cSrcweir |*
140*cdf0e10cSrcweir |* Destruktor
141*cdf0e10cSrcweir |*
142*cdf0e10cSrcweir \************************************************************************/
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir FuSelection::~FuSelection()
145*cdf0e10cSrcweir {
146*cdf0e10cSrcweir 	mpView->UnmarkAllPoints();
147*cdf0e10cSrcweir 	mpView->ResetCreationActive();
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 	if ( mpView->GetDragMode() != SDRDRAG_MOVE )
150*cdf0e10cSrcweir 	{
151*cdf0e10cSrcweir 		mpView->SetDragMode(SDRDRAG_MOVE);
152*cdf0e10cSrcweir 	}
153*cdf0e10cSrcweir }
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir /*************************************************************************
156*cdf0e10cSrcweir |*
157*cdf0e10cSrcweir |* MouseButtonDown-event
158*cdf0e10cSrcweir |*
159*cdf0e10cSrcweir \************************************************************************/
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
162*cdf0e10cSrcweir {
163*cdf0e10cSrcweir     // Hack fuer #?????#
164*cdf0e10cSrcweir     bHideAndAnimate = sal_False;
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir 	pHdl = NULL;
167*cdf0e10cSrcweir 	sal_Bool bReturn = FuDraw::MouseButtonDown(rMEvt);
168*cdf0e10cSrcweir     sal_Bool bWaterCan = SD_MOD()->GetWaterCan();
169*cdf0e10cSrcweir 	const bool bReadOnly = mpDocSh->IsReadOnly();
170*cdf0e10cSrcweir 	// When the right mouse button is pressed then only select objects
171*cdf0e10cSrcweir 	// (and deselect others) as a preparation for showing the context
172*cdf0e10cSrcweir 	// menu.
173*cdf0e10cSrcweir 	const bool bSelectionOnly = rMEvt.IsRight();
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir 	bMBDown = sal_True;
176*cdf0e10cSrcweir     bSelectionChanged = sal_False;
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir 	if ( mpView->IsAction() )
179*cdf0e10cSrcweir 	{
180*cdf0e10cSrcweir 		if ( rMEvt.IsRight() )
181*cdf0e10cSrcweir 			mpView->BckAction();
182*cdf0e10cSrcweir 		return sal_True;
183*cdf0e10cSrcweir 	}
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 	sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
186*cdf0e10cSrcweir 	sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir     // The following code is executed for right clicks as well as for left
189*cdf0e10cSrcweir     // clicks in order to modify the selection for the right button as a
190*cdf0e10cSrcweir     // preparation for the context menu.  The functions BegMarkObject() and
191*cdf0e10cSrcweir     // BegDragObject(), however, are not called for right clicks because a)
192*cdf0e10cSrcweir     // it makes no sense and b) to have IsAction() return sal_False when called
193*cdf0e10cSrcweir     // from Command() which is a prerequisite for the context menu.
194*cdf0e10cSrcweir     if ((rMEvt.IsLeft() || rMEvt.IsRight())
195*cdf0e10cSrcweir 		&& !mpView->IsAction()
196*cdf0e10cSrcweir 		&& (mpView->IsFrameDragSingles() || !mpView->HasMarkablePoints()))
197*cdf0e10cSrcweir     {
198*cdf0e10cSrcweir         /******************************************************************
199*cdf0e10cSrcweir         * KEIN BEZIER_EDITOR
200*cdf0e10cSrcweir         ******************************************************************/
201*cdf0e10cSrcweir         mpWindow->CaptureMouse();
202*cdf0e10cSrcweir         pHdl = mpView->PickHandle(aMDPos);
203*cdf0e10cSrcweir         SdrObject* pObj;
204*cdf0e10cSrcweir         SdrPageView* pPV;
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir         long nAngle0  = GetAngle(aMDPos - mpView->GetRef1());
207*cdf0e10cSrcweir         nAngle0 -= 27000;
208*cdf0e10cSrcweir         nAngle0 = NormAngle360(nAngle0);
209*cdf0e10cSrcweir         bMirrorSide0 = sal_Bool (nAngle0 < 18000L);
210*cdf0e10cSrcweir 
211*cdf0e10cSrcweir         if (!pHdl && mpView->Is3DRotationCreationActive())
212*cdf0e10cSrcweir         {
213*cdf0e10cSrcweir             /******************************************************************
214*cdf0e10cSrcweir             * Wenn 3D-Rotationskoerper erstellt werden sollen, jetzt
215*cdf0e10cSrcweir             * die Erstellung beenden
216*cdf0e10cSrcweir             ******************************************************************/
217*cdf0e10cSrcweir             bSuppressChangesOfSelection = sal_True;
218*cdf0e10cSrcweir 			if(mpWindow)
219*cdf0e10cSrcweir 				mpWindow->EnterWait();
220*cdf0e10cSrcweir             mpView->End3DCreation();
221*cdf0e10cSrcweir             bSuppressChangesOfSelection = sal_False;
222*cdf0e10cSrcweir             mpView->ResetCreationActive();
223*cdf0e10cSrcweir 			if(mpWindow)
224*cdf0e10cSrcweir 				mpWindow->LeaveWait();
225*cdf0e10cSrcweir         }
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir 		sal_Bool bTextEdit = sal_False;
228*cdf0e10cSrcweir         SdrViewEvent aVEvt;
229*cdf0e10cSrcweir 		SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
230*cdf0e10cSrcweir 
231*cdf0e10cSrcweir 		if ( eHit == SDRHIT_TEXTEDITOBJ && ( mpViewShell->GetFrameView()->IsQuickEdit() || dynamic_cast< sdr::table::SdrTableObj* >( aVEvt.pObj ) != NULL ) )
232*cdf0e10cSrcweir 		{
233*cdf0e10cSrcweir 			bTextEdit = sal_True;
234*cdf0e10cSrcweir 		}
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir         if(!bTextEdit
237*cdf0e10cSrcweir 			&& !mpDocSh->IsReadOnly()
238*cdf0e10cSrcweir 			&& ((mpView->IsMarkedHit(aMDPos, nHitLog) && !rMEvt.IsShift() && !rMEvt.IsMod2()) || pHdl != NULL)
239*cdf0e10cSrcweir 			&& (rMEvt.GetClicks() != 2)
240*cdf0e10cSrcweir 			)
241*cdf0e10cSrcweir         {
242*cdf0e10cSrcweir 			if (!pHdl && mpView->Is3DRotationCreationActive())
243*cdf0e10cSrcweir 			{
244*cdf0e10cSrcweir 				// Wechsel Rotationskoerper -> Selektion
245*cdf0e10cSrcweir 				mpView->ResetCreationActive();
246*cdf0e10cSrcweir 			}
247*cdf0e10cSrcweir 			else if (bWaterCan)
248*cdf0e10cSrcweir             {
249*cdf0e10cSrcweir                 // Remember the selected object for proper handling in
250*cdf0e10cSrcweir                 // MouseButtonUp().
251*cdf0e10cSrcweir                 pWaterCanCandidate = pickObject (aMDPos);
252*cdf0e10cSrcweir             }
253*cdf0e10cSrcweir             else
254*cdf0e10cSrcweir 			{
255*cdf0e10cSrcweir 				// Handle oder markiertes Objekt getroffen
256*cdf0e10cSrcweir 				bFirstMouseMove = sal_True;
257*cdf0e10cSrcweir 				aDragTimer.Start();
258*cdf0e10cSrcweir 			}
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir             if ( ! rMEvt.IsRight())
261*cdf0e10cSrcweir                 mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
262*cdf0e10cSrcweir 			bReturn = sal_True;
263*cdf0e10cSrcweir         }
264*cdf0e10cSrcweir         else
265*cdf0e10cSrcweir         {
266*cdf0e10cSrcweir             if (!rMEvt.IsMod2() && mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO))
267*cdf0e10cSrcweir             {
268*cdf0e10cSrcweir                 mpView->BegMacroObj(aMDPos, nHitLog, pObj, pPV, mpWindow);
269*cdf0e10cSrcweir                 bReturn = sal_True;
270*cdf0e10cSrcweir             }
271*cdf0e10cSrcweir             else if ( bTextEdit )
272*cdf0e10cSrcweir             {
273*cdf0e10cSrcweir                 sal_uInt16 nSdrObjKind = aVEvt.pObj->GetObjIdentifier();
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir                 if (aVEvt.pObj->GetObjInventor() == SdrInventor &&
276*cdf0e10cSrcweir                     (nSdrObjKind == OBJ_TEXT ||
277*cdf0e10cSrcweir                      nSdrObjKind == OBJ_TITLETEXT ||
278*cdf0e10cSrcweir                      nSdrObjKind == OBJ_OUTLINETEXT ||
279*cdf0e10cSrcweir                      !aVEvt.pObj->IsEmptyPresObj()))
280*cdf0e10cSrcweir                 {
281*cdf0e10cSrcweir                     // Seamless Editing: Verzweigen zur Texteingabe
282*cdf0e10cSrcweir 					if (!rMEvt.IsShift())
283*cdf0e10cSrcweir 						mpView->UnmarkAll();
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir                     SfxUInt16Item aItem(SID_TEXTEDIT, 1);
286*cdf0e10cSrcweir                     mpViewShell->GetViewFrame()->GetDispatcher()->
287*cdf0e10cSrcweir                     Execute(SID_TEXTEDIT, SFX_CALLMODE_SYNCHRON |
288*cdf0e10cSrcweir                             SFX_CALLMODE_RECORD, &aItem, 0L);
289*cdf0e10cSrcweir 					return bReturn; // VORSICHT, durch den synchronen Slot ist das objekt jetzt geloescht
290*cdf0e10cSrcweir                 }
291*cdf0e10cSrcweir             }
292*cdf0e10cSrcweir 			else if ( !rMEvt.IsMod2() && rMEvt.GetClicks() == 1 &&
293*cdf0e10cSrcweir 			          aVEvt.eEvent == SDREVENT_EXECUTEURL )
294*cdf0e10cSrcweir 	 		{
295*cdf0e10cSrcweir 	            mpWindow->ReleaseMouse();
296*cdf0e10cSrcweir                 SfxStringItem aStrItem(SID_FILE_NAME, aVEvt.pURLField->GetURL());
297*cdf0e10cSrcweir                 SfxStringItem aReferer(SID_REFERER, mpDocSh->GetMedium()->GetName());
298*cdf0e10cSrcweir                 SfxBoolItem aBrowseItem( SID_BROWSE, sal_True );
299*cdf0e10cSrcweir                 SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
300*cdf0e10cSrcweir 				mpWindow->ReleaseMouse();
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir 				if (rMEvt.IsMod1())
303*cdf0e10cSrcweir 				{
304*cdf0e10cSrcweir 					// Im neuen Frame oeffnen
305*cdf0e10cSrcweir                 	pFrame->GetDispatcher()->Execute(SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
306*cdf0e10cSrcweir                     		    &aStrItem, &aBrowseItem, &aReferer, 0L);
307*cdf0e10cSrcweir 				}
308*cdf0e10cSrcweir 				else
309*cdf0e10cSrcweir 				{
310*cdf0e10cSrcweir 					// Im aktuellen Frame oeffnen
311*cdf0e10cSrcweir 					SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
312*cdf0e10cSrcweir                 	pFrame->GetDispatcher()->Execute(SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
313*cdf0e10cSrcweir                     		    &aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
314*cdf0e10cSrcweir 				}
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir 				bReturn = sal_True;
317*cdf0e10cSrcweir 			}
318*cdf0e10cSrcweir             else if(!rMEvt.IsMod2()
319*cdf0e10cSrcweir 				&& mpViewShell->ISA(DrawViewShell)
320*cdf0e10cSrcweir 				)
321*cdf0e10cSrcweir             {
322*cdf0e10cSrcweir 				if(mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER))
323*cdf0e10cSrcweir 				{
324*cdf0e10cSrcweir 					// Animate object when not just selecting.
325*cdf0e10cSrcweir 					if ( ! bSelectionOnly)
326*cdf0e10cSrcweir 						bReturn = AnimateObj(pObj, aMDPos);
327*cdf0e10cSrcweir 
328*cdf0e10cSrcweir 					if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
329*cdf0e10cSrcweir 					{
330*cdf0e10cSrcweir 						if(rMEvt.GetClicks() == 1)
331*cdf0e10cSrcweir 						{
332*cdf0e10cSrcweir 							// In die Gruppe hineinschauen
333*cdf0e10cSrcweir 							if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
334*cdf0e10cSrcweir 								bReturn = AnimateObj(pObj, aMDPos);
335*cdf0e10cSrcweir 						}
336*cdf0e10cSrcweir 						else if( !bReadOnly && rMEvt.GetClicks() == 2)
337*cdf0e10cSrcweir 						{
338*cdf0e10cSrcweir 							// Neu: Doppelklick auf selektiertes Gruppenobjekt
339*cdf0e10cSrcweir 							// Gruppe betreten
340*cdf0e10cSrcweir 							if ( ! bSelectionOnly
341*cdf0e10cSrcweir 								&& pObj
342*cdf0e10cSrcweir 								&& pObj->GetPage() == pPV->GetPage())
343*cdf0e10cSrcweir 								bReturn = pPV->EnterGroup(pObj);
344*cdf0e10cSrcweir 						}
345*cdf0e10cSrcweir 					}
346*cdf0e10cSrcweir 				}
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir 				// #i71727# replaced else here with two possibilities, once the original else (!pObj)
349*cdf0e10cSrcweir 				// and also ignoring the found object when it's on a masterpage
350*cdf0e10cSrcweir 				if(!pObj || (pObj->GetPage() && pObj->GetPage()->IsMasterPage()))
351*cdf0e10cSrcweir 				{
352*cdf0e10cSrcweir 					if(mpView->IsGroupEntered() && 2 == rMEvt.GetClicks())
353*cdf0e10cSrcweir 					{
354*cdf0e10cSrcweir 						// New: double click on empty space/on obj on MasterPage, leave group
355*cdf0e10cSrcweir 						mpView->LeaveOneGroup();
356*cdf0e10cSrcweir 						bReturn = sal_True;
357*cdf0e10cSrcweir 					}
358*cdf0e10cSrcweir 				}
359*cdf0e10cSrcweir 			}
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir             if (!bReturn)
362*cdf0e10cSrcweir             {
363*cdf0e10cSrcweir                 if (bWaterCan)
364*cdf0e10cSrcweir                 {
365*cdf0e10cSrcweir                     if ( ! (rMEvt.IsShift() || rMEvt.IsMod2()))
366*cdf0e10cSrcweir                     {
367*cdf0e10cSrcweir                         // Find the object under the current mouse position
368*cdf0e10cSrcweir                         // and store it for the MouseButtonUp() method to
369*cdf0e10cSrcweir                         // evaluate.
370*cdf0e10cSrcweir                         pWaterCanCandidate = pickObject (aMDPos);
371*cdf0e10cSrcweir                     }
372*cdf0e10cSrcweir                 }
373*cdf0e10cSrcweir                 else
374*cdf0e10cSrcweir                 {
375*cdf0e10cSrcweir                     bReturn = sal_True;
376*cdf0e10cSrcweir                     sal_Bool bDeactivateOLE = sal_False;
377*cdf0e10cSrcweir 
378*cdf0e10cSrcweir                     if ( !rMEvt.IsShift() && !rMEvt.IsMod2() )
379*cdf0e10cSrcweir                     {
380*cdf0e10cSrcweir                         OSL_ASSERT (mpViewShell->GetViewShell()!=NULL);
381*cdf0e10cSrcweir                         Client* pIPClient = static_cast<Client*>(
382*cdf0e10cSrcweir                             mpViewShell->GetViewShell()->GetIPClient());
383*cdf0e10cSrcweir 
384*cdf0e10cSrcweir                         if (pIPClient && pIPClient->IsObjectInPlaceActive())
385*cdf0e10cSrcweir                         {
386*cdf0e10cSrcweir                             // OLE-Objekt wird im nachfolgenden UnmarkAll() deaktiviert
387*cdf0e10cSrcweir                             bDeactivateOLE = sal_True;
388*cdf0e10cSrcweir                         }
389*cdf0e10cSrcweir 
390*cdf0e10cSrcweir                         mpView->UnmarkAll();
391*cdf0e10cSrcweir                     }
392*cdf0e10cSrcweir 
393*cdf0e10cSrcweir                     sal_Bool bMarked = sal_False;
394*cdf0e10cSrcweir 
395*cdf0e10cSrcweir                     if ( !rMEvt.IsMod1() && !bDeactivateOLE)
396*cdf0e10cSrcweir                     {
397*cdf0e10cSrcweir                         if ( rMEvt.IsMod2() )
398*cdf0e10cSrcweir                         {
399*cdf0e10cSrcweir                             bMarked = mpView->MarkNextObj(aMDPos, nHitLog, rMEvt.IsShift() );
400*cdf0e10cSrcweir                         }
401*cdf0e10cSrcweir                         else
402*cdf0e10cSrcweir                         {
403*cdf0e10cSrcweir                             sal_Bool bToggle = sal_False;
404*cdf0e10cSrcweir 
405*cdf0e10cSrcweir                             if (rMEvt.IsShift() && mpView->GetMarkedObjectList().GetMarkCount() > 1)
406*cdf0e10cSrcweir                             {
407*cdf0e10cSrcweir                                 // Bei Einfachselektion kein Toggle
408*cdf0e10cSrcweir                                 bToggle = sal_True;
409*cdf0e10cSrcweir                             }
410*cdf0e10cSrcweir 
411*cdf0e10cSrcweir                             bMarked = mpView->MarkObj(aMDPos, nHitLog, bToggle, sal_False);
412*cdf0e10cSrcweir                         }
413*cdf0e10cSrcweir                     }
414*cdf0e10cSrcweir 
415*cdf0e10cSrcweir                     if( !bDeactivateOLE )
416*cdf0e10cSrcweir                     {
417*cdf0e10cSrcweir                         if ( !bReadOnly &&
418*cdf0e10cSrcweir                              bMarked                                                   &&
419*cdf0e10cSrcweir                              (!rMEvt.IsShift() || mpView->IsMarkedHit(aMDPos, nHitLog)))
420*cdf0e10cSrcweir                         {
421*cdf0e10cSrcweir                             /**********************************************************
422*cdf0e10cSrcweir                              * Objekt verschieben
423*cdf0e10cSrcweir                              **********************************************************/
424*cdf0e10cSrcweir                             aDragTimer.Start();
425*cdf0e10cSrcweir 
426*cdf0e10cSrcweir                             pHdl=mpView->PickHandle(aMDPos);
427*cdf0e10cSrcweir                             if ( ! rMEvt.IsRight())
428*cdf0e10cSrcweir                                 mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
429*cdf0e10cSrcweir                         }
430*cdf0e10cSrcweir                         else
431*cdf0e10cSrcweir                         {
432*cdf0e10cSrcweir                             /**********************************************************
433*cdf0e10cSrcweir                              * Objekt selektieren
434*cdf0e10cSrcweir                              **********************************************************/
435*cdf0e10cSrcweir                             if ( ! rMEvt.IsRight())
436*cdf0e10cSrcweir                                 mpView->BegMarkObj(aMDPos);
437*cdf0e10cSrcweir                         }
438*cdf0e10cSrcweir                     }
439*cdf0e10cSrcweir 
440*cdf0e10cSrcweir 					if( bMarked && bTempRotation && (nSlotId == SID_OBJECT_ROTATE) && !rMEvt.IsShift() && (rMEvt.GetClicks() != 2) )
441*cdf0e10cSrcweir 					{
442*cdf0e10cSrcweir 						nSlotId = SID_OBJECT_SELECT;
443*cdf0e10cSrcweir 						Activate();
444*cdf0e10cSrcweir 					}
445*cdf0e10cSrcweir 				}
446*cdf0e10cSrcweir             }
447*cdf0e10cSrcweir         }
448*cdf0e10cSrcweir     }
449*cdf0e10cSrcweir     else if ( !bReadOnly
450*cdf0e10cSrcweir 			  && (rMEvt.IsLeft() || rMEvt.IsRight())
451*cdf0e10cSrcweir 			  && !mpView->IsAction())
452*cdf0e10cSrcweir     {
453*cdf0e10cSrcweir         /**********************************************************************
454*cdf0e10cSrcweir         * BEZIER-EDITOR
455*cdf0e10cSrcweir         **********************************************************************/
456*cdf0e10cSrcweir         mpWindow->CaptureMouse();
457*cdf0e10cSrcweir         SdrViewEvent aVEvt;
458*cdf0e10cSrcweir         SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
459*cdf0e10cSrcweir 
460*cdf0e10cSrcweir         if (eHit == SDRHIT_HANDLE && aVEvt.pHdl->GetKind() == HDL_BWGT)
461*cdf0e10cSrcweir         {
462*cdf0e10cSrcweir             /******************************************************************
463*cdf0e10cSrcweir             * Handle draggen
464*cdf0e10cSrcweir             ******************************************************************/
465*cdf0e10cSrcweir             if ( ! rMEvt.IsRight())
466*cdf0e10cSrcweir                 mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, aVEvt.pHdl, nDrgLog);
467*cdf0e10cSrcweir         }
468*cdf0e10cSrcweir         else if (eHit == SDRHIT_MARKEDOBJECT && nEditMode == SID_BEZIER_INSERT)
469*cdf0e10cSrcweir         {
470*cdf0e10cSrcweir             /******************************************************************
471*cdf0e10cSrcweir             * Klebepunkt einfuegen
472*cdf0e10cSrcweir             ******************************************************************/
473*cdf0e10cSrcweir             mpView->BegInsObjPoint(aMDPos, rMEvt.IsMod1());
474*cdf0e10cSrcweir         }
475*cdf0e10cSrcweir         else if (eHit == SDRHIT_MARKEDOBJECT && rMEvt.IsMod1())
476*cdf0e10cSrcweir         {
477*cdf0e10cSrcweir             /******************************************************************
478*cdf0e10cSrcweir             * Klebepunkt selektieren
479*cdf0e10cSrcweir             ******************************************************************/
480*cdf0e10cSrcweir             if (!rMEvt.IsShift())
481*cdf0e10cSrcweir                 mpView->UnmarkAllPoints();
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir             if ( ! rMEvt.IsRight())
484*cdf0e10cSrcweir                 mpView->BegMarkPoints(aMDPos);
485*cdf0e10cSrcweir         }
486*cdf0e10cSrcweir         else if (eHit == SDRHIT_MARKEDOBJECT && !rMEvt.IsShift() && !rMEvt.IsMod2())
487*cdf0e10cSrcweir         {
488*cdf0e10cSrcweir             /******************************************************************
489*cdf0e10cSrcweir             * Objekt verschieben
490*cdf0e10cSrcweir             ******************************************************************/
491*cdf0e10cSrcweir             if ( ! rMEvt.IsRight())
492*cdf0e10cSrcweir                 mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, NULL, nDrgLog);
493*cdf0e10cSrcweir         }
494*cdf0e10cSrcweir         else if (eHit == SDRHIT_HANDLE)
495*cdf0e10cSrcweir         {
496*cdf0e10cSrcweir             /******************************************************************
497*cdf0e10cSrcweir             * Klebepunkt selektieren
498*cdf0e10cSrcweir             ******************************************************************/
499*cdf0e10cSrcweir             if (!mpView->IsPointMarked(*aVEvt.pHdl) || rMEvt.IsShift())
500*cdf0e10cSrcweir             {
501*cdf0e10cSrcweir                 if (!rMEvt.IsShift())
502*cdf0e10cSrcweir                 {
503*cdf0e10cSrcweir                     mpView->UnmarkAllPoints();
504*cdf0e10cSrcweir                     pHdl = mpView->PickHandle(aMDPos);
505*cdf0e10cSrcweir                 }
506*cdf0e10cSrcweir                 else
507*cdf0e10cSrcweir                 {
508*cdf0e10cSrcweir                     if (mpView->IsPointMarked(*aVEvt.pHdl))
509*cdf0e10cSrcweir                     {
510*cdf0e10cSrcweir                         mpView->UnmarkPoint(*aVEvt.pHdl);
511*cdf0e10cSrcweir                         pHdl = NULL;
512*cdf0e10cSrcweir                     }
513*cdf0e10cSrcweir                     else
514*cdf0e10cSrcweir                     {
515*cdf0e10cSrcweir                         pHdl = mpView->PickHandle(aMDPos);
516*cdf0e10cSrcweir                     }
517*cdf0e10cSrcweir                 }
518*cdf0e10cSrcweir 
519*cdf0e10cSrcweir                 if (pHdl)
520*cdf0e10cSrcweir                 {
521*cdf0e10cSrcweir                     mpView->MarkPoint(*pHdl);
522*cdf0e10cSrcweir                     if ( ! rMEvt.IsRight())
523*cdf0e10cSrcweir                         mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
524*cdf0e10cSrcweir                 }
525*cdf0e10cSrcweir             }
526*cdf0e10cSrcweir 			else
527*cdf0e10cSrcweir 			{
528*cdf0e10cSrcweir 				// #90239# point IS marked and NO shift is pressed. Start
529*cdf0e10cSrcweir 				// dragging of selected point(s)
530*cdf0e10cSrcweir 				pHdl = mpView->PickHandle(aMDPos);
531*cdf0e10cSrcweir 				if(pHdl)
532*cdf0e10cSrcweir                     if ( ! rMEvt.IsRight())
533*cdf0e10cSrcweir                         mpView->BegDragObj(aMDPos, (OutputDevice*)NULL, pHdl, nDrgLog);
534*cdf0e10cSrcweir 			}
535*cdf0e10cSrcweir         }
536*cdf0e10cSrcweir         else
537*cdf0e10cSrcweir         {
538*cdf0e10cSrcweir             /******************************************************************
539*cdf0e10cSrcweir             * Objekt selektieren oder draggen
540*cdf0e10cSrcweir             ******************************************************************/
541*cdf0e10cSrcweir             if (!rMEvt.IsShift() && !rMEvt.IsMod2() && eHit == SDRHIT_UNMARKEDOBJECT)
542*cdf0e10cSrcweir             {
543*cdf0e10cSrcweir                mpView->UnmarkAllObj();
544*cdf0e10cSrcweir             }
545*cdf0e10cSrcweir 
546*cdf0e10cSrcweir             sal_Bool bMarked = sal_False;
547*cdf0e10cSrcweir 
548*cdf0e10cSrcweir             if (!rMEvt.IsMod1())
549*cdf0e10cSrcweir             {
550*cdf0e10cSrcweir                 if (rMEvt.IsMod2())
551*cdf0e10cSrcweir                 {
552*cdf0e10cSrcweir                     bMarked = mpView->MarkNextObj(aMDPos, nHitLog, rMEvt.IsShift());
553*cdf0e10cSrcweir                 }
554*cdf0e10cSrcweir                 else
555*cdf0e10cSrcweir                 {
556*cdf0e10cSrcweir                     bMarked = mpView->MarkObj(aMDPos, nHitLog, rMEvt.IsShift(), sal_False);
557*cdf0e10cSrcweir                 }
558*cdf0e10cSrcweir             }
559*cdf0e10cSrcweir 
560*cdf0e10cSrcweir             if (bMarked &&
561*cdf0e10cSrcweir                 (!rMEvt.IsShift() || eHit == SDRHIT_MARKEDOBJECT))
562*cdf0e10cSrcweir             {
563*cdf0e10cSrcweir                 // Objekt verschieben
564*cdf0e10cSrcweir                 if ( ! rMEvt.IsRight())
565*cdf0e10cSrcweir                     mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, aVEvt.pHdl, nDrgLog);
566*cdf0e10cSrcweir             }
567*cdf0e10cSrcweir             else if (mpView->AreObjectsMarked())
568*cdf0e10cSrcweir             {
569*cdf0e10cSrcweir                 /**************************************************************
570*cdf0e10cSrcweir                 * Klebepunkt selektieren
571*cdf0e10cSrcweir                 **************************************************************/
572*cdf0e10cSrcweir                 if (!rMEvt.IsShift())
573*cdf0e10cSrcweir                     mpView->UnmarkAllPoints();
574*cdf0e10cSrcweir 
575*cdf0e10cSrcweir                 if ( ! rMEvt.IsRight())
576*cdf0e10cSrcweir                     mpView->BegMarkPoints(aMDPos);
577*cdf0e10cSrcweir             }
578*cdf0e10cSrcweir             else
579*cdf0e10cSrcweir             {
580*cdf0e10cSrcweir                 /**************************************************************
581*cdf0e10cSrcweir                 * Objekt selektieren
582*cdf0e10cSrcweir                 **************************************************************/
583*cdf0e10cSrcweir                 if ( ! rMEvt.IsRight())
584*cdf0e10cSrcweir                     mpView->BegMarkObj(aMDPos);
585*cdf0e10cSrcweir             }
586*cdf0e10cSrcweir 
587*cdf0e10cSrcweir             ForcePointer(&rMEvt);
588*cdf0e10cSrcweir         }
589*cdf0e10cSrcweir     }
590*cdf0e10cSrcweir 
591*cdf0e10cSrcweir 	if (!bIsInDragMode)
592*cdf0e10cSrcweir 	{
593*cdf0e10cSrcweir 		ForcePointer(&rMEvt);
594*cdf0e10cSrcweir 	}
595*cdf0e10cSrcweir 
596*cdf0e10cSrcweir 	return bReturn;
597*cdf0e10cSrcweir }
598*cdf0e10cSrcweir 
599*cdf0e10cSrcweir /*************************************************************************
600*cdf0e10cSrcweir |*
601*cdf0e10cSrcweir |* MouseMove-event
602*cdf0e10cSrcweir |*
603*cdf0e10cSrcweir \************************************************************************/
604*cdf0e10cSrcweir 
605*cdf0e10cSrcweir sal_Bool FuSelection::MouseMove(const MouseEvent& rMEvt)
606*cdf0e10cSrcweir {
607*cdf0e10cSrcweir 	sal_Bool bReturn = FuDraw::MouseMove(rMEvt);
608*cdf0e10cSrcweir 
609*cdf0e10cSrcweir     if (aDragTimer.IsActive())
610*cdf0e10cSrcweir 	{
611*cdf0e10cSrcweir         if(bFirstMouseMove)
612*cdf0e10cSrcweir         {
613*cdf0e10cSrcweir 			bFirstMouseMove = sal_False;
614*cdf0e10cSrcweir         }
615*cdf0e10cSrcweir 		else
616*cdf0e10cSrcweir         {
617*cdf0e10cSrcweir             aDragTimer.Stop();
618*cdf0e10cSrcweir         }
619*cdf0e10cSrcweir 	}
620*cdf0e10cSrcweir 
621*cdf0e10cSrcweir     if (mpView->IsAction())
622*cdf0e10cSrcweir 	{
623*cdf0e10cSrcweir 		Point aPix(rMEvt.GetPosPixel());
624*cdf0e10cSrcweir 		Point aPnt(mpWindow->PixelToLogic(aPix));
625*cdf0e10cSrcweir 
626*cdf0e10cSrcweir 		ForceScroll(aPix);
627*cdf0e10cSrcweir 
628*cdf0e10cSrcweir         if (mpView->IsInsObjPoint())
629*cdf0e10cSrcweir         {
630*cdf0e10cSrcweir             mpView->MovInsObjPoint(aPnt);
631*cdf0e10cSrcweir         }
632*cdf0e10cSrcweir         else
633*cdf0e10cSrcweir         {
634*cdf0e10cSrcweir             mpView->MovAction(aPnt);
635*cdf0e10cSrcweir         }
636*cdf0e10cSrcweir     }
637*cdf0e10cSrcweir 
638*cdf0e10cSrcweir 	ForcePointer(&rMEvt);
639*cdf0e10cSrcweir 
640*cdf0e10cSrcweir 	return (bReturn);
641*cdf0e10cSrcweir }
642*cdf0e10cSrcweir 
643*cdf0e10cSrcweir /*************************************************************************
644*cdf0e10cSrcweir |*
645*cdf0e10cSrcweir |* MouseButtonUp-event
646*cdf0e10cSrcweir |*
647*cdf0e10cSrcweir \************************************************************************/
648*cdf0e10cSrcweir 
649*cdf0e10cSrcweir sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
650*cdf0e10cSrcweir {
651*cdf0e10cSrcweir     sal_Bool bReturn = sal_False;
652*cdf0e10cSrcweir 	// When the right mouse button is pressed then only select objects
653*cdf0e10cSrcweir 	// (and deselect others) as a preparation for showing the context
654*cdf0e10cSrcweir 	// menu.
655*cdf0e10cSrcweir 	const bool bSelectionOnly = rMEvt.IsRight();
656*cdf0e10cSrcweir 
657*cdf0e10cSrcweir     if (bHideAndAnimate)
658*cdf0e10cSrcweir     {
659*cdf0e10cSrcweir         // Animation laeuft noch -> sofort returnieren
660*cdf0e10cSrcweir         bHideAndAnimate = sal_False;
661*cdf0e10cSrcweir         pHdl = NULL;
662*cdf0e10cSrcweir         mpWindow->ReleaseMouse();
663*cdf0e10cSrcweir         return(sal_True);
664*cdf0e10cSrcweir     }
665*cdf0e10cSrcweir 
666*cdf0e10cSrcweir 	if (aDragTimer.IsActive() )
667*cdf0e10cSrcweir 	{
668*cdf0e10cSrcweir 		aDragTimer.Stop();
669*cdf0e10cSrcweir 		bIsInDragMode = sal_False;
670*cdf0e10cSrcweir 	}
671*cdf0e10cSrcweir 
672*cdf0e10cSrcweir 	if( !mpView )
673*cdf0e10cSrcweir 		return (sal_False);
674*cdf0e10cSrcweir 
675*cdf0e10cSrcweir     Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
676*cdf0e10cSrcweir     sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
677*cdf0e10cSrcweir     sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
678*cdf0e10cSrcweir 
679*cdf0e10cSrcweir     if (mpView->IsFrameDragSingles() || !mpView->HasMarkablePoints())
680*cdf0e10cSrcweir     {
681*cdf0e10cSrcweir         /**********************************************************************
682*cdf0e10cSrcweir         * KEIN BEZIER_EDITOR
683*cdf0e10cSrcweir         **********************************************************************/
684*cdf0e10cSrcweir         if ( mpView->IsDragObj() )
685*cdf0e10cSrcweir         {
686*cdf0e10cSrcweir             /******************************************************************
687*cdf0e10cSrcweir             * Objekt wurde verschoben
688*cdf0e10cSrcweir             ******************************************************************/
689*cdf0e10cSrcweir             FrameView* pFrameView = mpViewShell->GetFrameView();
690*cdf0e10cSrcweir             sal_Bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
691*cdf0e10cSrcweir 
692*cdf0e10cSrcweir             if (bDragWithCopy)
693*cdf0e10cSrcweir             {
694*cdf0e10cSrcweir                 bDragWithCopy = !mpView->IsPresObjSelected(sal_False, sal_True);
695*cdf0e10cSrcweir             }
696*cdf0e10cSrcweir 
697*cdf0e10cSrcweir             mpView->SetDragWithCopy(bDragWithCopy);
698*cdf0e10cSrcweir             mpView->EndDragObj( mpView->IsDragWithCopy() );
699*cdf0e10cSrcweir 
700*cdf0e10cSrcweir             mpView->ForceMarkedToAnotherPage();
701*cdf0e10cSrcweir 
702*cdf0e10cSrcweir             if (!rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() &&
703*cdf0e10cSrcweir                 !bSelectionChanged                   &&
704*cdf0e10cSrcweir                 Abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
705*cdf0e10cSrcweir                 Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
706*cdf0e10cSrcweir             {
707*cdf0e10cSrcweir                 /**************************************************************
708*cdf0e10cSrcweir                 * Toggle zw. Selektion und Rotation
709*cdf0e10cSrcweir                 **************************************************************/
710*cdf0e10cSrcweir                 SdrObject* pSingleObj = NULL;
711*cdf0e10cSrcweir                 sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount();
712*cdf0e10cSrcweir 
713*cdf0e10cSrcweir                 if (nMarkCount==1)
714*cdf0e10cSrcweir                 {
715*cdf0e10cSrcweir                     pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
716*cdf0e10cSrcweir                 }
717*cdf0e10cSrcweir 
718*cdf0e10cSrcweir                 if (nSlotId == SID_OBJECT_SELECT
719*cdf0e10cSrcweir 					&& mpView->IsRotateAllowed()
720*cdf0e10cSrcweir 
721*cdf0e10cSrcweir 					&& (rMEvt.GetClicks() != 2)
722*cdf0e10cSrcweir 					&& (mpViewShell->GetFrameView()->IsClickChangeRotation()
723*cdf0e10cSrcweir 						|| (pSingleObj
724*cdf0e10cSrcweir 							&& pSingleObj->GetObjInventor()==E3dInventor))
725*cdf0e10cSrcweir 					&& ! bSelectionOnly)
726*cdf0e10cSrcweir 
727*cdf0e10cSrcweir                 {
728*cdf0e10cSrcweir                     bTempRotation = sal_True;
729*cdf0e10cSrcweir                     nSlotId = SID_OBJECT_ROTATE;
730*cdf0e10cSrcweir                     Activate();
731*cdf0e10cSrcweir                 }
732*cdf0e10cSrcweir                 else if (nSlotId == SID_OBJECT_ROTATE)
733*cdf0e10cSrcweir                 {
734*cdf0e10cSrcweir                     nSlotId = SID_OBJECT_SELECT;
735*cdf0e10cSrcweir                     Activate();
736*cdf0e10cSrcweir                 }
737*cdf0e10cSrcweir             }
738*cdf0e10cSrcweir             else if (nSlotId == SID_CONVERT_TO_3D_LATHE)
739*cdf0e10cSrcweir             {
740*cdf0e10cSrcweir                 if (!pHdl)
741*cdf0e10cSrcweir                 {
742*cdf0e10cSrcweir                     bSuppressChangesOfSelection = sal_True;
743*cdf0e10cSrcweir                     mpView->Start3DCreation();
744*cdf0e10cSrcweir                     bSuppressChangesOfSelection = sal_False;
745*cdf0e10cSrcweir                 }
746*cdf0e10cSrcweir                 else if (pHdl->GetKind() != HDL_MIRX &&
747*cdf0e10cSrcweir                          pHdl->GetKind() != HDL_REF1 &&
748*cdf0e10cSrcweir                          pHdl->GetKind() != HDL_REF2 && mpView->Is3DRotationCreationActive())
749*cdf0e10cSrcweir                 {
750*cdf0e10cSrcweir                     /*********************************************************
751*cdf0e10cSrcweir                     * Wenn 3D-Rotationskoerper erstellt werden sollen, jetzt
752*cdf0e10cSrcweir                     * die Erstellung beenden
753*cdf0e10cSrcweir                     **********************************************************/
754*cdf0e10cSrcweir                      long nAngle1  = GetAngle(aPnt - mpView->GetRef1());
755*cdf0e10cSrcweir                      nAngle1 -= 27000;
756*cdf0e10cSrcweir                      nAngle1 = NormAngle360(nAngle1);
757*cdf0e10cSrcweir                      sal_Bool bMirrorSide1 = sal_Bool (nAngle1 < 18000L);
758*cdf0e10cSrcweir 
759*cdf0e10cSrcweir                      if (bMirrorSide0 != bMirrorSide1)
760*cdf0e10cSrcweir                      {
761*cdf0e10cSrcweir                          bSuppressChangesOfSelection = sal_True;
762*cdf0e10cSrcweir 						if(mpWindow)
763*cdf0e10cSrcweir 							mpWindow->EnterWait();
764*cdf0e10cSrcweir                          mpView->End3DCreation();
765*cdf0e10cSrcweir                          bSuppressChangesOfSelection = sal_False;
766*cdf0e10cSrcweir                          nSlotId = SID_OBJECT_SELECT;
767*cdf0e10cSrcweir 						if(mpWindow)
768*cdf0e10cSrcweir 							mpWindow->LeaveWait();
769*cdf0e10cSrcweir                          Activate();
770*cdf0e10cSrcweir                     }
771*cdf0e10cSrcweir                 }
772*cdf0e10cSrcweir             }
773*cdf0e10cSrcweir         }
774*cdf0e10cSrcweir         else if (rMEvt.IsMod1()
775*cdf0e10cSrcweir 			&& !rMEvt.IsMod2()
776*cdf0e10cSrcweir 			&& Abs(aPnt.X() - aMDPos.X()) < nDrgLog
777*cdf0e10cSrcweir 			&& Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
778*cdf0e10cSrcweir         {
779*cdf0e10cSrcweir             // Gruppe betreten
780*cdf0e10cSrcweir             mpView->MarkObj(aPnt, nHitLog, rMEvt.IsShift(), rMEvt.IsMod1());
781*cdf0e10cSrcweir         }
782*cdf0e10cSrcweir 
783*cdf0e10cSrcweir         if (mpView->IsAction() )
784*cdf0e10cSrcweir         {
785*cdf0e10cSrcweir             mpView->EndAction();
786*cdf0e10cSrcweir         }
787*cdf0e10cSrcweir 
788*cdf0e10cSrcweir         if( SD_MOD()->GetWaterCan() )
789*cdf0e10cSrcweir         {
790*cdf0e10cSrcweir             if( rMEvt.IsRight() )
791*cdf0e10cSrcweir             {
792*cdf0e10cSrcweir                 // Bei rechter Maustaste wird im Giesskannenmodus ein Undo ausgefuehrt
793*cdf0e10cSrcweir                 mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_UNDO, SFX_CALLMODE_ASYNCHRON );
794*cdf0e10cSrcweir             }
795*cdf0e10cSrcweir             else if (pWaterCanCandidate != NULL)
796*cdf0e10cSrcweir             {
797*cdf0e10cSrcweir                 // Is the candiate object still under the mouse?
798*cdf0e10cSrcweir                 if (pickObject (aPnt) == pWaterCanCandidate)
799*cdf0e10cSrcweir                 {
800*cdf0e10cSrcweir                     SdStyleSheetPool* pPool = static_cast<SdStyleSheetPool*>(
801*cdf0e10cSrcweir                         mpDocSh->GetStyleSheetPool());
802*cdf0e10cSrcweir                     if (pPool != NULL)
803*cdf0e10cSrcweir                     {
804*cdf0e10cSrcweir                         SfxStyleSheet* pStyleSheet = static_cast<SfxStyleSheet*>(
805*cdf0e10cSrcweir                             pPool->GetActualStyleSheet());
806*cdf0e10cSrcweir                         if (pStyleSheet != NULL && mpView->IsUndoEnabled() )
807*cdf0e10cSrcweir                         {
808*cdf0e10cSrcweir 							// #108981#
809*cdf0e10cSrcweir 							// Added UNDOs for the WaterCan mode. This was never done in
810*cdf0e10cSrcweir 							// the past, thus it was missing all the time.
811*cdf0e10cSrcweir 							SdrUndoAction* pUndoAttr = mpDoc->GetSdrUndoFactory().CreateUndoAttrObject(*pWaterCanCandidate, sal_True, sal_True);
812*cdf0e10cSrcweir 							mpView->BegUndo(pUndoAttr->GetComment());
813*cdf0e10cSrcweir 							mpView->AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoGeoObject(*pWaterCanCandidate));
814*cdf0e10cSrcweir 							mpView->AddUndo(pUndoAttr);
815*cdf0e10cSrcweir 
816*cdf0e10cSrcweir 							pWaterCanCandidate->SetStyleSheet (pStyleSheet, sal_False);
817*cdf0e10cSrcweir 
818*cdf0e10cSrcweir 							// #108981#
819*cdf0e10cSrcweir 							mpView->EndUndo();
820*cdf0e10cSrcweir                         }
821*cdf0e10cSrcweir                     }
822*cdf0e10cSrcweir                 }
823*cdf0e10cSrcweir             }
824*cdf0e10cSrcweir             // else when there has been no object under the mouse when the
825*cdf0e10cSrcweir             // button was pressed then nothing happens even when there is
826*cdf0e10cSrcweir             // one now.
827*cdf0e10cSrcweir         }
828*cdf0e10cSrcweir 
829*cdf0e10cSrcweir         sal_uInt16 nClicks = rMEvt.GetClicks();
830*cdf0e10cSrcweir 
831*cdf0e10cSrcweir         if (nClicks == 2 && rMEvt.IsLeft() && bMBDown &&
832*cdf0e10cSrcweir             !rMEvt.IsMod1() && !rMEvt.IsShift() )
833*cdf0e10cSrcweir         {
834*cdf0e10cSrcweir             DoubleClick(rMEvt);
835*cdf0e10cSrcweir         }
836*cdf0e10cSrcweir 
837*cdf0e10cSrcweir         bMBDown = sal_False;
838*cdf0e10cSrcweir 
839*cdf0e10cSrcweir         ForcePointer(&rMEvt);
840*cdf0e10cSrcweir         pHdl = NULL;
841*cdf0e10cSrcweir         mpWindow->ReleaseMouse();
842*cdf0e10cSrcweir         SdrObject* pSingleObj = NULL;
843*cdf0e10cSrcweir         sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount();
844*cdf0e10cSrcweir 
845*cdf0e10cSrcweir         if (nMarkCount==1)
846*cdf0e10cSrcweir         {
847*cdf0e10cSrcweir             pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
848*cdf0e10cSrcweir         }
849*cdf0e10cSrcweir 
850*cdf0e10cSrcweir         if ( (nSlotId != SID_OBJECT_SELECT && nMarkCount==0)                    ||
851*cdf0e10cSrcweir              ( mpView->GetDragMode() == SDRDRAG_CROOK &&
852*cdf0e10cSrcweir               !mpView->IsCrookAllowed( mpView->IsCrookNoContortion() ) ) ||
853*cdf0e10cSrcweir              ( mpView->GetDragMode() == SDRDRAG_SHEAR &&
854*cdf0e10cSrcweir               !mpView->IsShearAllowed() && !mpView->IsDistortAllowed() ) ||
855*cdf0e10cSrcweir              ( nSlotId==SID_CONVERT_TO_3D_LATHE && pSingleObj &&
856*cdf0e10cSrcweir               (pSingleObj->GetObjInventor() != SdrInventor         ||
857*cdf0e10cSrcweir                pSingleObj->GetObjIdentifier() == OBJ_MEASURE) ) )
858*cdf0e10cSrcweir         {
859*cdf0e10cSrcweir 			bReturn = sal_True;
860*cdf0e10cSrcweir 	        ForcePointer(&rMEvt);
861*cdf0e10cSrcweir     	    pHdl = NULL;
862*cdf0e10cSrcweir         	mpWindow->ReleaseMouse();
863*cdf0e10cSrcweir 	        FuDraw::MouseButtonUp(rMEvt);
864*cdf0e10cSrcweir 			mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SYNCHRON);
865*cdf0e10cSrcweir 			return bReturn; // VORSICHT, durch den synchronen Slot ist das objekt jetzt geloescht
866*cdf0e10cSrcweir 		}
867*cdf0e10cSrcweir 
868*cdf0e10cSrcweir         FuDraw::MouseButtonUp(rMEvt);
869*cdf0e10cSrcweir     }
870*cdf0e10cSrcweir     else
871*cdf0e10cSrcweir     {
872*cdf0e10cSrcweir         /**********************************************************************
873*cdf0e10cSrcweir         * BEZIER_EDITOR
874*cdf0e10cSrcweir         **********************************************************************/
875*cdf0e10cSrcweir         if ( mpView->IsAction() )
876*cdf0e10cSrcweir         {
877*cdf0e10cSrcweir             if ( mpView->IsInsObjPoint() )
878*cdf0e10cSrcweir             {
879*cdf0e10cSrcweir                 mpView->EndInsObjPoint(SDRCREATE_FORCEEND);
880*cdf0e10cSrcweir             }
881*cdf0e10cSrcweir             else if ( mpView->IsDragObj() )
882*cdf0e10cSrcweir             {
883*cdf0e10cSrcweir                 FrameView* pFrameView = mpViewShell->GetFrameView();
884*cdf0e10cSrcweir                 sal_Bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
885*cdf0e10cSrcweir 
886*cdf0e10cSrcweir                 if (bDragWithCopy)
887*cdf0e10cSrcweir                 {
888*cdf0e10cSrcweir                     bDragWithCopy = !mpView->IsPresObjSelected(sal_False, sal_True);
889*cdf0e10cSrcweir                 }
890*cdf0e10cSrcweir 
891*cdf0e10cSrcweir                 mpView->SetDragWithCopy(bDragWithCopy);
892*cdf0e10cSrcweir                 mpView->EndDragObj( mpView->IsDragWithCopy() );
893*cdf0e10cSrcweir             }
894*cdf0e10cSrcweir             else
895*cdf0e10cSrcweir             {
896*cdf0e10cSrcweir                 mpView->EndAction();
897*cdf0e10cSrcweir 
898*cdf0e10cSrcweir                 sal_uInt16 nDrgLog2 = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
899*cdf0e10cSrcweir                 Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
900*cdf0e10cSrcweir 
901*cdf0e10cSrcweir                 if (Abs(aMDPos.X() - aPos.X()) < nDrgLog2 &&
902*cdf0e10cSrcweir                     Abs(aMDPos.Y() - aPos.Y()) < nDrgLog2 &&
903*cdf0e10cSrcweir                     !rMEvt.IsShift() && !rMEvt.IsMod2())
904*cdf0e10cSrcweir                 {
905*cdf0e10cSrcweir                     SdrViewEvent aVEvt;
906*cdf0e10cSrcweir                     SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
907*cdf0e10cSrcweir 
908*cdf0e10cSrcweir                     if (eHit == SDRHIT_NONE)
909*cdf0e10cSrcweir                     {
910*cdf0e10cSrcweir                         // Klick auf der Stelle: deselektieren
911*cdf0e10cSrcweir                         mpView->UnmarkAllObj();
912*cdf0e10cSrcweir                     }
913*cdf0e10cSrcweir                 }
914*cdf0e10cSrcweir             }
915*cdf0e10cSrcweir         }
916*cdf0e10cSrcweir         else if (!rMEvt.IsShift() && rMEvt.IsMod1() && !rMEvt.IsMod2() &&
917*cdf0e10cSrcweir                  Abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
918*cdf0e10cSrcweir                  Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
919*cdf0e10cSrcweir         {
920*cdf0e10cSrcweir             // Gruppe betreten
921*cdf0e10cSrcweir             mpView->MarkObj(aPnt, nHitLog, sal_False, rMEvt.IsMod1());
922*cdf0e10cSrcweir         }
923*cdf0e10cSrcweir 
924*cdf0e10cSrcweir 
925*cdf0e10cSrcweir         ForcePointer(&rMEvt);
926*cdf0e10cSrcweir         pHdl = NULL;
927*cdf0e10cSrcweir         mpWindow->ReleaseMouse();
928*cdf0e10cSrcweir 
929*cdf0e10cSrcweir         FuDraw::MouseButtonUp(rMEvt);
930*cdf0e10cSrcweir     }
931*cdf0e10cSrcweir 
932*cdf0e10cSrcweir 	return (bReturn);
933*cdf0e10cSrcweir }
934*cdf0e10cSrcweir 
935*cdf0e10cSrcweir /*************************************************************************
936*cdf0e10cSrcweir |*
937*cdf0e10cSrcweir |* Tastaturereignisse bearbeiten
938*cdf0e10cSrcweir |*
939*cdf0e10cSrcweir |* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
940*cdf0e10cSrcweir |* sal_False.
941*cdf0e10cSrcweir |*
942*cdf0e10cSrcweir \************************************************************************/
943*cdf0e10cSrcweir 
944*cdf0e10cSrcweir sal_Bool FuSelection::KeyInput(const KeyEvent& rKEvt)
945*cdf0e10cSrcweir {
946*cdf0e10cSrcweir 	sal_Bool bReturn = sal_False;
947*cdf0e10cSrcweir 
948*cdf0e10cSrcweir     switch (rKEvt.GetKeyCode().GetCode())
949*cdf0e10cSrcweir 	{
950*cdf0e10cSrcweir 		case KEY_ESCAPE:
951*cdf0e10cSrcweir 		{
952*cdf0e10cSrcweir 			bReturn = FuSelection::cancel();
953*cdf0e10cSrcweir         }
954*cdf0e10cSrcweir         break;
955*cdf0e10cSrcweir     }
956*cdf0e10cSrcweir 
957*cdf0e10cSrcweir 	if (!bReturn)
958*cdf0e10cSrcweir 	{
959*cdf0e10cSrcweir 		bReturn = FuDraw::KeyInput(rKEvt);
960*cdf0e10cSrcweir 
961*cdf0e10cSrcweir 		if(mpView->GetMarkedObjectList().GetMarkCount() == 0)
962*cdf0e10cSrcweir 		{
963*cdf0e10cSrcweir 	        mpView->ResetCreationActive();
964*cdf0e10cSrcweir 
965*cdf0e10cSrcweir 			mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
966*cdf0e10cSrcweir 		}
967*cdf0e10cSrcweir 	}
968*cdf0e10cSrcweir 
969*cdf0e10cSrcweir 	return(bReturn);
970*cdf0e10cSrcweir 
971*cdf0e10cSrcweir }
972*cdf0e10cSrcweir 
973*cdf0e10cSrcweir 
974*cdf0e10cSrcweir /*************************************************************************
975*cdf0e10cSrcweir |*
976*cdf0e10cSrcweir |* Function aktivieren
977*cdf0e10cSrcweir |*
978*cdf0e10cSrcweir \************************************************************************/
979*cdf0e10cSrcweir 
980*cdf0e10cSrcweir void FuSelection::Activate()
981*cdf0e10cSrcweir {
982*cdf0e10cSrcweir 	SdrDragMode eMode;
983*cdf0e10cSrcweir     mpView->ResetCreationActive();
984*cdf0e10cSrcweir 	mpView->SetEditMode(SDREDITMODE_EDIT);
985*cdf0e10cSrcweir 
986*cdf0e10cSrcweir 	switch( nSlotId )
987*cdf0e10cSrcweir 	{
988*cdf0e10cSrcweir 		case SID_OBJECT_ROTATE:
989*cdf0e10cSrcweir 		{
990*cdf0e10cSrcweir 			// (gemapter) Slot wird explizit auf Rotate gesetzt #31052#
991*cdf0e10cSrcweir 			if( mpViewShell->ISA(DrawViewShell) )
992*cdf0e10cSrcweir 			{
993*cdf0e10cSrcweir 				sal_uInt16* pSlotArray =
994*cdf0e10cSrcweir                     static_cast<DrawViewShell*>(mpViewShell)->GetSlotArray();
995*cdf0e10cSrcweir 				pSlotArray[ 1 ] = SID_OBJECT_ROTATE;
996*cdf0e10cSrcweir 			}
997*cdf0e10cSrcweir 
998*cdf0e10cSrcweir 			eMode = SDRDRAG_ROTATE;
999*cdf0e10cSrcweir 
1000*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1001*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1002*cdf0e10cSrcweir 		}
1003*cdf0e10cSrcweir 		break;
1004*cdf0e10cSrcweir 
1005*cdf0e10cSrcweir 		case SID_OBJECT_MIRROR:
1006*cdf0e10cSrcweir 		{
1007*cdf0e10cSrcweir 			eMode = SDRDRAG_MIRROR;
1008*cdf0e10cSrcweir 
1009*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1010*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1011*cdf0e10cSrcweir 		}
1012*cdf0e10cSrcweir 		break;
1013*cdf0e10cSrcweir 
1014*cdf0e10cSrcweir 		case SID_OBJECT_CROP:
1015*cdf0e10cSrcweir 		{
1016*cdf0e10cSrcweir 			eMode = SDRDRAG_CROP;
1017*cdf0e10cSrcweir 
1018*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1019*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1020*cdf0e10cSrcweir 		}
1021*cdf0e10cSrcweir 		break;
1022*cdf0e10cSrcweir 
1023*cdf0e10cSrcweir 		case SID_OBJECT_TRANSPARENCE:
1024*cdf0e10cSrcweir 		{
1025*cdf0e10cSrcweir 			eMode = SDRDRAG_TRANSPARENCE;
1026*cdf0e10cSrcweir 
1027*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1028*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1029*cdf0e10cSrcweir 		}
1030*cdf0e10cSrcweir 		break;
1031*cdf0e10cSrcweir 
1032*cdf0e10cSrcweir 		case SID_OBJECT_GRADIENT:
1033*cdf0e10cSrcweir 		{
1034*cdf0e10cSrcweir 			eMode = SDRDRAG_GRADIENT;
1035*cdf0e10cSrcweir 
1036*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1037*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1038*cdf0e10cSrcweir 		}
1039*cdf0e10cSrcweir 		break;
1040*cdf0e10cSrcweir 
1041*cdf0e10cSrcweir 		case SID_OBJECT_SHEAR:
1042*cdf0e10cSrcweir 		{
1043*cdf0e10cSrcweir 			eMode = SDRDRAG_SHEAR;
1044*cdf0e10cSrcweir 
1045*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1046*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1047*cdf0e10cSrcweir 		}
1048*cdf0e10cSrcweir 		break;
1049*cdf0e10cSrcweir 
1050*cdf0e10cSrcweir 		case SID_OBJECT_CROOK_ROTATE:
1051*cdf0e10cSrcweir 		{
1052*cdf0e10cSrcweir 			eMode = SDRDRAG_CROOK;
1053*cdf0e10cSrcweir 
1054*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1055*cdf0e10cSrcweir 			{
1056*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1057*cdf0e10cSrcweir 				mpView->SetCrookMode(SDRCROOK_ROTATE);
1058*cdf0e10cSrcweir 			}
1059*cdf0e10cSrcweir 		}
1060*cdf0e10cSrcweir 		break;
1061*cdf0e10cSrcweir 
1062*cdf0e10cSrcweir 		case SID_OBJECT_CROOK_SLANT:
1063*cdf0e10cSrcweir 		{
1064*cdf0e10cSrcweir 			eMode = SDRDRAG_CROOK;
1065*cdf0e10cSrcweir 
1066*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1067*cdf0e10cSrcweir 			{
1068*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1069*cdf0e10cSrcweir 				mpView->SetCrookMode(SDRCROOK_SLANT);
1070*cdf0e10cSrcweir 			}
1071*cdf0e10cSrcweir 		}
1072*cdf0e10cSrcweir 		break;
1073*cdf0e10cSrcweir 
1074*cdf0e10cSrcweir 		case SID_OBJECT_CROOK_STRETCH:
1075*cdf0e10cSrcweir 		{
1076*cdf0e10cSrcweir 			eMode = SDRDRAG_CROOK;
1077*cdf0e10cSrcweir 
1078*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1079*cdf0e10cSrcweir 			{
1080*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1081*cdf0e10cSrcweir 				mpView->SetCrookMode(SDRCROOK_STRETCH);
1082*cdf0e10cSrcweir 			}
1083*cdf0e10cSrcweir 		}
1084*cdf0e10cSrcweir 		break;
1085*cdf0e10cSrcweir 
1086*cdf0e10cSrcweir         case SID_CONVERT_TO_3D_LATHE:
1087*cdf0e10cSrcweir 		{
1088*cdf0e10cSrcweir 			eMode = SDRDRAG_MIRROR;
1089*cdf0e10cSrcweir             bSuppressChangesOfSelection = sal_True;
1090*cdf0e10cSrcweir 
1091*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1092*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1093*cdf0e10cSrcweir 
1094*cdf0e10cSrcweir             if (!mpView->Is3DRotationCreationActive())
1095*cdf0e10cSrcweir                 mpView->Start3DCreation();
1096*cdf0e10cSrcweir 
1097*cdf0e10cSrcweir             bSuppressChangesOfSelection = sal_False;
1098*cdf0e10cSrcweir         }
1099*cdf0e10cSrcweir         break;
1100*cdf0e10cSrcweir 
1101*cdf0e10cSrcweir 		default:
1102*cdf0e10cSrcweir 		{
1103*cdf0e10cSrcweir 			eMode = SDRDRAG_MOVE;
1104*cdf0e10cSrcweir 
1105*cdf0e10cSrcweir 			if ( mpView->GetDragMode() != eMode )
1106*cdf0e10cSrcweir 				mpView->SetDragMode(eMode);
1107*cdf0e10cSrcweir 		}
1108*cdf0e10cSrcweir 		break;
1109*cdf0e10cSrcweir 	}
1110*cdf0e10cSrcweir 
1111*cdf0e10cSrcweir 	if (nSlotId != SID_OBJECT_ROTATE)
1112*cdf0e10cSrcweir 	{
1113*cdf0e10cSrcweir 		bTempRotation = sal_False;
1114*cdf0e10cSrcweir 	}
1115*cdf0e10cSrcweir 
1116*cdf0e10cSrcweir 	FuDraw::Activate();
1117*cdf0e10cSrcweir }
1118*cdf0e10cSrcweir 
1119*cdf0e10cSrcweir 
1120*cdf0e10cSrcweir 
1121*cdf0e10cSrcweir /*************************************************************************
1122*cdf0e10cSrcweir |*
1123*cdf0e10cSrcweir |* Function deaktivieren
1124*cdf0e10cSrcweir |*
1125*cdf0e10cSrcweir \************************************************************************/
1126*cdf0e10cSrcweir 
1127*cdf0e10cSrcweir void FuSelection::Deactivate()
1128*cdf0e10cSrcweir {
1129*cdf0e10cSrcweir 	FuDraw::Deactivate();
1130*cdf0e10cSrcweir }
1131*cdf0e10cSrcweir 
1132*cdf0e10cSrcweir 
1133*cdf0e10cSrcweir /*************************************************************************
1134*cdf0e10cSrcweir |*
1135*cdf0e10cSrcweir |* Selektion hat sich geaendert
1136*cdf0e10cSrcweir |*
1137*cdf0e10cSrcweir \************************************************************************/
1138*cdf0e10cSrcweir 
1139*cdf0e10cSrcweir void FuSelection::SelectionHasChanged()
1140*cdf0e10cSrcweir {
1141*cdf0e10cSrcweir     bSelectionChanged = sal_True;
1142*cdf0e10cSrcweir 
1143*cdf0e10cSrcweir     FuDraw::SelectionHasChanged();
1144*cdf0e10cSrcweir 
1145*cdf0e10cSrcweir     if ((mpView->Is3DRotationCreationActive() && !bSuppressChangesOfSelection))
1146*cdf0e10cSrcweir     {
1147*cdf0e10cSrcweir         // Wechsel Rotationskoerper -> Selektion
1148*cdf0e10cSrcweir         mpView->ResetCreationActive();
1149*cdf0e10cSrcweir         nSlotId = SID_OBJECT_SELECT;
1150*cdf0e10cSrcweir         Activate();
1151*cdf0e10cSrcweir     }
1152*cdf0e10cSrcweir 
1153*cdf0e10cSrcweir     // Activate the right tool bar for the current context of the view.
1154*cdf0e10cSrcweir 	mpViewShell->GetViewShellBase().GetToolBarManager()->SelectionHasChanged(*mpViewShell, *mpView);
1155*cdf0e10cSrcweir }
1156*cdf0e10cSrcweir 
1157*cdf0e10cSrcweir 
1158*cdf0e10cSrcweir /*************************************************************************
1159*cdf0e10cSrcweir |*
1160*cdf0e10cSrcweir |* Aktuellen Bezier-Editmodus setzen
1161*cdf0e10cSrcweir |*
1162*cdf0e10cSrcweir \************************************************************************/
1163*cdf0e10cSrcweir 
1164*cdf0e10cSrcweir void FuSelection::SetEditMode(sal_uInt16 nMode)
1165*cdf0e10cSrcweir {
1166*cdf0e10cSrcweir     nEditMode = nMode;
1167*cdf0e10cSrcweir 
1168*cdf0e10cSrcweir     if (nEditMode == SID_BEZIER_INSERT)
1169*cdf0e10cSrcweir     {
1170*cdf0e10cSrcweir         mpView->SetInsObjPointMode(sal_True);
1171*cdf0e10cSrcweir     }
1172*cdf0e10cSrcweir     else
1173*cdf0e10cSrcweir     {
1174*cdf0e10cSrcweir         mpView->SetInsObjPointMode(sal_False);
1175*cdf0e10cSrcweir     }
1176*cdf0e10cSrcweir 
1177*cdf0e10cSrcweir     ForcePointer();
1178*cdf0e10cSrcweir 
1179*cdf0e10cSrcweir     SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings();
1180*cdf0e10cSrcweir     rBindings.Invalidate(SID_BEZIER_MOVE);
1181*cdf0e10cSrcweir     rBindings.Invalidate(SID_BEZIER_INSERT);
1182*cdf0e10cSrcweir }
1183*cdf0e10cSrcweir 
1184*cdf0e10cSrcweir /*************************************************************************
1185*cdf0e10cSrcweir |*
1186*cdf0e10cSrcweir |* Animation oder Interaktion ausfuehren
1187*cdf0e10cSrcweir |*
1188*cdf0e10cSrcweir \************************************************************************/
1189*cdf0e10cSrcweir 
1190*cdf0e10cSrcweir sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
1191*cdf0e10cSrcweir {
1192*cdf0e10cSrcweir 	sal_Bool bAnimated = sal_False;
1193*cdf0e10cSrcweir     sal_Bool bClosed = pObj->IsClosedObj();
1194*cdf0e10cSrcweir     sal_Bool bFilled = sal_False;
1195*cdf0e10cSrcweir 
1196*cdf0e10cSrcweir     if (bClosed)
1197*cdf0e10cSrcweir     {
1198*cdf0e10cSrcweir 	    SfxItemSet aSet(mpDoc->GetPool());
1199*cdf0e10cSrcweir 
1200*cdf0e10cSrcweir 		aSet.Put(pObj->GetMergedItemSet());
1201*cdf0e10cSrcweir 
1202*cdf0e10cSrcweir         const XFillStyleItem& rFillStyle = (const XFillStyleItem&) aSet.Get(XATTR_FILLSTYLE);
1203*cdf0e10cSrcweir 	    bFilled = rFillStyle.GetValue() != XFILL_NONE;
1204*cdf0e10cSrcweir     }
1205*cdf0e10cSrcweir 
1206*cdf0e10cSrcweir     const SetOfByte* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers();
1207*cdf0e10cSrcweir 	sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
1208*cdf0e10cSrcweir     const long  n2HitLog = nHitLog * 2;
1209*cdf0e10cSrcweir     Point aHitPosR(rPos);
1210*cdf0e10cSrcweir     Point aHitPosL(rPos);
1211*cdf0e10cSrcweir     Point aHitPosT(rPos);
1212*cdf0e10cSrcweir     Point aHitPosB(rPos);
1213*cdf0e10cSrcweir 
1214*cdf0e10cSrcweir     aHitPosR.X() += n2HitLog;
1215*cdf0e10cSrcweir     aHitPosL.X() -= n2HitLog;
1216*cdf0e10cSrcweir     aHitPosT.Y() += n2HitLog;
1217*cdf0e10cSrcweir     aHitPosB.Y() -= n2HitLog;
1218*cdf0e10cSrcweir 
1219*cdf0e10cSrcweir     if ( !bClosed                                      ||
1220*cdf0e10cSrcweir          !bFilled                                      ||
1221*cdf0e10cSrcweir          (SdrObjectPrimitiveHit(*pObj, aHitPosR, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
1222*cdf0e10cSrcweir           SdrObjectPrimitiveHit(*pObj, aHitPosL, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
1223*cdf0e10cSrcweir           SdrObjectPrimitiveHit(*pObj, aHitPosT, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
1224*cdf0e10cSrcweir           SdrObjectPrimitiveHit(*pObj, aHitPosB, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) ) )
1225*cdf0e10cSrcweir 	{
1226*cdf0e10cSrcweir 		if ( mpDoc->GetIMapInfo( pObj ) )
1227*cdf0e10cSrcweir         {
1228*cdf0e10cSrcweir 	        const IMapObject* pIMapObj = mpDoc->GetHitIMapObject( pObj, rPos, *mpWindow );
1229*cdf0e10cSrcweir 
1230*cdf0e10cSrcweir             if ( pIMapObj && pIMapObj->GetURL().Len() )
1231*cdf0e10cSrcweir             {
1232*cdf0e10cSrcweir 	            // Sprung zu Dokument
1233*cdf0e10cSrcweir                 mpWindow->ReleaseMouse();
1234*cdf0e10cSrcweir                 SfxStringItem aStrItem(SID_FILE_NAME, pIMapObj->GetURL());
1235*cdf0e10cSrcweir                 SfxStringItem aReferer(SID_REFERER, mpDocSh->GetMedium()->GetName());
1236*cdf0e10cSrcweir                 SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
1237*cdf0e10cSrcweir                 SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
1238*cdf0e10cSrcweir                 SfxBoolItem aBrowseItem( SID_BROWSE, sal_True );
1239*cdf0e10cSrcweir                 mpWindow->ReleaseMouse();
1240*cdf0e10cSrcweir                 pFrame->GetDispatcher()->
1241*cdf0e10cSrcweir 	                Execute(SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
1242*cdf0e10cSrcweir 	                        &aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
1243*cdf0e10cSrcweir 
1244*cdf0e10cSrcweir 	            bAnimated = sal_True;
1245*cdf0e10cSrcweir 			}
1246*cdf0e10cSrcweir         }
1247*cdf0e10cSrcweir         else if (!mpDocSh->ISA(GraphicDocShell)        &&
1248*cdf0e10cSrcweir                  mpView->ISA(DrawView)                 &&
1249*cdf0e10cSrcweir                  mpDoc->GetAnimationInfo(pObj))
1250*cdf0e10cSrcweir         {
1251*cdf0e10cSrcweir 	        /**********************************************************
1252*cdf0e10cSrcweir 	        * Animations-Objekt in der Mitte getroffen -> Interaktion
1253*cdf0e10cSrcweir 	        **********************************************************/
1254*cdf0e10cSrcweir 	        SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
1255*cdf0e10cSrcweir 	        DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>(mpViewShell);
1256*cdf0e10cSrcweir 	        mpWindow->ReleaseMouse();
1257*cdf0e10cSrcweir 
1258*cdf0e10cSrcweir 			switch (pInfo->meClickAction)
1259*cdf0e10cSrcweir             {
1260*cdf0e10cSrcweir 	            case presentation::ClickAction_BOOKMARK:
1261*cdf0e10cSrcweir 	            {
1262*cdf0e10cSrcweir 	 	    	    // Sprung zu Bookmark (Seite oder Objekt)
1263*cdf0e10cSrcweir 	    	        SfxStringItem aItem(SID_NAVIGATOR_OBJECT, pInfo->GetBookmark());
1264*cdf0e10cSrcweir 	                mpViewShell->GetViewFrame()->GetDispatcher()->
1265*cdf0e10cSrcweir 	                Execute(SID_NAVIGATOR_OBJECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aItem, 0L);
1266*cdf0e10cSrcweir                     bAnimated = sal_True;
1267*cdf0e10cSrcweir                 }
1268*cdf0e10cSrcweir                 break;
1269*cdf0e10cSrcweir 
1270*cdf0e10cSrcweir 	            case presentation::ClickAction_DOCUMENT:
1271*cdf0e10cSrcweir 	            {
1272*cdf0e10cSrcweir                     String sBookmark( pInfo->GetBookmark() );
1273*cdf0e10cSrcweir 	                // Sprung zu Dokument
1274*cdf0e10cSrcweir 	                if (sBookmark.Len())
1275*cdf0e10cSrcweir 	                {
1276*cdf0e10cSrcweir 						SfxStringItem aReferer(SID_REFERER, mpDocSh->GetMedium()->GetName());
1277*cdf0e10cSrcweir 	                    SfxStringItem aStrItem(SID_FILE_NAME, sBookmark);
1278*cdf0e10cSrcweir 	                    SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
1279*cdf0e10cSrcweir 	                    SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
1280*cdf0e10cSrcweir 	                    SfxBoolItem aBrowseItem( SID_BROWSE, sal_True );
1281*cdf0e10cSrcweir 	                    pFrame->GetDispatcher()->
1282*cdf0e10cSrcweir 	                    Execute(SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
1283*cdf0e10cSrcweir 	                            &aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
1284*cdf0e10cSrcweir 	                }
1285*cdf0e10cSrcweir 
1286*cdf0e10cSrcweir 	                bAnimated = sal_True;
1287*cdf0e10cSrcweir 	            }
1288*cdf0e10cSrcweir 	            break;
1289*cdf0e10cSrcweir 
1290*cdf0e10cSrcweir 	            case presentation::ClickAction_PREVPAGE:
1291*cdf0e10cSrcweir 	            {
1292*cdf0e10cSrcweir 	                // Sprung zur vorherigen Seite
1293*cdf0e10cSrcweir 	                SfxUInt16Item aItem(SID_NAVIGATOR_PAGE, PAGE_PREVIOUS);
1294*cdf0e10cSrcweir 	                mpViewShell->GetViewFrame()->GetDispatcher()->
1295*cdf0e10cSrcweir 	                Execute(SID_NAVIGATOR_PAGE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
1296*cdf0e10cSrcweir 	                        &aItem, 0L);
1297*cdf0e10cSrcweir 	                bAnimated = sal_True;
1298*cdf0e10cSrcweir 	            }
1299*cdf0e10cSrcweir 	            break;
1300*cdf0e10cSrcweir 
1301*cdf0e10cSrcweir 	            case presentation::ClickAction_NEXTPAGE:
1302*cdf0e10cSrcweir 	            {
1303*cdf0e10cSrcweir 	                // Sprung zur naechsten Seite
1304*cdf0e10cSrcweir 	                SfxUInt16Item aItem(SID_NAVIGATOR_PAGE, PAGE_NEXT);
1305*cdf0e10cSrcweir 	                mpViewShell->GetViewFrame()->GetDispatcher()->
1306*cdf0e10cSrcweir 	                Execute(SID_NAVIGATOR_PAGE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
1307*cdf0e10cSrcweir 	                        &aItem, 0L);
1308*cdf0e10cSrcweir 	                bAnimated = sal_True;
1309*cdf0e10cSrcweir 	            }
1310*cdf0e10cSrcweir 	            break;
1311*cdf0e10cSrcweir 
1312*cdf0e10cSrcweir 	            case presentation::ClickAction_FIRSTPAGE:
1313*cdf0e10cSrcweir 	            {
1314*cdf0e10cSrcweir 	                // Sprung zu erster Seite
1315*cdf0e10cSrcweir 	                SfxUInt16Item aItem(SID_NAVIGATOR_PAGE, PAGE_FIRST);
1316*cdf0e10cSrcweir 	                mpViewShell->GetViewFrame()->GetDispatcher()->
1317*cdf0e10cSrcweir 	                Execute(SID_NAVIGATOR_PAGE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
1318*cdf0e10cSrcweir 	                        &aItem, 0L);
1319*cdf0e10cSrcweir 	                bAnimated = sal_True;
1320*cdf0e10cSrcweir 	            }
1321*cdf0e10cSrcweir 	            break;
1322*cdf0e10cSrcweir 
1323*cdf0e10cSrcweir 	            case presentation::ClickAction_LASTPAGE:
1324*cdf0e10cSrcweir 	            {
1325*cdf0e10cSrcweir 	                // Sprung zu letzter Seite
1326*cdf0e10cSrcweir 	                SfxUInt16Item aItem(SID_NAVIGATOR_PAGE, PAGE_LAST);
1327*cdf0e10cSrcweir 	                mpViewShell->GetViewFrame()->GetDispatcher()->
1328*cdf0e10cSrcweir 	                Execute(SID_NAVIGATOR_PAGE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
1329*cdf0e10cSrcweir 	                        &aItem, 0L);
1330*cdf0e10cSrcweir 	                bAnimated = sal_True;
1331*cdf0e10cSrcweir 	            }
1332*cdf0e10cSrcweir 	            break;
1333*cdf0e10cSrcweir 
1334*cdf0e10cSrcweir 	            case presentation::ClickAction_SOUND:
1335*cdf0e10cSrcweir 	            {
1336*cdf0e10cSrcweir                         try
1337*cdf0e10cSrcweir                         {
1338*cdf0e10cSrcweir                             mxPlayer.set( avmedia::MediaWindow::createPlayer( pInfo->GetBookmark()), uno::UNO_QUERY_THROW );
1339*cdf0e10cSrcweir                             mxPlayer->start();
1340*cdf0e10cSrcweir                         }
1341*cdf0e10cSrcweir                         catch( uno::Exception& e )
1342*cdf0e10cSrcweir                         {
1343*cdf0e10cSrcweir                             (void)e;
1344*cdf0e10cSrcweir                         }
1345*cdf0e10cSrcweir 	                bAnimated = sal_True;
1346*cdf0e10cSrcweir 	            }
1347*cdf0e10cSrcweir 	            break;
1348*cdf0e10cSrcweir 
1349*cdf0e10cSrcweir 	            case presentation::ClickAction_VERB:
1350*cdf0e10cSrcweir 	            {
1351*cdf0e10cSrcweir 	                // Verb zuweisen
1352*cdf0e10cSrcweir 	                mpView->UnmarkAll();
1353*cdf0e10cSrcweir 	                mpView->MarkObj(pObj, mpView->GetSdrPageView(), sal_False, sal_False);
1354*cdf0e10cSrcweir 	                pDrViewSh->DoVerb((sal_Int16)pInfo->mnVerb);
1355*cdf0e10cSrcweir 	                bAnimated = sal_True;
1356*cdf0e10cSrcweir 	            }
1357*cdf0e10cSrcweir 	            break;
1358*cdf0e10cSrcweir 
1359*cdf0e10cSrcweir 	            case presentation::ClickAction_PROGRAM:
1360*cdf0e10cSrcweir 	            {
1361*cdf0e10cSrcweir                    String aBaseURL = GetDocSh()->GetMedium()->GetBaseURL();
1362*cdf0e10cSrcweir                    INetURLObject aURL( ::URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pInfo->GetBookmark(),
1363*cdf0e10cSrcweir                                                 URIHelper::GetMaybeFileHdl(), true, false,
1364*cdf0e10cSrcweir                                                 INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS ) );
1365*cdf0e10cSrcweir 
1366*cdf0e10cSrcweir 			       if( INET_PROT_FILE == aURL.GetProtocol() )
1367*cdf0e10cSrcweir 				   {
1368*cdf0e10cSrcweir 						SfxStringItem aUrl( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::NO_DECODE ) );
1369*cdf0e10cSrcweir 						SfxBoolItem aBrowsing( SID_BROWSE, sal_True );
1370*cdf0e10cSrcweir 
1371*cdf0e10cSrcweir 						SfxViewFrame* pViewFrm = SfxViewFrame::Current();
1372*cdf0e10cSrcweir 						if (pViewFrm)
1373*cdf0e10cSrcweir 							pViewFrm->GetDispatcher()->Execute( SID_OPENDOC,
1374*cdf0e10cSrcweir   														SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
1375*cdf0e10cSrcweir 														&aUrl,
1376*cdf0e10cSrcweir 														&aBrowsing,
1377*cdf0e10cSrcweir 														0L );
1378*cdf0e10cSrcweir 				   }
1379*cdf0e10cSrcweir 
1380*cdf0e10cSrcweir                     bAnimated = sal_True;
1381*cdf0e10cSrcweir 	            }
1382*cdf0e10cSrcweir 	            break;
1383*cdf0e10cSrcweir 
1384*cdf0e10cSrcweir 	            case presentation::ClickAction_MACRO:
1385*cdf0e10cSrcweir 	            {
1386*cdf0e10cSrcweir 	                // Execute makro
1387*cdf0e10cSrcweir 	                String aMacro = pInfo->GetBookmark();
1388*cdf0e10cSrcweir 
1389*cdf0e10cSrcweir 					if ( SfxApplication::IsXScriptURL( aMacro ) )
1390*cdf0e10cSrcweir 					{
1391*cdf0e10cSrcweir 						uno::Any aRet;
1392*cdf0e10cSrcweir 						uno::Sequence< sal_Int16 > aOutArgsIndex;
1393*cdf0e10cSrcweir 						uno::Sequence< uno::Any > aOutArgs;
1394*cdf0e10cSrcweir 						uno::Sequence< uno::Any >* pInArgs =
1395*cdf0e10cSrcweir 							new uno::Sequence< uno::Any >(0);
1396*cdf0e10cSrcweir 
1397*cdf0e10cSrcweir 						ErrCode eErr = mpDocSh->CallXScript( aMacro,
1398*cdf0e10cSrcweir 							*pInArgs, aRet, aOutArgsIndex, aOutArgs);
1399*cdf0e10cSrcweir 
1400*cdf0e10cSrcweir 						// Check the return value from the script
1401*cdf0e10cSrcweir 						sal_Bool bTmp = sal_False;
1402*cdf0e10cSrcweir 						if ( eErr == ERRCODE_NONE &&
1403*cdf0e10cSrcweir 							 aRet.getValueType() == getCppuBooleanType() &&
1404*cdf0e10cSrcweir 							 sal_True == ( aRet >>= bTmp ) &&
1405*cdf0e10cSrcweir 							 bTmp == sal_True )
1406*cdf0e10cSrcweir 						{
1407*cdf0e10cSrcweir 							bAnimated = sal_True;
1408*cdf0e10cSrcweir 						}
1409*cdf0e10cSrcweir 						else
1410*cdf0e10cSrcweir 						{
1411*cdf0e10cSrcweir 							bAnimated = sal_False;
1412*cdf0e10cSrcweir 						}
1413*cdf0e10cSrcweir 					}
1414*cdf0e10cSrcweir 					else
1415*cdf0e10cSrcweir 					{
1416*cdf0e10cSrcweir 						// aMacro has got following format:
1417*cdf0e10cSrcweir 	                	// "Macroname.Modulname.Libname.Documentname" or
1418*cdf0e10cSrcweir 	                	// "Macroname.Modulname.Libname.Applicationsname"
1419*cdf0e10cSrcweir 	                	String aMacroName =
1420*cdf0e10cSrcweir 							aMacro.GetToken(0, sal_Unicode('.'));
1421*cdf0e10cSrcweir 	                	String aModulName =
1422*cdf0e10cSrcweir 							 aMacro.GetToken(1, sal_Unicode('.'));
1423*cdf0e10cSrcweir 	                	String aLibName   =
1424*cdf0e10cSrcweir 							 aMacro.GetToken(2, sal_Unicode('.'));
1425*cdf0e10cSrcweir 	                	String aDocName   =
1426*cdf0e10cSrcweir 							 aMacro.GetToken(3, sal_Unicode('.'));
1427*cdf0e10cSrcweir 
1428*cdf0e10cSrcweir 						// In this moment the Call-method only
1429*cdf0e10cSrcweir 						// resolves modulename+macroname
1430*cdf0e10cSrcweir 	                	String aExecMacro(aModulName);
1431*cdf0e10cSrcweir 	                	aExecMacro.Append( sal_Unicode('.') );
1432*cdf0e10cSrcweir 	                	aExecMacro.Append( aMacroName );
1433*cdf0e10cSrcweir 	                	bAnimated = mpDocSh->GetBasic()->Call(aExecMacro);
1434*cdf0e10cSrcweir 	            	}
1435*cdf0e10cSrcweir 				}
1436*cdf0e10cSrcweir 	            break;
1437*cdf0e10cSrcweir 
1438*cdf0e10cSrcweir 	            default:
1439*cdf0e10cSrcweir 	            {
1440*cdf0e10cSrcweir 	                bAnimated = sal_False;
1441*cdf0e10cSrcweir 	            }
1442*cdf0e10cSrcweir 	            break;
1443*cdf0e10cSrcweir 	        }
1444*cdf0e10cSrcweir         }
1445*cdf0e10cSrcweir 
1446*cdf0e10cSrcweir 		if (!bAnimated                               &&
1447*cdf0e10cSrcweir 	    	mpView->ISA(DrawView)                 &&
1448*cdf0e10cSrcweir 	    	!mpDocSh->ISA(GraphicDocShell)        &&
1449*cdf0e10cSrcweir 			SlideShow::IsRunning( mpViewShell->GetViewShellBase() ) &&
1450*cdf0e10cSrcweir 	    	mpDoc->GetAnimationInfo(pObj))
1451*cdf0e10cSrcweir 		{
1452*cdf0e10cSrcweir 	    	/**********************************************************
1453*cdf0e10cSrcweir 	    	* Effekt-Objekt in der Mitte getroffen -> Effekt abspielen
1454*cdf0e10cSrcweir 	    	**********************************************************/
1455*cdf0e10cSrcweir 	    	SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
1456*cdf0e10cSrcweir 
1457*cdf0e10cSrcweir 	    	switch (pInfo->meClickAction)
1458*cdf0e10cSrcweir 	    	{
1459*cdf0e10cSrcweir 	        	case presentation::ClickAction_VANISH:
1460*cdf0e10cSrcweir 	        	case presentation::ClickAction_INVISIBLE:
1461*cdf0e10cSrcweir 		        	break;
1462*cdf0e10cSrcweir 
1463*cdf0e10cSrcweir 	        	default:
1464*cdf0e10cSrcweir 	            	bAnimated = sal_False;
1465*cdf0e10cSrcweir 	        	break;
1466*cdf0e10cSrcweir 	    	}
1467*cdf0e10cSrcweir 		}
1468*cdf0e10cSrcweir 	}
1469*cdf0e10cSrcweir 
1470*cdf0e10cSrcweir 	return bAnimated;
1471*cdf0e10cSrcweir }
1472*cdf0e10cSrcweir 
1473*cdf0e10cSrcweir 
1474*cdf0e10cSrcweir 
1475*cdf0e10cSrcweir /** is called when the currenct function should be aborted. <p>
1476*cdf0e10cSrcweir 	This is used when a function gets a KEY_ESCAPE but can also
1477*cdf0e10cSrcweir 	be called directly.
1478*cdf0e10cSrcweir 
1479*cdf0e10cSrcweir 	@returns true if a active function was aborted
1480*cdf0e10cSrcweir */
1481*cdf0e10cSrcweir bool FuSelection::cancel()
1482*cdf0e10cSrcweir {
1483*cdf0e10cSrcweir     if (mpView->Is3DRotationCreationActive())
1484*cdf0e10cSrcweir 	{
1485*cdf0e10cSrcweir 		mpView->ResetCreationActive();
1486*cdf0e10cSrcweir 		mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
1487*cdf0e10cSrcweir 		return true;
1488*cdf0e10cSrcweir     }
1489*cdf0e10cSrcweir 	else
1490*cdf0e10cSrcweir 	{
1491*cdf0e10cSrcweir 		return false;
1492*cdf0e10cSrcweir 	}
1493*cdf0e10cSrcweir }
1494*cdf0e10cSrcweir 
1495*cdf0e10cSrcweir 
1496*cdf0e10cSrcweir 
1497*cdf0e10cSrcweir 
1498*cdf0e10cSrcweir SdrObject* FuSelection::pickObject (const Point& rTestPoint)
1499*cdf0e10cSrcweir {
1500*cdf0e10cSrcweir 	SdrObject* pObject = NULL;
1501*cdf0e10cSrcweir     SdrPageView* pPageView;
1502*cdf0e10cSrcweir 	sal_uInt16 nHitLog = sal_uInt16 (mpWindow->PixelToLogic(Size(HITPIX,0)).Width());
1503*cdf0e10cSrcweir 	mpView->PickObj (rTestPoint, nHitLog, pObject, pPageView, SDRSEARCH_PICKMARKABLE);
1504*cdf0e10cSrcweir     return pObject;
1505*cdf0e10cSrcweir }
1506*cdf0e10cSrcweir } // end of namespace sd
1507