Kaydet (Commit) 08299e91 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add way for shape dumper to dump single shape

Change-Id: I031921d6869d3bbdef4ed11e4316b6cd977992ca
üst 9f13bb51
......@@ -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: */
......@@ -47,7 +47,7 @@ class DRAWINGLAYER_DLLPUBLIC XShapeDumper
public:
XShapeDumper();
OUString dump(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> xPageShapes, bool bDumpInteropProperties=false);
OUString dump(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> xPageShapes, bool bDumpInteropProperties=false);
};
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment