1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <EnhancedShapeDumper.hxx>
11 #include <rtl/strbuf.hxx>
12 #include <com/sun/star/beans/XPropertySet.hpp>
14 using namespace com::sun::star
;
17 // ---------- EnhancedCustomShapeExtrusion.idl ----------
20 void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
23 uno::Any anotherAny
= xPropSet
->getPropertyValue("Extrusion");
25 if(anotherAny
>>= bExtrusion
)
26 dumpExtrusionAsAttribute(bExtrusion
);
29 uno::Any anotherAny
= xPropSet
->getPropertyValue("Brightness");
30 double aBrightness
= double();
31 if(anotherAny
>>= aBrightness
)
32 dumpBrightnessAsAttribute(aBrightness
);
35 uno::Any anotherAny
= xPropSet
->getPropertyValue("Depth");
36 drawing::EnhancedCustomShapeParameterPair aDepth
;
37 if(anotherAny
>>= aDepth
)
38 dumpDepthAsElement(aDepth
);
41 uno::Any anotherAny
= xPropSet
->getPropertyValue("Diffusion");
42 double aDiffusion
= double();
43 if(anotherAny
>>= aDiffusion
)
44 dumpDiffusionAsAttribute(aDiffusion
);
47 uno::Any anotherAny
= xPropSet
->getPropertyValue("NumberOfLineSegments");
48 sal_Int32 aNumberOfLineSegments
= sal_Int32();
49 if(anotherAny
>>= aNumberOfLineSegments
)
50 dumpNumberOfLineSegmentsAsAttribute(aNumberOfLineSegments
);
53 uno::Any anotherAny
= xPropSet
->getPropertyValue("LightFace");
55 if(anotherAny
>>= bLightFace
)
56 dumpLightFaceAsAttribute(bLightFace
);
59 uno::Any anotherAny
= xPropSet
->getPropertyValue("FirstLightHarsh");
60 bool bFirstLightHarsh
;
61 if(anotherAny
>>= bFirstLightHarsh
)
62 dumpFirstLightHarshAsAttribute(bFirstLightHarsh
);
65 uno::Any anotherAny
= xPropSet
->getPropertyValue("SecondLightHarsh");
66 bool bSecondLightHarsh
;
67 if(anotherAny
>>= bSecondLightHarsh
)
68 dumpSecondLightHarshAsAttribute(bSecondLightHarsh
);
71 uno::Any anotherAny
= xPropSet
->getPropertyValue("FirstLightLevel");
72 double aFirstLightLevel
= double();
73 if(anotherAny
>>= aFirstLightLevel
)
74 dumpFirstLightLevelAsAttribute(aFirstLightLevel
);
77 uno::Any anotherAny
= xPropSet
->getPropertyValue("SecondLightLevel");
78 double aSecondLightLevel
= double();
79 if(anotherAny
>>= aSecondLightLevel
)
80 dumpSecondLightLevelAsAttribute(aSecondLightLevel
);
83 uno::Any anotherAny
= xPropSet
->getPropertyValue("FirstLightDirection");
84 drawing::Direction3D aFirstLightDirection
;
85 if(anotherAny
>>= aFirstLightDirection
)
86 dumpFirstLightDirectionAsElement(aFirstLightDirection
);
89 uno::Any anotherAny
= xPropSet
->getPropertyValue("SecondLightDirection");
90 drawing::Direction3D aSecondLightDirection
;
91 if(anotherAny
>>= aSecondLightDirection
)
92 dumpSecondLightDirectionAsElement(aSecondLightDirection
);
95 uno::Any anotherAny
= xPropSet
->getPropertyValue("Metal");
97 if(anotherAny
>>= bMetal
)
98 dumpMetalAsAttribute(bMetal
);
101 uno::Any anotherAny
= xPropSet
->getPropertyValue("ShadeMode");
102 drawing::ShadeMode eShadeMode
;
103 if(anotherAny
>>= eShadeMode
)
104 dumpShadeModeAsAttribute(eShadeMode
);
107 uno::Any anotherAny
= xPropSet
->getPropertyValue("RotateAngle");
108 drawing::EnhancedCustomShapeParameterPair aRotateAngle
;
109 if(anotherAny
>>= aRotateAngle
)
110 dumpRotateAngleAsElement(aRotateAngle
);
113 uno::Any anotherAny
= xPropSet
->getPropertyValue("RotationCenter");
114 drawing::Direction3D aRotationCenter
;
115 if(anotherAny
>>= aRotationCenter
)
116 dumpRotationCenterAsElement(aRotationCenter
);
119 uno::Any anotherAny
= xPropSet
->getPropertyValue("Shininess");
120 double aShininess
= double();
121 if(anotherAny
>>= aShininess
)
122 dumpShininessAsAttribute(aShininess
);
125 uno::Any anotherAny
= xPropSet
->getPropertyValue("Skew");
126 drawing::EnhancedCustomShapeParameterPair aSkew
;
127 if(anotherAny
>>= aSkew
)
128 dumpSkewAsElement(aSkew
);
131 uno::Any anotherAny
= xPropSet
->getPropertyValue("Specularity");
132 double aSpecularity
= double();
133 if(anotherAny
>>= aSpecularity
)
134 dumpSpecularityAsAttribute(aSpecularity
);
137 uno::Any anotherAny
= xPropSet
->getPropertyValue("ProjectionMode");
138 drawing::ProjectionMode eProjectionMode
;
139 if(anotherAny
>>= eProjectionMode
)
140 dumpProjectionModeAsAttribute(eProjectionMode
);
143 uno::Any anotherAny
= xPropSet
->getPropertyValue("ViewPoint");
144 drawing::Position3D aViewPoint
;
145 if(anotherAny
>>= aViewPoint
)
146 dumpViewPointAsElement(aViewPoint
);
149 uno::Any anotherAny
= xPropSet
->getPropertyValue("Origin");
150 drawing::EnhancedCustomShapeParameterPair aOrigin
;
151 if(anotherAny
>>= aOrigin
)
152 dumpOriginAsElement(aOrigin
);
155 uno::Any anotherAny
= xPropSet
->getPropertyValue("ExtrusionColor");
156 bool bExtrusionColor
;
157 if(anotherAny
>>= bExtrusionColor
)
158 dumpExtrusionColorAsAttribute(bExtrusionColor
);
161 void EnhancedShapeDumper::dumpExtrusionAsAttribute(bool bExtrusion
)
164 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusion"), "%s", "true");
166 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusion"), "%s", "false");
169 void EnhancedShapeDumper::dumpBrightnessAsAttribute(double aBrightness
)
171 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("brightness"), "%f", aBrightness
);
174 void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(drawing::EnhancedCustomShapeParameterPair aParameterPair
)
177 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "First" ));
178 dumpEnhancedCustomShapeParameter(aParameterPair
.First
);
179 xmlTextWriterEndElement( xmlWriter
);
182 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Second" ));
183 dumpEnhancedCustomShapeParameter(aParameterPair
.Second
);
184 xmlTextWriterEndElement( xmlWriter
);
188 void EnhancedShapeDumper::dumpDepthAsElement(const drawing::EnhancedCustomShapeParameterPair
& aDepth
)
190 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Depth" ));
191 dumpEnhancedCustomShapeParameterPair(aDepth
);
192 xmlTextWriterEndElement( xmlWriter
);
195 void EnhancedShapeDumper::dumpDiffusionAsAttribute(double aDiffusion
)
197 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("diffusion"), "%f", aDiffusion
);
200 void EnhancedShapeDumper::dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments
)
202 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("numberOfLineSegments"), "%" SAL_PRIdINT32
, aNumberOfLineSegments
);
205 void EnhancedShapeDumper::dumpLightFaceAsAttribute(bool bLightFace
)
208 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lightFace"), "%s", "true");
210 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lightFace"), "%s", "false");
213 void EnhancedShapeDumper::dumpFirstLightHarshAsAttribute(bool bFirstLightHarsh
)
216 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("firstLightHarsh"), "%s", "true");
218 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("firstLightHarsh"), "%s", "false");
221 void EnhancedShapeDumper::dumpSecondLightHarshAsAttribute(bool bSecondLightHarsh
)
223 if(bSecondLightHarsh
)
224 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("secondLightHarsh"), "%s", "true");
226 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("secondLightHarsh"), "%s", "false");
229 void EnhancedShapeDumper::dumpFirstLightLevelAsAttribute(double aFirstLightLevel
)
231 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("firstLightLevel"), "%f", aFirstLightLevel
);
234 void EnhancedShapeDumper::dumpSecondLightLevelAsAttribute(double aSecondLightLevel
)
236 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("secondLightLevel"), "%f", aSecondLightLevel
);
239 void EnhancedShapeDumper::dumpDirection3D(drawing::Direction3D aDirection3D
)
241 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("directionX"), "%f", aDirection3D
.DirectionX
);
242 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("directionY"), "%f", aDirection3D
.DirectionY
);
243 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("directionZ"), "%f", aDirection3D
.DirectionZ
);
246 void EnhancedShapeDumper::dumpFirstLightDirectionAsElement(drawing::Direction3D aFirstLightDirection
)
248 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FirstLightDirection" ));
249 dumpDirection3D(aFirstLightDirection
);
250 xmlTextWriterEndElement( xmlWriter
);
253 void EnhancedShapeDumper::dumpSecondLightDirectionAsElement(drawing::Direction3D aSecondLightDirection
)
255 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "SecondLightDirection" ));
256 dumpDirection3D(aSecondLightDirection
);
257 xmlTextWriterEndElement( xmlWriter
);
260 void EnhancedShapeDumper::dumpMetalAsAttribute(bool bMetal
)
263 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("metal"), "%s", "true");
265 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("metal"), "%s", "false");
268 void EnhancedShapeDumper::dumpShadeModeAsAttribute(drawing::ShadeMode eShadeMode
)
272 case drawing::ShadeMode_FLAT
:
273 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "FLAT");
275 case drawing::ShadeMode_PHONG
:
276 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "PHONG");
278 case drawing::ShadeMode_SMOOTH
:
279 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "SMOOTH");
281 case drawing::ShadeMode_DRAFT
:
282 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "DRAFT");
289 void EnhancedShapeDumper::dumpRotateAngleAsElement(const drawing::EnhancedCustomShapeParameterPair
& aRotateAngle
)
291 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RotateAngle" ));
292 dumpEnhancedCustomShapeParameterPair(aRotateAngle
);
293 xmlTextWriterEndElement( xmlWriter
);
296 void EnhancedShapeDumper::dumpRotationCenterAsElement(drawing::Direction3D aRotationCenter
)
298 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RotationCenter" ));
299 dumpDirection3D(aRotationCenter
);
300 xmlTextWriterEndElement( xmlWriter
);
303 void EnhancedShapeDumper::dumpShininessAsAttribute(double aShininess
)
305 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shininess"), "%f", aShininess
);
308 void EnhancedShapeDumper::dumpSkewAsElement(const drawing::EnhancedCustomShapeParameterPair
& aSkew
)
310 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Skew" ));
311 dumpEnhancedCustomShapeParameterPair(aSkew
);
312 xmlTextWriterEndElement( xmlWriter
);
315 void EnhancedShapeDumper::dumpSpecularityAsAttribute(double aSpecularity
)
317 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("specularity"), "%f", aSpecularity
);
320 void EnhancedShapeDumper::dumpProjectionModeAsAttribute(drawing::ProjectionMode eProjectionMode
)
322 switch(eProjectionMode
)
324 case drawing::ProjectionMode_PARALLEL
:
325 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("projectionMode"), "%s", "PARALLEL");
327 case drawing::ProjectionMode_PERSPECTIVE
:
328 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("projectionMode"), "%s", "PERSPECTIVE");
335 void EnhancedShapeDumper::dumpViewPointAsElement(drawing::Position3D aViewPoint
)
337 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "ViewPoint" ));
338 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("positionX"), "%f", aViewPoint
.PositionX
);
339 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("positionY"), "%f", aViewPoint
.PositionY
);
340 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("positionZ"), "%f", aViewPoint
.PositionZ
);
341 xmlTextWriterEndElement( xmlWriter
);
344 void EnhancedShapeDumper::dumpOriginAsElement(const drawing::EnhancedCustomShapeParameterPair
& aOrigin
)
346 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Origin" ));
347 dumpEnhancedCustomShapeParameterPair(aOrigin
);
348 xmlTextWriterEndElement( xmlWriter
);
351 void EnhancedShapeDumper::dumpExtrusionColorAsAttribute(bool bExtrusionColor
)
354 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionColor"), "%s", "true");
356 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionColor"), "%s", "false");
360 // ---------- EnhancedCustomShapeGeometry.idl -----------
363 void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
366 uno::Any anotherAny
= xPropSet
->getPropertyValue("Type");
368 if(anotherAny
>>= sType
)
369 dumpTypeAsAttribute(sType
);
372 uno::Any anotherAny
= xPropSet
->getPropertyValue("ViewBox");
373 awt::Rectangle aViewBox
;
374 if(anotherAny
>>= aViewBox
)
375 dumpViewBoxAsElement(aViewBox
);
378 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredX");
380 if(anotherAny
>>= bMirroredX
)
381 dumpMirroredXAsAttribute(bMirroredX
);
384 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredY");
386 if(anotherAny
>>= bMirroredY
)
387 dumpMirroredYAsAttribute(bMirroredY
);
390 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextRotateAngle");
391 double aTextRotateAngle
= double();
392 if(anotherAny
>>= aTextRotateAngle
)
393 dumpTextRotateAngleAsAttribute(aTextRotateAngle
);
396 uno::Any anotherAny
= xPropSet
->getPropertyValue("AdjustmentValues");
397 uno::Sequence
< drawing::EnhancedCustomShapeAdjustmentValue
> aAdjustmentValues
;
398 if(anotherAny
>>= aAdjustmentValues
)
399 dumpAdjustmentValuesAsElement(aAdjustmentValues
);
402 uno::Any anotherAny
= xPropSet
->getPropertyValue("Extrusion");
403 uno::Sequence
< beans::PropertyValue
> aExtrusion
;
404 if(anotherAny
>>= aExtrusion
)
405 dumpExtrusionAsElement(aExtrusion
);
408 uno::Any anotherAny
= xPropSet
->getPropertyValue("Path");
409 uno::Sequence
< beans::PropertyValue
> aPath
;
410 if(anotherAny
>>= aPath
)
411 dumpPathAsElement(aPath
);
414 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPath");
415 uno::Sequence
< beans::PropertyValue
> aTextPath
;
416 if(anotherAny
>>= aTextPath
)
417 dumpTextPathAsElement(aTextPath
);
420 uno::Any anotherAny
= xPropSet
->getPropertyValue("Equations");
421 uno::Sequence
< OUString
> aEquations
;
422 if(anotherAny
>>= aEquations
)
423 dumpEquationsAsElement(aEquations
);
426 uno::Any anotherAny
= xPropSet
->getPropertyValue("Handles");
427 uno::Sequence
< beans::PropertyValues
> aHandles
;
428 if(anotherAny
>>= aHandles
)
429 dumpHandlesAsElement(aHandles
);
432 void EnhancedShapeDumper::dumpTypeAsAttribute(const OUString
& sType
)
434 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("type"), "%s",
435 OUStringToOString(sType
, RTL_TEXTENCODING_UTF8
).getStr());
438 void EnhancedShapeDumper::dumpViewBoxAsElement(awt::Rectangle aViewBox
)
440 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "ViewBox" ));
441 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("x"), "%" SAL_PRIdINT32
, aViewBox
.X
);
442 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("y"), "%" SAL_PRIdINT32
, aViewBox
.Y
);
443 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("width"), "%" SAL_PRIdINT32
, aViewBox
.Width
);
444 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("height"), "%" SAL_PRIdINT32
, aViewBox
.Height
);
445 xmlTextWriterEndElement( xmlWriter
);
448 void EnhancedShapeDumper::dumpMirroredXAsAttribute(bool bMirroredX
)
451 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredX"), "%s", "true");
453 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredX"), "%s", "false");
456 void EnhancedShapeDumper::dumpMirroredYAsAttribute(bool bMirroredY
)
459 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredY"), "%s", "true");
461 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredY"), "%s", "false");
464 void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle
)
466 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle
);
469 void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeAdjustmentValue
>& aAdjustmentValues
)
471 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "AdjustmentValues" ));
472 sal_Int32 nLength
= aAdjustmentValues
.getLength();
473 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
475 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeAdjustmentValue" ));
476 uno::Any aAny
= aAdjustmentValues
[i
].Value
;
483 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
484 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
486 else if(aAny
>>= nValue
)
488 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%" SAL_PRIdINT32
, nValue
);
490 else if(aAny
>>= fValue
)
492 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%f", fValue
);
494 else if(aAny
>>= bValue
)
496 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s", (bValue
? "true": "false"));
499 switch(aAdjustmentValues
[i
].State
)
501 case beans::PropertyState_DIRECT_VALUE
:
502 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
504 case beans::PropertyState_DEFAULT_VALUE
:
505 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
507 case beans::PropertyState_AMBIGUOUS_VALUE
:
508 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
513 xmlTextWriterEndElement( xmlWriter
);
515 xmlTextWriterEndElement( xmlWriter
);
518 void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPropertyValue
)
520 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PropertyValue" ));
522 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s",
523 OUStringToOString(aPropertyValue
.Name
, RTL_TEXTENCODING_UTF8
).getStr());
524 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("handle"), "%" SAL_PRIdINT32
, aPropertyValue
.Handle
);
526 uno::Any aAny
= aPropertyValue
.Value
;
530 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
531 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
533 switch(aPropertyValue
.State
)
535 case beans::PropertyState_DIRECT_VALUE
:
536 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
538 case beans::PropertyState_DEFAULT_VALUE
:
539 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
541 case beans::PropertyState_AMBIGUOUS_VALUE
:
542 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
547 xmlTextWriterEndElement( xmlWriter
);
550 void EnhancedShapeDumper::dumpExtrusionAsElement(const uno::Sequence
< beans::PropertyValue
>& aExtrusion
)
552 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Extrusion" ));
553 sal_Int32 nLength
= aExtrusion
.getLength();
554 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
556 dumpPropertyValueAsElement(aExtrusion
[i
]);
558 xmlTextWriterEndElement( xmlWriter
);
561 void EnhancedShapeDumper::dumpPathAsElement(const uno::Sequence
< beans::PropertyValue
>& aPath
)
563 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Path" ));
564 sal_Int32 nLength
= aPath
.getLength();
565 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
567 dumpPropertyValueAsElement(aPath
[i
]);
569 xmlTextWriterEndElement( xmlWriter
);
572 void EnhancedShapeDumper::dumpTextPathAsElement(const uno::Sequence
< beans::PropertyValue
>& aTextPath
)
574 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "TextPath" ));
575 sal_Int32 nLength
= aTextPath
.getLength();
576 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
578 dumpPropertyValueAsElement(aTextPath
[i
]);
580 xmlTextWriterEndElement( xmlWriter
);
583 void EnhancedShapeDumper::dumpEquationsAsElement(const uno::Sequence
< OUString
>& aEquations
)
585 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Equations" ));
586 sal_Int32 nLength
= aEquations
.getLength();
587 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
589 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s",
590 OUStringToOString(aEquations
[i
], RTL_TEXTENCODING_UTF8
).getStr());
592 xmlTextWriterEndElement( xmlWriter
);
595 // PropertyValues specifies a sequence of PropertyValue instances.
596 // so in this case it's a Sequence of a Sequence of a PropertyValue instances.
597 // Welcome to Sequenception again.
598 void EnhancedShapeDumper::dumpHandlesAsElement(const uno::Sequence
< beans::PropertyValues
>& aHandles
)
600 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Handles" ));
601 sal_Int32 nSequenceLength
= aHandles
.getLength();
602 for (sal_Int32 i
= 0; i
< nSequenceLength
; ++i
)
604 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PropertyValues" ));
605 uno::Sequence
< beans::PropertyValue
> propertyValueSequence
= aHandles
[i
];
606 sal_Int32 nLength
= propertyValueSequence
.getLength();
607 for (sal_Int32 j
= 0; j
< nLength
; ++j
)
609 dumpPropertyValueAsElement(propertyValueSequence
[j
]);
611 xmlTextWriterEndElement( xmlWriter
);
613 xmlTextWriterEndElement( xmlWriter
);
617 // ---------- EnhancedCustomShapeHandle.idl -----------
620 void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
623 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredX");
625 if(anotherAny
>>= bMirroredX
)
626 dumpMirroredXAsAttribute(bMirroredX
);
629 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredY");
631 if(anotherAny
>>= bMirroredY
)
632 dumpMirroredYAsAttribute(bMirroredY
);
635 uno::Any anotherAny
= xPropSet
->getPropertyValue("Switched");
637 if(anotherAny
>>= bSwitched
)
638 dumpSwitchedAsAttribute(bSwitched
);
641 uno::Any anotherAny
= xPropSet
->getPropertyValue("Position");
642 drawing::EnhancedCustomShapeParameterPair aPosition
;
643 if(anotherAny
>>= aPosition
)
644 dumpPositionAsElement(aPosition
);
647 uno::Any anotherAny
= xPropSet
->getPropertyValue("Polar");
648 drawing::EnhancedCustomShapeParameterPair aPolar
;
649 if(anotherAny
>>= aPolar
)
650 dumpPolarAsElement(aPolar
);
653 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefX");
654 sal_Int32 aRefX
= sal_Int32();
655 if(anotherAny
>>= aRefX
)
656 dumpRefXAsAttribute(aRefX
);
659 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefY");
660 sal_Int32 aRefY
= sal_Int32();
661 if(anotherAny
>>= aRefY
)
662 dumpRefYAsAttribute(aRefY
);
665 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefAngle");
666 sal_Int32 aRefAngle
= sal_Int32();
667 if(anotherAny
>>= aRefAngle
)
668 dumpRefAngleAsAttribute(aRefAngle
);
671 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefR");
672 sal_Int32 aRefR
= sal_Int32();
673 if(anotherAny
>>= aRefR
)
674 dumpRefRAsAttribute(aRefR
);
677 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeXMinimum");
678 drawing::EnhancedCustomShapeParameter aRangeXMinimum
;
679 if(anotherAny
>>= aRangeXMinimum
)
680 dumpRangeXMinimumAsElement(aRangeXMinimum
);
683 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeXMaximum");
684 drawing::EnhancedCustomShapeParameter aRangeXMaximum
;
685 if(anotherAny
>>= aRangeXMaximum
)
686 dumpRangeXMaximumAsElement(aRangeXMaximum
);
689 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeYMinimum");
690 drawing::EnhancedCustomShapeParameter aRangeYMinimum
;
691 if(anotherAny
>>= aRangeYMinimum
)
692 dumpRangeYMinimumAsElement(aRangeYMinimum
);
695 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeYMaximum");
696 drawing::EnhancedCustomShapeParameter aRangeYMaximum
;
697 if(anotherAny
>>= aRangeYMaximum
)
698 dumpRangeYMaximumAsElement(aRangeYMaximum
);
701 uno::Any anotherAny
= xPropSet
->getPropertyValue("RadiusRangeMinimum");
702 drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum
;
703 if(anotherAny
>>= aRadiusRangeMinimum
)
704 dumpRadiusRangeMinimumAsElement(aRadiusRangeMinimum
);
707 uno::Any anotherAny
= xPropSet
->getPropertyValue("RadiusRangeMaximum");
708 drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum
;
709 if(anotherAny
>>= aRadiusRangeMaximum
)
710 dumpRadiusRangeMaximumAsElement(aRadiusRangeMaximum
);
714 void EnhancedShapeDumper::dumpSwitchedAsAttribute(bool bSwitched
)
717 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("switched"), "%s", "true");
719 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("switched"), "%s", "false");
722 void EnhancedShapeDumper::dumpPositionAsElement(const drawing::EnhancedCustomShapeParameterPair
& aPosition
)
724 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Position" ));
725 dumpEnhancedCustomShapeParameterPair(aPosition
);
726 xmlTextWriterEndElement( xmlWriter
);
729 void EnhancedShapeDumper::dumpPolarAsElement(const drawing::EnhancedCustomShapeParameterPair
& aPolar
)
731 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Polar" ));
732 dumpEnhancedCustomShapeParameterPair(aPolar
);
733 xmlTextWriterEndElement( xmlWriter
);
736 void EnhancedShapeDumper::dumpRefXAsAttribute(sal_Int32 aRefX
)
738 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refX"), "%" SAL_PRIdINT32
, aRefX
);
741 void EnhancedShapeDumper::dumpRefYAsAttribute(sal_Int32 aRefY
)
743 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refY"), "%" SAL_PRIdINT32
, aRefY
);
746 void EnhancedShapeDumper::dumpRefAngleAsAttribute(sal_Int32 aRefAngle
)
748 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refAngle"), "%" SAL_PRIdINT32
, aRefAngle
);
751 void EnhancedShapeDumper::dumpRefRAsAttribute(sal_Int32 aRefR
)
753 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refR"), "%" SAL_PRIdINT32
, aRefR
);
756 void EnhancedShapeDumper::dumpEnhancedCustomShapeParameter(drawing::EnhancedCustomShapeParameter aParameter
)
758 uno::Any aAny
= aParameter
.Value
;
765 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
766 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
768 else if(aAny
>>= nValue
)
770 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%" SAL_PRIdINT32
, nValue
);
772 else if(aAny
>>= fValue
)
774 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%f", fValue
);
776 else if(aAny
>>= bValue
)
778 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s", (bValue
? "true": "false"));
780 sal_Int32 aType
= aParameter
.Type
;
781 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("type"), "%" SAL_PRIdINT32
, aType
);
784 void EnhancedShapeDumper::dumpRangeXMinimumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeXMinimum
)
786 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeXMinimum" ));
787 dumpEnhancedCustomShapeParameter(aRangeXMinimum
);
788 xmlTextWriterEndElement( xmlWriter
);
791 void EnhancedShapeDumper::dumpRangeXMaximumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeXMaximum
)
793 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeXMaximum" ));
794 dumpEnhancedCustomShapeParameter(aRangeXMaximum
);
795 xmlTextWriterEndElement( xmlWriter
);
798 void EnhancedShapeDumper::dumpRangeYMinimumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeYMinimum
)
800 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeYMinimum" ));
801 dumpEnhancedCustomShapeParameter(aRangeYMinimum
);
802 xmlTextWriterEndElement( xmlWriter
);
805 void EnhancedShapeDumper::dumpRangeYMaximumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeYMaximum
)
807 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeYMaximum" ));
808 dumpEnhancedCustomShapeParameter(aRangeYMaximum
);
809 xmlTextWriterEndElement( xmlWriter
);
812 void EnhancedShapeDumper::dumpRadiusRangeMinimumAsElement(const drawing::EnhancedCustomShapeParameter
& aRadiusRangeMinimum
)
814 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RadiusRangeMinimum" ));
815 dumpEnhancedCustomShapeParameter(aRadiusRangeMinimum
);
816 xmlTextWriterEndElement( xmlWriter
);
819 void EnhancedShapeDumper::dumpRadiusRangeMaximumAsElement(const drawing::EnhancedCustomShapeParameter
& aRadiusRangeMaximum
)
821 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RadiusRangeMaximum" ));
822 dumpEnhancedCustomShapeParameter(aRadiusRangeMaximum
);
823 xmlTextWriterEndElement( xmlWriter
);
827 // ---------- EnhancedCustomShapePath.idl ---------------
830 void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
833 uno::Any anotherAny
= xPropSet
->getPropertyValue("Coordinates");
834 uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
> aCoordinates
;
835 if(anotherAny
>>= aCoordinates
)
836 dumpCoordinatesAsElement(aCoordinates
);
839 uno::Any anotherAny
= xPropSet
->getPropertyValue("Segments");
840 uno::Sequence
< drawing::EnhancedCustomShapeSegment
> aSegments
;
841 if(anotherAny
>>= aSegments
)
842 dumpSegmentsAsElement(aSegments
);
845 uno::Any anotherAny
= xPropSet
->getPropertyValue("StretchX");
846 sal_Int32 aStretchX
= sal_Int32();
847 if(anotherAny
>>= aStretchX
)
848 dumpStretchXAsAttribute(aStretchX
);
851 uno::Any anotherAny
= xPropSet
->getPropertyValue("StretchY");
852 sal_Int32 aStretchY
= sal_Int32();
853 if(anotherAny
>>= aStretchY
)
854 dumpStretchYAsAttribute(aStretchY
);
857 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextFrames");
858 uno::Sequence
< drawing::EnhancedCustomShapeTextFrame
> aTextFrames
;
859 if(anotherAny
>>= aTextFrames
)
860 dumpTextFramesAsElement(aTextFrames
);
863 uno::Any anotherAny
= xPropSet
->getPropertyValue("GluePoints");
864 uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
> aGluePoints
;
865 if(anotherAny
>>= aGluePoints
)
866 dumpGluePointsAsElement(aGluePoints
);
869 uno::Any anotherAny
= xPropSet
->getPropertyValue("GluePointLeavingDirections");
870 uno::Sequence
< double > aGluePointLeavingDirections
;
871 if(anotherAny
>>= aGluePointLeavingDirections
)
872 dumpGluePointLeavingDirectionsAsElement(aGluePointLeavingDirections
);
875 uno::Any anotherAny
= xPropSet
->getPropertyValue("GluePointType");
876 sal_Int32 aGluePointType
= sal_Int32();
877 if(anotherAny
>>= aGluePointType
)
878 dumpGluePointTypeAsAttribute(aGluePointType
);
881 uno::Any anotherAny
= xPropSet
->getPropertyValue("ExtrusionAllowed");
882 bool bExtrusionAllowed
;
883 if(anotherAny
>>= bExtrusionAllowed
)
884 dumpExtrusionAllowedAsAttribute(bExtrusionAllowed
);
887 uno::Any anotherAny
= xPropSet
->getPropertyValue("ConcentricGradientFillAllowed");
888 bool bConcentricGradientFillAllowed
;
889 if(anotherAny
>>= bConcentricGradientFillAllowed
)
890 dumpConcentricGradientFillAllowedAsAttribute(bConcentricGradientFillAllowed
);
893 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPathAllowed");
894 bool bTextPathAllowed
;
895 if(anotherAny
>>= bTextPathAllowed
)
896 dumpTextPathAllowedAsAttribute(bTextPathAllowed
);
899 uno::Any anotherAny
= xPropSet
->getPropertyValue("SubViewSize");
900 uno::Sequence
< awt::Size
> aSubViewSize
;
901 if(anotherAny
>>= aSubViewSize
)
902 dumpSubViewSizeAsElement(aSubViewSize
);
906 void EnhancedShapeDumper::dumpCoordinatesAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
>& aCoordinates
)
908 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Coordinates" ));
909 sal_Int32 nLength
= aCoordinates
.getLength();
910 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
912 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeParameterPair" ));
913 dumpEnhancedCustomShapeParameterPair(aCoordinates
[i
]);
914 xmlTextWriterEndElement( xmlWriter
);
916 xmlTextWriterEndElement( xmlWriter
);
919 void EnhancedShapeDumper::dumpSegmentsAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeSegment
>& aSegments
)
921 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Segments" ));
922 sal_Int32 nLength
= aSegments
.getLength();
923 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
925 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeSegment" ));
926 sal_Int32 aCommand
= aSegments
[i
].Command
;
927 sal_Int32 aCount
= aSegments
[i
].Count
;
928 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("command"), "%" SAL_PRIdINT32
, aCommand
);
929 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("count"), "%" SAL_PRIdINT32
, aCount
);
930 xmlTextWriterEndElement( xmlWriter
);
932 xmlTextWriterEndElement( xmlWriter
);
935 void EnhancedShapeDumper::dumpStretchXAsAttribute(sal_Int32 aStretchX
)
937 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("stretchX"), "%" SAL_PRIdINT32
, aStretchX
);
940 void EnhancedShapeDumper::dumpStretchYAsAttribute(sal_Int32 aStretchY
)
942 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("stretchY"), "%" SAL_PRIdINT32
, aStretchY
);
945 void EnhancedShapeDumper::dumpTextFramesAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeTextFrame
>& aTextFrames
)
947 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "TextFrames" ));
948 sal_Int32 nLength
= aTextFrames
.getLength();
949 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
951 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeTextFrame" ));
953 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "TopLeft" ));
954 dumpEnhancedCustomShapeParameterPair(aTextFrames
[i
].TopLeft
);
955 xmlTextWriterEndElement( xmlWriter
);
957 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "BottomRight" ));
958 dumpEnhancedCustomShapeParameterPair(aTextFrames
[i
].BottomRight
);
959 xmlTextWriterEndElement( xmlWriter
);
961 xmlTextWriterEndElement( xmlWriter
);
963 xmlTextWriterEndElement( xmlWriter
);
966 void EnhancedShapeDumper::dumpGluePointsAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
>& aGluePoints
)
968 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "GluePoints" ));
969 sal_Int32 nLength
= aGluePoints
.getLength();
970 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
972 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeParameterPair" ));
973 dumpEnhancedCustomShapeParameterPair(aGluePoints
[i
]);
974 xmlTextWriterEndElement( xmlWriter
);
976 xmlTextWriterEndElement( xmlWriter
);
979 void EnhancedShapeDumper::dumpGluePointLeavingDirectionsAsElement(const uno::Sequence
< double >& aGluePointLeavingDirections
)
981 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "GluePointLeavingDirections" ));
982 sal_Int32 nLength
= aGluePointLeavingDirections
.getLength();
983 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
985 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("value"), "%f", aGluePointLeavingDirections
[i
]);
987 xmlTextWriterEndElement( xmlWriter
);
990 void EnhancedShapeDumper::dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType
)
992 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("gluePointType"), "%" SAL_PRIdINT32
, aGluePointType
);
995 void EnhancedShapeDumper::dumpExtrusionAllowedAsAttribute(bool bExtrusionAllowed
)
997 if(bExtrusionAllowed
)
998 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionAllowed"), "%s", "true");
1000 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionAllowed"), "%s", "false");
1003 void EnhancedShapeDumper::dumpConcentricGradientFillAllowedAsAttribute(bool bConcentricGradientFillAllowed
)
1005 if(bConcentricGradientFillAllowed
)
1006 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("concentricGradientFillAllowed"), "%s", "true");
1008 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("concentricGradientFillAllowed"), "%s", "false");
1011 void EnhancedShapeDumper::dumpTextPathAllowedAsAttribute(bool bTextPathAllowed
)
1013 if(bTextPathAllowed
)
1014 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathAllowed"), "%s", "true");
1016 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathAllowed"), "%s", "false");
1019 void EnhancedShapeDumper::dumpSubViewSizeAsElement(const uno::Sequence
< awt::Size
>& aSubViewSize
)
1021 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "SubViewSize" ));
1022 sal_Int32 nLength
= aSubViewSize
.getLength();
1023 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
1025 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Size" ));
1026 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("width"), "%" SAL_PRIdINT32
, aSubViewSize
[i
].Width
);
1027 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("height"), "%" SAL_PRIdINT32
, aSubViewSize
[i
].Height
);
1028 xmlTextWriterEndElement( xmlWriter
);
1030 xmlTextWriterEndElement( xmlWriter
);
1034 // ---------- EnhancedCustomShapeTextPath.idl ---------------
1037 void EnhancedShapeDumper::dumpEnhancedCustomShapeTextPathService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
1040 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPath");
1042 if(anotherAny
>>= bTextPath
)
1043 dumpTextPathAsAttribute(bTextPath
);
1046 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPathMode");
1047 drawing::EnhancedCustomShapeTextPathMode eTextPathMode
;
1048 if(anotherAny
>>= eTextPathMode
)
1049 dumpTextPathModeAsAttribute(eTextPathMode
);
1052 uno::Any anotherAny
= xPropSet
->getPropertyValue("ScaleX");
1054 if(anotherAny
>>= bScaleX
)
1055 dumpScaleXAsAttribute(bScaleX
);
1059 void EnhancedShapeDumper::dumpTextPathAsAttribute(bool bTextPath
)
1062 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPath"), "%s", "true");
1064 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPath"), "%s", "false");
1067 void EnhancedShapeDumper::dumpTextPathModeAsAttribute(drawing::EnhancedCustomShapeTextPathMode eTextPathMode
)
1069 switch(eTextPathMode
)
1071 case drawing::EnhancedCustomShapeTextPathMode_NORMAL
:
1072 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathMode"), "%s", "NORMAL");
1074 case drawing::EnhancedCustomShapeTextPathMode_PATH
:
1075 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathMode"), "%s", "PATH");
1077 case drawing::EnhancedCustomShapeTextPathMode_SHAPE
:
1078 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathMode"), "%s", "SHAPE");
1085 void EnhancedShapeDumper::dumpScaleXAsAttribute(bool bScaleX
)
1088 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("scaleX"), "%s", "true");
1090 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("scaleX"), "%s", "false");
1093 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */