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