summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2021-09-22 13:25:00 +0200
committerLászló Németh <nemeth@numbertext.org>2021-09-27 17:04:13 +0200
commit6e200689eb309cdbe1e4f08311a400835de19bfb (patch)
tree262bfca86312a2ee0c0a0ea064961cd0a9e89b32 /sd
parent82798029b1d89be07fb21eed081906460ba1cd08 (diff)
tdf#141704 PPTX import: fix hyperlinks on images added via placeholder
Note: see "Interaction..." in the local menu of the image of the first slide for manual checking of the fix. See commit 9bb91441b46d677860530d8bf9597c96561a1b0a "tdf#141704 PPTX import: fix hyperlinks on images" Change-Id: Iba372c095f76b263575d261a7a0fc98eda449bce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122429 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/hyperlinkOnImage.pptxbin0 -> 17576 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx30
2 files changed, 30 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/hyperlinkOnImage.pptx b/sd/qa/unit/data/pptx/hyperlinkOnImage.pptx
new file mode 100644
index 000000000000..38832da5eb25
--- /dev/null
+++ b/sd/qa/unit/data/pptx/hyperlinkOnImage.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 7bad28a80c86..edf69608092a 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -122,6 +122,7 @@ public:
virtual void setUp() override;
void testDocumentLayout();
+ void testHyperlinkOnImage();
void testTdf142645();
void testTdf141704();
void testTdf142915();
@@ -246,6 +247,7 @@ public:
CPPUNIT_TEST_SUITE(SdImportTest);
CPPUNIT_TEST(testDocumentLayout);
+ CPPUNIT_TEST(testHyperlinkOnImage);
CPPUNIT_TEST(testTdf142645);
CPPUNIT_TEST(testTdf141704);
CPPUNIT_TEST(testTdf142915);
@@ -446,6 +448,34 @@ void SdImportTest::testDocumentLayout()
}
}
+void SdImportTest::testHyperlinkOnImage()
+{
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/hyperlinkOnImage.pptx"), PPTX);
+
+ uno::Reference< beans::XPropertySet > xShape1(getShapeFromPage(1, 0, 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("ClickAction"));
+ CPPUNIT_ASSERT_EQUAL(css::presentation::ClickAction_LASTPAGE,
+ iter1->second.get<css::presentation::ClickAction>());
+
+ 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("ClickAction"));
+ CPPUNIT_ASSERT_EQUAL(css::presentation::ClickAction_NONE,
+ iter2->second.get<css::presentation::ClickAction>());
+
+ xDocShRef->DoClose();
+}
+
void SdImportTest::testTdf142645()
{
sd::DrawDocShellRef xDocShRef