summaryrefslogtreecommitdiff
path: root/sd/qa/unit/import-tests.cxx
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2021-08-31 13:15:01 +0200
committerLászló Németh <nemeth@numbertext.org>2021-09-14 15:23:27 +0200
commit9bb91441b46d677860530d8bf9597c96561a1b0a (patch)
tree11933133dfac527d1a77adad04997c8bbcfbdeb8 /sd/qa/unit/import-tests.cxx
parent431c8411b446528ba45ac76e8c39726ff4c0a4df (diff)
tdf#141704 PPTX import: fix hyperlinks on images
Hyperlinks on images pointing to the "first/last/ previous/next" slides and "exit presentation/go to the website/go to the slide" weren't imported. Note: images added via the Content placeholder will be fixed later. Change-Id: Idda1ff6fd3243b06262637c7c8e579e78309e317 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121369 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd/qa/unit/import-tests.cxx')
-rw-r--r--sd/qa/unit/import-tests.cxx59
1 files changed, 59 insertions, 0 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 482520908849..7bad28a80c86 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -123,6 +123,7 @@ public:
void testDocumentLayout();
void testTdf142645();
+ void testTdf141704();
void testTdf142915();
void testTdf142913();
void testTdf142590();
@@ -246,6 +247,7 @@ public:
CPPUNIT_TEST(testDocumentLayout);
CPPUNIT_TEST(testTdf142645);
+ CPPUNIT_TEST(testTdf141704);
CPPUNIT_TEST(testTdf142915);
CPPUNIT_TEST(testTdf142913);
CPPUNIT_TEST(testTdf142590);
@@ -458,6 +460,63 @@ void SdImportTest::testTdf142645()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf141704()
+{
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf141704.pptx"), PPTX);
+
+ for (sal_Int32 i = 0; i < 7; i++)
+ {
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(1, i, xDocShRef));
+ uno::Reference<document::XEventsSupplier> xEventsSupplier(xShape, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xEvents(xEventsSupplier->getEvents());
+
+ uno::Sequence<beans::PropertyValue> props;
+ xEvents->getByName("OnClick") >>= props;
+ comphelper::SequenceAsHashMap map(props);
+ auto iter(map.find("ClickAction"));
+ switch (i)
+ {
+ case 0:
+ CPPUNIT_ASSERT_EQUAL(css::presentation::ClickAction_LASTPAGE,
+ iter->second.get<css::presentation::ClickAction>());
+ break;
+ case 1:
+ CPPUNIT_ASSERT_EQUAL(css::presentation::ClickAction_NEXTPAGE,
+ iter->second.get<css::presentation::ClickAction>());
+ break;
+ case 2:
+ CPPUNIT_ASSERT_EQUAL(css::presentation::ClickAction_PREVPAGE,
+ iter->second.get<css::presentation::ClickAction>());
+ break;
+ case 3:
+ {
+ auto iter1(map.find("Bookmark"));
+ CPPUNIT_ASSERT_EQUAL(OUString("http://www.example.com/"), iter1->second.get<OUString>());
+ }
+ break;
+ case 4:
+ {
+ auto iter2(map.find("Bookmark"));
+ CPPUNIT_ASSERT_EQUAL(OUString("End Show"), iter2->second.get<OUString>());
+ }
+ break;
+ case 5:
+ CPPUNIT_ASSERT_EQUAL(css::presentation::ClickAction_STOPPRESENTATION,
+ iter->second.get<css::presentation::ClickAction>());
+ break;
+ case 6:
+ CPPUNIT_ASSERT_EQUAL(css::presentation::ClickAction_FIRSTPAGE,
+ iter->second.get<css::presentation::ClickAction>());
+ break;
+ default:
+ break;
+ }
+ }
+
+ xDocShRef->DoClose();
+}
+
void SdImportTest::testTdf142915()
{
::sd::DrawDocShellRef xDocShRef