xref: /aoo4110/main/sc/source/ui/drawfunc/fusel.cxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sc.hxx"
26 
27 // INCLUDE ---------------------------------------------------------------
28 
29 #include <com/sun/star/embed/EmbedStates.hpp>
30 
31 #include <editeng/eeitem.hxx>
32 #include <editeng/flditem.hxx>
33 #include <svx/svdoole2.hxx>
34 #include <svx/svdotext.hxx>
35 #include <sfx2/dispatch.hxx>
36 #include <svtools/imapobj.hxx>
37 #include <svx/svdouno.hxx>
38 #include <svx/svdomedia.hxx>
39 #include <svx/svdpagv.hxx>
40 #include <editeng/outlobj.hxx>
41 #include <svx/svdocapt.hxx>
42 #include <sfx2/app.hxx>
43 
44 #include "fusel.hxx"
45 #include "sc.hrc"
46 #include "fudraw.hxx"
47 #include "futext.hxx"
48 #include "drawview.hxx"
49 #include "tabvwsh.hxx"
50 #include "drawpage.hxx"
51 #include "globstr.hrc"
52 #include "drwlayer.hxx"
53 #include "userdat.hxx"
54 #include "scmod.hxx"
55 #include "client.hxx"
56 #include "charthelper.hxx"
57 #include "docuno.hxx"
58 #include "docsh.hxx"
59 
60 // -----------------------------------------------------------------------
61 
62 //	Maximal erlaubte Mausbewegung um noch Drag&Drop zu starten
63 //!	fusel,fuconstr,futext - zusammenfassen!
64 #define SC_MAXDRAGMOVE	3
65 
66 // -----------------------------------------------------------------------
67 
68 #ifdef _MSC_VER
69 #pragma optimize ( "", off )
70 #endif
71 
72 using namespace com::sun::star;
73 
74 /*************************************************************************
75 |*
76 |* Konstruktor
77 |*
78 \************************************************************************/
79 
FuSelection(ScTabViewShell * pViewSh,Window * pWin,ScDrawView * pViewP,SdrModel * pDoc,SfxRequest & rReq)80 FuSelection::FuSelection(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pViewP,
81 			   SdrModel* pDoc, SfxRequest& rReq ) :
82     FuDraw(pViewSh, pWin, pViewP, pDoc, rReq),
83 	bVCAction(sal_False)
84 {
85 }
86 
87 /*************************************************************************
88 |*
89 |* Destruktor
90 |*
91 \************************************************************************/
92 
~FuSelection()93 FuSelection::~FuSelection()
94 {
95 }
96 
Command(const CommandEvent & rCEvt)97 sal_uInt8 FuSelection::Command(const CommandEvent& rCEvt)
98 {
99 	//	special code for non-VCL OS2/UNX removed
100 
101 	return FuDraw::Command( rCEvt );
102 }
103 
104 /*************************************************************************
105 |*
106 |* MouseButtonDown-event
107 |*
108 \************************************************************************/
109 
MouseButtonDown(const MouseEvent & rMEvt)110 sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
111 {
112 	// #95491# remember button state for creation of own MouseEvents
113 	SetMouseButtonCode(rMEvt.GetButtons());
114 	const bool bSelectionOnly = rMEvt.IsRight();
115 	if ( pView->IsAction() )
116 	{
117         if ( bSelectionOnly )
118 			pView->BckAction();
119 		return sal_True;
120 	}
121 
122 	bVCAction = sal_False;
123 	bIsInDragMode = sal_False;		//	irgendwo muss es ja zurueckgesetzt werden (#50033#)
124 
125 	sal_Bool bReturn = FuDraw::MouseButtonDown(rMEvt);
126 
127 	aMDPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
128 
129 	if ( rMEvt.IsLeft() )
130 	{
131 		SdrHdl* pHdl = pView->PickHandle(aMDPos);
132 		SdrObject* pObj;
133 		SdrPageView* pPV;
134 
135 		if ( pHdl!=NULL || pView->IsMarkedHit(aMDPos) )
136 		{
137 		    // Determine if this is the tail of a SdrCaptionObj i.e.
138 		    // we need to disable the drag option on the tail of a note
139 		    // object. Also, disable the ability to use the circular
140 		    // drag of a note object.
141             bool bDrag = false;
142 		    const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
143 		    if( rMarkList.GetMarkCount() == 1 )
144 		    {
145                 SdrObject* pMarkedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
146                 if( ScDrawLayer::IsNoteCaption( pMarkedObj ) )
147 			    {
148 			        // move using the valid caption handles for note text box.
149 			        if(pHdl && (pHdl->GetKind() != HDL_POLY && pHdl->GetKind() != HDL_CIRC))
150                         bDrag = true;
151 			        // move the complete note box.
152 			        else if(!pHdl)
153                         bDrag = true;
154 			    }
155 			    else
156                     bDrag = true;   // different object
157 		    }
158             else
159                 bDrag = true;       // several objects
160 
161             if ( bDrag )
162             {
163                 aDragTimer.Start();
164                 pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl);
165                 bReturn = sal_True;
166             }
167 		}
168 		else
169 		{
170 			sal_Bool bAlt = rMEvt.IsMod2();
171 			if ( !bAlt && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO) )
172 			{
173 				pView->BegMacroObj(aMDPos, pObj, pPV, pWindow);
174 				bReturn = sal_True;
175 			}
176 			else
177 			{
178                 String sURL, sTarget;
179                 if ( !bAlt && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER))
180                 {
181                    // Support for imported Excel docs
182                    // Excel is of course not consistent and allows
183                    // a hyperlink to be assigned for an object group
184                    // and even though the hyperlink is exported in the Escher layer
185                    // its never used, when dealing with a group object the link
186                    // associated with the clicked object is used only
187 
188                    // additionally you can also select a macro in Excel for a grouped
189                    // objects and this results in the macro being set for the elements
190                    // in the group and no macro is exported for the group
191 
192                    // if a macro and hlink are defined favour the hlink
193 
194                    // If a group object has no hyperlink use the hyperlink of the
195                    // object clicked
196 
197                    if ( pObj->IsGroupObject() )
198                    {
199                        SdrObject* pHit = NULL;
200                        if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
201                            pObj = pHit;
202                    }
203 
204                    ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, sal_True );
205 #ifdef ISSUE66550_HLINK_FOR_SHAPES
206                    // For interoperability favour links over macros if both are defined
207                    if ( pInfo->GetHlink().getLength() > 0 )
208                    {
209                        OSL_TRACE("** Got URL");
210                        sURL = pInfo->GetHlink();
211                    }
212                    else if ( pInfo->GetMacro().getLength() > 0 )
213 #else
214                    if ( pInfo->GetMacro().getLength() > 0 )
215 #endif
216                    {
217                        SfxObjectShell* pObjSh = SfxObjectShell::Current();
218                        if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
219                        {
220                            uno::Any aRet;
221                            uno::Sequence< sal_Int16 > aOutArgsIndex;
222                            uno::Sequence< uno::Any > aOutArgs;
223                            uno::Sequence< uno::Any >* pInArgs =
224                                new uno::Sequence< uno::Any >(0);
225                            pObjSh->CallXScript( pInfo->GetMacro(),
226                                *pInArgs, aRet, aOutArgsIndex, aOutArgs);
227                            pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
228                            return sal_True;        // kein CaptureMouse etc.
229                        }
230                    }
231                 }
232 
233 				//	URL / ImageMap
234 
235 				SdrViewEvent aVEvt;
236 				if ( !bAlt &&
237 					pView->PickAnything( rMEvt, SDRMOUSEBUTTONDOWN, aVEvt ) != SDRHIT_NONE &&
238 					aVEvt.pObj != NULL )
239 				{
240 					if ( ScDrawLayer::GetIMapInfo( aVEvt.pObj ) )		// ImageMap
241 					{
242 						const IMapObject* pIMapObj =
243 								ScDrawLayer::GetHitIMapObject( aVEvt.pObj, aMDPos, *pWindow );
244 						if ( pIMapObj && pIMapObj->GetURL().Len() )
245 						{
246                             sURL = pIMapObj->GetURL();
247                             sTarget = pIMapObj->GetTarget();
248 						}
249 					}
250 					if ( aVEvt.eEvent == SDREVENT_EXECUTEURL && aVEvt.pURLField )	// URL
251                     {
252                         sURL = aVEvt.pURLField->GetURL();
253                         sTarget = aVEvt.pURLField->GetTargetFrame();
254                     }
255 				}
256 
257                 // open hyperlink, if found at object or in object's text
258                 if ( sURL.Len() > 0 )
259                 {
260                     ScGlobal::OpenURL( sURL, sTarget );
261                     pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
262                     return sal_True;        // kein CaptureMouse etc.
263                 }
264 
265 				//	Is another object being edited in this view?
266 				//	(Editing is ended in MarkListHasChanged - test before UnmarkAll)
267 				SfxInPlaceClient* pClient = pViewShell->GetIPClient();
268                 sal_Bool bWasOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
269 
270 				//	Markieren
271 
272                 // do not allow multiselection with note caption
273 				bool bCaptionClicked = IsNoteCaptionClicked( aMDPos );
274 				if ( !rMEvt.IsShift() || bCaptionClicked || IsNoteCaptionMarked() )
275 					pView->UnmarkAll();
276 
277                 /*  Unlock internal layer, if a note caption is clicked. The
278                     layer will be relocked in ScDrawView::MarkListHasChanged(). */
279 				if( bCaptionClicked )
280                     pView->UnlockInternalLayer();
281 
282                 // try to select the clicked object
283 				if ( pView->MarkObj( aMDPos, -2, sal_False, rMEvt.IsMod1() ) )
284 				{
285 					//*********************************************************
286 					//Objekt verschieben
287 					//********************************************************
288 					if (pView->IsMarkedHit(aMDPos))
289 					{
290 						//	#95834# Don't start drag timer if inplace editing of an OLE object
291 						//	was just ended with this mouse click - the view will be moved
292 						//	(different tool bars) and the object that was clicked on would
293 						//	be moved unintentionally.
294 						if ( !bWasOleActive )
295 							aDragTimer.Start();
296 
297 						pHdl=pView->PickHandle(aMDPos);
298 						pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl);
299 						bReturn = sal_True;
300 					}
301 					else									// Objekt am Rand getroffen
302 						if (pViewShell->IsDrawSelMode())
303 							bReturn = sal_True;
304 				}
305 				else
306 				{
307 					//		nichts getroffen
308 
309 					if (pViewShell->IsDrawSelMode())
310 					{
311 						//*********************************************************
312 						//Objekt selektieren
313 						//********************************************************
314 						pView->BegMarkObj(aMDPos);
315 						bReturn = sal_True;
316 					}
317 				}
318 			}
319 		}
320 
321 	}
322 
323 	if (!bIsInDragMode)
324 	{
325 		if (!bVCAction)					// VC rufen selber CaptureMouse
326 			pWindow->CaptureMouse();
327 		ForcePointer(&rMEvt);
328 	}
329 
330 	return bReturn;
331 }
332 
333 /*************************************************************************
334 |*
335 |* MouseMove-event
336 |*
337 \************************************************************************/
338 
MouseMove(const MouseEvent & rMEvt)339 sal_Bool __EXPORT FuSelection::MouseMove(const MouseEvent& rMEvt)
340 {
341 	sal_Bool bReturn = FuDraw::MouseMove(rMEvt);
342 
343 	if (aDragTimer.IsActive() )
344 	{
345 		Point aOldPixel = pWindow->LogicToPixel( aMDPos );
346 		Point aNewPixel = rMEvt.GetPosPixel();
347 		if ( Abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE ||
348 			 Abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE )
349 			aDragTimer.Stop();
350 	}
351 
352 	if ( pView->IsAction() )
353 	{
354 		Point aPix(rMEvt.GetPosPixel());
355 		Point aPnt(pWindow->PixelToLogic(aPix));
356 
357 		ForceScroll(aPix);
358 		pView->MovAction(aPnt);
359 		bReturn = sal_True;
360 	}
361 
362 	// Ein VCControl ist aktiv
363 	// Event an den Manager weiterleiten
364 	if( bVCAction )
365 	{
366 		//	GetSbxForm gibts nicht mehr - Basic-Controls sind tot
367 		//SdrPageView* pPgView = pView->GetPageViewByIndex(0);
368 		//ScDrawPage*  pPage	 = (ScDrawPage*)pPgView->GetPage();
369 		//VCSbxForm* pForm = (VCSbxForm*)(SbxObject*)(pPage->GetSbxForm());
370 		//((VCManager*)(pForm->GetVCContainer()))->
371 		//    MouseMove( pWindow, rMEvt );
372 		bReturn = sal_True;
373 	}
374 
375 	ForcePointer(&rMEvt);
376 
377 	return (bReturn);
378 }
379 
380 /*************************************************************************
381 |*
382 |* MouseButtonUp-event
383 |*
384 \************************************************************************/
385 
MouseButtonUp(const MouseEvent & rMEvt)386 sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
387 {
388 	// #95491# remember button state for creation of own MouseEvents
389 	SetMouseButtonCode(rMEvt.GetButtons());
390 
391 	sal_Bool bReturn = FuDraw::MouseButtonUp(rMEvt);
392 //	sal_Bool bOle	 = pViewShell->GetViewData()->IsOle();
393     sal_Bool bOle = pViewShell->GetViewFrame()->GetFrame().IsInPlace();
394 
395 	if (aDragTimer.IsActive() )
396 	{
397 		aDragTimer.Stop();
398 	}
399 
400 	Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
401 
402     bool bCopy = false;
403     ScViewData* pViewData = ( pViewShell ? pViewShell->GetViewData() : NULL );
404     ScDocument* pDocument = ( pViewData ? pViewData->GetDocument() : NULL );
405     SdrPageView* pPageView = ( pView ? pView->GetSdrPageView() : NULL );
406     SdrPage* pPage = ( pPageView ? pPageView->GetPage() : NULL );
407     ::std::vector< ::rtl::OUString > aExcludedChartNames;
408     ScRangeListVector aProtectedChartRangesVector;
409 
410 	if ( rMEvt.IsLeft() )
411 	{
412 		if ( pView->IsDragObj() )
413 		{
414 			/******************************************************************
415 			* Objekt wurde verschoben
416 			******************************************************************/
417             if ( rMEvt.IsMod1() )
418             {
419                 if ( pPage )
420                 {
421                     ScChartHelper::GetChartNames( aExcludedChartNames, pPage );
422                 }
423                 if ( pView && pDocument )
424                 {
425                     const SdrMarkList& rSdrMarkList = pView->GetMarkedObjectList();
426                     sal_uLong nMarkCount = rSdrMarkList.GetMarkCount();
427                     for ( sal_uLong i = 0; i < nMarkCount; ++i )
428                     {
429                         SdrMark* pMark = rSdrMarkList.GetMark( i );
430                         SdrObject* pObj = ( pMark ? pMark->GetMarkedSdrObj() : NULL );
431                         if ( pObj )
432                         {
433                             ScChartHelper::AddRangesIfProtectedChart( aProtectedChartRangesVector, pDocument, pObj );
434                         }
435                     }
436                 }
437                 bCopy = true;
438             }
439 
440 			pView->EndDragObj( rMEvt.IsMod1() );
441 			pView->ForceMarkedToAnotherPage();
442 
443 			const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
444 			if (rMarkList.GetMarkCount() == 1)
445 			{
446 		  	    SdrMark* pMark = rMarkList.GetMark(0);
447 		  	    SdrObject* pObj = pMark->GetMarkedSdrObj();
448 		  	    FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
449 		  	    FuText* pText = static_cast<FuText*>(pPoor);
450 			    pText->StopDragMode(pObj );
451 			}
452 			bReturn = sal_True;
453 		}
454 		else if (pView->IsAction() )
455 		{
456             // unlock internal layer to include note captions
457             pView->UnlockInternalLayer();
458 			pView->EndAction();
459 			if ( pView->AreObjectsMarked() )
460             {
461 				bReturn = sal_True;
462 
463                 /*  if multi-selection contains a note caption object, remove
464                     all other objects from selection. */
465                 const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
466                 sal_uLong nCount = rMarkList.GetMarkCount();
467                 if( nCount > 1 )
468                 {
469                     bool bFound = false;
470                     for( sal_uLong nIdx = 0; !bFound && (nIdx < nCount); ++nIdx )
471                     {
472                         SdrObject* pObj = rMarkList.GetMark( nIdx )->GetMarkedSdrObj();
473                         bFound = ScDrawLayer::IsNoteCaption( pObj );
474                         if( bFound )
475                         {
476                             pView->UnMarkAll();
477                             pView->MarkObj( pObj, pView->GetSdrPageView() );
478                         }
479                     }
480                 }
481             }
482 		}
483 	}
484 
485 /*
486 	if ( pView->IsObjEdit() )
487 	{
488 		sal_Bool bShowCursor = sal_True;
489 //! 	pOutlinerView = pView->GetOutlinerView(pWindow, bShowCursor);
490 		bReturn = sal_True;
491 	}
492 */
493 	/**************************************************************************
494 	* Ggf. OLE-Objekt beruecksichtigen
495 	**************************************************************************/
496 	SfxInPlaceClient* pIPClient = pViewShell->GetIPClient();
497 
498 	if (pIPClient)
499 	{
500         ScModule* pScMod = SC_MOD();
501         bool bUnoRefDialog = pScMod->IsRefDialogOpen() && pScMod->GetCurRefDlgId() == WID_SIMPLE_REF;
502 
503         if ( pIPClient->IsObjectInPlaceActive() && !bUnoRefDialog )
504             pIPClient->DeactivateObject();
505 	}
506 
507 	sal_uInt16 nClicks = rMEvt.GetClicks();
508 	if ( nClicks == 2 && rMEvt.IsLeft() )
509 	{
510 		if ( pView->AreObjectsMarked() )
511 		{
512 			const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
513 			if (rMarkList.GetMarkCount() == 1)
514 			{
515 				SdrMark* pMark = rMarkList.GetMark(0);
516 				SdrObject* pObj = pMark->GetMarkedSdrObj();
517 
518 				//	#43984# aktivieren nur, wenn die Maus auch (noch) ueber dem
519 				//	selektierten Objekt steht
520 
521 				SdrViewEvent aVEvt;
522 				SdrHitKind eHit = pView->PickAnything( rMEvt, SDRMOUSEBUTTONDOWN, aVEvt );
523 				if ( eHit != SDRHIT_NONE && aVEvt.pObj == pObj )
524 				{
525 					sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
526 
527 					//
528 					//	OLE: aktivieren
529 					//
530 
531 					if (nSdrObjKind == OBJ_OLE2)
532 					{
533 						if (!bOle)
534 						{
535                             if (((SdrOle2Obj*) pObj)->GetObjRef().is())
536 							{
537 								//HMHpView->HideMarkHdl();
538 								pViewShell->ActivateObject( (SdrOle2Obj*) pObj, 0 );
539 							}
540 						}
541 					}
542 
543 					//
544                     //  Edit text
545                     //  #49458# not in UNO controls
546                     //  #i32352# not in media objects
547 					//
548                     else if ( pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) && !pObj->ISA(SdrMediaObj) )
549 					{
550 						OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
551 						sal_Bool bVertical = ( pOPO && pOPO->IsVertical() );
552 						sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
553 
554 						pViewShell->GetViewData()->GetDispatcher().
555 							Execute(nTextSlotId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD);
556 
557 						// jetzt den erzeugten FuText holen und in den EditModus setzen
558 						FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
559 						if ( pPoor && pPoor->GetSlotID() == nTextSlotId )	 //	hat keine RTTI
560 						{
561 							FuText* pText = (FuText*)pPoor;
562 							Point aMousePixel = rMEvt.GetPosPixel();
563 							pText->SetInEditMode( pObj, &aMousePixel );
564 						}
565 						bReturn = sal_True;
566 					}
567 				}
568 			}
569 		}
570 		else if ( TestDetective( pView->GetSdrPageView(), aPnt ) )
571 			bReturn = sal_True;
572 	}
573 
574 	// Ein VCControl ist aktiv
575 	// Event an den Manager weiterleiten
576 	if( bVCAction )
577 	{
578 		//	GetSbxForm gibts nicht mehr - Basic-Controls sind tot
579 		//SdrPageView* pPgView = pView->GetPageViewByIndex(0);
580 		//ScDrawPage*  pPage	 = (ScDrawPage*)pPgView->GetPage();
581 		//VCSbxForm* pForm = (VCSbxForm*)(SbxObject*)(pPage->GetSbxForm());
582 		//((VCManager*)(pForm->GetVCContainer()))->
583 		//    MouseButtonUp( pWindow, rMEvt );
584 		//HMHpView->ShowMarkHdl();
585 		bVCAction = sal_False;
586 		bReturn = sal_True;
587 	}
588 
589 	ForcePointer(&rMEvt);
590 
591 	pWindow->ReleaseMouse();
592 
593 	//	Command-Handler fuer Kontext-Menue kommt erst nach MouseButtonUp,
594 	//	darum hier die harte IsLeft-Abfrage
595 	if ( !bReturn && rMEvt.IsLeft() )
596 		if (pViewShell->IsDrawSelMode())
597 			pViewShell->GetViewData()->GetDispatcher().
598 				Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
599 
600     if ( bCopy && pViewData && pDocument && pPage )
601     {
602         ScDocShell* pDocShell = pViewData->GetDocShell();
603         ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : NULL );
604         if ( pModelObj )
605         {
606             SCTAB nTab = pViewData->GetTabNo();
607             ScChartHelper::CreateProtectedChartListenersAndNotify( pDocument, pPage, pModelObj, nTab,
608                 aProtectedChartRangesVector, aExcludedChartNames );
609         }
610     }
611 
612 	return (bReturn);
613 }
614 
615 /*************************************************************************
616 |*
617 |* Tastaturereignisse bearbeiten
618 |*
619 |* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
620 |* FALSE.
621 |*
622 \************************************************************************/
623 
KeyInput(const KeyEvent & rKEvt)624 sal_Bool FuSelection::KeyInput(const KeyEvent& rKEvt)
625 {
626 	sal_Bool bReturn = sal_False;
627 
628 	if (!bReturn)
629 	{
630 		bReturn = FuDraw::KeyInput(rKEvt);
631 	}
632 
633 	return(bReturn);
634 }
635 
636 
637 /*************************************************************************
638 |*
639 |* Function aktivieren
640 |*
641 \************************************************************************/
642 
Activate()643 void FuSelection::Activate()
644 {
645 /*
646 	SdrDragMode eMode;
647 	switch (aSfxRequest.GetSlot() )
648 	{
649 		case SID_OBJECT_SELECT:
650 			eMode = SDRDRAG_MOVE;
651 			break;
652 		case SID_OBJECT_ROTATE:
653 			eMode = SDRDRAG_ROTATE;
654 			break;
655 		case SID_OBJECT_MIRROR:
656 			eMode = SDRDRAG_MIRROR;
657 			break;
658 	}
659 	pView->SetDragMode(eMode);
660 */
661 	FuDraw::Activate();
662 }
663 
664 
665 
666 /*************************************************************************
667 |*
668 |* Function deaktivieren
669 |*
670 \************************************************************************/
671 
Deactivate()672 void FuSelection::Deactivate()
673 {
674 	/**************************************************************************
675 	* Hide Cursor
676 	**************************************************************************/
677 //    sal_Bool bShowCursor = sal_False;
678 //! pOutlinerView = pView->GetOutlinerView(pWindow, bShowCursor);
679 
680 //	pView->SetDragMode(SDRDRAG_MOVE);
681 	FuDraw::Deactivate();
682 }
683 
684 
685 #ifdef _MSC_VER
686 #pragma optimize ( "", on )
687 #endif
688 
689 
690 
691 
692 
693