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

Added Extrusion, Path & TextPath properties

Change-Id: I46e7d6e0c83d8f988f2e5a5b9e7a10cbaef83958
üst 59fba39c
...@@ -91,6 +91,9 @@ public: ...@@ -91,6 +91,9 @@ public:
void dumpMirroredYAsAttribute(sal_Bool bMirroredY); void dumpMirroredYAsAttribute(sal_Bool bMirroredY);
void dumpTextRotateAngleAsAttribute(double aTextRotateAngle); void dumpTextRotateAngleAsAttribute(double aTextRotateAngle);
void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues); void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues);
void dumpExtrusionAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aExtrusion);
void dumpPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aPath);
void dumpTextPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aTextPath);
private: private:
xmlTextWriterPtr xmlWriter; xmlTextWriterPtr xmlWriter;
......
...@@ -433,46 +433,64 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference< ...@@ -433,46 +433,64 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference<
if(anotherAny >>= aAdjustmentValues) if(anotherAny >>= aAdjustmentValues)
dumpAdjustmentValuesAsElement(aAdjustmentValues); dumpAdjustmentValuesAsElement(aAdjustmentValues);
} }
{
uno::Any anotherAny = xPropSet->getPropertyValue("Extrusion");
uno::Sequence< beans::PropertyValue > aExtrusion;
if(anotherAny >>= aExtrusion)
dumpExtrusionAsElement(aExtrusion);
}
{
uno::Any anotherAny = xPropSet->getPropertyValue("Path");
uno::Sequence< beans::PropertyValue > aPath;
if(anotherAny >>= aPath)
dumpPathAsElement(aPath);
}
{
uno::Any anotherAny = xPropSet->getPropertyValue("TextPath");
uno::Sequence< beans::PropertyValue > aTextPath;
if(anotherAny >>= aTextPath)
dumpTextPathAsElement(aTextPath);
}
} }
void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType) void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType)
{ {
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s",
rtl::OUStringToOString(sType, RTL_TEXTENCODING_UTF8).getStr()); rtl::OUStringToOString(sType, RTL_TEXTENCODING_UTF8).getStr());
} }
void EnhancedShapeDumper::dumpViewBoxAsElement(awt::Rectangle aViewBox) void EnhancedShapeDumper::dumpViewBoxAsElement(awt::Rectangle aViewBox)
{ {
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ViewBox" )); xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ViewBox" ));
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("x"), "%" SAL_PRIdINT32, aViewBox.X); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("x"), "%" SAL_PRIdINT32, aViewBox.X);
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("y"), "%" SAL_PRIdINT32, aViewBox.Y); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("y"), "%" SAL_PRIdINT32, aViewBox.Y);
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aViewBox.Width); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aViewBox.Width);
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aViewBox.Height); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aViewBox.Height);
xmlTextWriterEndElement( xmlWriter ); xmlTextWriterEndElement( xmlWriter );
} }
void EnhancedShapeDumper::dumpMirroredXAsAttribute(sal_Bool bMirroredX) void EnhancedShapeDumper::dumpMirroredXAsAttribute(sal_Bool bMirroredX)
{ {
if(bMirroredX) if(bMirroredX)
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredX"), "%s", "true"); xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredX"), "%s", "true");
else else
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredX"), "%s", "false"); xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredX"), "%s", "false");
} }
void EnhancedShapeDumper::dumpMirroredYAsAttribute(sal_Bool bMirroredY) void EnhancedShapeDumper::dumpMirroredYAsAttribute(sal_Bool bMirroredY)
{ {
if(bMirroredY) if(bMirroredY)
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "true"); xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "true");
else else
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "false"); xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "false");
} }
void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle) void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle)
{ {
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle); xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle);
} }
void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues) void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues)
{ {
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "AdjustmentValues" )); xmlTextWriterStartElement(xmlWriter, BAD_CAST( "AdjustmentValues" ));
sal_Int32 nLength = aAdjustmentValues.getLength(); sal_Int32 nLength = aAdjustmentValues.getLength();
for (sal_Int32 i = 0; i < nLength; ++i) for (sal_Int32 i = 0; i < nLength; ++i)
...@@ -502,10 +520,10 @@ void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing:: ...@@ -502,10 +520,10 @@ void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing::
xmlTextWriterEndElement( xmlWriter ); xmlTextWriterEndElement( xmlWriter );
} }
xmlTextWriterEndElement( xmlWriter ); xmlTextWriterEndElement( xmlWriter );
} }
void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPropertyValue) void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPropertyValue)
{ {
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" )); xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" ));
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s",
...@@ -534,5 +552,38 @@ void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPrope ...@@ -534,5 +552,38 @@ void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPrope
break; break;
} }
xmlTextWriterEndElement( xmlWriter ); xmlTextWriterEndElement( xmlWriter );
}
void EnhancedShapeDumper::dumpExtrusionAsElement(uno::Sequence< beans::PropertyValue > aExtrusion)
{
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Extrusion" ));
sal_Int32 nLength = aExtrusion.getLength();
for (sal_Int32 i = 0; i < nLength; ++i)
{
dumpPropertyValueAsElement(aExtrusion[i]);
} }
xmlTextWriterEndElement( xmlWriter );
}
void EnhancedShapeDumper::dumpPathAsElement(uno::Sequence< beans::PropertyValue > aPath)
{
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Path" ));
sal_Int32 nLength = aPath.getLength();
for (sal_Int32 i = 0; i < nLength; ++i)
{
dumpPropertyValueAsElement(aPath[i]);
}
xmlTextWriterEndElement( xmlWriter );
}
void EnhancedShapeDumper::dumpTextPathAsElement(uno::Sequence< beans::PropertyValue > aTextPath)
{
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "TextPath" ));
sal_Int32 nLength = aTextPath.getLength();
for (sal_Int32 i = 0; i < nLength; ++i)
{
dumpPropertyValueAsElement(aTextPath[i]);
}
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