sw/source/filter/xml/xmltexti.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
New commits: commit 76e1b96eb6b2a6eefd3f97cbf83679b1229047a3 Author: Caolán McNamara <caol...@redhat.com> Date: Tue May 1 12:57:02 2018 +0100 set Referer on link mediadescriptor to allow determining if the source document is from a trusted/untrusted location Reviewed-on: https://gerrit.libreoffice.org/53693 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Stephan Bergmann <sberg...@redhat.com> (cherry picked from commit cd25a97bbadc0a5c1fd6b0e8603c8b6ebd051926) Change-Id: I780568652d2ef0cc8543c27ba26289277b5d9d0c Reviewed-on: https://gerrit.libreoffice.org/53802 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 537dbcadb7ae..d1498cf3cc71 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -572,17 +572,22 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 ); aMediaDescriptor[0].Name = "URL"; - aMediaDescriptor[0].Value <<= OUString( aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); - if ( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() ) + aMediaDescriptor[0].Value <<= aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); + + if (SfxMedium* pMedium = pDoc->GetDocShell() ? pDoc->GetDocShell()->GetMedium() : nullptr) { - uno::Reference< task::XInteractionHandler > xInteraction = - pDoc->GetDocShell()->GetMedium()->GetInteractionHandler(); + uno::Reference< task::XInteractionHandler > xInteraction = pMedium->GetInteractionHandler(); if ( xInteraction.is() ) { aMediaDescriptor.realloc( 2 ); aMediaDescriptor[1].Name = "InteractionHandler"; aMediaDescriptor[1].Value <<= xInteraction; } + + const auto nLen = aMediaDescriptor.getLength() + 1; + aMediaDescriptor.realloc(nLen); + aMediaDescriptor[nLen - 1].Name = "Referer"; + aMediaDescriptor[nLen - 1].Value <<= pMedium->GetName(); } uno::Reference < embed::XEmbeddedObject > xObj( _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits