[Libreoffice-commits] core.git: comphelper/source filter/source include/comphelper
Caolán McNamara
caolanm at redhat.com
Thu Dec 24 13:24:46 PST 2015
comphelper/source/container/embeddedobjectcontainer.cxx | 9 +++++++--
filter/source/msfilter/msdffimp.cxx | 4 ++--
include/comphelper/embeddedobjectcontainer.hxx | 2 +-
3 files changed, 10 insertions(+), 5 deletions(-)
New commits:
commit a4764cfa80270f973da5861d0ddc28298bf16f4d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 23 21:22:58 2015 +0000
crashtesting: fdo73974-1.doc assert on reexport to doc
try setting DefaultParentBaseURL based on the parent BaseURL
for objects created this way
Change-Id: Idfc44d90e4f73f23976e8648c504786955b4fce6
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index b813b96..127798f 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -589,7 +589,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
return xRet;
}
-uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbeddedObject( const css::uno::Sequence < css::beans::PropertyValue >& aMedium, OUString& rNewName )
+uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbeddedObject( const css::uno::Sequence < css::beans::PropertyValue >& aMedium, OUString& rNewName, OUString const* pBaseURL )
{
if ( rNewName.isEmpty() )
rNewName = CreateUniqueObjectName();
@@ -598,9 +598,14 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
try
{
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
- uno::Sequence< beans::PropertyValue > aObjDescr( 1 );
+ uno::Sequence< beans::PropertyValue > aObjDescr(pBaseURL ? 2 : 1);
aObjDescr[0].Name = "Parent";
aObjDescr[0].Value <<= pImpl->m_xModel.get();
+ if (pBaseURL)
+ {
+ aObjDescr[1].Name = "DefaultParentBaseURL";
+ aObjDescr[1].Value <<= *pBaseURL;
+ }
xObj.set( xFactory->createInstanceInitFromMediaDescriptor(
pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY );
uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index f29cf4f..309cee3 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6947,7 +6947,7 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo
OUString aName( aDstStgName );
comphelper::EmbeddedObjectContainer aCnt( rDestStorage );
- xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
+ xObj = aCnt.InsertEmbeddedObject(aMedium, aName, &rBaseURL);
if ( !xObj.is() )
{
@@ -6955,7 +6955,7 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo
{
// throw the filter parameter away as workaround
aMedium.realloc( 2 );
- xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
+ xObj = aCnt.InsertEmbeddedObject(aMedium, aName, &rBaseURL);
}
if ( !xObj.is() )
diff --git a/include/comphelper/embeddedobjectcontainer.hxx b/include/comphelper/embeddedobjectcontainer.hxx
index 24153c2..b7cae38 100644
--- a/include/comphelper/embeddedobjectcontainer.hxx
+++ b/include/comphelper/embeddedobjectcontainer.hxx
@@ -110,7 +110,7 @@ public:
// load an embedded object from a MediaDescriptor and insert it into the container
// a new object will be created from the new content and returned
css::uno::Reference < css::embed::XEmbeddedObject >
- InsertEmbeddedObject( const css::uno::Sequence < css::beans::PropertyValue >&, OUString& );
+ InsertEmbeddedObject( const css::uno::Sequence < css::beans::PropertyValue >&, OUString& rName, OUString const* pBaseURL = nullptr);
// create an embedded link based on a MediaDescriptor and insert it into the container
// a new object will be created from the new content and returned
More information about the Libreoffice-commits
mailing list