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