summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2021-10-25 09:15:20 +0200
committerLászló Németh <nemeth@numbertext.org>2021-11-04 11:50:51 +0100
commitcec1f712c87e557e1b7313e0dbef4a635f69d953 (patch)
tree1aa47e7ff275b1505ce975a58fbdca055b12721d /sd
parent60b9c16bd482e43cfc5d70d807b84df442707a83 (diff)
tdf#144918 PPTX import: fix internal hyperlink on shapes
Slide names in internal hyperlinks of shapes could be replaced with the placeholder name 'Slide n', resulting non-functioning hyperlink during the slideshow. Follow-up to commit 83d92437e05a9ec872d9303953fa408dd4dcbcde "tdf#144616 PPTX import: fix hyperlinks on shapes". Change-Id: I733ddcdcdf92b32c4e6272d3cf48da872a63cd47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124135 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf144918.pptxbin0 -> 17564 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx28
2 files changed, 28 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf144918.pptx b/sd/qa/unit/data/pptx/tdf144918.pptx
new file mode 100644
index 000000000000..54f862bd1b48
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf144918.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index e1b71fd788cf..92b08ef32094 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -123,6 +123,7 @@ public:
virtual void setUp() override;
void testDocumentLayout();
+ void testTdf144918();
void testTdf144917();
void testHyperlinkOnImage();
void testTdf142645();
@@ -189,6 +190,7 @@ public:
CPPUNIT_TEST_SUITE(SdImportTest);
CPPUNIT_TEST(testDocumentLayout);
+ CPPUNIT_TEST(testTdf144918);
CPPUNIT_TEST(testTdf144917);
CPPUNIT_TEST(testHyperlinkOnImage);
CPPUNIT_TEST(testTdf142645);
@@ -333,6 +335,32 @@ void SdImportTest::testDocumentLayout()
}
}
+void SdImportTest::testTdf144918()
+{
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf144918.pptx"), PPTX);
+
+ uno::Reference< beans::XPropertySet > xShape1(getShapeFromPage(0, 1, xDocShRef));
+ uno::Reference<document::XEventsSupplier> xEventsSupplier1(xShape1, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xEvents1(xEventsSupplier1->getEvents());
+ uno::Sequence<beans::PropertyValue> props1;
+ xEvents1->getByName("OnClick") >>= props1;
+ comphelper::SequenceAsHashMap map1(props1);
+ auto iter1(map1.find("Bookmark"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First slide"), iter1->second.get<OUString>());
+
+ uno::Reference< beans::XPropertySet > xShape2(getShapeFromPage(1, 1, xDocShRef));
+ uno::Reference<document::XEventsSupplier> xEventsSupplier2(xShape2, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xEvents2(xEventsSupplier2->getEvents());
+ uno::Sequence<beans::PropertyValue> props2;
+ xEvents2->getByName("OnClick") >>= props2;
+ comphelper::SequenceAsHashMap map2(props2);
+ auto iter2(map2.find("Bookmark"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Third slide"), iter2->second.get<OUString>());
+
+ xDocShRef->DoClose();
+}
+
void SdImportTest::testTdf144917()
{
sd::DrawDocShellRef xDocShRef