summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2015-08-29 00:57:20 +1000
committerAndras Timar <andras.timar@collabora.com>2015-08-31 19:01:21 +0000
commitdaecb93affd5e5ec89eec0d18f433a296b9aed1d (patch)
tree9a4a15b9fd08283c3f681b26b321dec074329143 /vcl/qa/cppunit
parent61d203fab63ef4f4863e8b2308e62bd245aa62db (diff)
tdf#93750 allow for EMF+ record padding up to 11 bytes
When an array of EMF+ has extra bytes in the end, that are less than 12, they should not be treated as another EMF+ record, but simply ignored. Change-Id: I34701c00916812c8a6a4b69730f602da81719b35 Reviewed-on: https://gerrit.libreoffice.org/18110 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'vcl/qa/cppunit')
-rw-r--r--vcl/qa/cppunit/wmf/data/tdf93750.emfbin0 -> 66416 bytes
-rw-r--r--vcl/qa/cppunit/wmf/wmfimporttest.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/wmf/data/tdf93750.emf b/vcl/qa/cppunit/wmf/data/tdf93750.emf
new file mode 100644
index 000000000000..3c4c41592be6
--- /dev/null
+++ b/vcl/qa/cppunit/wmf/data/tdf93750.emf
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/wmfimporttest.cxx b/vcl/qa/cppunit/wmf/wmfimporttest.cxx
index 3cee5fe9bb18..6e595c070c8c 100644
--- a/vcl/qa/cppunit/wmf/wmfimporttest.cxx
+++ b/vcl/qa/cppunit/wmf/wmfimporttest.cxx
@@ -44,12 +44,14 @@ public:
void testSine();
void testEmfProblem();
void testWorldTransformFontSize();
+ void testTdf93750();
CPPUNIT_TEST_SUITE(WmfTest);
CPPUNIT_TEST(testNonPlaceableWmf);
CPPUNIT_TEST(testSine);
CPPUNIT_TEST(testEmfProblem);
CPPUNIT_TEST(testWorldTransformFontSize);
+ CPPUNIT_TEST(testTdf93750);
CPPUNIT_TEST_SUITE_END();
};
@@ -148,6 +150,21 @@ void WmfTest::testWorldTransformFontSize()
assertXPath(pDoc, "/metafile/font[3]", "weight", "normal");
}
+void WmfTest::testTdf93750()
+{
+ SvFileStream aFileStream(getFullUrl("tdf93750.emf"), StreamMode::READ);
+ GDIMetaFile aGDIMetaFile;
+ ReadWindowMetafile(aFileStream, aGDIMetaFile);
+
+ MetafileXmlDump dumper;
+ xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile);
+
+ CPPUNIT_ASSERT (pDoc);
+
+ assertXPath(pDoc, "/metafile/push[1]/comment[2]", "datasize", "28");
+ assertXPath(pDoc, "/metafile/push[1]/comment[3]", "datasize", "72");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(WmfTest);
CPPUNIT_PLUGIN_IMPLEMENT();