diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-04-25 19:47:36 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-04-25 20:02:21 +0200 |
commit | 08299e911131c2850907d9c612950497a8348d2f (patch) | |
tree | a7429f39f059e3de6ccdf11bdf5d0ba8aa091a6f /drawinglayer | |
parent | 9f13bb51a852f29ce3c26845859a547c6be4e423 (diff) |
add way for shape dumper to dump single shape
Change-Id: I031921d6869d3bbdef4ed11e4316b6cd977992ca
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/dumper/XShapeDumper.cxx | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 93712ad9b123..639ec73e04b0 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1938,7 +1938,6 @@ void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr x OUString XShapeDumper::dump(uno::Reference<drawing::XShapes> xPageShapes, bool bDumpInteropProperties) { - OStringBuffer aString; xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL ); xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer ); @@ -1961,4 +1960,28 @@ OUString XShapeDumper::dump(uno::Reference<drawing::XShapes> xPageShapes, bool b return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); } +OUString XShapeDumper::dump(uno::Reference<drawing::XShape> xPageShapes, bool bDumpInteropProperties) +{ + OStringBuffer aString; + xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL ); + xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer ); + xmlTextWriterSetIndent( xmlWriter, 1 ); + + xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL ); + + try + { + dumpXShape( xPageShapes, xmlWriter, bDumpInteropProperties ); + } + catch (const beans::UnknownPropertyException& e) + { + std::cout << "Exception caught in XShapeDumper: " << e.Message << std::endl; + } + + xmlTextWriterEndDocument( xmlWriter ); + xmlFreeTextWriter( xmlWriter ); + + return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |