Kaydet (Commit) 6ca69fc4 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

bnc#881024 test font size at world transform

Change-Id: If9b09b69ccd890e45d963422ccedb711585f6434
üst a34e2e08
...@@ -43,11 +43,14 @@ public: ...@@ -43,11 +43,14 @@ public:
void testNonPlaceableWmf(); void testNonPlaceableWmf();
void testSine(); void testSine();
void testEmfProblem(); void testEmfProblem();
void testWorldTransformFontSize();
CPPUNIT_TEST_SUITE(WmfTest); CPPUNIT_TEST_SUITE(WmfTest);
CPPUNIT_TEST(testNonPlaceableWmf); CPPUNIT_TEST(testNonPlaceableWmf);
CPPUNIT_TEST(testSine); CPPUNIT_TEST(testSine);
CPPUNIT_TEST(testEmfProblem); CPPUNIT_TEST(testEmfProblem);
CPPUNIT_TEST(testWorldTransformFontSize);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
}; };
...@@ -123,6 +126,36 @@ void WmfTest::testEmfProblem() ...@@ -123,6 +126,36 @@ void WmfTest::testEmfProblem()
assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "right", "1876"); 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_TEST_SUITE_REGISTRATION(WmfTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment