diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/tdf97808.fodp | 30 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 38 | ||||
-rw-r--r-- | sd/qa/unit/sdmodeltestbase.hxx | 3 |
3 files changed, 71 insertions, 0 deletions
diff --git a/sd/qa/unit/data/tdf97808.fodp b/sd/qa/unit/data/tdf97808.fodp new file mode 100644 index 000000000000..ac2d3e2d8c13 --- /dev/null +++ b/sd/qa/unit/data/tdf97808.fodp @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.presentation"> + <office:styles> + + <draw:marker draw:name="Arrow" svg:viewBox="0 0 20 30" svg:d="M10 0l-10 30h20z"/> + <draw:stroke-dash draw:name="Dashed_20__28_var_29__20_2" draw:display-name="Dashed (var) 2" draw:style="rect" draw:dots1="1" draw:dots1-length="0.02cm" draw:dots2="1" draw:dots2-length="0.02cm" draw:distance="0.02cm"/> + <style:style style:name="objectwithoutfill" style:family="graphic"> + <style:graphic-properties draw:stroke-dash="Dashed_20__28_var_29__20_2" svg:stroke-color="#000000" draw:marker-end="Arrow" draw:marker-end-width="0.6cm" draw:fill="solid" draw:fill-color="#008000"/> + </style:style> + + </office:styles> + <office:automatic-styles> + + <style:style style:name="gr12" style:family="graphic" style:parent-style-name="objectwithoutfill"> + <style:graphic-properties svg:stroke-color="#999999" draw:marker-end="" draw:marker-end-width="0.3cm" draw:fill="solid" draw:textarea-vertical-align="middle"/> + </style:style> + + </office:automatic-styles> + <office:body> + <office:presentation> + + <draw:page> + <draw:line draw:style-name="gr12" svg:x1="7.152cm" svg:y1="17.473cm" svg:x2="6.89cm" svg:y2="15.718cm"> + <text:p/> + </draw:line> + </draw:page> + + </office:presentation> + </office:body> +</office:document> diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 9f4c2e343131..cdfd7f6c5cf5 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp> #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> +#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/table/XTableRows.hpp> #include <stlpool.hxx> @@ -73,6 +74,7 @@ public: void testN778859(); void testMasterPageStyleParent(); void testGradientAngle(); + void testTdf97808(); void testFdo64512(); void testFdo71075(); void testN828390_2(); @@ -114,6 +116,7 @@ public: CPPUNIT_TEST(testN778859); CPPUNIT_TEST(testMasterPageStyleParent); CPPUNIT_TEST(testGradientAngle); + CPPUNIT_TEST(testTdf97808); CPPUNIT_TEST(testFdo64512); CPPUNIT_TEST(testFdo71075); CPPUNIT_TEST(testN828390_2); @@ -552,6 +555,41 @@ void SdImportTest::testFdo77027() xDocShRef->DoClose(); } +template<class T> +std::ostream& operator<<(std::ostream& rStrm, const uno::Reference<T>& xRef) +{ + rStrm << xRef.get(); + return rStrm; +} + +void SdImportTest::testTdf97808() +{ + sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/tdf97808.fodp"), FODP); + + uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier( + xDocShRef->GetModel(), uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xStyleFamilies(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName("graphics"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xStyle(xStyleFamily->getByName("objectwithoutfill"), uno::UNO_QUERY); + OUString lineend; + CPPUNIT_ASSERT(xStyle->getPropertyValue("LineEndName") >>= lineend); + CPPUNIT_ASSERT_EQUAL(OUString("Arrow"), lineend); + + // the draw:marker-end="" did not override the style + uno::Reference<drawing::XDrawPagesSupplier> xDoc( + xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW); + uno::Reference<drawing::XDrawPage> xPage( + xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xLine( + xPage->getByIndex(0), uno::UNO_QUERY_THROW); + //uno::Reference<style::XStyle> xParent; + uno::Reference<beans::XPropertySet> xParent; + CPPUNIT_ASSERT(xLine->getPropertyValue("Style") >>= xParent); + CPPUNIT_ASSERT_EQUAL(xStyle, xParent); + CPPUNIT_ASSERT(xLine->getPropertyValue("LineEndName") >>= lineend); + CPPUNIT_ASSERT_EQUAL(OUString(), lineend); +} + void SdImportTest::testFdo64512() { sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo64512.odp"), ODP); diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 8a280d9bd75d..57245d5d5a93 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -50,6 +50,7 @@ struct FileFormat #define HTML_FORMAT_TYPE ( SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN ) #define PDF_FORMAT_TYPE ( SfxFilterFlags::STARONEFILTER | SfxFilterFlags::ALIEN | SfxFilterFlags::IMPORT | SfxFilterFlags::PREFERED ) #define FODG_FORMAT_TYPE (SfxFilterFlags::STARONEFILTER | SfxFilterFlags::OWN | SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT) +#define FODP_FORMAT_TYPE (SfxFilterFlags::STARONEFILTER | SfxFilterFlags::OWN | SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT) /** List of file formats we support in Impress unit tests. @@ -67,6 +68,7 @@ FileFormat aFileFormats[] = { "html", "graphic_HTML", "graphic_HTML", "", HTML_FORMAT_TYPE }, { "pdf", "draw_pdf_import", "pdf_Portable_Document_Format", "", PDF_FORMAT_TYPE }, { "fodg", "OpenDocument Drawing Flat XML", "Flat XML ODF Drawing", "", FODG_FORMAT_TYPE }, + { "fodp", "OpenDocument Presentation Flat XML", "Flat XML ODF Presentation", "", FODP_FORMAT_TYPE }, { nullptr, nullptr, nullptr, nullptr, SfxFilterFlags::NONE } }; @@ -76,6 +78,7 @@ FileFormat aFileFormats[] = #define HTML 3 #define PDF 4 #define FODG 5 +#define FODP 6 /// Base class for filter tests loading or roundtriping a document, and asserting the document model. class SdModelTestBase : public test::BootstrapFixture, public unotest::MacrosTest |