diff options
author | Mark Hung <marklh9@gmail.com> | 2019-01-20 20:33:26 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2019-02-04 01:03:00 +0100 |
commit | 8a1321362a0229a25869e4e3d0422a5a51c5b5be (patch) | |
tree | 3afb0f5d5469adb70e8a5d6ea246413c7312b2e8 /sd | |
parent | 04160a24e34beb6802cea356b947ed9d8d382d19 (diff) |
tdf#44223 oox: import embedded media stream.
- Handle cTn and tgtEl of MediaNodeContext.
- Setting the audio source of XAudio.
- Embed the media in TimeNodeTargetElementContext.
- Embed the media in SoundActionContext.
- Allow avmedia::EmbedMedia to embed media from a XInputStream.
Change-Id: I164ac50f97f2036db4bfa2f99adedff0bba382e2
Reviewed-on: https://gerrit.libreoffice.org/67208
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf44223.pptx | bin | 0 -> 63723 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf44223.pptx b/sd/qa/unit/data/pptx/tdf44223.pptx Binary files differnew file mode 100644 index 000000000000..6f0af688c206 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf44223.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index a068fad4481d..4a60ca586719 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -44,6 +44,8 @@ #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/document/XStorageBasedDocument.hpp> +#include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/presentation/ClickAction.hpp> #include <com/sun/star/presentation/XPresentationPage.hpp> #include <com/sun/star/drawing/GraphicExportFilter.hpp> @@ -191,6 +193,7 @@ public: void testTdf120028(); void testTdf120028b(); void testTdf94238(); + void testTdf44223(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -275,6 +278,7 @@ public: CPPUNIT_TEST(testTdf120028); CPPUNIT_TEST(testTdf120028b); CPPUNIT_TEST(testTdf94238); + CPPUNIT_TEST(testTdf44223); CPPUNIT_TEST_SUITE_END(); }; @@ -2621,6 +2625,27 @@ void SdImportTest::testTdf94238() CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_RADIAL, aGradient.Style); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(100), aGradient.YOffset); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(39), aGradient.Border); +} + +void SdImportTest::testTdf44223() +{ + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf44223.pptx"), PPTX); + uno::Reference<document::XStorageBasedDocument> xSBD(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY); + CPPUNIT_ASSERT(xSBD.is()); + + uno::Reference<embed::XStorage> xStorage = xSBD->getDocumentStorage(); + CPPUNIT_ASSERT(xStorage.is()); + + uno::Reference<container::XNameAccess> xNameAccess(xStorage, uno::UNO_QUERY); + CPPUNIT_ASSERT(xNameAccess.is()); + + uno::Reference<embed::XStorage> xStorage_2(xNameAccess->getByName("Media"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xStorage_2.is()); + uno::Reference< container::XNameAccess > xNameAccess_2(xStorage_2, uno::UNO_QUERY); + + CPPUNIT_ASSERT(xNameAccess_2->hasByName("audio1.wav")); + CPPUNIT_ASSERT(xNameAccess_2->hasByName("audio2.wav")); xDocShRef->DoClose(); } |