summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/scmod.hxx10
-rw-r--r--sc/source/ui/app/inputwin.cxx15
-rw-r--r--sc/source/ui/app/makefile.mk5
-rw-r--r--sc/source/ui/app/scmod.cxx14
-rw-r--r--sc/source/ui/app/seltrans.cxx438
-rw-r--r--sc/source/ui/inc/gridwin.hxx9
-rw-r--r--sc/source/ui/inc/seltrans.hxx117
-rw-r--r--sc/source/ui/inc/tabview.hxx6
8 files changed, 601 insertions, 13 deletions
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 76af5ad22d6d..470f6f0ca0a0 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scmod.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: nn $ $Date: 2001-05-29 19:31:58 $
+ * last change: $Author: nn $ $Date: 2001-10-02 18:26:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -118,6 +118,7 @@ class ScNavipiCfg;
class ScFormEditData;
class ScTransferObj;
class ScDrawTransferObj;
+class ScSelectionTransferObj;
//==================================================================
@@ -154,6 +155,7 @@ class ScModule: public ScModuleDummy, public SfxListener
Timer aSpellTimer;
ScDragData aDragData;
ScClipData aClipData;
+ ScSelectionTransferObj* pSelTransfer;
ScMessagePool* pMessagePool;
// globalen InputHandler gibt's nicht mehr, jede View hat einen
ScInputHandler* pRefInputHandler;
@@ -210,6 +212,10 @@ public:
ScDocument* GetClipDoc(); // called from document - should be removed later
+ // X selection:
+ ScSelectionTransferObj* GetSelectionTransfer() const { return pSelTransfer; }
+ void SetSelectionTransfer( ScSelectionTransferObj* pNew );
+
void SetWaterCan( BOOL bNew ) { bIsWaterCan = bNew; }
BOOL GetIsWaterCan() const { return bIsWaterCan; }
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index a03fc19fbe71..0a49005660dd 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inputwin.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: nn $ $Date: 2001-09-24 17:33:17 $
+ * last change: $Author: nn $ $Date: 2001-10-02 18:31:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -692,7 +692,16 @@ void __EXPORT ScTextWnd::MouseButtonUp( const MouseEvent& rMEvt )
{
if (pEditView)
if (pEditView->MouseButtonUp( rMEvt ))
- SC_MOD()->InputSelection( pEditView );
+ {
+ if ( rMEvt.IsMiddle() &&
+ GetSettings().GetMouseSettings().GetMiddleButtonAction() == MOUSE_MIDDLE_PASTESELECTION )
+ {
+ // EditView may have pasted from selection
+ SC_MOD()->InputChanged( pEditView );
+ }
+ else
+ SC_MOD()->InputSelection( pEditView );
+ }
}
void __EXPORT ScTextWnd::Command( const CommandEvent& rCEvt )
diff --git a/sc/source/ui/app/makefile.mk b/sc/source/ui/app/makefile.mk
index c97ae5fdb76d..51473eee74a2 100644
--- a/sc/source/ui/app/makefile.mk
+++ b/sc/source/ui/app/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.6 $
+# $Revision: 1.7 $
#
-# last change: $Author: hjs $ $Date: 2001-07-13 15:59:30 $
+# last change: $Author: nn $ $Date: 2001-10-02 18:25:14 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -92,6 +92,7 @@ SLOFILES = \
$(SLO)$/transobj.obj \
$(SLO)$/drwtrans.obj \
$(SLO)$/lnktrans.obj \
+ $(SLO)$/seltrans.obj \
$(SLO)$/inputhdl.obj \
$(SLO)$/inputwin.obj \
$(SLO)$/rfindlst.obj \
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 01ad57b1309b..49bd09d5a0d9 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scmod.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: nn $ $Date: 2001-08-13 16:23:11 $
+ * last change: $Author: nn $ $Date: 2001-10-02 18:31:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -153,6 +153,7 @@ ScModule::ScModule( SfxObjectFactory* pFact ) :
ScModuleDummy( SFX_APP()->CreateResManager( "sc" ), FALSE, pFact ),
bIsWaterCan( FALSE ),
bIsInEditCommand( FALSE ),
+ pSelTransfer( NULL ),
pRefInputHandler( NULL ),
pViewCfg( NULL ),
pDocCfg( NULL ),
@@ -200,6 +201,8 @@ ScModule::ScModule( SfxObjectFactory* pFact ) :
ScModule::~ScModule()
{
+ DBG_ASSERT( !pSelTransfer, "Selection Transfer object not deleted" );
+
// InputHandler braucht nicht mehr geloescht zu werden (gibt keinen an der App mehr)
DELETEZ( pMessagePool );
@@ -654,6 +657,13 @@ ScDocument* ScModule::GetClipDoc()
//------------------------------------------------------------------
+void ScModule::SetSelectionTransfer( ScSelectionTransferObj* pNew )
+{
+ pSelTransfer = pNew;
+}
+
+//------------------------------------------------------------------
+
void ScModule::InitFormEditData()
{
pFormEditData = new ScFormEditData;
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
new file mode 100644
index 000000000000..5598df889eda
--- /dev/null
+++ b/sc/source/ui/app/seltrans.cxx
@@ -0,0 +1,438 @@
+/*************************************************************************
+ *
+ * $RCSfile: seltrans.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: nn $ $Date: 2001-10-02 18:24:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// INCLUDE ---------------------------------------------------------------
+
+#ifdef PCH
+#include "ui_pch.hxx"
+#endif
+
+#pragma hdrstop
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/form/FormButtonType.hpp>
+
+#include <tools/urlobj.hxx>
+#include <sfx2/docfile.hxx>
+#include <svx/fmglob.hxx>
+#include <svx/svdograf.hxx>
+#include <svx/svdouno.hxx>
+
+#include "seltrans.hxx"
+#include "transobj.hxx"
+#include "drwtrans.hxx"
+#include "scmod.hxx"
+#include "dbfunc.hxx" // for CopyToClip
+#include "docsh.hxx"
+#include "drawview.hxx"
+#include "drwlayer.hxx"
+
+using namespace com::sun::star;
+
+// -----------------------------------------------------------------------
+
+BOOL lcl_IsURLButton( SdrObject* pObject )
+{
+ BOOL bRet = FALSE;
+
+ SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObject);
+ if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
+ {
+ uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
+ DBG_ASSERT( xControlModel.is(), "uno control without model" );
+ if ( xControlModel.is() )
+ {
+ uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
+
+ rtl::OUString sPropButtonType = rtl::OUString::createFromAscii( "ButtonType" );
+ if(xInfo->hasPropertyByName( sPropButtonType ))
+ {
+ uno::Any aAny = xPropSet->getPropertyValue( sPropButtonType );
+ form::FormButtonType eTmp;
+ if ( (aAny >>= eTmp) && eTmp == form::FormButtonType_URL )
+ bRet = TRUE;
+ }
+ }
+ }
+
+ return bRet;
+}
+
+// static
+
+ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView )
+{
+ ScSelectionTransferObj* pRet = NULL;
+
+ if ( pView )
+ {
+ ScSelectionTransferMode eMode = SC_SELTRANS_INVALID;
+
+ SdrView* pSdrView = pView->GetSdrView();
+ if ( pSdrView )
+ {
+ // handle selection on drawing layer
+ const SdrMarkList& rMarkList = pSdrView->GetMarkList();
+ ULONG nMarkCount = rMarkList.GetMarkCount();
+ if ( nMarkCount )
+ {
+ if ( nMarkCount == 1 )
+ {
+ SdrObject* pObj = rMarkList.GetMark(0)->GetObj();
+ UINT16 nSdrObjKind = pObj->GetObjIdentifier();
+
+ if ( nSdrObjKind == OBJ_GRAF )
+ {
+ if ( ((SdrGrafObj*)pObj)->GetGraphic().GetType() == GRAPHIC_BITMAP )
+ eMode = SC_SELTRANS_DRAW_BITMAP;
+ else
+ eMode = SC_SELTRANS_DRAW_GRAPHIC;
+ }
+ else if ( nSdrObjKind == OBJ_OLE2 )
+ eMode = SC_SELTRANS_DRAW_OLE;
+ else if ( lcl_IsURLButton( pObj ) )
+ eMode = SC_SELTRANS_DRAW_BOOKMARK;
+ }
+
+ if ( eMode == SC_SELTRANS_INVALID )
+ eMode = SC_SELTRANS_DRAW_OTHER; // something selected but no special selection
+ }
+ }
+ if ( eMode == SC_SELTRANS_INVALID ) // no drawing object selected
+ {
+ ScRange aRange;
+ ScViewData* pViewData = pView->GetViewData();
+ const ScMarkData& rMark = pViewData->GetMarkData();
+ if ( rMark.IsMarked() && pViewData->GetSimpleArea( aRange, FALSE ) )
+ {
+ // only for "real" selection, cursor alone isn't used
+ if ( aRange.aStart == aRange.aEnd )
+ eMode = SC_SELTRANS_CELL;
+ else
+ eMode = SC_SELTRANS_CELLS;
+ }
+ }
+
+ if ( eMode != SC_SELTRANS_INVALID )
+ pRet = new ScSelectionTransferObj( pView, eMode );
+ }
+
+ return pRet;
+}
+
+
+ScSelectionTransferObj::ScSelectionTransferObj( ScTabView* pSource, ScSelectionTransferMode eNewMode ) :
+ pView( pSource ),
+ eMode( eNewMode ),
+ pCellData( NULL ),
+ pDrawData( NULL )
+{
+ //! store range for StillValid
+}
+
+ScSelectionTransferObj::~ScSelectionTransferObj()
+{
+ DBG_ASSERT( !pView, "ScSelectionTransferObj dtor: ForgetView not called" );
+}
+
+BOOL ScSelectionTransferObj::StillValid()
+{
+ //! check if view still has same cell selection
+ //! (but return FALSE if data has changed inbetween)
+ return FALSE;
+}
+
+void ScSelectionTransferObj::ForgetView()
+{
+ pView = NULL;
+ eMode = SC_SELTRANS_INVALID;
+
+ if (pCellData)
+ {
+ pCellData->release();
+ pCellData = NULL;
+ }
+ if (pDrawData)
+ {
+ pDrawData->release();
+ pDrawData = NULL;
+ }
+}
+
+void ScSelectionTransferObj::AddSupportedFormats()
+{
+ // AddSupportedFormats must work without actually creating the
+ // "real" transfer object
+
+ switch (eMode)
+ {
+ case SC_SELTRANS_CELL:
+ case SC_SELTRANS_CELLS:
+ // same formats as in ScTransferObj::AddSupportedFormats
+ AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
+ AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
+ AddFormat( SOT_FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMAT_BITMAP );
+ AddFormat( SOT_FORMATSTR_ID_HTML );
+ AddFormat( SOT_FORMATSTR_ID_SYLK );
+ AddFormat( SOT_FORMATSTR_ID_LINK );
+ AddFormat( SOT_FORMATSTR_ID_DIF );
+ AddFormat( SOT_FORMAT_STRING );
+ AddFormat( SOT_FORMAT_RTF );
+ if ( eMode == SC_SELTRANS_CELL )
+ AddFormat( SOT_FORMATSTR_ID_EDITENGINE );
+ break;
+
+ // different graphic formats as in ScDrawTransferObj::AddSupportedFormats:
+
+ case SC_SELTRANS_DRAW_BITMAP:
+ AddFormat( SOT_FORMATSTR_ID_SVXB );
+ AddFormat( SOT_FORMAT_BITMAP );
+ AddFormat( SOT_FORMAT_GDIMETAFILE );
+ break;
+
+ case SC_SELTRANS_DRAW_GRAPHIC:
+ AddFormat( SOT_FORMATSTR_ID_SVXB );
+ AddFormat( SOT_FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMAT_BITMAP );
+ break;
+
+ case SC_SELTRANS_DRAW_BOOKMARK:
+ AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
+ AddFormat( SOT_FORMATSTR_ID_SOLK );
+ AddFormat( SOT_FORMAT_STRING );
+ AddFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR );
+ AddFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK );
+ AddFormat( SOT_FORMATSTR_ID_DRAWING );
+ break;
+
+ case SC_SELTRANS_DRAW_OLE:
+ AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
+ AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
+ AddFormat( SOT_FORMAT_GDIMETAFILE );
+ break;
+
+ case SC_SELTRANS_DRAW_OTHER:
+ // other drawing objects
+ AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
+ AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
+ AddFormat( SOT_FORMATSTR_ID_DRAWING );
+ AddFormat( SOT_FORMAT_BITMAP );
+ AddFormat( SOT_FORMAT_GDIMETAFILE );
+ break;
+ }
+}
+
+void ScSelectionTransferObj::CreateCellData()
+{
+ DBG_ASSERT( !pCellData, "CreateCellData twice" );
+ if ( pView )
+ {
+ ScViewData* pViewData = pView->GetViewData();
+ const ScMarkData& rMark = pViewData->GetMarkData();
+ //! MarkToSimple?
+
+ // similar to ScViewFunctionSet::BeginDrag
+ if ( rMark.IsMarked() && !rMark.IsMultiMarked() )
+ {
+ ScDocument* pClipDoc = new ScDocument( SCDOCMODE_CLIP );
+ // bApi = TRUE -> no error mesages
+ BOOL bCopied = pViewData->GetView()->CopyToClip( pClipDoc, FALSE, TRUE );
+ if ( bCopied )
+ {
+ ScDocShell* pDocSh = pViewData->GetDocShell();
+ TransferableObjectDescriptor aObjDesc;
+ pDocSh->FillTransferableObjectDescriptor( aObjDesc );
+ aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
+ // maSize is set in ScTransferObj ctor
+
+ ScTransferObj* pTransferObj = new ScTransferObj( pClipDoc, aObjDesc );
+ uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj );
+
+ // SetDragHandlePos is not used - there is no mouse position
+ //? pTransferObj->SetVisibleTab( nTab );
+
+ pTransferObj->SetDragSource( pDocSh, rMark );
+
+ pCellData = pTransferObj;
+ pCellData->acquire(); // keep ref count up - released in ForgetView
+ }
+ else
+ delete pClipDoc;
+ }
+ }
+ DBG_ASSERT( pCellData, "can't create CellData" );
+}
+
+//! make static member of ScDrawView
+extern void lcl_CheckOle( const SdrMarkList& rMarkList, BOOL& rAnyOle, BOOL& rOneOle );
+
+void ScSelectionTransferObj::CreateDrawData()
+{
+ DBG_ASSERT( !pDrawData, "CreateDrawData twice" );
+ if ( pView )
+ {
+ // similar to ScDrawView::BeginDrag
+
+ ScDrawView* pDrawView = pView->GetScDrawView();
+ if ( pDrawView )
+ {
+ BOOL bAnyOle, bOneOle;
+ const SdrMarkList& rMarkList = pDrawView->GetMarkList();
+ lcl_CheckOle( rMarkList, bAnyOle, bOneOle );
+
+ //---------------------------------------------------------
+ ScDocShellRef aDragShellRef;
+ if (bAnyOle)
+ {
+ aDragShellRef = new ScDocShell; // ohne Ref lebt die DocShell nicht !!!
+ aDragShellRef->DoInitNew(NULL);
+ }
+ //---------------------------------------------------------
+
+ ScDrawLayer::SetGlobalDrawPersist(aDragShellRef);
+ SdrModel* pModel = pDrawView->GetAllMarkedModel();
+ ScDrawLayer::SetGlobalDrawPersist(NULL);
+
+ ScViewData* pViewData = pView->GetViewData();
+ ScDocShell* pDocSh = pViewData->GetDocShell();
+
+ TransferableObjectDescriptor aObjDesc;
+ pDocSh->FillTransferableObjectDescriptor( aObjDesc );
+ aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
+ // maSize is set in ScDrawTransferObj ctor
+
+ ScDrawTransferObj* pTransferObj = new ScDrawTransferObj( pModel, pDocSh, aObjDesc );
+ uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj );
+
+ SvEmbeddedObjectRef aPersistRef( aDragShellRef );
+ pTransferObj->SetDrawPersist( aPersistRef ); // keep persist for ole objects alive
+ pTransferObj->SetDragSource( pDrawView ); // copies selection
+
+ pDrawData = pTransferObj;
+ pDrawData->acquire(); // keep ref count up - released in ForgetView
+ }
+ }
+ DBG_ASSERT( pDrawData, "can't create DrawData" );
+}
+
+ScTransferObj* ScSelectionTransferObj::GetCellData()
+{
+ if ( !pCellData && ( eMode == SC_SELTRANS_CELL || eMode == SC_SELTRANS_CELLS ) )
+ CreateCellData();
+ return pCellData;
+}
+
+ScDrawTransferObj* ScSelectionTransferObj::GetDrawData()
+{
+ if ( !pDrawData && ( eMode == SC_SELTRANS_DRAW_BITMAP || eMode == SC_SELTRANS_DRAW_GRAPHIC ||
+ eMode == SC_SELTRANS_DRAW_BOOKMARK || eMode == SC_SELTRANS_DRAW_OLE ||
+ eMode == SC_SELTRANS_DRAW_OTHER ) )
+ CreateDrawData();
+ return pDrawData;
+}
+
+sal_Bool ScSelectionTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+{
+ sal_Bool bOK = sal_False;
+
+ uno::Reference<datatransfer::XTransferable> xSource;
+ switch (eMode)
+ {
+ case SC_SELTRANS_CELL:
+ case SC_SELTRANS_CELLS:
+ xSource = GetCellData();
+ break;
+ case SC_SELTRANS_DRAW_BITMAP:
+ case SC_SELTRANS_DRAW_GRAPHIC:
+ case SC_SELTRANS_DRAW_BOOKMARK:
+ case SC_SELTRANS_DRAW_OLE:
+ case SC_SELTRANS_DRAW_OTHER:
+ xSource = GetDrawData();
+ break;
+ }
+
+ if ( xSource.is() )
+ {
+ TransferableDataHelper aHelper( xSource );
+ uno::Any aAny = aHelper.GetAny( rFlavor );
+ bOK = SetAny( aAny, rFlavor );
+ }
+
+ return bOK;
+}
+
+void ScSelectionTransferObj::ObjectReleased()
+{
+ // called when another selection is set from outside
+
+ ForgetView();
+
+ ScModule* pScMod = SC_MOD();
+ if ( pScMod->GetSelectionTransfer() == this )
+ pScMod->SetSelectionTransfer( NULL );
+
+ TransferableHelper::ObjectReleased();
+}
+
+
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index ea83d9eb744a..2bddce4c1209 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: gridwin.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: nn $ $Date: 2001-03-30 19:12:07 $
+ * last change: $Author: nn $ $Date: 2001-10-02 18:32:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -103,6 +103,7 @@ class SdrEditView;
class ScNoteMarker;
class FloatingWindow;
class SdrHdlList;
+class ScTransferObj;
// Maus-Status (nMouseStatus)
@@ -255,6 +256,8 @@ private:
sal_Int8 AcceptPrivateDrop( const AcceptDropEvent& rEvt );
sal_Int8 ExecutePrivateDrop( const ExecuteDropEvent& rEvt );
+ sal_Int8 DropTransferObj( ScTransferObj* pTransObj, USHORT nDestPosX, USHORT nDestPosY,
+ const Point& rLogicPos, sal_Int8 nDndAction );
BOOL DrawMouseButtonDown(const MouseEvent& rMEvt);
BOOL DrawMouseButtonUp(const MouseEvent& rMEvt);
@@ -298,6 +301,8 @@ private:
void DoAutoFilterPopup( USHORT nCol, USHORT nRow, BOOL bDataSelect );
#endif
+ void PasteSelection( const Point& rPosPixel );
+
protected:
virtual void Resize( const Size& rSize );
virtual void Paint( const Rectangle& rRect );
diff --git a/sc/source/ui/inc/seltrans.hxx b/sc/source/ui/inc/seltrans.hxx
new file mode 100644
index 000000000000..1d8415013bc3
--- /dev/null
+++ b/sc/source/ui/inc/seltrans.hxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * $RCSfile: seltrans.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: nn $ $Date: 2001-10-02 18:21:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef SC_SELTRANS_HXX
+#define SC_SELTRANS_HXX
+
+#ifndef _TRANSFER_HXX
+#include <svtools/transfer.hxx>
+#endif
+
+class ScTabView;
+class ScTransferObj;
+class ScDrawTransferObj;
+
+enum ScSelectionTransferMode
+{
+ SC_SELTRANS_INVALID,
+ SC_SELTRANS_CELL,
+ SC_SELTRANS_CELLS,
+ SC_SELTRANS_DRAW_BITMAP,
+ SC_SELTRANS_DRAW_GRAPHIC,
+ SC_SELTRANS_DRAW_BOOKMARK,
+ SC_SELTRANS_DRAW_OLE,
+ SC_SELTRANS_DRAW_OTHER
+};
+
+class ScSelectionTransferObj : public TransferableHelper
+{
+private:
+ ScTabView* pView;
+ ScSelectionTransferMode eMode;
+ ScTransferObj* pCellData;
+ ScDrawTransferObj* pDrawData;
+
+ ScSelectionTransferObj( ScTabView* pSource, ScSelectionTransferMode eNewMode );
+ void CreateCellData();
+ void CreateDrawData();
+
+public:
+ // creates an object if the view has a valid selection,
+ // returns NULL otherwise
+ static ScSelectionTransferObj* CreateFromView( ScTabView* pSource );
+
+ virtual ~ScSelectionTransferObj();
+
+ void ForgetView();
+ BOOL StillValid();
+ ScTabView* GetView() const { return pView; }
+
+ ScTransferObj* GetCellData();
+ ScDrawTransferObj* GetDrawData();
+
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void ObjectReleased();
+};
+
+#endif
+
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 0deb7f708955..15071f6470fb 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tabview.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: nn $ $Date: 2001-08-02 18:21:53 $
+ * last change: $Author: nn $ $Date: 2001-10-02 18:32:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -338,6 +338,8 @@ public:
void CursorPosChanged();
void UpdateInputContext();
+ void CheckSelectionTransfer();
+
void InvertHorizontal( ScVSplitPos eWhich, long nDragPos );
void InvertVertical( ScHSplitPos eWhich, long nDragPos );