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

Added dumping property AdjustmentValues

Change-Id: Iac59e89f3d7dd5e75ca43b43c19639880fc2b3d5
üst 0e135909
......@@ -36,6 +36,7 @@
#include <com/sun/star/drawing/Position3D.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#ifndef EnhancedShapeDumper_hxx
#define EnhancedShapeDumper_hxx
......@@ -87,6 +88,7 @@ public:
void dumpMirroredXAsAttribute(sal_Bool bMirroredX);
void dumpMirroredYAsAttribute(sal_Bool bMirroredY);
void dumpTextRotateAngleAsAttribute(double aTextRotateAngle);
void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues);
private:
xmlTextWriterPtr xmlWriter;
......
......@@ -427,6 +427,12 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference<
if(anotherAny >>= aTextRotateAngle)
dumpTextRotateAngleAsAttribute(aTextRotateAngle);
}
{
uno::Any anotherAny = xPropSet->getPropertyValue("AdjustmentValues");
uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues;
if(anotherAny >>= aAdjustmentValues)
dumpAdjustmentValuesAsElement(aAdjustmentValues);
}
}
void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType)
{
......@@ -465,4 +471,36 @@ void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle);
}
void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues)
{
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "AdjustmentValues" ));
sal_Int32 nLength = aAdjustmentValues.getLength();
for (sal_Int32 i = 0; i < nLength; ++i)
{
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeAdjustmentValue" ));
uno::Any aAny = aAdjustmentValues[i].Value;
rtl::OUString sValue;
if(aAny >>= sValue)
{
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s",
rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
}
switch(aAdjustmentValues[i].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 );
}
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