[Libreoffice-commits] core.git: Branch 'private/kohei/chart-bugs' - include/sfx2 include/svtools sc/source sd/source sfx2/source svtools/source
Kohei Yoshida
kohei.yoshida at collabora.com
Fri Jun 13 20:06:33 PDT 2014
include/sfx2/objsh.hxx | 2 ++
include/svtools/embedtransfer.hxx | 4 ++++
sc/source/ui/app/drwtrans.cxx | 11 ++++++++---
sc/source/ui/inc/drwtrans.hxx | 1 +
sd/source/ui/view/sdview3.cxx | 5 +++--
sfx2/source/doc/objxtor.cxx | 17 +++++++++++++++++
svtools/source/misc/embedtransfer.cxx | 6 +++++-
7 files changed, 40 insertions(+), 6 deletions(-)
New commits:
commit 1482c4b110d32145d02a111f54384966139e8ce4
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Fri Jun 13 23:05:12 2014 -0400
Create unique doc shell IDs for source and destination shells.
Change-Id: I8f21d9bb982025b84298779a9ffb99e0a71a43e0
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 9c28cc5..1cb8e91 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -218,6 +218,8 @@ public:
using SotObject::GetInterface;
+ static OUString CreateShellID( const SfxObjectShell* pShell );
+
// Document-Shell Iterator
static SfxObjectShell* GetFirst( const TypeId* pType = 0,
bool bOnlyVisible = true );
diff --git a/include/svtools/embedtransfer.hxx b/include/svtools/embedtransfer.hxx
index 10625ea..3fd24ce 100644
--- a/include/svtools/embedtransfer.hxx
+++ b/include/svtools/embedtransfer.hxx
@@ -33,6 +33,8 @@ private:
Graphic* m_pGraphic;
sal_Int64 m_nAspect;
+ OUString maParentShellID;
+
protected:
virtual void AddSupportedFormats() SAL_OVERRIDE;
@@ -46,6 +48,8 @@ public:
sal_Int64 nAspect );
virtual ~SvEmbedTransferHelper();
+ void SetParentShellID( const OUString& rShellID );
+
static void FillTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
const Graphic* pGraphic,
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index bd80dac..14d4088 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -91,7 +91,8 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
pDragSourceView( NULL ),
nDragSourceFlags( 0 ),
bDragWasInternal( false ),
- nSourceDocID( 0 )
+ nSourceDocID( 0 ),
+ maShellID(SfxObjectShell::CreateShellID(pContainerShell))
{
// check what kind of objects are contained
@@ -717,9 +718,13 @@ void ScDrawTransferObj::CreateOLEData()
// No OLE object present.
return;
- aOleData = TransferableDataHelper(
+ SvEmbedTransferHelper* pEmbedTransfer =
new SvEmbedTransferHelper(
- pObj->GetObjRef(), pObj->GetGraphic(), pObj->GetAspect()));
+ pObj->GetObjRef(), pObj->GetGraphic(), pObj->GetAspect());
+
+ pEmbedTransfer->SetParentShellID(maShellID);
+
+ aOleData = TransferableDataHelper(pEmbedTransfer);
}
diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx
index 55a7301..5b4e869 100644
--- a/sc/source/ui/inc/drwtrans.hxx
+++ b/sc/source/ui/inc/drwtrans.hxx
@@ -63,6 +63,7 @@ private:
ScRangeListVector m_aProtectedChartRangesVector;
+ OUString maShellID;
void InitDocShell();
SdrOle2Obj* GetSingleObject();
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 9c6792b..f59139d 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -847,9 +847,10 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
if (aDataHelper.GetTransferableObjectDescriptor(SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc))
{
- xStm = aDataHelper.GetInputStream(nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE, OUString());
+ 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, OUString());
+ xStm = aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBEDDED_OBJ, aDocShellID);
}
if (xStm.is())
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index ef40d73..e3eff95 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -474,7 +474,24 @@ bool SfxObjectShell::Close()
return true;
}
+OUString SfxObjectShell::CreateShellID( const SfxObjectShell* pShell )
+{
+ if (!pShell)
+ return OUString();
+
+ OUString aShellID;
+
+ SfxMedium* pMedium = pShell->GetMedium();
+ if (pMedium)
+ aShellID = pMedium->GetBaseURL();
+ if (!aShellID.isEmpty())
+ return aShellID;
+
+ sal_Int64 nShellID = reinterpret_cast<sal_Int64>(pShell);
+ aShellID = "0x" + OUString::number(nShellID, 16);
+ return aShellID;
+}
// returns a pointer the first SfxDocument of specified type
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index 5fa152e..4341c85 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -65,6 +65,10 @@ SvEmbedTransferHelper::~SvEmbedTransferHelper()
}
}
+void SvEmbedTransferHelper::SetParentShellID( const OUString& rShellID )
+{
+ maParentShellID = rShellID;
+}
void SvEmbedTransferHelper::AddSupportedFormats()
@@ -76,7 +80,7 @@ void SvEmbedTransferHelper::AddSupportedFormats()
-bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
+bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc )
{
bool bRet = false;
More information about the Libreoffice-commits
mailing list