summaryrefslogtreecommitdiff
path: root/test/source/mtfxmldump.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-06-10 19:24:30 +0200
committerJan Holesovsky <kendy@collabora.com>2014-06-10 19:33:12 +0200
commitce90fa303234e9e6628bf9dfcc7f81565a639d06 (patch)
tree08dd6d315b1d59be79bf22c418f3d5039e035411 /test/source/mtfxmldump.cxx
parent2a649539b723a01649102ff7be3cab2bbdff834d (diff)
MetafileXmlDump: Add dumping of META_CLIPREGION_ACTION's.
Change-Id: I4b51abf6193c33367edebc82772054875b5b9bba
Diffstat (limited to 'test/source/mtfxmldump.cxx')
-rw-r--r--test/source/mtfxmldump.cxx21
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);