LCOV - code coverage report
Current view: top level - sc/source/ui/drawfunc - fusel.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 6 249 2.4 %
Date: 2014-04-11 Functions: 5 12 41.7 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10