Kaydet (Commit) 142d63d0 authored tarafından Miklos Vajna's avatar Miklos Vajna

oox: add a method to dump a PropertyMap as data

It was already possible to dump a PropertyMap as code, but not as data.
The plan here is that if we dump the customshape preset definitions as
data, then once there is a parser for it, we can get rid of the ugly
generated code.

Change-Id: If596941fedf71693e5d0bff436446ac0855c4c84
üst a60d9aa7
...@@ -110,6 +110,8 @@ public: ...@@ -110,6 +110,8 @@ public:
#endif #endif
static void dumpCode( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet); static void dumpCode( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet);
void dumpCode(); void dumpCode();
static void dumpData(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> rXPropSet);
void dumpData();
#endif #endif
private: private:
const PropertyNameVector* mpPropNames; const PropertyNameVector* mpPropNames;
......
...@@ -173,6 +173,7 @@ certain functionality. ...@@ -173,6 +173,7 @@ certain functionality.
@li @c filter.tiff @li @c filter.tiff
@li @c filter.xslt - xslt import/export @li @c filter.xslt - xslt import/export
@li @c oox.cscode - see oox/source/drawingml/customshapes/README @li @c oox.cscode - see oox/source/drawingml/customshapes/README
@li @c oox.csdata - see oox/source/drawingml/customshapes/README
@li @c oox.drawingml - DrawingML @li @c oox.drawingml - DrawingML
@li @c oox.ppt - pptx filter @li @c oox.ppt - pptx filter
@li @c oox.storage - ZipStorage class @li @c oox.storage - ZipStorage class
......
...@@ -351,6 +351,9 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi ...@@ -351,6 +351,9 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
SAL_INFO("oox.cscode", "==cscode== begin"); SAL_INFO("oox.cscode", "==cscode== begin");
aPropertyMap.dumpCode(); aPropertyMap.dumpCode();
SAL_INFO("oox.cscode", "==cscode== end"); SAL_INFO("oox.cscode", "==cscode== end");
SAL_INFO("oox.csdata", "==csdata== begin");
aPropertyMap.dumpData();
SAL_INFO("oox.csdata", "==csdata== end");
#endif #endif
// converting the vector to a sequence // converting the vector to a sequence
Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence(); Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence();
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
# include <com/sun/star/text/WritingMode.hpp> # include <com/sun/star/text/WritingMode.hpp>
using ::com::sun::star::style::LineSpacing; using ::com::sun::star::style::LineSpacing;
using ::com::sun::star::text::WritingMode; using ::com::sun::star::text::WritingMode;
#include <comphelper/anytostring.hxx>
#include <iostream>
#endif #endif
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
...@@ -929,10 +931,27 @@ void PropertyMap::dumpCode( Reference< XPropertySet > rXPropSet ) ...@@ -929,10 +931,27 @@ void PropertyMap::dumpCode( Reference< XPropertySet > rXPropSet )
} }
} }
void PropertyMap::dumpData(Reference<XPropertySet> xPropertySet)
{
Reference<XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
Sequence<Property> aProperties = xPropertySetInfo->getProperties();
for (int i = 0; i < aProperties.getLength(); ++i)
{
std::cerr << aProperties[i].Name << std::endl;
std::cerr << comphelper::anyToString(xPropertySet->getPropertyValue(aProperties[i].Name)) << std::endl;
}
}
void PropertyMap::dumpCode() void PropertyMap::dumpCode()
{ {
dumpCode( Reference< XPropertySet >( makePropertySet(), UNO_QUERY ) ); dumpCode( Reference< XPropertySet >( makePropertySet(), UNO_QUERY ) );
} }
void PropertyMap::dumpData()
{
dumpData( Reference< XPropertySet >( makePropertySet(), UNO_QUERY ) );
}
#endif #endif
} // namespace oox } // namespace oox
......
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