diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-01-09 14:45:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-01-09 15:17:08 +0000 |
commit | d9b589379cbc41b920dfe3f10e6d2c53431df676 (patch) | |
tree | 4ea238a2bb63081510d99457055df20a50b9e3f9 /comphelper | |
parent | f6f73d2e40712dadf69cd73a34d006988669978c (diff) |
crashtesting: fdo85994-1.doc assert on reexport to doc
try setting DefaultParentBaseURL based on the parent BaseURL
for objects created this way
Change-Id: I1a660ff6e4874321e0308d556c7ce0e10a2605fe
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/container/embeddedobjectcontainer.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 127798f45569..9a913217c60f 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -368,7 +368,7 @@ uno::Reference<embed::XEmbeddedObject> EmbeddedObjectContainer::Get_Impl( } uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbeddedObject( const uno::Sequence < sal_Int8 >& rClassId, - const uno::Sequence < beans::PropertyValue >& rArgs, OUString& rNewName ) + const uno::Sequence < beans::PropertyValue >& rArgs, OUString& rNewName, OUString const* pBaseURL ) { if ( rNewName.isEmpty() ) rNewName = CreateUniqueObjectName(); @@ -381,10 +381,16 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbedde { uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); - uno::Sequence< beans::PropertyValue > aObjDescr( rArgs.getLength() + 1 ); + const size_t nExtraArgs = pBaseURL ? 2 : 1; + uno::Sequence< beans::PropertyValue > aObjDescr( rArgs.getLength() + nExtraArgs ); aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); - ::std::copy( rArgs.begin(), rArgs.end(), aObjDescr.getArray() + 1 ); + if (pBaseURL) + { + aObjDescr[1].Name = "DefaultParentBaseURL"; + aObjDescr[1].Value <<= *pBaseURL; + } + ::std::copy( rArgs.begin(), rArgs.end(), aObjDescr.getArray() + nExtraArgs ); xObj.set( xFactory->createInstanceInitNew( rClassId, OUString(), pImpl->mxStorage, rNewName, aObjDescr ), uno::UNO_QUERY ); @@ -402,9 +408,9 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbedde return xObj; } -uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbeddedObject( const uno::Sequence < sal_Int8 >& rClassId, OUString& rNewName ) +uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbeddedObject( const uno::Sequence < sal_Int8 >& rClassId, OUString& rNewName, OUString const* pBaseURL ) { - return CreateEmbeddedObject( rClassId, uno::Sequence < beans::PropertyValue >(), rNewName ); + return CreateEmbeddedObject( rClassId, uno::Sequence < beans::PropertyValue >(), rNewName, pBaseURL ); } void EmbeddedObjectContainer::AddEmbeddedObject( const css::uno::Reference < css::embed::XEmbeddedObject >& xObj, const OUString& rName ) |