diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-07-19 22:12:04 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-07-20 21:02:51 +0200 |
commit | 6ca69fc429c45890f23e622b3591b81074d3d9ba (patch) | |
tree | 22b2d23535d8958e2d3e907ae75c2e35a9b006ad /vcl | |
parent | emf+: recognise some more object types (diff) | |
download | core-6ca69fc429c45890f23e622b3591b81074d3d9ba.tar.gz core-6ca69fc429c45890f23e622b3591b81074d3d9ba.zip |
bnc#881024 test font size at world transform
Change-Id: If9b09b69ccd890e45d963422ccedb711585f6434
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/wmf/data/image1.emf | bin | 0 -> 233976 bytes | |||
-rw-r--r-- | vcl/qa/cppunit/wmf/wmfimporttest.cxx | 33 |
2 files changed, 33 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/wmf/data/image1.emf b/vcl/qa/cppunit/wmf/data/image1.emf Binary files differnew file mode 100644 index 000000000000..2dcc32a4cf27 --- /dev/null +++ b/vcl/qa/cppunit/wmf/data/image1.emf diff --git a/vcl/qa/cppunit/wmf/wmfimporttest.cxx b/vcl/qa/cppunit/wmf/wmfimporttest.cxx index cc24c76947b0..6e2e374fa7cb 100644 --- a/vcl/qa/cppunit/wmf/wmfimporttest.cxx +++ b/vcl/qa/cppunit/wmf/wmfimporttest.cxx @@ -43,11 +43,14 @@ public: void testNonPlaceableWmf(); void testSine(); void testEmfProblem(); + void testWorldTransformFontSize(); CPPUNIT_TEST_SUITE(WmfTest); CPPUNIT_TEST(testNonPlaceableWmf); CPPUNIT_TEST(testSine); CPPUNIT_TEST(testEmfProblem); + CPPUNIT_TEST(testWorldTransformFontSize); + CPPUNIT_TEST_SUITE_END(); }; @@ -123,6 +126,36 @@ void WmfTest::testEmfProblem() assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "right", "1876"); } +void WmfTest::testWorldTransformFontSize() +{ + SvFileStream aFileStream(getFullUrl("image1.emf"), STREAM_READ); + GDIMetaFile aGDIMetaFile; + ReadWindowMetafile(aFileStream, aGDIMetaFile); + + MetafileXmlDump dumper; + dumper.filterAllActionTypes(); + dumper.filterActionType(META_FONT_ACTION, false); + xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile); + + CPPUNIT_ASSERT (pDoc); + + assertXPath(pDoc, "/metafile/font", 8); + + assertXPath(pDoc, "/metafile/font[1]", "color", "#595959"); + assertXPath(pDoc, "/metafile/font[1]", "width", "0"); + assertXPath(pDoc, "/metafile/font[1]", "height", "389"); + assertXPath(pDoc, "/metafile/font[1]", "orientation", "0"); + assertXPath(pDoc, "/metafile/font[1]", "weight", "bold"); + + // World transform should not affect font size. Rotating text for 90 degrees + // should not exchange font width and height. + assertXPath(pDoc, "/metafile/font[3]", "color", "#000000"); + assertXPath(pDoc, "/metafile/font[3]", "width", "0"); + assertXPath(pDoc, "/metafile/font[3]", "height", "530"); + assertXPath(pDoc, "/metafile/font[3]", "orientation", "900"); + assertXPath(pDoc, "/metafile/font[3]", "weight", "normal"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(WmfTest); CPPUNIT_PLUGIN_IMPLEMENT(); |