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

Added properties Metal & ShadeMode

Change-Id: I254a9089d78b97dde331812f77ad7977631b0d12
üst 6c245e06
......@@ -31,6 +31,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/ShadeMode.hpp>
#ifndef EnhancedShapeDumper_hxx
#define EnhancedShapeDumper_hxx
......@@ -63,6 +64,8 @@ public:
void dumpSecondLightLevelAsAttribute(double aSecondLightLevel);
void dumpFirstLightDirectionAsElement(com::sun::star::drawing::Direction3D aFirstLightDirection);
void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection);
void dumpMetalAsAttribute(sal_Bool bMetal);
void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode);
private:
xmlTextWriterPtr xmlWriter;
......
......@@ -110,6 +110,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference
if(anotherAny >>= aSecondLightDirection)
dumpSecondLightDirectionAsElement(aSecondLightDirection);
}
{
uno::Any anotherAny = xPropSet->getPropertyValue("Metal");
sal_Bool bMetal;
if(anotherAny >>= bMetal)
dumpMetalAsAttribute(bMetal);
}
{
uno::Any anotherAny = xPropSet->getPropertyValue("ShadeMode");
drawing::ShadeMode eShadeMode;
if(anotherAny >>= eShadeMode)
dumpShadeModeAsAttribute(eShadeMode);
}
}
void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion)
{
......@@ -224,4 +236,33 @@ void EnhancedShapeDumper::dumpSecondLightDirectionAsElement(drawing::Direction3D
xmlTextWriterEndElement( xmlWriter );
}
void EnhancedShapeDumper::dumpMetalAsAttribute(sal_Bool bMetal)
{
if(bMetal)
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("metal"), "%s", "true");
else
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("metal"), "%s", "false");
}
void EnhancedShapeDumper::dumpShadeModeAsAttribute(drawing::ShadeMode eShadeMode)
{
switch(eShadeMode)
{
case drawing::ShadeMode_FLAT:
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "FLAT");
break;
case drawing::ShadeMode_PHONG:
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "PHONG");
break;
case drawing::ShadeMode_SMOOTH:
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "SMOOTH");
break;
case drawing::ShadeMode_DRAFT:
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "DRAFT");
break;
default:
break;
}
}
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