SVGIO: tdf#79163: Add import test
Change-Id: I891425f331e9be21c160eb0b11f05dba280bef23 Reviewed-on: https://gerrit.libreoffice.org/22196 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
This commit is contained in:
@@ -44,6 +44,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
|
||||
void testFontsizePercentage();
|
||||
void testTdf45771();
|
||||
void testTdf85770();
|
||||
void testTdf79163();
|
||||
|
||||
Primitive2DSequence parseSvg(const char* aSource);
|
||||
|
||||
@@ -58,6 +59,7 @@ public:
|
||||
CPPUNIT_TEST(testFontsizePercentage);
|
||||
CPPUNIT_TEST(testTdf45771);
|
||||
CPPUNIT_TEST(testTdf85770);
|
||||
CPPUNIT_TEST(testTdf79163);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
};
|
||||
|
||||
@@ -221,6 +223,20 @@ void Test::testTdf85770()
|
||||
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "text", "Start ");
|
||||
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "text", "End");
|
||||
}
|
||||
|
||||
void Test::testTdf79163()
|
||||
{
|
||||
Primitive2DSequence aSequenceTdf79163 = parseSvg("/svgio/qa/cppunit/data/tdf79163.svg");
|
||||
CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceTdf79163.getLength());
|
||||
|
||||
Primitive2dXmlDump dumper;
|
||||
xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf79163));
|
||||
|
||||
CPPUNIT_ASSERT (pDocument);
|
||||
|
||||
assertXPath(pDocument, "/primitive2D/transform/mask/unifiedtransparence", "transparence", "0");
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<rect x="50" y="50" height="110" width="110"
|
||||
style="fill: #ccccff" opacity="0.5"
|
||||
>
|
||||
</rect>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 225 B |
@@ -22,6 +22,8 @@
|
||||
#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
|
||||
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
|
||||
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
|
||||
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
|
||||
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
|
||||
|
||||
#include <drawinglayer/attribute/lineattribute.hxx>
|
||||
|
||||
@@ -184,6 +186,27 @@ void Primitive2dXmlDump::decomposeAndWrite(
|
||||
}
|
||||
break;
|
||||
|
||||
case PRIMITIVE2D_ID_MASKPRIMITIVE2D:
|
||||
{
|
||||
const MaskPrimitive2D* pMaskPrimitive2D = dynamic_cast<const MaskPrimitive2D*>(pBasePrimitive);
|
||||
rWriter.startElement("mask");
|
||||
|
||||
decomposeAndWrite(pMaskPrimitive2D->getChildren(), rWriter);
|
||||
rWriter.endElement();
|
||||
}
|
||||
break;
|
||||
|
||||
case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D:
|
||||
{
|
||||
const UnifiedTransparencePrimitive2D* pUnifiedTransparencePrimitive2D = dynamic_cast<const UnifiedTransparencePrimitive2D*>(pBasePrimitive);
|
||||
rWriter.startElement("unifiedtransparence");
|
||||
|
||||
rWriter.attribute("transparence", pUnifiedTransparencePrimitive2D->getTransparence());
|
||||
|
||||
rWriter.endElement();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
rWriter.element(OUStringToOString(sCurrentElementTag, RTL_TEXTENCODING_UTF8));
|
||||
|
||||
Reference in New Issue
Block a user