diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-07-04 03:42:50 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-12 03:10:17 +0200 |
commit | 59fba39c076c90918d99aabf272f87385030f400 (patch) | |
tree | f3475f046cb196ce9957163bd8a5a330d6e30e77 | |
parent | Added dumping property AdjustmentValues (diff) | |
download | core-59fba39c076c90918d99aabf272f87385030f400.tar.gz core-59fba39c076c90918d99aabf272f87385030f400.zip |
Added auxiliary method for dumping PropertyValue
Change-Id: Ie060ea82bda32bd62ea0fa82da037a47a78f3bf9
-rw-r--r-- | drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 2 | ||||
-rw-r--r-- | drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 32 |
2 files changed, 34 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 375864a76f63..afa0d109b496 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -37,6 +37,7 @@ #include <com/sun/star/awt/Rectangle.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -54,6 +55,7 @@ public: // auxiliary functions void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D); + void dumpPropertyValueAsElement(com::sun::star::beans::PropertyValue aPropertyValue); // EnhancedCustomShapeExtrusion.idl void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 7336db7c76e4..8c6df680d865 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -504,3 +504,35 @@ void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing:: 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 ); + } + |