From ce90fa303234e9e6628bf9dfcc7f81565a639d06 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 10 Jun 2014 19:24:30 +0200 Subject: MetafileXmlDump: Add dumping of META_CLIPREGION_ACTION's. Change-Id: I4b51abf6193c33367edebc82772054875b5b9bba --- test/source/mtfxmldump.cxx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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(pAction); -- cgit