sw/qa/extras/rtfimport/rtfimport.cxx | 3 --- sw/source/filter/xml/xmltexti.cxx | 11 ++++++++--- 2 files changed, 8 insertions(+), 6 deletions(-)
New commits: commit d7b0063c32502f01fcec72492d131760f4fda990 Author: Caolán McNamara <[email protected]> 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 <[email protected]> Reviewed-by: Stephan Bergmann <[email protected]> (cherry picked from commit cd25a97bbadc0a5c1fd6b0e8603c8b6ebd051926) Reviewed-on: https://gerrit.libreoffice.org/53803 Reviewed-by: Miklos Vajna <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Mike Kaganski <[email protected]> (cherry picked from commit 2d87c267267530077a94c894bc619831b01d1c04) Conflicts: sw/source/filter/xml/xmltexti.cxx Change-Id: I780568652d2ef0cc8543c27ba26289277b5d9d0c diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 710f010b1cdc..943db05c75bf 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -577,16 +577,21 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 ); aMediaDescriptor[0].Name = "URL"; aMediaDescriptor[0].Value <<= OUString( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) ); - 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( commit c8278b68b398b3c2b8556821958e977750409b28 Author: Luboš Luňák <[email protected]> Date: Tue Apr 24 13:01:22 2018 +0200 remove page count check in a test (irrelevant and fragile) If I load this document in LO, either my build or distro build, it has only one page, so the test fails for me only because of the 2-page check. The commit causing this, b904d639a8, has been in for quite a while, so it's apparently something special about my setup, but a) the test doesn't actually require 2 pages for anything, b) the commit mentions that the test is fragile, c) if I manually inspect the .rtf, there's an extra page that I do not see even in Word2013, so the document is possibly a bit broken. One way or another, the page check seems pointless. Change-Id: I18bdf25f71e8eb9225acd667e60f426fca008ee4 Reviewed-on: https://gerrit.libreoffice.org/53380 Tested-by: Jenkins <[email protected]> Reviewed-by: Luboš Luňák <[email protected]> (cherry picked from commit 6154d04d90b7b4f68e6c3629bf0c6306ef64a937) diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index ded9c987929a..bafe8ed3cea5 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2757,9 +2757,6 @@ DECLARE_RTFIMPORT_TEST(testImportHeaderFooter, "tdf108055.rtf") DECLARE_RTFIMPORT_TEST(testTdf108947, "tdf108947.rtf") { - //Check page count - CPPUNIT_ASSERT_EQUAL(2, getPages()); - //Check if Headers/Footers contain what they should in this document uno::Reference<text::XText> xHeaderTextRight = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Default Style"), "HeaderTextRight"); OUString aActual = xHeaderTextRight->getString(); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
