summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/drawvie4.cxx
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2001-03-23 18:26:39 +0000
committerNiklas Nebel <nn@openoffice.org>2001-03-23 18:26:39 +0000
commitac67f489432eebcb1b37d354f4599bbe72588ae5 (patch)
tree809f6238d7e870423692a0a3bc69498fcb83658f /sc/source/ui/view/drawvie4.cxx
parent4c8040639b6ecdac7a54c792b376bdcf8ab8092c (diff)
new drag&drop
Diffstat (limited to 'sc/source/ui/view/drawvie4.cxx')
-rw-r--r--sc/source/ui/view/drawvie4.cxx85
1 files changed, 51 insertions, 34 deletions
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index d1bbbc09780f..39a3ce278793 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: drawvie4.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: nn $ $Date: 2001-02-14 19:27:31 $
+ * last change: $Author: nn $ $Date: 2001-03-23 19:24:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -405,7 +405,7 @@
#include "viewdata.hxx"
#include "document.hxx"
#include "docsh.hxx"
-#include "dataobj.hxx"
+//#include "dataobj.hxx"
#include "drwtrans.hxx"
#include "drawutil.hxx"
#include "scmod.hxx"
@@ -494,7 +494,8 @@ BOOL ScDrawView::BeginDrag( Window* pWindow, const Point& rStartPos )
SdrView aEditView( GetModel() );
lcl_InitMarks( aEditView, *this, nTab );
- BegUndo( ScGlobal::GetRscString( STR_UNDO_DRAGDROP ) );
+ //BegUndo( ScGlobal::GetRscString( STR_UNDO_DRAGDROP ) );
+ //! in DragDone!
//---------------------------------------------------------
ScDocShellRef aDragShellRef;
@@ -506,48 +507,64 @@ BOOL ScDrawView::BeginDrag( Window* pWindow, const Point& rStartPos )
//---------------------------------------------------------
ScDrawLayer::SetGlobalDrawPersist(aDragShellRef);
- SdrModel* pDragModel = GetAllMarkedModel();
+ SdrModel* pModel = GetAllMarkedModel();
ScDrawLayer::SetGlobalDrawPersist(NULL);
- SvDataObjectRef pDragServer = new ScDataObject(pDragModel,
- pViewData->GetDocShell(), bOneOle);
- pScMod->SetDragObject(pDragModel, &aEditView, 0);
- DropAction eDropAction = pDragServer->ExecuteDrag(pWindow,
- POINTER_MOVEDATA, POINTER_COPYDATA, POINTER_LINKDATA,
- DRAG_ALL, &aRegion);
- BOOL bIntern = pScMod->GetDragIntern();
- pScMod->ResetDragObject();
- pDragServer.Clear(); // enthaelt Referenzen auf pDragShell
+ ScDocShell* pDocSh = pViewData->GetDocShell();
- //---------------------------------------------------------
+ TransferableObjectDescriptor aObjDesc;
+ pDocSh->FillTransferableObjectDescriptor( aObjDesc );
+ aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
+ // maSize is set in ScDrawTransferObj ctor
- switch (eDropAction)
- {
- case DROP_MOVE:
- case DROP_DISCARD:
- if (!bIntern)
- aEditView.DeleteMarked();
- break;
+ ScDrawTransferObj* pTransferObj = new ScDrawTransferObj( pModel, pDocSh, aObjDesc );
+ uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj );
- case DROP_NONE:
- case DROP_COPY:
- case DROP_LINK:
- case DROP_PRINT:
- break;
+ //pScMod->SetDragObject(pDragModel, &aEditView, 0);
+ //! keep pTransferObj pointer instead
- default:
- break;
- }
+ pTransferObj->StartDrag( pWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
+ }
+
+ return bReturn;
+}
- if (eDropAction != DROP_NONE)
- bReturn = TRUE;
+#if 0
- EndUndo();
+void ScDrawView::DragDone()
+{
+ BOOL bIntern = pScMod->GetDragIntern();
+ pScMod->ResetDragObject();
+ pDragServer.Clear(); // enthaelt Referenzen auf pDragShell
+
+ //---------------------------------------------------------
+
+ switch (eDropAction)
+ {
+ case DROP_MOVE:
+ case DROP_DISCARD:
+ if (!bIntern)
+ aEditView.DeleteMarked();
+ break;
+
+ case DROP_NONE:
+ case DROP_COPY:
+ case DROP_LINK:
+ case DROP_PRINT:
+ break;
+
+ default:
+ break;
}
- return bReturn;
+ if (eDropAction != DROP_NONE)
+ bReturn = TRUE;
+
+ EndUndo();
}
+#endif
+
void ScDrawView::DoCopy()
{
BOOL bAnyOle, bOneOle;