Kaydet (Commit) e4a06fc9 authored tarafından Michael Stahl's avatar Michael Stahl

sw: set a BaseURL when copying embedded objects

Turns out that SfxObjectShell::CreateShellID() will produce the
SfxMedium's base URL if it exists, so
EmbeddedObjectContainer::CopyAndGetEmbeddedObject() already has
parameters, sw just needs to set them.

Change-Id: I36cedfde4e7c2e25c43c66a30d8ca572f099ad69
üst 8338e278
......@@ -696,7 +696,8 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
// objects without persistence are not really stored by the method
if (xObj.is() && StoreEmbeddedObject(xObj, rName, true, rSrcShellID, rDestShellID))
{
xResult = Get_Impl( rName, xObj);
assert(!rDestShellID.isEmpty() && !rDestShellID.startsWith("0x")); // assume that every shell has a base URL
xResult = Get_Impl(rName, xObj, &rDestShellID);
if ( !xResult.is() )
{
// this is a case when object has no real persistence
......
......@@ -439,8 +439,8 @@ SwContentNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
pSrc->GetEmbeddedObjectContainer(),
pSrc->GetEmbeddedObjectContainer().GetEmbeddedObject( aOLEObj.aName ),
aNewName,
OUString(),
OUString());
SfxObjectShell::CreateShellID(pSrc),
SfxObjectShell::CreateShellID(pPersistShell));
SwOLENode* pOLENd = pDoc->GetNodes().MakeOLENode( rIdx, aNewName, GetAspect(),
pDoc->GetDfltGrfFormatColl(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment