Kaydet (Commit) 0b7f4a4f authored tarafından Caolán McNamara's avatar Caolán McNamara

set Referer on link mediadescriptor

to allow determining if the source document is from a trusted/untrusted
location

Change-Id: I780568652d2ef0cc8543c27ba26289277b5d9d0c
Reviewed-on: https://gerrit.libreoffice.org/53689Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 73ada0a0
......@@ -572,16 +572,21 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 );
aMediaDescriptor[0].Name = "URL";
aMediaDescriptor[0].Value <<= aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
if ( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() )
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(
......
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