diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-06-10 19:24:30 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-06-10 19:33:12 +0200 |
commit | ce90fa303234e9e6628bf9dfcc7f81565a639d06 (patch) | |
tree | 08dd6d315b1d59be79bf22c418f3d5039e035411 /test | |
parent | 2a649539b723a01649102ff7be3cab2bbdff834d (diff) |
MetafileXmlDump: Add dumping of META_CLIPREGION_ACTION's.
Change-Id: I4b51abf6193c33367edebc82772054875b5b9bba
Diffstat (limited to 'test')
-rw-r--r-- | test/source/mtfxmldump.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx index 5e329a3b85a2..500fa8663ef9 100644 --- a/test/source/mtfxmldump.cxx +++ b/test/source/mtfxmldump.cxx @@ -167,7 +167,7 @@ xmlDocPtr MetafileXmlDump::dumpAndParse(GDIMetaFile& rMetaFile, const OUString& if (rTempStreamName.isEmpty()) pStream = new SvMemoryStream(); else - pStream = new SvFileStream(rTempStreamName, STREAM_STD_READWRITE); + pStream = new SvFileStream(rTempStreamName, STREAM_STD_READWRITE | STREAM_TRUNC); xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO(lclWriteCallback, lclCloseCallback, pStream, NULL); xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer ); @@ -336,6 +336,25 @@ xmlDocPtr MetafileXmlDump::dumpAndParse(GDIMetaFile& rMetaFile, const OUString& } break; + case META_CLIPREGION_ACTION: + { + const MetaClipRegionAction* pA = static_cast< const MetaClipRegionAction* >(pAction); + + aWriter.startElement("clipregion"); + + // FIXME for now we dump only the bounding box; this is + // enough for the tests we have, but may need extending to + // dumping the real polypolygon in the future + Rectangle aRectangle = pA->GetRegion().GetBoundRect(); + aWriter.attribute("top", aRectangle.Top()); + aWriter.attribute("left", aRectangle.Left()); + aWriter.attribute("bottom", aRectangle.Bottom()); + aWriter.attribute("right", aRectangle.Right()); + + aWriter.endElement(); + } + break; + case META_ISECTRECTCLIPREGION_ACTION: { MetaISectRectClipRegionAction* pMetaISectRectClipRegionAction = static_cast<MetaISectRectClipRegionAction*>(pAction); |