Kaydet (Commit) 59fba39c authored tarafından Artur Dorda's avatar Artur Dorda Kaydeden (comit) Markus Mohrhard

Added auxiliary method for dumping PropertyValue

Change-Id: Ie060ea82bda32bd62ea0fa82da037a47a78f3bf9
üst 2704fe39
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <com/sun/star/awt/Rectangle.hpp> #include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#ifndef EnhancedShapeDumper_hxx #ifndef EnhancedShapeDumper_hxx
#define EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx
...@@ -54,6 +55,7 @@ public: ...@@ -54,6 +55,7 @@ public:
// auxiliary functions // auxiliary functions
void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair);
void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D); void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D);
void dumpPropertyValueAsElement(com::sun::star::beans::PropertyValue aPropertyValue);
// EnhancedCustomShapeExtrusion.idl // EnhancedCustomShapeExtrusion.idl
void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet);
......
...@@ -504,3 +504,35 @@ void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing:: ...@@ -504,3 +504,35 @@ void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing::
xmlTextWriterEndElement( xmlWriter ); xmlTextWriterEndElement( xmlWriter );
} }
void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPropertyValue)
{
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" ));
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s",
rtl::OUStringToOString(aPropertyValue.Name, RTL_TEXTENCODING_UTF8).getStr());
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("handle"), "%" SAL_PRIdINT32, aPropertyValue.Handle);
uno::Any aAny = aPropertyValue.Value;
rtl::OUString sValue;
if(aAny >>= sValue)
{
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s",
rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
}
switch(aPropertyValue.State)
{
case beans::PropertyState_DIRECT_VALUE:
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
break;
case beans::PropertyState_DEFAULT_VALUE:
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
break;
case beans::PropertyState_AMBIGUOUS_VALUE:
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
break;
default:
break;
}
xmlTextWriterEndElement( xmlWriter );
}
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