diff options
Diffstat (limited to 'sw/qa/extras/htmlimport/htmlimport.cxx')
-rw-r--r-- | sw/qa/extras/htmlimport/htmlimport.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index 342e7e16ac5b..da9270701ce6 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -15,6 +15,8 @@ #include <com/sun/star/drawing/BitmapMode.hpp> #include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp> #include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/io/XActiveDataStreamer.hpp> +#include <com/sun/star/io/XSeekable.hpp> #include <tools/datetime.hxx> #include <unotools/datetime.hxx> #include <vcl/GraphicNativeTransform.hxx> @@ -295,6 +297,23 @@ DECLARE_HTMLIMPORT_TEST(testReqIfBr, "reqif-br.xhtml") CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("aaa\nbbb")); } +DECLARE_HTMLIMPORT_TEST(testReqIfOle2, "reqif-ole2.xhtml") +{ + uno::Reference<text::XTextEmbeddedObjectsSupplier> xSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xObjects(xSupplier->getEmbeddedObjects(), + uno::UNO_QUERY); + uno::Reference<document::XEmbeddedObjectSupplier2> xObject(xObjects->getByIndex(0), + uno::UNO_QUERY); + uno::Reference<io::XActiveDataStreamer> xEmbeddedObject(xObject->getExtendedControlOverEmbeddedObject(), uno::UNO_QUERY); + // This failed, the "RTF fragment" native data was loaded as-is, we had no + // filter to handle it, so nothing happened on double-click. + CPPUNIT_ASSERT(xEmbeddedObject.is()); + uno::Reference<io::XSeekable> xStream(xEmbeddedObject->getStream(), uno::UNO_QUERY); + // This was 80913, the RTF hexdump -> OLE1 binary -> OLE2 conversion was + // missing. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(38912), xStream->getLength()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |