diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-05-16 17:39:26 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-05-19 00:01:14 +0200 |
commit | 46297bb42129ec778fdf0ad0a1014f5c0c16d170 (patch) | |
tree | e352a19825c75405b2e68133d6bb147f28cfa514 /test | |
parent | ee43de69083fc9f90d4fadb9129b3d0dcf804439 (diff) |
test: write to stream directly in MetafileXmlDump
Change-Id: If62a29af473f602f89e6e0e4a06772a320a23b9a
Diffstat (limited to 'test')
-rw-r--r-- | test/source/mtfxmldump.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx index 31f9aba37978..95bdba46bcea 100644 --- a/test/source/mtfxmldump.cxx +++ b/test/source/mtfxmldump.cxx @@ -17,15 +17,17 @@ namespace { -int writeCallback(void* pContext, const char* sBuffer, int nLen) +int lclWriteCallback(void* pContext, const char* sBuffer, int nLen) { - OStringBuffer* pBuffer = static_cast<OStringBuffer*>(pContext); - pBuffer->append(sBuffer); + SvStream* pStream = static_cast<SvStream*>(pContext); + pStream->Write(sBuffer, nLen); return nLen; } -int closeCallback(void* ) +int lclCloseCallback(void* pContext) { + SvStream* pStream = static_cast<SvStream*>(pContext); + pStream->WriteChar(0); return 0; } @@ -162,8 +164,7 @@ void MetafileXmlDump::dump(GDIMetaFile& rMetaFile) { std::vector<bool> usedIds(512, false); - OStringBuffer aString; - xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL ); + xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO(lclWriteCallback, lclCloseCallback, &mrStream, NULL); xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer ); xmlTextWriterSetIndent( xmlWriter, 1 ); @@ -395,8 +396,6 @@ void MetafileXmlDump::dump(GDIMetaFile& rMetaFile) aWriter.endElement(); aWriter.endDocument(); - - mrStream.WriteOString(aString.makeStringAndClear()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |