From 142d63d01567b5c7e513258f2835dbde54b30012 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 16 Apr 2014 18:15:21 +0200 Subject: 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 --- oox/source/drawingml/customshapeproperties.cxx | 3 +++ oox/source/helper/propertymap.cxx | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'oox') diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index 4886912ac054..cfaec25460dd 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -351,6 +351,9 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi SAL_INFO("oox.cscode", "==cscode== begin"); aPropertyMap.dumpCode(); SAL_INFO("oox.cscode", "==cscode== end"); + SAL_INFO("oox.csdata", "==csdata== begin"); + aPropertyMap.dumpData(); + SAL_INFO("oox.csdata", "==csdata== end"); #endif // converting the vector to a sequence Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence(); diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index 05c3b135ea54..1e5af51263b5 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -27,6 +27,8 @@ # include using ::com::sun::star::style::LineSpacing; using ::com::sun::star::text::WritingMode; +#include +#include #endif #include @@ -929,10 +931,27 @@ void PropertyMap::dumpCode( Reference< XPropertySet > rXPropSet ) } } +void PropertyMap::dumpData(Reference xPropertySet) +{ + Reference xPropertySetInfo = xPropertySet->getPropertySetInfo(); + Sequence 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() { dumpCode( Reference< XPropertySet >( makePropertySet(), UNO_QUERY ) ); } + +void PropertyMap::dumpData() +{ + dumpData( Reference< XPropertySet >( makePropertySet(), UNO_QUERY ) ); +} #endif } // namespace oox -- cgit