diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-04 11:49:25 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-09-28 10:18:43 +0200 |
commit | 5a114e7c6e1b2f8bccf36e9d3ab6c82ac2868b9b (patch) | |
tree | 479a7c47ded7877920d2b0559b492dbc764ddbca /sd | |
parent | 13eb06f272d48178d420744fcf3243d2abf14aef (diff) |
tdf#93097 oox: fix import of metadata from non-relative stream paths
Commit ef2668bad976f1fbb70759887cafd35ea7833655 (PPTX import: fix
missing document metadata, 2014-08-28) implemented metadata import for
the PPTX filter, but in case the metadata stream is not an existing one,
then OHierarchyHolder_Impl::GetListPathFromString() invoked by
OStorage::openStreamElementByHierarchicalName() throws.
The bugdoc is generated by a 3rd-party tool that always starts the
stream path with a slash, and MSO seems to just ignore that: so let's do
the same to be able to open the document.
(cherry picked from commit 46cf9bb76b29f2bfa6639d9aaf4f26dee365bc0c)
Conflicts:
sd/qa/unit/import-tests.cxx
Reviewed-on: https://gerrit.libreoffice.org/18372
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Conflicts:
sd/qa/unit/import-tests.cxx
(cherry picked from commit 1b635af9c337b929737d2ed807c9decc2ff6643b)
Conflicts:
sd/qa/unit/import-tests.cxx
Change-Id: I6c0715adeb19b9055669f6a45055415dd2c44e28
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf93097.pptx | bin | 0 -> 29386 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf93097.pptx b/sd/qa/unit/data/pptx/tdf93097.pptx Binary files differnew file mode 100644 index 000000000000..687110db3540 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf93097.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 2eba3c340f0c..24398d82f673 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -105,6 +105,7 @@ public: void testBnc822341(); #endif void testTdf93830(); + void testTdf93097(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testDocumentLayout); @@ -148,6 +149,7 @@ public: CPPUNIT_TEST(testBnc910045); CPPUNIT_TEST(testTdf93830); + CPPUNIT_TEST(testTdf93097); CPPUNIT_TEST_SUITE_END(); }; @@ -1415,6 +1417,16 @@ void SdFiltersTest::testTdf93830() xDocShRef->DoClose(); } +void SdFiltersTest::testTdf93097() +{ + // Throwing metadata import aborted the filter, check that metadata is now imported. + sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/tdf93097.pptx") ); + uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(xDocShRef->GetModel(), uno::UNO_QUERY); + uno::Reference<document::XDocumentProperties> xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties(); + CPPUNIT_ASSERT_EQUAL(OUString("ss"), xDocumentProperties->getTitle()); + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); CPPUNIT_PLUGIN_IMPLEMENT(); |