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(
175 const drawing::EnhancedCustomShapeParameterPair
& aParameterPair
)
178 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "First" ));
179 dumpEnhancedCustomShapeParameter(aParameterPair
.First
);
180 xmlTextWriterEndElement( xmlWriter
);
183 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Second" ));
184 dumpEnhancedCustomShapeParameter(aParameterPair
.Second
);
185 xmlTextWriterEndElement( xmlWriter
);
189 void EnhancedShapeDumper::dumpDepthAsElement(const drawing::EnhancedCustomShapeParameterPair
& aDepth
)
191 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Depth" ));
192 dumpEnhancedCustomShapeParameterPair(aDepth
);
193 xmlTextWriterEndElement( xmlWriter
);
196 void EnhancedShapeDumper::dumpDiffusionAsAttribute(double aDiffusion
)
198 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("diffusion"), "%f", aDiffusion
);
201 void EnhancedShapeDumper::dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments
)
203 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("numberOfLineSegments"), "%" SAL_PRIdINT32
, aNumberOfLineSegments
);
206 void EnhancedShapeDumper::dumpLightFaceAsAttribute(bool bLightFace
)
209 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lightFace"), "%s", "true");
211 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lightFace"), "%s", "false");
214 void EnhancedShapeDumper::dumpFirstLightHarshAsAttribute(bool bFirstLightHarsh
)
217 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("firstLightHarsh"), "%s", "true");
219 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("firstLightHarsh"), "%s", "false");
222 void EnhancedShapeDumper::dumpSecondLightHarshAsAttribute(bool bSecondLightHarsh
)
224 if(bSecondLightHarsh
)
225 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("secondLightHarsh"), "%s", "true");
227 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("secondLightHarsh"), "%s", "false");
230 void EnhancedShapeDumper::dumpFirstLightLevelAsAttribute(double aFirstLightLevel
)
232 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("firstLightLevel"), "%f", aFirstLightLevel
);
235 void EnhancedShapeDumper::dumpSecondLightLevelAsAttribute(double aSecondLightLevel
)
237 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("secondLightLevel"), "%f", aSecondLightLevel
);
240 void EnhancedShapeDumper::dumpDirection3D(drawing::Direction3D aDirection3D
)
242 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("directionX"), "%f", aDirection3D
.DirectionX
);
243 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("directionY"), "%f", aDirection3D
.DirectionY
);
244 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("directionZ"), "%f", aDirection3D
.DirectionZ
);
247 void EnhancedShapeDumper::dumpFirstLightDirectionAsElement(drawing::Direction3D aFirstLightDirection
)
249 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FirstLightDirection" ));
250 dumpDirection3D(aFirstLightDirection
);
251 xmlTextWriterEndElement( xmlWriter
);
254 void EnhancedShapeDumper::dumpSecondLightDirectionAsElement(drawing::Direction3D aSecondLightDirection
)
256 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "SecondLightDirection" ));
257 dumpDirection3D(aSecondLightDirection
);
258 xmlTextWriterEndElement( xmlWriter
);
261 void EnhancedShapeDumper::dumpMetalAsAttribute(bool bMetal
)
264 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("metal"), "%s", "true");
266 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("metal"), "%s", "false");
269 void EnhancedShapeDumper::dumpShadeModeAsAttribute(drawing::ShadeMode eShadeMode
)
273 case drawing::ShadeMode_FLAT
:
274 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "FLAT");
276 case drawing::ShadeMode_PHONG
:
277 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "PHONG");
279 case drawing::ShadeMode_SMOOTH
:
280 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "SMOOTH");
282 case drawing::ShadeMode_DRAFT
:
283 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "DRAFT");
290 void EnhancedShapeDumper::dumpRotateAngleAsElement(const drawing::EnhancedCustomShapeParameterPair
& aRotateAngle
)
292 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RotateAngle" ));
293 dumpEnhancedCustomShapeParameterPair(aRotateAngle
);
294 xmlTextWriterEndElement( xmlWriter
);
297 void EnhancedShapeDumper::dumpRotationCenterAsElement(drawing::Direction3D aRotationCenter
)
299 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RotationCenter" ));
300 dumpDirection3D(aRotationCenter
);
301 xmlTextWriterEndElement( xmlWriter
);
304 void EnhancedShapeDumper::dumpShininessAsAttribute(double aShininess
)
306 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shininess"), "%f", aShininess
);
309 void EnhancedShapeDumper::dumpSkewAsElement(const drawing::EnhancedCustomShapeParameterPair
& aSkew
)
311 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Skew" ));
312 dumpEnhancedCustomShapeParameterPair(aSkew
);
313 xmlTextWriterEndElement( xmlWriter
);
316 void EnhancedShapeDumper::dumpSpecularityAsAttribute(double aSpecularity
)
318 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("specularity"), "%f", aSpecularity
);
321 void EnhancedShapeDumper::dumpProjectionModeAsAttribute(drawing::ProjectionMode eProjectionMode
)
323 switch(eProjectionMode
)
325 case drawing::ProjectionMode_PARALLEL
:
326 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("projectionMode"), "%s", "PARALLEL");
328 case drawing::ProjectionMode_PERSPECTIVE
:
329 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("projectionMode"), "%s", "PERSPECTIVE");
336 void EnhancedShapeDumper::dumpViewPointAsElement(drawing::Position3D aViewPoint
)
338 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "ViewPoint" ));
339 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("positionX"), "%f", aViewPoint
.PositionX
);
340 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("positionY"), "%f", aViewPoint
.PositionY
);
341 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("positionZ"), "%f", aViewPoint
.PositionZ
);
342 xmlTextWriterEndElement( xmlWriter
);
345 void EnhancedShapeDumper::dumpOriginAsElement(const drawing::EnhancedCustomShapeParameterPair
& aOrigin
)
347 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Origin" ));
348 dumpEnhancedCustomShapeParameterPair(aOrigin
);
349 xmlTextWriterEndElement( xmlWriter
);
352 void EnhancedShapeDumper::dumpExtrusionColorAsAttribute(bool bExtrusionColor
)
355 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionColor"), "%s", "true");
357 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionColor"), "%s", "false");
361 // ---------- EnhancedCustomShapeGeometry.idl -----------
364 void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
367 uno::Any anotherAny
= xPropSet
->getPropertyValue("Type");
369 if(anotherAny
>>= sType
)
370 dumpTypeAsAttribute(sType
);
373 uno::Any anotherAny
= xPropSet
->getPropertyValue("ViewBox");
374 awt::Rectangle aViewBox
;
375 if(anotherAny
>>= aViewBox
)
376 dumpViewBoxAsElement(aViewBox
);
379 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredX");
381 if(anotherAny
>>= bMirroredX
)
382 dumpMirroredXAsAttribute(bMirroredX
);
385 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredY");
387 if(anotherAny
>>= bMirroredY
)
388 dumpMirroredYAsAttribute(bMirroredY
);
391 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextRotateAngle");
392 double aTextRotateAngle
= double();
393 if(anotherAny
>>= aTextRotateAngle
)
394 dumpTextRotateAngleAsAttribute(aTextRotateAngle
);
397 uno::Any anotherAny
= xPropSet
->getPropertyValue("AdjustmentValues");
398 uno::Sequence
< drawing::EnhancedCustomShapeAdjustmentValue
> aAdjustmentValues
;
399 if(anotherAny
>>= aAdjustmentValues
)
400 dumpAdjustmentValuesAsElement(aAdjustmentValues
);
403 uno::Any anotherAny
= xPropSet
->getPropertyValue("Extrusion");
404 uno::Sequence
< beans::PropertyValue
> aExtrusion
;
405 if(anotherAny
>>= aExtrusion
)
406 dumpExtrusionAsElement(aExtrusion
);
409 uno::Any anotherAny
= xPropSet
->getPropertyValue("Path");
410 uno::Sequence
< beans::PropertyValue
> aPath
;
411 if(anotherAny
>>= aPath
)
412 dumpPathAsElement(aPath
);
415 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPath");
416 uno::Sequence
< beans::PropertyValue
> aTextPath
;
417 if(anotherAny
>>= aTextPath
)
418 dumpTextPathAsElement(aTextPath
);
421 uno::Any anotherAny
= xPropSet
->getPropertyValue("Equations");
422 uno::Sequence
< OUString
> aEquations
;
423 if(anotherAny
>>= aEquations
)
424 dumpEquationsAsElement(aEquations
);
427 uno::Any anotherAny
= xPropSet
->getPropertyValue("Handles");
428 uno::Sequence
< beans::PropertyValues
> aHandles
;
429 if(anotherAny
>>= aHandles
)
430 dumpHandlesAsElement(aHandles
);
433 void EnhancedShapeDumper::dumpTypeAsAttribute(const OUString
& sType
)
435 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("type"), "%s",
436 OUStringToOString(sType
, RTL_TEXTENCODING_UTF8
).getStr());
439 void EnhancedShapeDumper::dumpViewBoxAsElement(awt::Rectangle aViewBox
)
441 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "ViewBox" ));
442 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("x"), "%" SAL_PRIdINT32
, aViewBox
.X
);
443 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("y"), "%" SAL_PRIdINT32
, aViewBox
.Y
);
444 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("width"), "%" SAL_PRIdINT32
, aViewBox
.Width
);
445 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("height"), "%" SAL_PRIdINT32
, aViewBox
.Height
);
446 xmlTextWriterEndElement( xmlWriter
);
449 void EnhancedShapeDumper::dumpMirroredXAsAttribute(bool bMirroredX
)
452 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredX"), "%s", "true");
454 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredX"), "%s", "false");
457 void EnhancedShapeDumper::dumpMirroredYAsAttribute(bool bMirroredY
)
460 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredY"), "%s", "true");
462 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredY"), "%s", "false");
465 void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle
)
467 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle
);
470 void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeAdjustmentValue
>& aAdjustmentValues
)
472 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "AdjustmentValues" ));
473 sal_Int32 nLength
= aAdjustmentValues
.getLength();
474 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
476 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeAdjustmentValue" ));
477 uno::Any aAny
= aAdjustmentValues
[i
].Value
;
484 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
485 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
487 else if(aAny
>>= nValue
)
489 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%" SAL_PRIdINT32
, nValue
);
491 else if(aAny
>>= fValue
)
493 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%f", fValue
);
495 else if(aAny
>>= bValue
)
497 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s", (bValue
? "true": "false"));
500 switch(aAdjustmentValues
[i
].State
)
502 case beans::PropertyState_DIRECT_VALUE
:
503 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
505 case beans::PropertyState_DEFAULT_VALUE
:
506 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
508 case beans::PropertyState_AMBIGUOUS_VALUE
:
509 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
514 xmlTextWriterEndElement( xmlWriter
);
516 xmlTextWriterEndElement( xmlWriter
);
519 void EnhancedShapeDumper::dumpPropertyValueAsElement(const beans::PropertyValue
& aPropertyValue
)
521 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PropertyValue" ));
523 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s",
524 OUStringToOString(aPropertyValue
.Name
, RTL_TEXTENCODING_UTF8
).getStr());
525 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("handle"), "%" SAL_PRIdINT32
, aPropertyValue
.Handle
);
527 uno::Any aAny
= aPropertyValue
.Value
;
531 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
532 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
534 switch(aPropertyValue
.State
)
536 case beans::PropertyState_DIRECT_VALUE
:
537 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
539 case beans::PropertyState_DEFAULT_VALUE
:
540 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
542 case beans::PropertyState_AMBIGUOUS_VALUE
:
543 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
548 xmlTextWriterEndElement( xmlWriter
);
551 void EnhancedShapeDumper::dumpExtrusionAsElement(const uno::Sequence
< beans::PropertyValue
>& aExtrusion
)
553 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Extrusion" ));
554 sal_Int32 nLength
= aExtrusion
.getLength();
555 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
557 dumpPropertyValueAsElement(aExtrusion
[i
]);
559 xmlTextWriterEndElement( xmlWriter
);
562 void EnhancedShapeDumper::dumpPathAsElement(const uno::Sequence
< beans::PropertyValue
>& aPath
)
564 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Path" ));
565 sal_Int32 nLength
= aPath
.getLength();
566 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
568 dumpPropertyValueAsElement(aPath
[i
]);
570 xmlTextWriterEndElement( xmlWriter
);
573 void EnhancedShapeDumper::dumpTextPathAsElement(const uno::Sequence
< beans::PropertyValue
>& aTextPath
)
575 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "TextPath" ));
576 sal_Int32 nLength
= aTextPath
.getLength();
577 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
579 dumpPropertyValueAsElement(aTextPath
[i
]);
581 xmlTextWriterEndElement( xmlWriter
);
584 void EnhancedShapeDumper::dumpEquationsAsElement(const uno::Sequence
< OUString
>& aEquations
)
586 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Equations" ));
587 sal_Int32 nLength
= aEquations
.getLength();
588 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
590 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s",
591 OUStringToOString(aEquations
[i
], RTL_TEXTENCODING_UTF8
).getStr());
593 xmlTextWriterEndElement( xmlWriter
);
596 // PropertyValues specifies a sequence of PropertyValue instances.
597 // so in this case it's a Sequence of a Sequence of a PropertyValue instances.
598 // Welcome to Sequenception again.
599 void EnhancedShapeDumper::dumpHandlesAsElement(const uno::Sequence
< beans::PropertyValues
>& aHandles
)
601 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Handles" ));
602 sal_Int32 nSequenceLength
= aHandles
.getLength();
603 for (sal_Int32 i
= 0; i
< nSequenceLength
; ++i
)
605 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PropertyValues" ));
606 uno::Sequence
< beans::PropertyValue
> propertyValueSequence
= aHandles
[i
];
607 sal_Int32 nLength
= propertyValueSequence
.getLength();
608 for (sal_Int32 j
= 0; j
< nLength
; ++j
)
610 dumpPropertyValueAsElement(propertyValueSequence
[j
]);
612 xmlTextWriterEndElement( xmlWriter
);
614 xmlTextWriterEndElement( xmlWriter
);
618 // ---------- EnhancedCustomShapeHandle.idl -----------
621 void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
624 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredX");
626 if(anotherAny
>>= bMirroredX
)
627 dumpMirroredXAsAttribute(bMirroredX
);
630 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredY");
632 if(anotherAny
>>= bMirroredY
)
633 dumpMirroredYAsAttribute(bMirroredY
);
636 uno::Any anotherAny
= xPropSet
->getPropertyValue("Switched");
638 if(anotherAny
>>= bSwitched
)
639 dumpSwitchedAsAttribute(bSwitched
);
642 uno::Any anotherAny
= xPropSet
->getPropertyValue("Position");
643 drawing::EnhancedCustomShapeParameterPair aPosition
;
644 if(anotherAny
>>= aPosition
)
645 dumpPositionAsElement(aPosition
);
648 uno::Any anotherAny
= xPropSet
->getPropertyValue("Polar");
649 drawing::EnhancedCustomShapeParameterPair aPolar
;
650 if(anotherAny
>>= aPolar
)
651 dumpPolarAsElement(aPolar
);
654 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefX");
655 sal_Int32 aRefX
= sal_Int32();
656 if(anotherAny
>>= aRefX
)
657 dumpRefXAsAttribute(aRefX
);
660 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefY");
661 sal_Int32 aRefY
= sal_Int32();
662 if(anotherAny
>>= aRefY
)
663 dumpRefYAsAttribute(aRefY
);
666 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefAngle");
667 sal_Int32 aRefAngle
= sal_Int32();
668 if(anotherAny
>>= aRefAngle
)
669 dumpRefAngleAsAttribute(aRefAngle
);
672 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefR");
673 sal_Int32 aRefR
= sal_Int32();
674 if(anotherAny
>>= aRefR
)
675 dumpRefRAsAttribute(aRefR
);
678 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeXMinimum");
679 drawing::EnhancedCustomShapeParameter aRangeXMinimum
;
680 if(anotherAny
>>= aRangeXMinimum
)
681 dumpRangeXMinimumAsElement(aRangeXMinimum
);
684 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeXMaximum");
685 drawing::EnhancedCustomShapeParameter aRangeXMaximum
;
686 if(anotherAny
>>= aRangeXMaximum
)
687 dumpRangeXMaximumAsElement(aRangeXMaximum
);
690 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeYMinimum");
691 drawing::EnhancedCustomShapeParameter aRangeYMinimum
;
692 if(anotherAny
>>= aRangeYMinimum
)
693 dumpRangeYMinimumAsElement(aRangeYMinimum
);
696 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeYMaximum");
697 drawing::EnhancedCustomShapeParameter aRangeYMaximum
;
698 if(anotherAny
>>= aRangeYMaximum
)
699 dumpRangeYMaximumAsElement(aRangeYMaximum
);
702 uno::Any anotherAny
= xPropSet
->getPropertyValue("RadiusRangeMinimum");
703 drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum
;
704 if(anotherAny
>>= aRadiusRangeMinimum
)
705 dumpRadiusRangeMinimumAsElement(aRadiusRangeMinimum
);
708 uno::Any anotherAny
= xPropSet
->getPropertyValue("RadiusRangeMaximum");
709 drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum
;
710 if(anotherAny
>>= aRadiusRangeMaximum
)
711 dumpRadiusRangeMaximumAsElement(aRadiusRangeMaximum
);
715 void EnhancedShapeDumper::dumpSwitchedAsAttribute(bool bSwitched
)
718 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("switched"), "%s", "true");
720 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("switched"), "%s", "false");
723 void EnhancedShapeDumper::dumpPositionAsElement(const drawing::EnhancedCustomShapeParameterPair
& aPosition
)
725 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Position" ));
726 dumpEnhancedCustomShapeParameterPair(aPosition
);
727 xmlTextWriterEndElement( xmlWriter
);
730 void EnhancedShapeDumper::dumpPolarAsElement(const drawing::EnhancedCustomShapeParameterPair
& aPolar
)
732 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Polar" ));
733 dumpEnhancedCustomShapeParameterPair(aPolar
);
734 xmlTextWriterEndElement( xmlWriter
);
737 void EnhancedShapeDumper::dumpRefXAsAttribute(sal_Int32 aRefX
)
739 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refX"), "%" SAL_PRIdINT32
, aRefX
);
742 void EnhancedShapeDumper::dumpRefYAsAttribute(sal_Int32 aRefY
)
744 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refY"), "%" SAL_PRIdINT32
, aRefY
);
747 void EnhancedShapeDumper::dumpRefAngleAsAttribute(sal_Int32 aRefAngle
)
749 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refAngle"), "%" SAL_PRIdINT32
, aRefAngle
);
752 void EnhancedShapeDumper::dumpRefRAsAttribute(sal_Int32 aRefR
)
754 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refR"), "%" SAL_PRIdINT32
, aRefR
);
757 void EnhancedShapeDumper::dumpEnhancedCustomShapeParameter(
758 const drawing::EnhancedCustomShapeParameter
& aParameter
)
760 uno::Any aAny
= aParameter
.Value
;
767 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
768 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
770 else if(aAny
>>= nValue
)
772 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%" SAL_PRIdINT32
, nValue
);
774 else if(aAny
>>= fValue
)
776 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%f", fValue
);
778 else if(aAny
>>= bValue
)
780 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s", (bValue
? "true": "false"));
782 sal_Int32 aType
= aParameter
.Type
;
783 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("type"), "%" SAL_PRIdINT32
, aType
);
786 void EnhancedShapeDumper::dumpRangeXMinimumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeXMinimum
)
788 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeXMinimum" ));
789 dumpEnhancedCustomShapeParameter(aRangeXMinimum
);
790 xmlTextWriterEndElement( xmlWriter
);
793 void EnhancedShapeDumper::dumpRangeXMaximumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeXMaximum
)
795 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeXMaximum" ));
796 dumpEnhancedCustomShapeParameter(aRangeXMaximum
);
797 xmlTextWriterEndElement( xmlWriter
);
800 void EnhancedShapeDumper::dumpRangeYMinimumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeYMinimum
)
802 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeYMinimum" ));
803 dumpEnhancedCustomShapeParameter(aRangeYMinimum
);
804 xmlTextWriterEndElement( xmlWriter
);
807 void EnhancedShapeDumper::dumpRangeYMaximumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeYMaximum
)
809 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeYMaximum" ));
810 dumpEnhancedCustomShapeParameter(aRangeYMaximum
);
811 xmlTextWriterEndElement( xmlWriter
);
814 void EnhancedShapeDumper::dumpRadiusRangeMinimumAsElement(const drawing::EnhancedCustomShapeParameter
& aRadiusRangeMinimum
)
816 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RadiusRangeMinimum" ));
817 dumpEnhancedCustomShapeParameter(aRadiusRangeMinimum
);
818 xmlTextWriterEndElement( xmlWriter
);
821 void EnhancedShapeDumper::dumpRadiusRangeMaximumAsElement(const drawing::EnhancedCustomShapeParameter
& aRadiusRangeMaximum
)
823 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RadiusRangeMaximum" ));
824 dumpEnhancedCustomShapeParameter(aRadiusRangeMaximum
);
825 xmlTextWriterEndElement( xmlWriter
);
829 // ---------- EnhancedCustomShapePath.idl ---------------
832 void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
835 uno::Any anotherAny
= xPropSet
->getPropertyValue("Coordinates");
836 uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
> aCoordinates
;
837 if(anotherAny
>>= aCoordinates
)
838 dumpCoordinatesAsElement(aCoordinates
);
841 uno::Any anotherAny
= xPropSet
->getPropertyValue("Segments");
842 uno::Sequence
< drawing::EnhancedCustomShapeSegment
> aSegments
;
843 if(anotherAny
>>= aSegments
)
844 dumpSegmentsAsElement(aSegments
);
847 uno::Any anotherAny
= xPropSet
->getPropertyValue("StretchX");
848 sal_Int32 aStretchX
= sal_Int32();
849 if(anotherAny
>>= aStretchX
)
850 dumpStretchXAsAttribute(aStretchX
);
853 uno::Any anotherAny
= xPropSet
->getPropertyValue("StretchY");
854 sal_Int32 aStretchY
= sal_Int32();
855 if(anotherAny
>>= aStretchY
)
856 dumpStretchYAsAttribute(aStretchY
);
859 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextFrames");
860 uno::Sequence
< drawing::EnhancedCustomShapeTextFrame
> aTextFrames
;
861 if(anotherAny
>>= aTextFrames
)
862 dumpTextFramesAsElement(aTextFrames
);
865 uno::Any anotherAny
= xPropSet
->getPropertyValue("GluePoints");
866 uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
> aGluePoints
;
867 if(anotherAny
>>= aGluePoints
)
868 dumpGluePointsAsElement(aGluePoints
);
871 uno::Any anotherAny
= xPropSet
->getPropertyValue("GluePointLeavingDirections");
872 uno::Sequence
< double > aGluePointLeavingDirections
;
873 if(anotherAny
>>= aGluePointLeavingDirections
)
874 dumpGluePointLeavingDirectionsAsElement(aGluePointLeavingDirections
);
877 uno::Any anotherAny
= xPropSet
->getPropertyValue("GluePointType");
878 sal_Int32 aGluePointType
= sal_Int32();
879 if(anotherAny
>>= aGluePointType
)
880 dumpGluePointTypeAsAttribute(aGluePointType
);
883 uno::Any anotherAny
= xPropSet
->getPropertyValue("ExtrusionAllowed");
884 bool bExtrusionAllowed
;
885 if(anotherAny
>>= bExtrusionAllowed
)
886 dumpExtrusionAllowedAsAttribute(bExtrusionAllowed
);
889 uno::Any anotherAny
= xPropSet
->getPropertyValue("ConcentricGradientFillAllowed");
890 bool bConcentricGradientFillAllowed
;
891 if(anotherAny
>>= bConcentricGradientFillAllowed
)
892 dumpConcentricGradientFillAllowedAsAttribute(bConcentricGradientFillAllowed
);
895 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPathAllowed");
896 bool bTextPathAllowed
;
897 if(anotherAny
>>= bTextPathAllowed
)
898 dumpTextPathAllowedAsAttribute(bTextPathAllowed
);
901 uno::Any anotherAny
= xPropSet
->getPropertyValue("SubViewSize");
902 uno::Sequence
< awt::Size
> aSubViewSize
;
903 if(anotherAny
>>= aSubViewSize
)
904 dumpSubViewSizeAsElement(aSubViewSize
);
908 void EnhancedShapeDumper::dumpCoordinatesAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
>& aCoordinates
)
910 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Coordinates" ));
911 sal_Int32 nLength
= aCoordinates
.getLength();
912 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
914 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeParameterPair" ));
915 dumpEnhancedCustomShapeParameterPair(aCoordinates
[i
]);
916 xmlTextWriterEndElement( xmlWriter
);
918 xmlTextWriterEndElement( xmlWriter
);
921 void EnhancedShapeDumper::dumpSegmentsAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeSegment
>& aSegments
)
923 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Segments" ));
924 sal_Int32 nLength
= aSegments
.getLength();
925 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
927 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeSegment" ));
928 sal_Int32 aCommand
= aSegments
[i
].Command
;
929 sal_Int32 aCount
= aSegments
[i
].Count
;
930 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("command"), "%" SAL_PRIdINT32
, aCommand
);
931 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("count"), "%" SAL_PRIdINT32
, aCount
);
932 xmlTextWriterEndElement( xmlWriter
);
934 xmlTextWriterEndElement( xmlWriter
);
937 void EnhancedShapeDumper::dumpStretchXAsAttribute(sal_Int32 aStretchX
)
939 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("stretchX"), "%" SAL_PRIdINT32
, aStretchX
);
942 void EnhancedShapeDumper::dumpStretchYAsAttribute(sal_Int32 aStretchY
)
944 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("stretchY"), "%" SAL_PRIdINT32
, aStretchY
);
947 void EnhancedShapeDumper::dumpTextFramesAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeTextFrame
>& aTextFrames
)
949 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "TextFrames" ));
950 sal_Int32 nLength
= aTextFrames
.getLength();
951 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
953 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeTextFrame" ));
955 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "TopLeft" ));
956 dumpEnhancedCustomShapeParameterPair(aTextFrames
[i
].TopLeft
);
957 xmlTextWriterEndElement( xmlWriter
);
959 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "BottomRight" ));
960 dumpEnhancedCustomShapeParameterPair(aTextFrames
[i
].BottomRight
);
961 xmlTextWriterEndElement( xmlWriter
);
963 xmlTextWriterEndElement( xmlWriter
);
965 xmlTextWriterEndElement( xmlWriter
);
968 void EnhancedShapeDumper::dumpGluePointsAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
>& aGluePoints
)
970 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "GluePoints" ));
971 sal_Int32 nLength
= aGluePoints
.getLength();
972 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
974 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeParameterPair" ));
975 dumpEnhancedCustomShapeParameterPair(aGluePoints
[i
]);
976 xmlTextWriterEndElement( xmlWriter
);
978 xmlTextWriterEndElement( xmlWriter
);
981 void EnhancedShapeDumper::dumpGluePointLeavingDirectionsAsElement(const uno::Sequence
< double >& aGluePointLeavingDirections
)
983 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "GluePointLeavingDirections" ));
984 sal_Int32 nLength
= aGluePointLeavingDirections
.getLength();
985 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
987 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("value"), "%f", aGluePointLeavingDirections
[i
]);
989 xmlTextWriterEndElement( xmlWriter
);
992 void EnhancedShapeDumper::dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType
)
994 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("gluePointType"), "%" SAL_PRIdINT32
, aGluePointType
);
997 void EnhancedShapeDumper::dumpExtrusionAllowedAsAttribute(bool bExtrusionAllowed
)
999 if(bExtrusionAllowed
)
1000 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionAllowed"), "%s", "true");
1002 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionAllowed"), "%s", "false");
1005 void EnhancedShapeDumper::dumpConcentricGradientFillAllowedAsAttribute(bool bConcentricGradientFillAllowed
)
1007 if(bConcentricGradientFillAllowed
)
1008 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("concentricGradientFillAllowed"), "%s", "true");
1010 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("concentricGradientFillAllowed"), "%s", "false");
1013 void EnhancedShapeDumper::dumpTextPathAllowedAsAttribute(bool bTextPathAllowed
)
1015 if(bTextPathAllowed
)
1016 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathAllowed"), "%s", "true");
1018 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathAllowed"), "%s", "false");
1021 void EnhancedShapeDumper::dumpSubViewSizeAsElement(const uno::Sequence
< awt::Size
>& aSubViewSize
)
1023 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "SubViewSize" ));
1024 sal_Int32 nLength
= aSubViewSize
.getLength();
1025 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
1027 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Size" ));
1028 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("width"), "%" SAL_PRIdINT32
, aSubViewSize
[i
].Width
);
1029 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("height"), "%" SAL_PRIdINT32
, aSubViewSize
[i
].Height
);
1030 xmlTextWriterEndElement( xmlWriter
);
1032 xmlTextWriterEndElement( xmlWriter
);
1036 // ---------- EnhancedCustomShapeTextPath.idl ---------------
1039 void EnhancedShapeDumper::dumpEnhancedCustomShapeTextPathService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
1042 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPath");
1044 if(anotherAny
>>= bTextPath
)
1045 dumpTextPathAsAttribute(bTextPath
);
1048 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPathMode");
1049 drawing::EnhancedCustomShapeTextPathMode eTextPathMode
;
1050 if(anotherAny
>>= eTextPathMode
)
1051 dumpTextPathModeAsAttribute(eTextPathMode
);
1054 uno::Any anotherAny
= xPropSet
->getPropertyValue("ScaleX");
1056 if(anotherAny
>>= bScaleX
)
1057 dumpScaleXAsAttribute(bScaleX
);
1061 void EnhancedShapeDumper::dumpTextPathAsAttribute(bool bTextPath
)
1064 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPath"), "%s", "true");
1066 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPath"), "%s", "false");
1069 void EnhancedShapeDumper::dumpTextPathModeAsAttribute(drawing::EnhancedCustomShapeTextPathMode eTextPathMode
)
1071 switch(eTextPathMode
)
1073 case drawing::EnhancedCustomShapeTextPathMode_NORMAL
:
1074 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathMode"), "%s", "NORMAL");
1076 case drawing::EnhancedCustomShapeTextPathMode_PATH
:
1077 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathMode"), "%s", "PATH");
1079 case drawing::EnhancedCustomShapeTextPathMode_SHAPE
:
1080 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathMode"), "%s", "SHAPE");
1087 void EnhancedShapeDumper::dumpScaleXAsAttribute(bool bScaleX
)
1090 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("scaleX"), "%s", "true");
1092 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("scaleX"), "%s", "false");
1095 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */