1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_sd.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #include "View.hxx" 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir #include <vector> 35*cdf0e10cSrcweir #include <com/sun/star/embed/XEmbedPersist.hpp> 36*cdf0e10cSrcweir #include <tools/ref.hxx> 37*cdf0e10cSrcweir #include <tools/urlobj.hxx> 38*cdf0e10cSrcweir #ifndef _MSGBOX_HXX //autogen 39*cdf0e10cSrcweir #include <vcl/msgbox.hxx> 40*cdf0e10cSrcweir #endif 41*cdf0e10cSrcweir #include <svx/svdetc.hxx> 42*cdf0e10cSrcweir #include <svx/svdoole2.hxx> 43*cdf0e10cSrcweir #include <svx/svdograf.hxx> 44*cdf0e10cSrcweir #include <vcl/graph.hxx> 45*cdf0e10cSrcweir #include <svx/xexch.hxx> 46*cdf0e10cSrcweir #include <svx/svxdlg.hxx> 47*cdf0e10cSrcweir #include <svx/dialogs.hrc> 48*cdf0e10cSrcweir #include <sfx2/docfile.hxx> 49*cdf0e10cSrcweir #include <sfx2/childwin.hxx> 50*cdf0e10cSrcweir #include <svx/svdundo.hxx> 51*cdf0e10cSrcweir #include <svx/svdpagv.hxx> 52*cdf0e10cSrcweir #include <svl/urlbmk.hxx> 53*cdf0e10cSrcweir #include <svl/urlbmk.hxx> 54*cdf0e10cSrcweir #include <editeng/outliner.hxx> 55*cdf0e10cSrcweir #include <svx/xflclit.hxx> 56*cdf0e10cSrcweir #include <svx/dbexch.hrc> 57*cdf0e10cSrcweir #include <sot/formats.hxx> 58*cdf0e10cSrcweir #include <editeng/editeng.hxx> 59*cdf0e10cSrcweir #include <svx/svditer.hxx> 60*cdf0e10cSrcweir #include <svx/obj3d.hxx> 61*cdf0e10cSrcweir #include <svx/scene3d.hxx> 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir #include <sfx2/objsh.hxx> 64*cdf0e10cSrcweir #include <svtools/embedtransfer.hxx> 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir #include "navigatr.hxx" 67*cdf0e10cSrcweir #include "anminfo.hxx" 68*cdf0e10cSrcweir #include "strings.hrc" 69*cdf0e10cSrcweir #include "glob.hrc" 70*cdf0e10cSrcweir #include "sdxfer.hxx" 71*cdf0e10cSrcweir #include "sdresid.hxx" 72*cdf0e10cSrcweir #include "sdmod.hxx" 73*cdf0e10cSrcweir #include "DrawViewShell.hxx" 74*cdf0e10cSrcweir #include "DrawDocShell.hxx" 75*cdf0e10cSrcweir #include "fudraw.hxx" 76*cdf0e10cSrcweir #include "drawdoc.hxx" 77*cdf0e10cSrcweir #include "Window.hxx" 78*cdf0e10cSrcweir #include "sdpage.hxx" 79*cdf0e10cSrcweir #include "unoaprms.hxx" 80*cdf0e10cSrcweir #include "drawview.hxx" 81*cdf0e10cSrcweir #include "helpids.h" 82*cdf0e10cSrcweir #include <vcl/svapp.hxx> 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir #include "slideshow.hxx" 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir namespace sd { 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir #ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED 89*cdf0e10cSrcweir #define SO2_DECL_SVINPLACEOBJECT_DEFINED 90*cdf0e10cSrcweir SO2_DECL_REF(SvInPlaceObject) 91*cdf0e10cSrcweir #endif 92*cdf0e10cSrcweir #ifndef SO2_DECL_SVSTORAGE_DEFINED 93*cdf0e10cSrcweir #define SO2_DECL_SVSTORAGE_DEFINED 94*cdf0e10cSrcweir SO2_DECL_REF(SvStorage) 95*cdf0e10cSrcweir #endif 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir using namespace ::com::sun::star; 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir // ------------------------ 100*cdf0e10cSrcweir // - SdNavigatorDropEvent - 101*cdf0e10cSrcweir // ------------------------ 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir struct SdNavigatorDropEvent : public ExecuteDropEvent 104*cdf0e10cSrcweir { 105*cdf0e10cSrcweir DropTargetHelper& mrTargetHelper; 106*cdf0e10cSrcweir ::sd::Window* mpTargetWindow; 107*cdf0e10cSrcweir sal_uInt16 mnPage; 108*cdf0e10cSrcweir sal_uInt16 mnLayer; 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir SdNavigatorDropEvent ( 111*cdf0e10cSrcweir const ExecuteDropEvent& rEvt, 112*cdf0e10cSrcweir DropTargetHelper& rTargetHelper, 113*cdf0e10cSrcweir ::sd::Window* pTargetWindow, 114*cdf0e10cSrcweir sal_uInt16 nPage, 115*cdf0e10cSrcweir sal_uInt16 nLayer ) 116*cdf0e10cSrcweir : ExecuteDropEvent( rEvt ), 117*cdf0e10cSrcweir mrTargetHelper( rTargetHelper ), 118*cdf0e10cSrcweir mpTargetWindow( pTargetWindow ), 119*cdf0e10cSrcweir mnPage( nPage ), 120*cdf0e10cSrcweir mnLayer( nLayer ) 121*cdf0e10cSrcweir {} 122*cdf0e10cSrcweir }; 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateClipboardDataObject( View*, ::Window& ) 127*cdf0e10cSrcweir { 128*cdf0e10cSrcweir // since SdTransferable::CopyToClipboard is called, this 129*cdf0e10cSrcweir // dynamically created object ist destroyed automatically 130*cdf0e10cSrcweir SdTransferable* pTransferable = new SdTransferable( mpDoc, NULL, sal_False ); 131*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable ); 132*cdf0e10cSrcweir 133*cdf0e10cSrcweir SD_MOD()->pTransferClip = pTransferable; 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir mpDoc->CreatingDataObj( pTransferable ); 136*cdf0e10cSrcweir pTransferable->SetWorkDocument( (SdDrawDocument*) GetAllMarkedModel() ); 137*cdf0e10cSrcweir mpDoc->CreatingDataObj( NULL ); 138*cdf0e10cSrcweir 139*cdf0e10cSrcweir // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get 140*cdf0e10cSrcweir // fat lines correctly 141*cdf0e10cSrcweir const Rectangle aMarkRect( GetAllMarkedBoundRect() ); 142*cdf0e10cSrcweir TransferableObjectDescriptor aObjDesc; 143*cdf0e10cSrcweir String aDisplayName; 144*cdf0e10cSrcweir SdrOle2Obj* pSdrOleObj = NULL; 145*cdf0e10cSrcweir SdrPageView* pPgView = GetSdrPageView(); 146*cdf0e10cSrcweir SdPage* pOldPage = pPgView ? ( (SdPage*) pPgView->GetPage() ) : NULL; 147*cdf0e10cSrcweir SdPage* pNewPage = (SdPage*) pTransferable->GetWorkDocument()->GetPage( 0 ); 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir if( pOldPage ) 150*cdf0e10cSrcweir { 151*cdf0e10cSrcweir pNewPage->SetSize( pOldPage->GetSize() ); 152*cdf0e10cSrcweir pNewPage->SetLayoutName( pOldPage->GetLayoutName() ); 153*cdf0e10cSrcweir } 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir if( GetMarkedObjectCount() == 1 ) 156*cdf0e10cSrcweir { 157*cdf0e10cSrcweir SdrObject* pObj = GetMarkedObjectByIndex(0); 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir if( pObj && pObj->ISA(SdrOle2Obj) && ((SdrOle2Obj*) pObj)->GetObjRef().is() ) 160*cdf0e10cSrcweir { 161*cdf0e10cSrcweir // If object has no persistence it must be copied as part of the document 162*cdf0e10cSrcweir try 163*cdf0e10cSrcweir { 164*cdf0e10cSrcweir uno::Reference< embed::XEmbedPersist > xPersObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY ); 165*cdf0e10cSrcweir if ( xPersObj.is() && xPersObj->hasEntry() ) 166*cdf0e10cSrcweir pSdrOleObj = (SdrOle2Obj*) pObj; 167*cdf0e10cSrcweir } 168*cdf0e10cSrcweir catch( uno::Exception& ) 169*cdf0e10cSrcweir {} 170*cdf0e10cSrcweir } 171*cdf0e10cSrcweir } 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir if( pSdrOleObj ) 174*cdf0e10cSrcweir SvEmbedTransferHelper::FillTransferableObjectDescriptor( aObjDesc, pSdrOleObj->GetObjRef(), pSdrOleObj->GetGraphic(), pSdrOleObj->GetAspect() ); 175*cdf0e10cSrcweir else 176*cdf0e10cSrcweir pTransferable->GetWorkDocument()->GetDocSh()->FillTransferableObjectDescriptor( aObjDesc ); 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir if( mpDocSh ) 179*cdf0e10cSrcweir aObjDesc.maDisplayName = mpDocSh->GetMedium()->GetURLObject().GetURLNoPass(); 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir aObjDesc.maSize = aMarkRect.GetSize(); 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir pTransferable->SetStartPos( aMarkRect.TopLeft() ); 184*cdf0e10cSrcweir pTransferable->SetObjectDescriptor( aObjDesc ); 185*cdf0e10cSrcweir pTransferable->CopyToClipboard( mpViewSh->GetActiveWindow() ); 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir return xRet; 188*cdf0e10cSrcweir } 189*cdf0e10cSrcweir 190*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 191*cdf0e10cSrcweir 192*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateDragDataObject( View* pWorkView, ::Window& rWindow, const Point& rDragPos ) 193*cdf0e10cSrcweir { 194*cdf0e10cSrcweir SdTransferable* pTransferable = new SdTransferable( mpDoc, pWorkView, sal_False ); 195*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable ); 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir SD_MOD()->pTransferDrag = pTransferable; 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir TransferableObjectDescriptor aObjDesc; 200*cdf0e10cSrcweir String aDisplayName; 201*cdf0e10cSrcweir SdrOle2Obj* pSdrOleObj = NULL; 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir if( GetMarkedObjectCount() == 1 ) 204*cdf0e10cSrcweir { 205*cdf0e10cSrcweir SdrObject* pObj = GetMarkedObjectByIndex( 0 ); 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir if( pObj && pObj->ISA( SdrOle2Obj ) && ( (SdrOle2Obj*) pObj )->GetObjRef().is() ) 208*cdf0e10cSrcweir { 209*cdf0e10cSrcweir // If object has no persistence it must be copied as part of the document 210*cdf0e10cSrcweir try 211*cdf0e10cSrcweir { 212*cdf0e10cSrcweir uno::Reference< embed::XEmbedPersist > xPersObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY ); 213*cdf0e10cSrcweir if ( xPersObj.is() && xPersObj->hasEntry() ) 214*cdf0e10cSrcweir pSdrOleObj = (SdrOle2Obj*) pObj; 215*cdf0e10cSrcweir } 216*cdf0e10cSrcweir catch( uno::Exception& ) 217*cdf0e10cSrcweir {} 218*cdf0e10cSrcweir } 219*cdf0e10cSrcweir } 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir if( mpDocSh ) 222*cdf0e10cSrcweir aDisplayName = mpDocSh->GetMedium()->GetURLObject().GetURLNoPass(); 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir if( pSdrOleObj ) 225*cdf0e10cSrcweir SvEmbedTransferHelper::FillTransferableObjectDescriptor( aObjDesc, pSdrOleObj->GetObjRef(), pSdrOleObj->GetGraphic(), pSdrOleObj->GetAspect() ); 226*cdf0e10cSrcweir else 227*cdf0e10cSrcweir mpDocSh->FillTransferableObjectDescriptor( aObjDesc ); 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir aObjDesc.maSize = GetAllMarkedRect().GetSize(); 230*cdf0e10cSrcweir aObjDesc.maDragStartPos = rDragPos; 231*cdf0e10cSrcweir aObjDesc.maDisplayName = aDisplayName; 232*cdf0e10cSrcweir aObjDesc.mbCanLink = sal_False; 233*cdf0e10cSrcweir 234*cdf0e10cSrcweir pTransferable->SetStartPos( rDragPos ); 235*cdf0e10cSrcweir pTransferable->SetObjectDescriptor( aObjDesc ); 236*cdf0e10cSrcweir pTransferable->StartDrag( &rWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK ); 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir return xRet; 239*cdf0e10cSrcweir } 240*cdf0e10cSrcweir 241*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 242*cdf0e10cSrcweir 243*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateSelectionDataObject( View* pWorkView, ::Window& rWindow ) 244*cdf0e10cSrcweir { 245*cdf0e10cSrcweir SdTransferable* pTransferable = new SdTransferable( mpDoc, pWorkView, sal_True ); 246*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable ); 247*cdf0e10cSrcweir TransferableObjectDescriptor aObjDesc; 248*cdf0e10cSrcweir const Rectangle aMarkRect( GetAllMarkedRect() ); 249*cdf0e10cSrcweir String aDisplayName; 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir SD_MOD()->pTransferSelection = pTransferable; 252*cdf0e10cSrcweir 253*cdf0e10cSrcweir if( mpDocSh ) 254*cdf0e10cSrcweir { 255*cdf0e10cSrcweir aDisplayName = mpDocSh->GetMedium()->GetURLObject().GetURLNoPass(); 256*cdf0e10cSrcweir mpDocSh->FillTransferableObjectDescriptor( aObjDesc ); 257*cdf0e10cSrcweir } 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir aObjDesc.maSize = aMarkRect.GetSize(); 260*cdf0e10cSrcweir 261*cdf0e10cSrcweir pTransferable->SetStartPos( aMarkRect.TopLeft() ); 262*cdf0e10cSrcweir pTransferable->SetObjectDescriptor( aObjDesc ); 263*cdf0e10cSrcweir pTransferable->CopyToSelection( &rWindow ); 264*cdf0e10cSrcweir 265*cdf0e10cSrcweir return xRet; 266*cdf0e10cSrcweir } 267*cdf0e10cSrcweir 268*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 269*cdf0e10cSrcweir 270*cdf0e10cSrcweir void View::UpdateSelectionClipboard( sal_Bool bForceDeselect ) 271*cdf0e10cSrcweir { 272*cdf0e10cSrcweir if( mpViewSh && mpViewSh->GetActiveWindow() ) 273*cdf0e10cSrcweir { 274*cdf0e10cSrcweir if( !bForceDeselect && GetMarkedObjectList().GetMarkCount() ) 275*cdf0e10cSrcweir CreateSelectionDataObject( this, *mpViewSh->GetActiveWindow() ); 276*cdf0e10cSrcweir else if( SD_MOD()->pTransferSelection && ( SD_MOD()->pTransferSelection->GetView() == this ) ) 277*cdf0e10cSrcweir { 278*cdf0e10cSrcweir TransferableHelper::ClearSelection( mpViewSh->GetActiveWindow() ); 279*cdf0e10cSrcweir SD_MOD()->pTransferSelection = NULL; 280*cdf0e10cSrcweir } 281*cdf0e10cSrcweir } 282*cdf0e10cSrcweir } 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir void View::DoCut(::Window* ) 287*cdf0e10cSrcweir { 288*cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView(); 289*cdf0e10cSrcweir 290*cdf0e10cSrcweir if( pOLV ) 291*cdf0e10cSrcweir ( (OutlinerView*) pOLV)->Cut(); 292*cdf0e10cSrcweir else if( AreObjectsMarked() ) 293*cdf0e10cSrcweir { 294*cdf0e10cSrcweir String aStr( SdResId(STR_UNDO_CUT) ); 295*cdf0e10cSrcweir 296*cdf0e10cSrcweir DoCopy(); 297*cdf0e10cSrcweir BegUndo( ( aStr += sal_Unicode(' ') ) += GetDescriptionOfMarkedObjects() ); 298*cdf0e10cSrcweir DeleteMarked(); 299*cdf0e10cSrcweir EndUndo(); 300*cdf0e10cSrcweir } 301*cdf0e10cSrcweir } 302*cdf0e10cSrcweir 303*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 304*cdf0e10cSrcweir 305*cdf0e10cSrcweir void View::DoCopy (::Window* pWindow) 306*cdf0e10cSrcweir { 307*cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView(); 308*cdf0e10cSrcweir 309*cdf0e10cSrcweir if( pOLV ) 310*cdf0e10cSrcweir ( (OutlinerView*) pOLV)->Copy(); 311*cdf0e10cSrcweir else if( AreObjectsMarked() ) 312*cdf0e10cSrcweir { 313*cdf0e10cSrcweir BrkAction(); 314*cdf0e10cSrcweir CreateClipboardDataObject( this, *pWindow ); 315*cdf0e10cSrcweir } 316*cdf0e10cSrcweir } 317*cdf0e10cSrcweir 318*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir void View::DoPaste (::Window* pWindow) 321*cdf0e10cSrcweir { 322*cdf0e10cSrcweir TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( mpViewSh->GetActiveWindow() ) ); 323*cdf0e10cSrcweir if( !aDataHelper.GetTransferable().is() ) 324*cdf0e10cSrcweir return; // empty clipboard? 325*cdf0e10cSrcweir 326*cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView(); 327*cdf0e10cSrcweir 328*cdf0e10cSrcweir if( pOLV && EditEngine::HasValidData( aDataHelper.GetTransferable() ) ) 329*cdf0e10cSrcweir { 330*cdf0e10cSrcweir const_cast< OutlinerView* >(pOLV)->PasteSpecial(); 331*cdf0e10cSrcweir 332*cdf0e10cSrcweir SdrObject* pObj = GetTextEditObject(); 333*cdf0e10cSrcweir SdPage* pPage = (SdPage*)( pObj ? pObj->GetPage() : NULL ); 334*cdf0e10cSrcweir ::Outliner* pOutliner = pOLV->GetOutliner(); 335*cdf0e10cSrcweir 336*cdf0e10cSrcweir if( pOutliner) 337*cdf0e10cSrcweir { 338*cdf0e10cSrcweir if( pObj && pPage && pPage->GetPresObjKind(pObj) == PRESOBJ_TITLE ) 339*cdf0e10cSrcweir { 340*cdf0e10cSrcweir // remove all hard linebreaks from the title 341*cdf0e10cSrcweir if( pOutliner && pOutliner->GetParagraphCount() > 1 ) 342*cdf0e10cSrcweir { 343*cdf0e10cSrcweir sal_Bool bOldUpdateMode = pOutliner->GetUpdateMode(); 344*cdf0e10cSrcweir 345*cdf0e10cSrcweir pOutliner->SetUpdateMode( sal_False ); 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir const EditEngine& rEdit = pOutliner->GetEditEngine(); 348*cdf0e10cSrcweir const int nParaCount = rEdit.GetParagraphCount(); 349*cdf0e10cSrcweir 350*cdf0e10cSrcweir for( int nPara = nParaCount - 2; nPara >= 0; nPara-- ) 351*cdf0e10cSrcweir { 352*cdf0e10cSrcweir const sal_uInt16 nParaLen = (sal_uInt16)rEdit.GetTextLen( (sal_uInt16)nPara ); 353*cdf0e10cSrcweir pOutliner->QuickDelete( ESelection( (sal_uInt16)nPara, nParaLen, (sal_uInt16)nPara+1, 0 ) ); 354*cdf0e10cSrcweir pOutliner->QuickInsertLineBreak( ESelection( (sal_uInt16)nPara, nParaLen, (sal_uInt16)nPara, nParaLen ) ); 355*cdf0e10cSrcweir } 356*cdf0e10cSrcweir 357*cdf0e10cSrcweir DBG_ASSERT( rEdit.GetParagraphCount() <= 1, "Titelobjekt contains hard line breaks" ); 358*cdf0e10cSrcweir pOutliner->SetUpdateMode(bOldUpdateMode); 359*cdf0e10cSrcweir } 360*cdf0e10cSrcweir } 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir if( !mpDoc->IsChanged() ) 363*cdf0e10cSrcweir { 364*cdf0e10cSrcweir if( pOutliner && pOutliner->IsModified() ) 365*cdf0e10cSrcweir mpDoc->SetChanged( sal_True ); 366*cdf0e10cSrcweir } 367*cdf0e10cSrcweir } 368*cdf0e10cSrcweir } 369*cdf0e10cSrcweir else 370*cdf0e10cSrcweir { 371*cdf0e10cSrcweir Point aPos; 372*cdf0e10cSrcweir sal_Int8 nDnDAction = DND_ACTION_COPY; 373*cdf0e10cSrcweir 374*cdf0e10cSrcweir if( pWindow ) 375*cdf0e10cSrcweir aPos = pWindow->PixelToLogic( Rectangle( aPos, pWindow->GetOutputSizePixel() ).Center() ); 376*cdf0e10cSrcweir 377*cdf0e10cSrcweir DrawViewShell* pDrViewSh = (DrawViewShell*) mpDocSh->GetViewShell(); 378*cdf0e10cSrcweir 379*cdf0e10cSrcweir if (pDrViewSh != NULL) 380*cdf0e10cSrcweir { 381*cdf0e10cSrcweir if( !InsertData( aDataHelper, aPos, nDnDAction, sal_False ) ) 382*cdf0e10cSrcweir { 383*cdf0e10cSrcweir INetBookmark aINetBookmark( aEmptyStr, aEmptyStr ); 384*cdf0e10cSrcweir 385*cdf0e10cSrcweir if( ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) && 386*cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) ) || 387*cdf0e10cSrcweir ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) && 388*cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, aINetBookmark ) ) || 389*cdf0e10cSrcweir ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) && 390*cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) ) 391*cdf0e10cSrcweir { 392*cdf0e10cSrcweir pDrViewSh->InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL ); 393*cdf0e10cSrcweir } 394*cdf0e10cSrcweir } 395*cdf0e10cSrcweir } 396*cdf0e10cSrcweir } 397*cdf0e10cSrcweir } 398*cdf0e10cSrcweir 399*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir void View::StartDrag( const Point& rStartPos, ::Window* pWindow ) 402*cdf0e10cSrcweir { 403*cdf0e10cSrcweir if( AreObjectsMarked() && IsAction() && mpViewSh && pWindow && !mpDragSrcMarkList ) 404*cdf0e10cSrcweir { 405*cdf0e10cSrcweir BrkAction(); 406*cdf0e10cSrcweir 407*cdf0e10cSrcweir if( IsTextEdit() ) 408*cdf0e10cSrcweir SdrEndTextEdit(); 409*cdf0e10cSrcweir 410*cdf0e10cSrcweir DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( mpDocSh ? mpDocSh->GetViewShell() : 0 ); 411*cdf0e10cSrcweir 412*cdf0e10cSrcweir if( pDrawViewShell ) 413*cdf0e10cSrcweir { 414*cdf0e10cSrcweir FunctionReference xFunction( pDrawViewShell->GetCurrentFunction() ); 415*cdf0e10cSrcweir 416*cdf0e10cSrcweir if( xFunction.is() && xFunction->ISA( FuDraw ) ) 417*cdf0e10cSrcweir static_cast<FuDraw*>(xFunction.get())->ForcePointer( NULL ); 418*cdf0e10cSrcweir } 419*cdf0e10cSrcweir 420*cdf0e10cSrcweir mpDragSrcMarkList = new SdrMarkList(GetMarkedObjectList()); 421*cdf0e10cSrcweir mnDragSrcPgNum = GetSdrPageView()->GetPage()->GetPageNum(); 422*cdf0e10cSrcweir 423*cdf0e10cSrcweir if( IsUndoEnabled() ) 424*cdf0e10cSrcweir { 425*cdf0e10cSrcweir String aStr( SdResId(STR_UNDO_DRAGDROP) ); 426*cdf0e10cSrcweir aStr += sal_Unicode(' '); 427*cdf0e10cSrcweir aStr += mpDragSrcMarkList->GetMarkDescription(); 428*cdf0e10cSrcweir BegUndo(aStr); 429*cdf0e10cSrcweir } 430*cdf0e10cSrcweir CreateDragDataObject( this, *pWindow, rStartPos ); 431*cdf0e10cSrcweir } 432*cdf0e10cSrcweir } 433*cdf0e10cSrcweir 434*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 435*cdf0e10cSrcweir 436*cdf0e10cSrcweir void View::DragFinished( sal_Int8 nDropAction ) 437*cdf0e10cSrcweir { 438*cdf0e10cSrcweir const bool bUndo = IsUndoEnabled(); 439*cdf0e10cSrcweir 440*cdf0e10cSrcweir SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; 441*cdf0e10cSrcweir 442*cdf0e10cSrcweir if( pDragTransferable ) 443*cdf0e10cSrcweir pDragTransferable->SetView( NULL ); 444*cdf0e10cSrcweir 445*cdf0e10cSrcweir if( ( nDropAction & DND_ACTION_MOVE ) && 446*cdf0e10cSrcweir pDragTransferable && !pDragTransferable->IsInternalMove() && 447*cdf0e10cSrcweir mpDragSrcMarkList && mpDragSrcMarkList->GetMarkCount() && 448*cdf0e10cSrcweir !IsPresObjSelected() ) 449*cdf0e10cSrcweir { 450*cdf0e10cSrcweir mpDragSrcMarkList->ForceSort(); 451*cdf0e10cSrcweir 452*cdf0e10cSrcweir if( bUndo ) 453*cdf0e10cSrcweir BegUndo(); 454*cdf0e10cSrcweir 455*cdf0e10cSrcweir sal_uLong nm, nAnz = mpDragSrcMarkList->GetMarkCount(); 456*cdf0e10cSrcweir 457*cdf0e10cSrcweir for( nm = nAnz; nm>0; ) 458*cdf0e10cSrcweir { 459*cdf0e10cSrcweir nm--; 460*cdf0e10cSrcweir SdrMark* pM=mpDragSrcMarkList->GetMark(nm); 461*cdf0e10cSrcweir if( bUndo ) 462*cdf0e10cSrcweir AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pM->GetMarkedSdrObj())); 463*cdf0e10cSrcweir } 464*cdf0e10cSrcweir 465*cdf0e10cSrcweir mpDragSrcMarkList->GetMark(0)->GetMarkedSdrObj()->GetOrdNum(); 466*cdf0e10cSrcweir 467*cdf0e10cSrcweir for (nm=nAnz; nm>0;) 468*cdf0e10cSrcweir { 469*cdf0e10cSrcweir nm--; 470*cdf0e10cSrcweir SdrMark* pM=mpDragSrcMarkList->GetMark(nm); 471*cdf0e10cSrcweir SdrObject* pObj=pM->GetMarkedSdrObj(); 472*cdf0e10cSrcweir sal_uInt32 nOrdNum=pObj->GetOrdNumDirect(); 473*cdf0e10cSrcweir 474*cdf0e10cSrcweir if( pObj && pObj->GetPage() ) 475*cdf0e10cSrcweir { 476*cdf0e10cSrcweir #ifdef DBG_UTIL 477*cdf0e10cSrcweir SdrObject* pChkObj = 478*cdf0e10cSrcweir #endif 479*cdf0e10cSrcweir pObj->GetPage()->RemoveObject(nOrdNum); 480*cdf0e10cSrcweir DBG_ASSERT(pChkObj==pObj,"pChkObj!=pObj beim RemoveObject()"); 481*cdf0e10cSrcweir } 482*cdf0e10cSrcweir } 483*cdf0e10cSrcweir 484*cdf0e10cSrcweir if( bUndo ) 485*cdf0e10cSrcweir EndUndo(); 486*cdf0e10cSrcweir } 487*cdf0e10cSrcweir 488*cdf0e10cSrcweir if( pDragTransferable ) 489*cdf0e10cSrcweir pDragTransferable->SetInternalMove( sal_False ); 490*cdf0e10cSrcweir 491*cdf0e10cSrcweir if( bUndo ) 492*cdf0e10cSrcweir EndUndo(); 493*cdf0e10cSrcweir mnDragSrcPgNum = SDRPAGE_NOTFOUND; 494*cdf0e10cSrcweir delete mpDragSrcMarkList; 495*cdf0e10cSrcweir mpDragSrcMarkList = NULL; 496*cdf0e10cSrcweir } 497*cdf0e10cSrcweir 498*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 499*cdf0e10cSrcweir 500*cdf0e10cSrcweir sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper, 501*cdf0e10cSrcweir ::sd::Window*, sal_uInt16, sal_uInt16 nLayer ) 502*cdf0e10cSrcweir { 503*cdf0e10cSrcweir String aLayerName( GetActiveLayer() ); 504*cdf0e10cSrcweir SdrPageView* pPV = GetSdrPageView(); 505*cdf0e10cSrcweir sal_Int8 nDropAction = rEvt.mnAction; 506*cdf0e10cSrcweir sal_Int8 nRet = DND_ACTION_NONE; 507*cdf0e10cSrcweir 508*cdf0e10cSrcweir if( nLayer != SDRLAYER_NOTFOUND ) 509*cdf0e10cSrcweir { 510*cdf0e10cSrcweir SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); 511*cdf0e10cSrcweir aLayerName = rLayerAdmin.GetLayerPerID(nLayer)->GetName(); 512*cdf0e10cSrcweir } 513*cdf0e10cSrcweir 514*cdf0e10cSrcweir if( mbIsDropAllowed && !pPV->IsLayerLocked( aLayerName ) && pPV->IsLayerVisible( aLayerName ) ) 515*cdf0e10cSrcweir { 516*cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView(); 517*cdf0e10cSrcweir sal_Bool bIsInsideOutlinerView = sal_False; 518*cdf0e10cSrcweir 519*cdf0e10cSrcweir if( pOLV ) 520*cdf0e10cSrcweir { 521*cdf0e10cSrcweir Rectangle aRect( pOLV->GetOutputArea() ); 522*cdf0e10cSrcweir 523*cdf0e10cSrcweir if (GetMarkedObjectCount() == 1) 524*cdf0e10cSrcweir { 525*cdf0e10cSrcweir SdrMark* pMark = GetSdrMarkByIndex(0); 526*cdf0e10cSrcweir SdrObject* pObj = pMark->GetMarkedSdrObj(); 527*cdf0e10cSrcweir aRect.Union( pObj->GetLogicRect() ); 528*cdf0e10cSrcweir } 529*cdf0e10cSrcweir 530*cdf0e10cSrcweir if( aRect.IsInside( pOLV->GetWindow()->PixelToLogic( rEvt.maPosPixel ) ) ) 531*cdf0e10cSrcweir { 532*cdf0e10cSrcweir bIsInsideOutlinerView = sal_True; 533*cdf0e10cSrcweir } 534*cdf0e10cSrcweir } 535*cdf0e10cSrcweir 536*cdf0e10cSrcweir if( !bIsInsideOutlinerView ) 537*cdf0e10cSrcweir { 538*cdf0e10cSrcweir SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; 539*cdf0e10cSrcweir 540*cdf0e10cSrcweir if( pDragTransferable ) 541*cdf0e10cSrcweir { 542*cdf0e10cSrcweir const View* pSourceView = pDragTransferable->GetView(); 543*cdf0e10cSrcweir 544*cdf0e10cSrcweir if( pDragTransferable->IsPageTransferable() ) 545*cdf0e10cSrcweir { 546*cdf0e10cSrcweir nRet = DND_ACTION_COPY; 547*cdf0e10cSrcweir } 548*cdf0e10cSrcweir else if( pSourceView ) 549*cdf0e10cSrcweir { 550*cdf0e10cSrcweir if( !( nDropAction & DND_ACTION_LINK ) || 551*cdf0e10cSrcweir pSourceView->GetDocSh()->GetMedium()->GetName().Len() ) 552*cdf0e10cSrcweir { 553*cdf0e10cSrcweir nRet = nDropAction; 554*cdf0e10cSrcweir } 555*cdf0e10cSrcweir } 556*cdf0e10cSrcweir } 557*cdf0e10cSrcweir else 558*cdf0e10cSrcweir { 559*cdf0e10cSrcweir const sal_Bool bDrawing = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_DRAWING ); 560*cdf0e10cSrcweir const sal_Bool bGraphic = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_SVXB ); 561*cdf0e10cSrcweir const sal_Bool bMtf = rTargetHelper.IsDropFormatSupported( FORMAT_GDIMETAFILE ); 562*cdf0e10cSrcweir const sal_Bool bBitmap = rTargetHelper.IsDropFormatSupported( FORMAT_BITMAP ); 563*cdf0e10cSrcweir sal_Bool bBookmark = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ); 564*cdf0e10cSrcweir sal_Bool bXFillExchange = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_XFA ); 565*cdf0e10cSrcweir 566*cdf0e10cSrcweir // check handle insert 567*cdf0e10cSrcweir if( !nRet && ( (bXFillExchange && ( SDRDRAG_GRADIENT == GetDragMode() )) || ( SDRDRAG_TRANSPARENCE == GetDragMode() ) ) ) 568*cdf0e10cSrcweir { 569*cdf0e10cSrcweir const SdrHdlList& rHdlList = GetHdlList(); 570*cdf0e10cSrcweir 571*cdf0e10cSrcweir for( sal_uInt32 n = 0; n < rHdlList.GetHdlCount(); n++ ) 572*cdf0e10cSrcweir { 573*cdf0e10cSrcweir SdrHdl* pIAOHandle = rHdlList.GetHdl( n ); 574*cdf0e10cSrcweir 575*cdf0e10cSrcweir if( pIAOHandle && ( HDL_COLR == pIAOHandle->GetKind() ) ) 576*cdf0e10cSrcweir { 577*cdf0e10cSrcweir if(pIAOHandle->getOverlayObjectList().isHitPixel(rEvt.maPosPixel)) 578*cdf0e10cSrcweir { 579*cdf0e10cSrcweir nRet = nDropAction; 580*cdf0e10cSrcweir static_cast< SdrHdlColor* >( pIAOHandle )->SetSize( SDR_HANDLE_COLOR_SIZE_SELECTED ); 581*cdf0e10cSrcweir } 582*cdf0e10cSrcweir else 583*cdf0e10cSrcweir { 584*cdf0e10cSrcweir static_cast< SdrHdlColor* >( pIAOHandle )->SetSize( SDR_HANDLE_COLOR_SIZE_NORMAL ); 585*cdf0e10cSrcweir } 586*cdf0e10cSrcweir } 587*cdf0e10cSrcweir } 588*cdf0e10cSrcweir } 589*cdf0e10cSrcweir 590*cdf0e10cSrcweir // check object insert 591*cdf0e10cSrcweir if( !nRet && ( bXFillExchange || ( ( bDrawing || bGraphic || bMtf || bBitmap || bBookmark ) && ( nDropAction & DND_ACTION_LINK ) ) ) ) 592*cdf0e10cSrcweir { 593*cdf0e10cSrcweir SdrObject* pPickObj = NULL; 594*cdf0e10cSrcweir SdrPageView* pPageView = NULL; 595*cdf0e10cSrcweir ::sd::Window* pWindow = mpViewSh->GetActiveWindow(); 596*cdf0e10cSrcweir Point aPos( pWindow->PixelToLogic( rEvt.maPosPixel ) ); 597*cdf0e10cSrcweir const sal_Bool bHasPickObj = PickObj( aPos, getHitTolLog(), pPickObj, pPageView ); 598*cdf0e10cSrcweir sal_Bool bIsPresTarget = sal_False; 599*cdf0e10cSrcweir 600*cdf0e10cSrcweir if( bHasPickObj && pPickObj && ( pPickObj->IsEmptyPresObj() || pPickObj->GetUserCall() ) ) 601*cdf0e10cSrcweir { 602*cdf0e10cSrcweir SdPage* pPage = (SdPage*) pPickObj->GetPage(); 603*cdf0e10cSrcweir 604*cdf0e10cSrcweir if( pPage && pPage->IsMasterPage() ) 605*cdf0e10cSrcweir bIsPresTarget = pPage->IsPresObj( pPickObj ); 606*cdf0e10cSrcweir } 607*cdf0e10cSrcweir 608*cdf0e10cSrcweir if( bHasPickObj && !bIsPresTarget && 609*cdf0e10cSrcweir ( !pPickObj->ISA( SdrGrafObj ) || bGraphic || bMtf || bBitmap || ( bXFillExchange && !pPickObj->ISA( SdrGrafObj ) && !pPickObj->ISA( SdrOle2Obj ) ) ) ) 610*cdf0e10cSrcweir { 611*cdf0e10cSrcweir if( mpDropMarkerObj != pPickObj ) 612*cdf0e10cSrcweir { 613*cdf0e10cSrcweir mpDropMarkerObj = pPickObj; 614*cdf0e10cSrcweir ImplClearDrawDropMarker(); 615*cdf0e10cSrcweir 616*cdf0e10cSrcweir if(mpDropMarkerObj) 617*cdf0e10cSrcweir { 618*cdf0e10cSrcweir mpDropMarker = new SdrDropMarkerOverlay(*this, *mpDropMarkerObj); 619*cdf0e10cSrcweir } 620*cdf0e10cSrcweir } 621*cdf0e10cSrcweir 622*cdf0e10cSrcweir nRet = nDropAction; 623*cdf0e10cSrcweir } 624*cdf0e10cSrcweir else 625*cdf0e10cSrcweir bXFillExchange = sal_False; 626*cdf0e10cSrcweir } 627*cdf0e10cSrcweir 628*cdf0e10cSrcweir // check normal insert 629*cdf0e10cSrcweir if( !nRet ) 630*cdf0e10cSrcweir { 631*cdf0e10cSrcweir const sal_Bool bSBAFormat = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ); 632*cdf0e10cSrcweir const sal_Bool bEditEngine = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_EDITENGINE ); 633*cdf0e10cSrcweir const sal_Bool bString = rTargetHelper.IsDropFormatSupported( FORMAT_STRING ); 634*cdf0e10cSrcweir const sal_Bool bRTF = rTargetHelper.IsDropFormatSupported( FORMAT_RTF ); 635*cdf0e10cSrcweir const sal_Bool bFile = rTargetHelper.IsDropFormatSupported( FORMAT_FILE ); 636*cdf0e10cSrcweir const sal_Bool bFileList = rTargetHelper.IsDropFormatSupported( FORMAT_FILE_LIST ); 637*cdf0e10cSrcweir 638*cdf0e10cSrcweir if( mpDropMarker ) 639*cdf0e10cSrcweir { 640*cdf0e10cSrcweir ImplClearDrawDropMarker(); 641*cdf0e10cSrcweir mpDropMarkerObj = NULL; 642*cdf0e10cSrcweir } 643*cdf0e10cSrcweir 644*cdf0e10cSrcweir if( bBookmark && bFile && ( nDropAction & DND_ACTION_MOVE ) && mpViewSh && SlideShow::IsRunning(mpViewSh->GetViewShellBase()) ) 645*cdf0e10cSrcweir bBookmark = sal_False; 646*cdf0e10cSrcweir 647*cdf0e10cSrcweir if( bDrawing || bGraphic || bMtf || bBitmap || bBookmark || bFile || bFileList || bXFillExchange || bSBAFormat || bEditEngine || bString || bRTF ) 648*cdf0e10cSrcweir nRet = nDropAction; 649*cdf0e10cSrcweir 650*cdf0e10cSrcweir // For entries from the navigator, change action copy. 651*cdf0e10cSrcweir if (bBookmark 652*cdf0e10cSrcweir && rTargetHelper.IsDropFormatSupported( 653*cdf0e10cSrcweir SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormatId()) 654*cdf0e10cSrcweir && (nDropAction & DND_ACTION_MOVE)!=0) 655*cdf0e10cSrcweir { 656*cdf0e10cSrcweir nRet = DND_ACTION_COPY; 657*cdf0e10cSrcweir } 658*cdf0e10cSrcweir } 659*cdf0e10cSrcweir } 660*cdf0e10cSrcweir } 661*cdf0e10cSrcweir } 662*cdf0e10cSrcweir 663*cdf0e10cSrcweir // destroy drop marker if this is a leaving event 664*cdf0e10cSrcweir if( rEvt.mbLeaving && mpDropMarker ) 665*cdf0e10cSrcweir { 666*cdf0e10cSrcweir ImplClearDrawDropMarker(); 667*cdf0e10cSrcweir mpDropMarkerObj = NULL; 668*cdf0e10cSrcweir } 669*cdf0e10cSrcweir 670*cdf0e10cSrcweir return nRet; 671*cdf0e10cSrcweir } 672*cdf0e10cSrcweir 673*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 674*cdf0e10cSrcweir 675*cdf0e10cSrcweir sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper, 676*cdf0e10cSrcweir ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer ) 677*cdf0e10cSrcweir { 678*cdf0e10cSrcweir SdrPageView* pPV = GetSdrPageView(); 679*cdf0e10cSrcweir String aActiveLayer = GetActiveLayer(); 680*cdf0e10cSrcweir sal_Int8 nDropAction = rEvt.mnAction; 681*cdf0e10cSrcweir sal_Int8 nRet = DND_ACTION_NONE; 682*cdf0e10cSrcweir 683*cdf0e10cSrcweir // destroy drop marker if it is shown 684*cdf0e10cSrcweir if( mpDropMarker ) 685*cdf0e10cSrcweir { 686*cdf0e10cSrcweir ImplClearDrawDropMarker(); 687*cdf0e10cSrcweir mpDropMarkerObj = NULL; 688*cdf0e10cSrcweir } 689*cdf0e10cSrcweir 690*cdf0e10cSrcweir if( !pPV->IsLayerLocked( aActiveLayer ) ) 691*cdf0e10cSrcweir { 692*cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView(); 693*cdf0e10cSrcweir sal_Bool bIsInsideOutlinerView = sal_False; 694*cdf0e10cSrcweir 695*cdf0e10cSrcweir if( pOLV ) 696*cdf0e10cSrcweir { 697*cdf0e10cSrcweir Rectangle aRect( pOLV->GetOutputArea() ); 698*cdf0e10cSrcweir 699*cdf0e10cSrcweir if( GetMarkedObjectCount() == 1 ) 700*cdf0e10cSrcweir { 701*cdf0e10cSrcweir SdrMark* pMark = GetSdrMarkByIndex(0); 702*cdf0e10cSrcweir SdrObject* pObj = pMark->GetMarkedSdrObj(); 703*cdf0e10cSrcweir aRect.Union( pObj->GetLogicRect() ); 704*cdf0e10cSrcweir } 705*cdf0e10cSrcweir 706*cdf0e10cSrcweir Point aPos( pOLV->GetWindow()->PixelToLogic( rEvt.maPosPixel ) ); 707*cdf0e10cSrcweir 708*cdf0e10cSrcweir if( aRect.IsInside( aPos ) ) 709*cdf0e10cSrcweir { 710*cdf0e10cSrcweir bIsInsideOutlinerView = sal_True; 711*cdf0e10cSrcweir } 712*cdf0e10cSrcweir } 713*cdf0e10cSrcweir 714*cdf0e10cSrcweir if( !bIsInsideOutlinerView ) 715*cdf0e10cSrcweir { 716*cdf0e10cSrcweir Point aPos; 717*cdf0e10cSrcweir TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable ); 718*cdf0e10cSrcweir 719*cdf0e10cSrcweir if( pTargetWindow ) 720*cdf0e10cSrcweir aPos = pTargetWindow->PixelToLogic( rEvt.maPosPixel ); 721*cdf0e10cSrcweir 722*cdf0e10cSrcweir // handle insert? 723*cdf0e10cSrcweir if( (!nRet && ( SDRDRAG_GRADIENT == GetDragMode() )) || (( SDRDRAG_TRANSPARENCE == GetDragMode() ) && aDataHelper.HasFormat( SOT_FORMATSTR_ID_XFA )) ) 724*cdf0e10cSrcweir { 725*cdf0e10cSrcweir const SdrHdlList& rHdlList = GetHdlList(); 726*cdf0e10cSrcweir 727*cdf0e10cSrcweir for( sal_uInt32 n = 0; !nRet && n < rHdlList.GetHdlCount(); n++ ) 728*cdf0e10cSrcweir { 729*cdf0e10cSrcweir SdrHdl* pIAOHandle = rHdlList.GetHdl( n ); 730*cdf0e10cSrcweir 731*cdf0e10cSrcweir if( pIAOHandle && ( HDL_COLR == pIAOHandle->GetKind() ) ) 732*cdf0e10cSrcweir { 733*cdf0e10cSrcweir if(pIAOHandle->getOverlayObjectList().isHitPixel(rEvt.maPosPixel)) 734*cdf0e10cSrcweir { 735*cdf0e10cSrcweir SotStorageStreamRef xStm; 736*cdf0e10cSrcweir 737*cdf0e10cSrcweir if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_XFA, xStm ) && xStm.Is() ) 738*cdf0e10cSrcweir { 739*cdf0e10cSrcweir XFillExchangeData aFillData( XFillAttrSetItem( &mpDoc->GetPool() ) ); 740*cdf0e10cSrcweir 741*cdf0e10cSrcweir *xStm >> aFillData; 742*cdf0e10cSrcweir const Color aColor( ( (XFillColorItem&) aFillData.GetXFillAttrSetItem()->GetItemSet().Get( XATTR_FILLCOLOR ) ).GetColorValue() ); 743*cdf0e10cSrcweir static_cast< SdrHdlColor* >( pIAOHandle )->SetColor( aColor, sal_True ); 744*cdf0e10cSrcweir nRet = nDropAction; 745*cdf0e10cSrcweir } 746*cdf0e10cSrcweir } 747*cdf0e10cSrcweir } 748*cdf0e10cSrcweir } 749*cdf0e10cSrcweir } 750*cdf0e10cSrcweir 751*cdf0e10cSrcweir // standard insert? 752*cdf0e10cSrcweir if( !nRet && InsertData( aDataHelper, aPos, nDropAction, sal_True, 0, nPage, nLayer ) ) 753*cdf0e10cSrcweir nRet = nDropAction; 754*cdf0e10cSrcweir 755*cdf0e10cSrcweir // special insert? 756*cdf0e10cSrcweir if( !nRet && mpViewSh ) 757*cdf0e10cSrcweir { 758*cdf0e10cSrcweir String aTmpString1, aTmpString2; 759*cdf0e10cSrcweir INetBookmark aINetBookmark( aTmpString1, aTmpString2 ); 760*cdf0e10cSrcweir 761*cdf0e10cSrcweir // insert bookmark 762*cdf0e10cSrcweir if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) && 763*cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) ) 764*cdf0e10cSrcweir { 765*cdf0e10cSrcweir SdPageObjsTLB::SdPageObjsTransferable* pPageObjsTransferable = SdPageObjsTLB::SdPageObjsTransferable::getImplementation( aDataHelper.GetXTransferable() ); 766*cdf0e10cSrcweir 767*cdf0e10cSrcweir if( pPageObjsTransferable && 768*cdf0e10cSrcweir ( NAVIGATOR_DRAGTYPE_LINK == pPageObjsTransferable->GetDragType() || 769*cdf0e10cSrcweir NAVIGATOR_DRAGTYPE_EMBEDDED == pPageObjsTransferable->GetDragType() ) ) 770*cdf0e10cSrcweir { 771*cdf0e10cSrcweir // insert bookmark from own navigator (handled async. due to possible message box ) 772*cdf0e10cSrcweir Application::PostUserEvent( LINK( this, View, ExecuteNavigatorDrop ), 773*cdf0e10cSrcweir new SdNavigatorDropEvent( rEvt, rTargetHelper, pTargetWindow, 774*cdf0e10cSrcweir nPage, nLayer ) ); 775*cdf0e10cSrcweir nRet = nDropAction; 776*cdf0e10cSrcweir } 777*cdf0e10cSrcweir else 778*cdf0e10cSrcweir { 779*cdf0e10cSrcweir SdrObject* pPickObj = NULL; 780*cdf0e10cSrcweir SdrPageView* pPageView = NULL; 781*cdf0e10cSrcweir 782*cdf0e10cSrcweir if( PickObj( aPos, getHitTolLog(), pPickObj, pPageView ) ) 783*cdf0e10cSrcweir { 784*cdf0e10cSrcweir // insert as clip action => jump 785*cdf0e10cSrcweir rtl::OUString aBookmark( aINetBookmark.GetURL() ); 786*cdf0e10cSrcweir SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo( pPickObj ); 787*cdf0e10cSrcweir sal_Bool bCreated = sal_False; 788*cdf0e10cSrcweir 789*cdf0e10cSrcweir if( aBookmark.getLength() ) 790*cdf0e10cSrcweir { 791*cdf0e10cSrcweir presentation::ClickAction eClickAction = presentation::ClickAction_DOCUMENT; 792*cdf0e10cSrcweir 793*cdf0e10cSrcweir sal_Int32 nIndex = aBookmark.indexOf( (sal_Unicode)'#' ); 794*cdf0e10cSrcweir if( nIndex != -1 ) 795*cdf0e10cSrcweir { 796*cdf0e10cSrcweir const String aDocName( aBookmark.copy( 0, nIndex ) ); 797*cdf0e10cSrcweir 798*cdf0e10cSrcweir if( mpDocSh->GetMedium()->GetName() == aDocName || mpDocSh->GetName() == aDocName ) 799*cdf0e10cSrcweir { 800*cdf0e10cSrcweir // internal jump, only use the part after and including '#' 801*cdf0e10cSrcweir eClickAction = presentation::ClickAction_BOOKMARK; 802*cdf0e10cSrcweir aBookmark = aBookmark.copy( nIndex+1 ); 803*cdf0e10cSrcweir } 804*cdf0e10cSrcweir } 805*cdf0e10cSrcweir 806*cdf0e10cSrcweir if( !pInfo ) 807*cdf0e10cSrcweir { 808*cdf0e10cSrcweir pInfo = SdDrawDocument::GetShapeUserData( *pPickObj, true ); 809*cdf0e10cSrcweir bCreated = sal_True; 810*cdf0e10cSrcweir } 811*cdf0e10cSrcweir 812*cdf0e10cSrcweir // Undo-Action mit alten und neuen Groessen erzeugen 813*cdf0e10cSrcweir SdAnimationPrmsUndoAction* pAction = new SdAnimationPrmsUndoAction(mpDoc, pPickObj, bCreated); 814*cdf0e10cSrcweir pAction->SetActive(pInfo->mbActive, pInfo->mbActive); 815*cdf0e10cSrcweir pAction->SetEffect(pInfo->meEffect, pInfo->meEffect); 816*cdf0e10cSrcweir pAction->SetTextEffect(pInfo->meTextEffect, pInfo->meTextEffect); 817*cdf0e10cSrcweir pAction->SetSpeed(pInfo->meSpeed, pInfo->meSpeed); 818*cdf0e10cSrcweir pAction->SetDim(pInfo->mbDimPrevious, pInfo->mbDimPrevious); 819*cdf0e10cSrcweir pAction->SetDimColor(pInfo->maDimColor, pInfo->maDimColor); 820*cdf0e10cSrcweir pAction->SetDimHide(pInfo->mbDimHide, pInfo->mbDimHide); 821*cdf0e10cSrcweir pAction->SetSoundOn(pInfo->mbSoundOn, pInfo->mbSoundOn); 822*cdf0e10cSrcweir pAction->SetSound(pInfo->maSoundFile, pInfo->maSoundFile); 823*cdf0e10cSrcweir pAction->SetPlayFull(pInfo->mbPlayFull, pInfo->mbPlayFull); 824*cdf0e10cSrcweir pAction->SetPathObj(pInfo->mpPathObj, pInfo->mpPathObj); 825*cdf0e10cSrcweir pAction->SetClickAction(pInfo->meClickAction, eClickAction); 826*cdf0e10cSrcweir pAction->SetBookmark(pInfo->GetBookmark(), aBookmark); 827*cdf0e10cSrcweir // pAction->SetInvisibleInPres(pInfo->mbInvisibleInPresentation, sal_True); 828*cdf0e10cSrcweir pAction->SetVerb(pInfo->mnVerb, pInfo->mnVerb); 829*cdf0e10cSrcweir pAction->SetSecondEffect(pInfo->meSecondEffect, pInfo->meSecondEffect); 830*cdf0e10cSrcweir pAction->SetSecondSpeed(pInfo->meSecondSpeed, pInfo->meSecondSpeed); 831*cdf0e10cSrcweir pAction->SetSecondSoundOn(pInfo->mbSecondSoundOn, pInfo->mbSecondSoundOn); 832*cdf0e10cSrcweir pAction->SetSecondPlayFull(pInfo->mbSecondPlayFull, pInfo->mbSecondPlayFull); 833*cdf0e10cSrcweir 834*cdf0e10cSrcweir String aString(SdResId(STR_UNDO_ANIMATION)); 835*cdf0e10cSrcweir pAction->SetComment(aString); 836*cdf0e10cSrcweir mpDocSh->GetUndoManager()->AddUndoAction(pAction); 837*cdf0e10cSrcweir pInfo->meClickAction = eClickAction; 838*cdf0e10cSrcweir pInfo->SetBookmark( aBookmark ); 839*cdf0e10cSrcweir mpDoc->SetChanged(); 840*cdf0e10cSrcweir 841*cdf0e10cSrcweir nRet = nDropAction; 842*cdf0e10cSrcweir } 843*cdf0e10cSrcweir } 844*cdf0e10cSrcweir else if( mpViewSh->ISA( DrawViewShell ) ) 845*cdf0e10cSrcweir { 846*cdf0e10cSrcweir // insert as normal URL button 847*cdf0e10cSrcweir ( (DrawViewShell*) mpViewSh )->InsertURLButton( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), String(), &aPos ); 848*cdf0e10cSrcweir nRet = nDropAction; 849*cdf0e10cSrcweir } 850*cdf0e10cSrcweir } 851*cdf0e10cSrcweir } 852*cdf0e10cSrcweir } 853*cdf0e10cSrcweir } 854*cdf0e10cSrcweir } 855*cdf0e10cSrcweir 856*cdf0e10cSrcweir return nRet; 857*cdf0e10cSrcweir } 858*cdf0e10cSrcweir 859*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 860*cdf0e10cSrcweir 861*cdf0e10cSrcweir IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEvent ) 862*cdf0e10cSrcweir { 863*cdf0e10cSrcweir TransferableDataHelper aDataHelper( pSdNavigatorDropEvent->maDropEvent.Transferable ); 864*cdf0e10cSrcweir SdPageObjsTLB::SdPageObjsTransferable* pPageObjsTransferable = SdPageObjsTLB::SdPageObjsTransferable::getImplementation( aDataHelper.GetXTransferable() ); 865*cdf0e10cSrcweir INetBookmark aINetBookmark; 866*cdf0e10cSrcweir 867*cdf0e10cSrcweir if( pPageObjsTransferable && aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) ) 868*cdf0e10cSrcweir { 869*cdf0e10cSrcweir Point aPos; 870*cdf0e10cSrcweir List aBookmarkList; 871*cdf0e10cSrcweir String aBookmark; 872*cdf0e10cSrcweir SdPage* pPage = (SdPage*) GetSdrPageView()->GetPage(); 873*cdf0e10cSrcweir sal_uInt16 nPgPos = 0xFFFF; 874*cdf0e10cSrcweir 875*cdf0e10cSrcweir if( pSdNavigatorDropEvent->mpTargetWindow ) 876*cdf0e10cSrcweir aPos = pSdNavigatorDropEvent->mpTargetWindow->PixelToLogic( pSdNavigatorDropEvent->maPosPixel ); 877*cdf0e10cSrcweir 878*cdf0e10cSrcweir const rtl::OUString aURL( aINetBookmark.GetURL() ); 879*cdf0e10cSrcweir sal_Int32 nIndex = aURL.indexOf( (sal_Unicode)'#' ); 880*cdf0e10cSrcweir if( nIndex != -1 ) 881*cdf0e10cSrcweir aBookmark = aURL.copy( nIndex+1 ); 882*cdf0e10cSrcweir aBookmarkList.Insert( &aBookmark ); 883*cdf0e10cSrcweir 884*cdf0e10cSrcweir if( !pPage->IsMasterPage() ) 885*cdf0e10cSrcweir { 886*cdf0e10cSrcweir if( pPage->GetPageKind() == PK_STANDARD ) 887*cdf0e10cSrcweir nPgPos = pPage->GetPageNum() + 2; 888*cdf0e10cSrcweir else if( pPage->GetPageKind() == PK_NOTES ) 889*cdf0e10cSrcweir nPgPos = pPage->GetPageNum() + 1; 890*cdf0e10cSrcweir } 891*cdf0e10cSrcweir 892*cdf0e10cSrcweir // Um zu gewaehrleisten, dass alle Seitennamen eindeutig sind, werden 893*cdf0e10cSrcweir // die einzufuegenden geprueft und gegebenenfalls in einer Ersatzliste 894*cdf0e10cSrcweir // aufgenommen (bNameOK == sal_False -> Benutzer hat abgebrochen) 895*cdf0e10cSrcweir List* pExchangeList = NULL; 896*cdf0e10cSrcweir sal_Bool bLink = ( NAVIGATOR_DRAGTYPE_LINK == pPageObjsTransferable->GetDragType() ? sal_True : sal_False ); 897*cdf0e10cSrcweir sal_Bool bNameOK = GetExchangeList( pExchangeList, &aBookmarkList, 2 ); 898*cdf0e10cSrcweir sal_Bool bReplace = sal_False; 899*cdf0e10cSrcweir 900*cdf0e10cSrcweir // Da man hier nicht weiss, ob es sich um eine Seite oder ein Objekt handelt, 901*cdf0e10cSrcweir // wird eine Liste sowohl mit Seiten, als auch mit Objekten gefuellt. 902*cdf0e10cSrcweir // Sollten Seitennamen und Objektnamen identisch sein gibt es hier natuerlich Probleme !!! 903*cdf0e10cSrcweir if( bNameOK ) 904*cdf0e10cSrcweir { 905*cdf0e10cSrcweir mpDoc->InsertBookmark( &aBookmarkList, pExchangeList, 906*cdf0e10cSrcweir bLink, bReplace, nPgPos, sal_False, 907*cdf0e10cSrcweir &pPageObjsTransferable->GetDocShell(), 908*cdf0e10cSrcweir sal_True, &aPos ); 909*cdf0e10cSrcweir } 910*cdf0e10cSrcweir 911*cdf0e10cSrcweir // Loeschen der ExchangeList 912*cdf0e10cSrcweir if( pExchangeList ) 913*cdf0e10cSrcweir { 914*cdf0e10cSrcweir for( void* p = pExchangeList->First(); p; p = pExchangeList->Next() ) 915*cdf0e10cSrcweir delete (String*) p; 916*cdf0e10cSrcweir 917*cdf0e10cSrcweir delete pExchangeList; 918*cdf0e10cSrcweir } 919*cdf0e10cSrcweir } 920*cdf0e10cSrcweir 921*cdf0e10cSrcweir delete pSdNavigatorDropEvent; 922*cdf0e10cSrcweir 923*cdf0e10cSrcweir return 0; 924*cdf0e10cSrcweir } 925*cdf0e10cSrcweir 926*cdf0e10cSrcweir /************************************************************************* 927*cdf0e10cSrcweir |* 928*cdf0e10cSrcweir |* Rueckgabeparameter: 929*cdf0e10cSrcweir |* pExchangeList == NULL -> Namen sind alle eindeutig 930*cdf0e10cSrcweir |* bNameOK == sal_False -> Benutzer hat abgebrochen 931*cdf0e10cSrcweir |* nType == 0 -> Seiten 932*cdf0e10cSrcweir |* nType == 1 -> Objekte 933*cdf0e10cSrcweir |* nType == 2 -> Seiten + Objekte 934*cdf0e10cSrcweir |* 935*cdf0e10cSrcweir \************************************************************************/ 936*cdf0e10cSrcweir 937*cdf0e10cSrcweir sal_Bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_uInt16 nType ) 938*cdf0e10cSrcweir { 939*cdf0e10cSrcweir DBG_ASSERT( !rpExchangeList, "ExchangeList muss NULL sein!"); 940*cdf0e10cSrcweir 941*cdf0e10cSrcweir sal_Bool bListIdentical = sal_True; // BookmarkList und ExchangeList sind gleich 942*cdf0e10cSrcweir sal_Bool bNameOK = sal_True; // Name ist eindeutig 943*cdf0e10cSrcweir 944*cdf0e10cSrcweir rpExchangeList = new List(); 945*cdf0e10cSrcweir 946*cdf0e10cSrcweir if( pBookmarkList ) 947*cdf0e10cSrcweir { 948*cdf0e10cSrcweir String* pString = (String*) pBookmarkList->First(); 949*cdf0e10cSrcweir 950*cdf0e10cSrcweir while( pString && bNameOK ) 951*cdf0e10cSrcweir { 952*cdf0e10cSrcweir String* pNewName = new String( *pString ); 953*cdf0e10cSrcweir 954*cdf0e10cSrcweir if( nType == 0 || nType == 2 ) 955*cdf0e10cSrcweir bNameOK = mpDocSh->CheckPageName ( 956*cdf0e10cSrcweir mpViewSh->GetActiveWindow(), *pNewName); 957*cdf0e10cSrcweir 958*cdf0e10cSrcweir if( bNameOK && ( nType == 1 || nType == 2 ) ) 959*cdf0e10cSrcweir { 960*cdf0e10cSrcweir if( mpDoc->GetObj( *pNewName ) ) 961*cdf0e10cSrcweir { 962*cdf0e10cSrcweir String aTitle( SdResId( STR_TITLE_NAMEGROUP ) ); 963*cdf0e10cSrcweir String aDesc( SdResId( STR_DESC_NAMEGROUP ) ); 964*cdf0e10cSrcweir SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); 965*cdf0e10cSrcweir AbstractSvxNameDialog* pDlg = pFact ? pFact->CreateSvxNameDialog( mpViewSh->GetActiveWindow(), *pNewName, aDesc ) : 0; 966*cdf0e10cSrcweir if( pDlg ) 967*cdf0e10cSrcweir { 968*cdf0e10cSrcweir pDlg->SetEditHelpId( HID_SD_NAMEDIALOG_OBJECT ); 969*cdf0e10cSrcweir 970*cdf0e10cSrcweir bNameOK = sal_False; 971*cdf0e10cSrcweir pDlg->SetText( aTitle ); 972*cdf0e10cSrcweir 973*cdf0e10cSrcweir while( !bNameOK && pDlg->Execute() == RET_OK ) 974*cdf0e10cSrcweir { 975*cdf0e10cSrcweir pDlg->GetName( *pNewName ); 976*cdf0e10cSrcweir 977*cdf0e10cSrcweir if( !mpDoc->GetObj( *pNewName ) ) 978*cdf0e10cSrcweir bNameOK = sal_True; 979*cdf0e10cSrcweir } 980*cdf0e10cSrcweir 981*cdf0e10cSrcweir delete pDlg; 982*cdf0e10cSrcweir } 983*cdf0e10cSrcweir } 984*cdf0e10cSrcweir } 985*cdf0e10cSrcweir 986*cdf0e10cSrcweir if( bListIdentical ) 987*cdf0e10cSrcweir bListIdentical = ( *pString == *pNewName ); 988*cdf0e10cSrcweir 989*cdf0e10cSrcweir rpExchangeList->Insert( pNewName, LIST_APPEND ); 990*cdf0e10cSrcweir pString = (String*) pBookmarkList->Next(); 991*cdf0e10cSrcweir } 992*cdf0e10cSrcweir } 993*cdf0e10cSrcweir 994*cdf0e10cSrcweir // ExchangeList ist mit BookmarkList identisch 995*cdf0e10cSrcweir if( rpExchangeList && bListIdentical ) 996*cdf0e10cSrcweir { 997*cdf0e10cSrcweir String* pString = (String*) rpExchangeList->First(); 998*cdf0e10cSrcweir while( pString ) 999*cdf0e10cSrcweir { 1000*cdf0e10cSrcweir delete pString; 1001*cdf0e10cSrcweir pString = (String*) rpExchangeList->Next(); 1002*cdf0e10cSrcweir } 1003*cdf0e10cSrcweir delete rpExchangeList; 1004*cdf0e10cSrcweir rpExchangeList = NULL; 1005*cdf0e10cSrcweir } 1006*cdf0e10cSrcweir 1007*cdf0e10cSrcweir return( bNameOK ); 1008*cdf0e10cSrcweir } 1009*cdf0e10cSrcweir 1010*cdf0e10cSrcweir typedef std::vector< std::pair< sal_uInt32, sal_uInt32 > > PathSurrogateVector; 1011*cdf0e10cSrcweir typedef std::vector< SdrObject* > SdrObjectVector; 1012*cdf0e10cSrcweir 1013*cdf0e10cSrcweir void ImplProcessObjectList(SdrObject* pObj, SdrObjectVector& rVector ) 1014*cdf0e10cSrcweir { 1015*cdf0e10cSrcweir sal_Bool bIsGroup(pObj->IsGroupObject()); 1016*cdf0e10cSrcweir if(bIsGroup && pObj->ISA(E3dObject) && !pObj->ISA(E3dScene)) 1017*cdf0e10cSrcweir bIsGroup = sal_False; 1018*cdf0e10cSrcweir 1019*cdf0e10cSrcweir rVector.push_back( pObj ); 1020*cdf0e10cSrcweir 1021*cdf0e10cSrcweir if(bIsGroup) 1022*cdf0e10cSrcweir { 1023*cdf0e10cSrcweir SdrObjList* pObjList = pObj->GetSubList(); 1024*cdf0e10cSrcweir sal_uInt32 a; 1025*cdf0e10cSrcweir for( a = 0; a < pObjList->GetObjCount(); a++) 1026*cdf0e10cSrcweir ImplProcessObjectList(pObjList->GetObj(a), rVector); 1027*cdf0e10cSrcweir } 1028*cdf0e10cSrcweir } 1029*cdf0e10cSrcweir 1030*cdf0e10cSrcweir SdrModel* View::GetMarkedObjModel() const 1031*cdf0e10cSrcweir { 1032*cdf0e10cSrcweir return FmFormView::GetMarkedObjModel();; 1033*cdf0e10cSrcweir } 1034*cdf0e10cSrcweir 1035*cdf0e10cSrcweir sal_Bool View::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst /* =NULL */, sal_uInt32 nOptions /* =0 */) 1036*cdf0e10cSrcweir { 1037*cdf0e10cSrcweir return FmFormView::Paste( rMod, rPos, pLst,nOptions );; 1038*cdf0e10cSrcweir } 1039*cdf0e10cSrcweir 1040*cdf0e10cSrcweir } // end of namespace sd 1041