summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/app/sdxfer.cxx4
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx2
-rw-r--r--sd/source/ui/inc/TabControl.hxx2
-rw-r--r--sd/source/ui/inc/View.hxx5
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx2
-rw-r--r--sd/source/ui/inc/sdxfer.hxx2
-rw-r--r--sd/source/ui/view/sdview2.cxx6
-rw-r--r--sd/source/ui/view/sdview3.cxx29
-rw-r--r--sd/source/ui/view/tabcontr.cxx2
9 files changed, 34 insertions, 20 deletions
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 77997dc97467..c2ca420758ed 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -448,7 +448,7 @@ void SdTransferable::AddSupportedFormats()
}
}
-bool SdTransferable::GetData( const DataFlavor& rFlavor )
+bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDoc )
{
if (SD_MOD()==NULL)
return false;
@@ -476,7 +476,7 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor )
if( nFormat == FORMAT_GDIMETAFILE && mpGraphic )
bOK = SetGDIMetaFile( mpGraphic->GetGDIMetaFile(), rFlavor );
else
- bOK = SetAny( mpOLEDataHelper->GetAny( rFlavor ), rFlavor );
+ bOK = SetAny( mpOLEDataHelper->GetAny(rFlavor, rDestDoc), rFlavor );
if( mpSdDrawDocumentIntern )
mpSdDrawDocumentIntern->SetSwapGraphicsMode( nOldSwapMode );
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 72f6e7d9e17e..87e7e8dab391 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -125,7 +125,7 @@ void SdPageObjsTLB::SdPageObjsTransferable::AddSupportedFormats()
-bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uLong nFormatId = SotExchange::GetFormat( rFlavor );
switch (nFormatId)
diff --git a/sd/source/ui/inc/TabControl.hxx b/sd/source/ui/inc/TabControl.hxx
index 2ec16b904d42..1700921dfee5 100644
--- a/sd/source/ui/inc/TabControl.hxx
+++ b/sd/source/ui/inc/TabControl.hxx
@@ -95,7 +95,7 @@ private:
virtual ~TabControlTransferable();
virtual void AddSupportedFormats() SAL_OVERRIDE;
- virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
+ virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
};
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index da4098d5f5f3..cd80568e776c 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -177,7 +177,10 @@ public:
virtual void onAccessibilityOptionsChanged() SAL_OVERRIDE;
virtual SdrModel* GetMarkedObjModel() const SAL_OVERRIDE;
- virtual bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0) SAL_OVERRIDE;
+ virtual bool Paste(
+ const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+ const OUString& rSrcShellID, const OUString& rDestShellID ) SAL_OVERRIDE;
+
using SdrExchangeView::Paste;
/** returns true if we have an undo manager and there is an open list undo action */
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index dad48ca76f70..fdeff1bf6054 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -100,7 +100,7 @@ public:
SAL_DLLPRIVATE virtual ~SdPageObjsTransferable();
SAL_DLLPRIVATE virtual void AddSupportedFormats() SAL_OVERRIDE;
- SAL_DLLPRIVATE virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
+ SAL_DLLPRIVATE virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
SAL_DLLPRIVATE virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
SAL_DLLPRIVATE virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx
index 10ebdf788dcb..4f9f4195ffd1 100644
--- a/sd/source/ui/inc/sdxfer.hxx
+++ b/sd/source/ui/inc/sdxfer.hxx
@@ -106,7 +106,7 @@ public:
protected:
virtual void AddSupportedFormats() SAL_OVERRIDE;
- virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
+ virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
virtual void ObjectReleased() SAL_OVERRIDE;
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 32e9bde14462..c400af7b4f0d 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -977,9 +977,11 @@ SdrModel* View::GetMarkedObjModel() const
return FmFormView::GetMarkedObjModel();;
}
-bool View::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst /* =NULL */, sal_uInt32 nOptions /* =0 */)
+bool View::Paste(
+ const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+ const OUString& rSrcShellID, const OUString& rDestShellID )
{
- return FmFormView::Paste( rMod, rPos, pLst,nOptions );;
+ return FmFormView::Paste(rMod, rPos, pLst, nOptions, rSrcShellID, rDestShellID);
}
} // end of namespace sd
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 89e7aeb9731c..f841807934ef 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -603,7 +603,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
SdDrawDocument* pSourceDoc = (SdDrawDocument*) pSourceView->GetModel();
pSourceDoc->CreatingDataObj( pOwnData );
SdDrawDocument* pModel = (SdDrawDocument*) pSourceView->GetMarkedObjModel();
- bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+ bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
if( !pPage )
pPage = (SdPage*) GetSdrPageView()->GetPage();
@@ -644,7 +644,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
pWorkModel->DeletePage( (sal_uInt16) i );
}
- bReturn = Paste( *pWorkModel, maDropPos, pPage, nPasteOptions );
+ bReturn = Paste(*pWorkModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
if( !pPage )
pPage = (SdPage*) GetSdrPageView()->GetPage();
@@ -803,7 +803,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
maDropPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
}
- bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+ bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
}
xShell->DoClose();
@@ -844,9 +844,15 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
uno::Reference < io::XInputStream > xStm;
TransferableObjectDescriptor aObjDesc;
- if( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) &&
- ( aDataHelper.GetInputStream( nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE, xStm ) ||
- aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ, xStm ) ) )
+ if (aDataHelper.GetTransferableObjectDescriptor(SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc))
+ {
+ OUString aDocShellID = SfxObjectShell::CreateShellID(mrDoc.GetDocSh());
+ xStm = aDataHelper.GetInputStream(nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE, aDocShellID);
+ if (!xStm.is())
+ xStm = aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBEDDED_OBJ, aDocShellID);
+ }
+
+ if (xStm.is())
{
if( mrDoc.GetDocSh() && ( mrDoc.GetDocSh()->GetClassName() == aObjDesc.maClassName ) )
{
@@ -880,7 +886,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
pModel->DeletePage( (sal_uInt16) i );
}
- bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+ bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
if( !pPage )
pPage = (SdPage*) GetSdrPageView()->GetPage();
@@ -1029,8 +1035,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
uno::Reference < embed::XEmbeddedObject > xObj;
OUString aName;
- if ( aDataHelper.GetInputStream( nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, xStm ) ||
- aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, xStm ) )
+ xStm = aDataHelper.GetInputStream(nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, OUString());
+ if (!xStm.is())
+ xStm = aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, OUString());
+
+ if (xStm.is())
{
xObj = mpDocSh->GetEmbeddedObjectContainer().InsertEmbeddedObject( xStm, aName );
}
@@ -1504,7 +1513,7 @@ bool View::PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nP
pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
CreateTableFromRTF( *xStm, pModel );
- bool bRet = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+ bool bRet = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
xComponent->dispose();
xComponent.clear();
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index 827739acff84..2df6a85b04b7 100644
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
@@ -62,7 +62,7 @@ void TabControl::TabControlTransferable::AddSupportedFormats()
-bool TabControl::TabControlTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& )
+bool TabControl::TabControlTransferable::GetData( const css::datatransfer::DataFlavor& /*rFlavor*/, const OUString& /*rDestDoc*/ )
{
return false;
}