From cb7851d105af419209e2f10073bc7b1688b6484b Mon Sep 17 00:00:00 2001 From: Serge Krot Date: Wed, 4 Apr 2018 14:06:00 +0200 Subject: tdf#116266: Take into account file extension when image type is unknown For external images there is no always exists image type, we need to take into account the file extension to determine its mime type. Added unit test. Reviewed-on: https://gerrit.libreoffice.org/52375 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt (cherry picked from commit bc906ec69d47ecde13ddf63cf3d366ec89055cfe) Conflicts: sd/qa/unit/import-tests.cxx Change-Id: I884ae18939b6def683bb318260c4e195da5bb252 --- sd/qa/unit/data/odp/tdf116266.odp | Bin 0 -> 43204 bytes sd/qa/unit/data/odp/tdf116266_chart.svg | 99 ++++++++++++++++++++++++++++++++ sd/qa/unit/import-tests.cxx | 11 ++++ 3 files changed, 110 insertions(+) create mode 100755 sd/qa/unit/data/odp/tdf116266.odp create mode 100755 sd/qa/unit/data/odp/tdf116266_chart.svg (limited to 'sd') diff --git a/sd/qa/unit/data/odp/tdf116266.odp b/sd/qa/unit/data/odp/tdf116266.odp new file mode 100755 index 000000000000..17ce46ea59a9 Binary files /dev/null and b/sd/qa/unit/data/odp/tdf116266.odp differ diff --git a/sd/qa/unit/data/odp/tdf116266_chart.svg b/sd/qa/unit/data/odp/tdf116266_chart.svg new file mode 100755 index 000000000000..3a3ef2d0eca5 --- /dev/null +++ b/sd/qa/unit/data/odp/tdf116266_chart.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1950 + 1970 + 1990 + 2010 + 0 + 100 + 200 + 300 + 400 + 500 + 600 + 700 + Data + + 2016 vs 2006 ≙- 0,23 %/a + \ No newline at end of file diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 4794de11a76c..5c098d4dc6bf 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -139,6 +139,7 @@ public: void testTdf104201(); void testTdf104445(); void testTdf114488(); + void testTdf116266(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -198,6 +199,7 @@ public: CPPUNIT_TEST(testTdf104201); CPPUNIT_TEST(testTdf104445); CPPUNIT_TEST(testTdf114488); + CPPUNIT_TEST(testTdf116266); CPPUNIT_TEST_SUITE_END(); }; @@ -1712,6 +1714,15 @@ void SdImportTest::testTdf114488() CPPUNIT_ASSERT_EQUAL(OUString("image/x-wmf"), sMimeType); } +void SdImportTest::testTdf116266() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf116266.odp"), ODP); + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + sfx2::LinkManager* rLinkManager = pDoc->GetLinkManager(); + // The document contains one SVG stored as a link. + CPPUNIT_ASSERT_EQUAL(size_t(1), rLinkManager->GetLinks().size()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit v1.2.3