[Libreoffice-commits] core.git: Branch 'distro/collabora/cd-5.3-3.1' - sw/source
sw/source/filter/xml/xmltexti.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit 7a6b608591e21ef61dc05cff9fc58da531035755 Author: Caolán McNamaraDate: 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 Reviewed-by: Stephan Bergmann (cherry picked from commit cd25a97bbadc0a5c1fd6b0e8603c8b6ebd051926) Change-Id: I780568652d2ef0cc8543c27ba26289277b5d9d0c Reviewed-on: https://gerrit.libreoffice.org/53803 Reviewed-by: Miklos Vajna Reviewed-by: Mike Kaganski Tested-by: Mike Kaganski (cherry picked from commit 2d87c267267530077a94c894bc619831b01d1c04) diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 3cc7372f8986..a26e4f7640dc 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -575,17 +575,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
[Libreoffice-commits] core.git: Branch 'distro/collabora/cd-5.3-3.1' - sw/source
sw/source/uibase/wrtsh/wrtsh2.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit 0cd1c3789bbd50c7c8fe80066afb794a07c7c4b0 Author: Jan HolesovskyDate: Fri Apr 6 15:46:47 2018 +0200 sw lok: Don't try to open TOC marks in a new window, jump instead. Change-Id: I1ecae82c4b1e08383f6957c38cb70b91fc3549d4 Reviewed-on: https://gerrit.libreoffice.org/52504 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian (cherry picked from commit e112fe434df84d2367d9efb83e9e1105a1394492) Reviewed-on: https://gerrit.libreoffice.org/52509 diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index ac17db298931..e4305c383c11 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -470,8 +470,9 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, sal_uInt16 nFilter, if ( dynamic_cast( ) == nullptr ) return; -// We are doing tiledRendering, let the client handles the URL loading. -if (comphelper::LibreOfficeKit::isActive()) +// We are doing tiledRendering, let the client handles the URL loading, +// unless we are jumping to a TOC mark. +if (comphelper::LibreOfficeKit::isActive() && !rURL.startsWith("#")) { rVSh.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr()); return; @@ -506,7 +507,7 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, sal_uInt16 nFilter, //#39076# Silent can be removed accordingly to SFX. SfxBoolItem aBrowse( SID_BROWSE, true ); -if( nFilter & URLLOAD_NEWVIEW ) +if ((nFilter & URLLOAD_NEWVIEW) && !comphelper::LibreOfficeKit::isActive()) aTargetFrameName.SetValue( "_blank" ); const SfxPoolItem* aArr[] = { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits