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 <com/sun/star/beans/XPropertySet.hpp>
13 using namespace com::sun::star
;
16 // ---------- EnhancedCustomShapeExtrusion.idl ----------
19 void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
22 uno::Any anotherAny
= xPropSet
->getPropertyValue("Extrusion");
24 if(anotherAny
>>= bExtrusion
)
25 dumpExtrusionAsAttribute(bExtrusion
);
28 uno::Any anotherAny
= xPropSet
->getPropertyValue("Brightness");
29 double aBrightness
= double();
30 if(anotherAny
>>= aBrightness
)
31 dumpBrightnessAsAttribute(aBrightness
);
34 uno::Any anotherAny
= xPropSet
->getPropertyValue("Depth");
35 drawing::EnhancedCustomShapeParameterPair aDepth
;
36 if(anotherAny
>>= aDepth
)
37 dumpDepthAsElement(aDepth
);
40 uno::Any anotherAny
= xPropSet
->getPropertyValue("Diffusion");
41 double aDiffusion
= double();
42 if(anotherAny
>>= aDiffusion
)
43 dumpDiffusionAsAttribute(aDiffusion
);
46 uno::Any anotherAny
= xPropSet
->getPropertyValue("NumberOfLineSegments");
47 sal_Int32 aNumberOfLineSegments
= sal_Int32();
48 if(anotherAny
>>= aNumberOfLineSegments
)
49 dumpNumberOfLineSegmentsAsAttribute(aNumberOfLineSegments
);
52 uno::Any anotherAny
= xPropSet
->getPropertyValue("LightFace");
54 if(anotherAny
>>= bLightFace
)
55 dumpLightFaceAsAttribute(bLightFace
);
58 uno::Any anotherAny
= xPropSet
->getPropertyValue("FirstLightHarsh");
59 bool bFirstLightHarsh
;
60 if(anotherAny
>>= bFirstLightHarsh
)
61 dumpFirstLightHarshAsAttribute(bFirstLightHarsh
);
64 uno::Any anotherAny
= xPropSet
->getPropertyValue("SecondLightHarsh");
65 bool bSecondLightHarsh
;
66 if(anotherAny
>>= bSecondLightHarsh
)
67 dumpSecondLightHarshAsAttribute(bSecondLightHarsh
);
70 uno::Any anotherAny
= xPropSet
->getPropertyValue("FirstLightLevel");
71 double aFirstLightLevel
= double();
72 if(anotherAny
>>= aFirstLightLevel
)
73 dumpFirstLightLevelAsAttribute(aFirstLightLevel
);
76 uno::Any anotherAny
= xPropSet
->getPropertyValue("SecondLightLevel");
77 double aSecondLightLevel
= double();
78 if(anotherAny
>>= aSecondLightLevel
)
79 dumpSecondLightLevelAsAttribute(aSecondLightLevel
);
82 uno::Any anotherAny
= xPropSet
->getPropertyValue("FirstLightDirection");
83 drawing::Direction3D aFirstLightDirection
;
84 if(anotherAny
>>= aFirstLightDirection
)
85 dumpFirstLightDirectionAsElement(aFirstLightDirection
);
88 uno::Any anotherAny
= xPropSet
->getPropertyValue("SecondLightDirection");
89 drawing::Direction3D aSecondLightDirection
;
90 if(anotherAny
>>= aSecondLightDirection
)
91 dumpSecondLightDirectionAsElement(aSecondLightDirection
);
94 uno::Any anotherAny
= xPropSet
->getPropertyValue("Metal");
96 if(anotherAny
>>= bMetal
)
97 dumpMetalAsAttribute(bMetal
);
100 uno::Any anotherAny
= xPropSet
->getPropertyValue("ShadeMode");
101 drawing::ShadeMode eShadeMode
;
102 if(anotherAny
>>= eShadeMode
)
103 dumpShadeModeAsAttribute(eShadeMode
);
106 uno::Any anotherAny
= xPropSet
->getPropertyValue("RotateAngle");
107 drawing::EnhancedCustomShapeParameterPair aRotateAngle
;
108 if(anotherAny
>>= aRotateAngle
)
109 dumpRotateAngleAsElement(aRotateAngle
);
112 uno::Any anotherAny
= xPropSet
->getPropertyValue("RotationCenter");
113 drawing::Direction3D aRotationCenter
;
114 if(anotherAny
>>= aRotationCenter
)
115 dumpRotationCenterAsElement(aRotationCenter
);
118 uno::Any anotherAny
= xPropSet
->getPropertyValue("Shininess");
119 double aShininess
= double();
120 if(anotherAny
>>= aShininess
)
121 dumpShininessAsAttribute(aShininess
);
124 uno::Any anotherAny
= xPropSet
->getPropertyValue("Skew");
125 drawing::EnhancedCustomShapeParameterPair aSkew
;
126 if(anotherAny
>>= aSkew
)
127 dumpSkewAsElement(aSkew
);
130 uno::Any anotherAny
= xPropSet
->getPropertyValue("Specularity");
131 double aSpecularity
= double();
132 if(anotherAny
>>= aSpecularity
)
133 dumpSpecularityAsAttribute(aSpecularity
);
136 uno::Any anotherAny
= xPropSet
->getPropertyValue("ProjectionMode");
137 drawing::ProjectionMode eProjectionMode
;
138 if(anotherAny
>>= eProjectionMode
)
139 dumpProjectionModeAsAttribute(eProjectionMode
);
142 uno::Any anotherAny
= xPropSet
->getPropertyValue("ViewPoint");
143 drawing::Position3D aViewPoint
;
144 if(anotherAny
>>= aViewPoint
)
145 dumpViewPointAsElement(aViewPoint
);
148 uno::Any anotherAny
= xPropSet
->getPropertyValue("Origin");
149 drawing::EnhancedCustomShapeParameterPair aOrigin
;
150 if(anotherAny
>>= aOrigin
)
151 dumpOriginAsElement(aOrigin
);
154 uno::Any anotherAny
= xPropSet
->getPropertyValue("ExtrusionColor");
155 bool bExtrusionColor
;
156 if(anotherAny
>>= bExtrusionColor
)
157 dumpExtrusionColorAsAttribute(bExtrusionColor
);
160 void EnhancedShapeDumper::dumpExtrusionAsAttribute(bool bExtrusion
)
163 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusion"), "%s", "true");
165 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusion"), "%s", "false");
168 void EnhancedShapeDumper::dumpBrightnessAsAttribute(double aBrightness
)
170 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("brightness"), "%f", aBrightness
);
173 void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(
174 const drawing::EnhancedCustomShapeParameterPair
& aParameterPair
)
177 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "First" ));
178 dumpEnhancedCustomShapeParameter(aParameterPair
.First
);
179 (void)xmlTextWriterEndElement( xmlWriter
);
182 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Second" ));
183 dumpEnhancedCustomShapeParameter(aParameterPair
.Second
);
184 (void)xmlTextWriterEndElement( xmlWriter
);
188 void EnhancedShapeDumper::dumpDepthAsElement(const drawing::EnhancedCustomShapeParameterPair
& aDepth
)
190 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Depth" ));
191 dumpEnhancedCustomShapeParameterPair(aDepth
);
192 (void)xmlTextWriterEndElement( xmlWriter
);
195 void EnhancedShapeDumper::dumpDiffusionAsAttribute(double aDiffusion
)
197 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("diffusion"), "%f", aDiffusion
);
200 void EnhancedShapeDumper::dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments
)
202 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("numberOfLineSegments"), "%" SAL_PRIdINT32
, aNumberOfLineSegments
);
205 void EnhancedShapeDumper::dumpLightFaceAsAttribute(bool bLightFace
)
208 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lightFace"), "%s", "true");
210 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lightFace"), "%s", "false");
213 void EnhancedShapeDumper::dumpFirstLightHarshAsAttribute(bool bFirstLightHarsh
)
216 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("firstLightHarsh"), "%s", "true");
218 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("firstLightHarsh"), "%s", "false");
221 void EnhancedShapeDumper::dumpSecondLightHarshAsAttribute(bool bSecondLightHarsh
)
223 if(bSecondLightHarsh
)
224 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("secondLightHarsh"), "%s", "true");
226 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("secondLightHarsh"), "%s", "false");
229 void EnhancedShapeDumper::dumpFirstLightLevelAsAttribute(double aFirstLightLevel
)
231 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("firstLightLevel"), "%f", aFirstLightLevel
);
234 void EnhancedShapeDumper::dumpSecondLightLevelAsAttribute(double aSecondLightLevel
)
236 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("secondLightLevel"), "%f", aSecondLightLevel
);
239 void EnhancedShapeDumper::dumpDirection3D(drawing::Direction3D aDirection3D
)
241 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("directionX"), "%f", aDirection3D
.DirectionX
);
242 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("directionY"), "%f", aDirection3D
.DirectionY
);
243 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("directionZ"), "%f", aDirection3D
.DirectionZ
);
246 void EnhancedShapeDumper::dumpFirstLightDirectionAsElement(drawing::Direction3D aFirstLightDirection
)
248 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FirstLightDirection" ));
249 dumpDirection3D(aFirstLightDirection
);
250 (void)xmlTextWriterEndElement( xmlWriter
);
253 void EnhancedShapeDumper::dumpSecondLightDirectionAsElement(drawing::Direction3D aSecondLightDirection
)
255 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "SecondLightDirection" ));
256 dumpDirection3D(aSecondLightDirection
);
257 (void)xmlTextWriterEndElement( xmlWriter
);
260 void EnhancedShapeDumper::dumpMetalAsAttribute(bool bMetal
)
263 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("metal"), "%s", "true");
265 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("metal"), "%s", "false");
268 void EnhancedShapeDumper::dumpShadeModeAsAttribute(drawing::ShadeMode eShadeMode
)
272 case drawing::ShadeMode_FLAT
:
273 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "FLAT");
275 case drawing::ShadeMode_PHONG
:
276 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "PHONG");
278 case drawing::ShadeMode_SMOOTH
:
279 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "SMOOTH");
281 case drawing::ShadeMode_DRAFT
:
282 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadeMode"), "%s", "DRAFT");
289 void EnhancedShapeDumper::dumpRotateAngleAsElement(const drawing::EnhancedCustomShapeParameterPair
& aRotateAngle
)
291 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RotateAngle" ));
292 dumpEnhancedCustomShapeParameterPair(aRotateAngle
);
293 (void)xmlTextWriterEndElement( xmlWriter
);
296 void EnhancedShapeDumper::dumpRotationCenterAsElement(drawing::Direction3D aRotationCenter
)
298 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RotationCenter" ));
299 dumpDirection3D(aRotationCenter
);
300 (void)xmlTextWriterEndElement( xmlWriter
);
303 void EnhancedShapeDumper::dumpShininessAsAttribute(double aShininess
)
305 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shininess"), "%f", aShininess
);
308 void EnhancedShapeDumper::dumpSkewAsElement(const drawing::EnhancedCustomShapeParameterPair
& aSkew
)
310 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Skew" ));
311 dumpEnhancedCustomShapeParameterPair(aSkew
);
312 (void)xmlTextWriterEndElement( xmlWriter
);
315 void EnhancedShapeDumper::dumpSpecularityAsAttribute(double aSpecularity
)
317 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("specularity"), "%f", aSpecularity
);
320 void EnhancedShapeDumper::dumpProjectionModeAsAttribute(drawing::ProjectionMode eProjectionMode
)
322 switch(eProjectionMode
)
324 case drawing::ProjectionMode_PARALLEL
:
325 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("projectionMode"), "%s", "PARALLEL");
327 case drawing::ProjectionMode_PERSPECTIVE
:
328 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("projectionMode"), "%s", "PERSPECTIVE");
335 void EnhancedShapeDumper::dumpViewPointAsElement(drawing::Position3D aViewPoint
)
337 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "ViewPoint" ));
338 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("positionX"), "%f", aViewPoint
.PositionX
);
339 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("positionY"), "%f", aViewPoint
.PositionY
);
340 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("positionZ"), "%f", aViewPoint
.PositionZ
);
341 (void)xmlTextWriterEndElement( xmlWriter
);
344 void EnhancedShapeDumper::dumpOriginAsElement(const drawing::EnhancedCustomShapeParameterPair
& aOrigin
)
346 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Origin" ));
347 dumpEnhancedCustomShapeParameterPair(aOrigin
);
348 (void)xmlTextWriterEndElement( xmlWriter
);
351 void EnhancedShapeDumper::dumpExtrusionColorAsAttribute(bool bExtrusionColor
)
354 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionColor"), "%s", "true");
356 (void)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(std::u16string_view sType
)
434 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("type"), "%s",
435 OUStringToOString(sType
, RTL_TEXTENCODING_UTF8
).getStr());
438 void EnhancedShapeDumper::dumpViewBoxAsElement(awt::Rectangle aViewBox
)
440 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "ViewBox" ));
441 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("x"), "%" SAL_PRIdINT32
, aViewBox
.X
);
442 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("y"), "%" SAL_PRIdINT32
, aViewBox
.Y
);
443 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("width"), "%" SAL_PRIdINT32
, aViewBox
.Width
);
444 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("height"), "%" SAL_PRIdINT32
, aViewBox
.Height
);
445 (void)xmlTextWriterEndElement( xmlWriter
);
448 void EnhancedShapeDumper::dumpMirroredXAsAttribute(bool bMirroredX
)
451 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredX"), "%s", "true");
453 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredX"), "%s", "false");
456 void EnhancedShapeDumper::dumpMirroredYAsAttribute(bool bMirroredY
)
459 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredY"), "%s", "true");
461 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("mirroredY"), "%s", "false");
464 void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle
)
466 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle
);
469 void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeAdjustmentValue
>& aAdjustmentValues
)
471 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "AdjustmentValues" ));
472 for (const auto& i
: aAdjustmentValues
)
474 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeAdjustmentValue" ));
475 uno::Any aAny
= i
.Value
;
482 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
483 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
485 else if(aAny
>>= nValue
)
487 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%" SAL_PRIdINT32
, nValue
);
489 else if(aAny
>>= fValue
)
491 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%f", fValue
);
493 else if(aAny
>>= bValue
)
495 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s", (bValue
? "true": "false"));
500 case beans::PropertyState_DIRECT_VALUE
:
501 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
503 case beans::PropertyState_DEFAULT_VALUE
:
504 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
506 case beans::PropertyState_AMBIGUOUS_VALUE
:
507 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
512 (void)xmlTextWriterEndElement( xmlWriter
);
514 (void)xmlTextWriterEndElement( xmlWriter
);
517 void EnhancedShapeDumper::dumpPropertyValueAsElement(const beans::PropertyValue
& aPropertyValue
)
519 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PropertyValue" ));
521 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s",
522 OUStringToOString(aPropertyValue
.Name
, RTL_TEXTENCODING_UTF8
).getStr());
523 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("handle"), "%" SAL_PRIdINT32
, aPropertyValue
.Handle
);
525 uno::Any aAny
= aPropertyValue
.Value
;
529 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
530 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
532 switch(aPropertyValue
.State
)
534 case beans::PropertyState_DIRECT_VALUE
:
535 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
537 case beans::PropertyState_DEFAULT_VALUE
:
538 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
540 case beans::PropertyState_AMBIGUOUS_VALUE
:
541 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
546 (void)xmlTextWriterEndElement( xmlWriter
);
549 void EnhancedShapeDumper::dumpExtrusionAsElement(const uno::Sequence
< beans::PropertyValue
>& aExtrusion
)
551 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Extrusion" ));
552 for (const auto& i
: aExtrusion
)
554 dumpPropertyValueAsElement(i
);
556 (void)xmlTextWriterEndElement( xmlWriter
);
559 void EnhancedShapeDumper::dumpPathAsElement(const uno::Sequence
< beans::PropertyValue
>& aPath
)
561 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Path" ));
562 for (const auto& i
: aPath
)
564 dumpPropertyValueAsElement(i
);
566 (void)xmlTextWriterEndElement( xmlWriter
);
569 void EnhancedShapeDumper::dumpTextPathAsElement(const uno::Sequence
< beans::PropertyValue
>& aTextPath
)
571 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "TextPath" ));
572 for (const auto& i
: aTextPath
)
574 dumpPropertyValueAsElement(i
);
576 (void)xmlTextWriterEndElement( xmlWriter
);
579 void EnhancedShapeDumper::dumpEquationsAsElement(const uno::Sequence
< OUString
>& aEquations
)
581 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Equations" ));
582 for (const auto& i
: aEquations
)
584 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s",
585 OUStringToOString(i
, RTL_TEXTENCODING_UTF8
).getStr());
587 (void)xmlTextWriterEndElement( xmlWriter
);
590 // PropertyValues specifies a sequence of PropertyValue instances.
591 // so in this case it's a Sequence of a Sequence of a PropertyValue instances.
592 // Welcome to Sequenception again.
593 void EnhancedShapeDumper::dumpHandlesAsElement(const uno::Sequence
< beans::PropertyValues
>& aHandles
)
595 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Handles" ));
596 for (const auto& i
: aHandles
)
598 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PropertyValues" ));
599 uno::Sequence
< beans::PropertyValue
> propertyValueSequence
= i
;
600 for (const auto& j
: propertyValueSequence
)
602 dumpPropertyValueAsElement(j
);
604 (void)xmlTextWriterEndElement( xmlWriter
);
606 (void)xmlTextWriterEndElement( xmlWriter
);
610 // ---------- EnhancedCustomShapeHandle.idl -----------
613 void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
616 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredX");
618 if(anotherAny
>>= bMirroredX
)
619 dumpMirroredXAsAttribute(bMirroredX
);
622 uno::Any anotherAny
= xPropSet
->getPropertyValue("MirroredY");
624 if(anotherAny
>>= bMirroredY
)
625 dumpMirroredYAsAttribute(bMirroredY
);
628 uno::Any anotherAny
= xPropSet
->getPropertyValue("Switched");
630 if(anotherAny
>>= bSwitched
)
631 dumpSwitchedAsAttribute(bSwitched
);
634 uno::Any anotherAny
= xPropSet
->getPropertyValue("Position");
635 drawing::EnhancedCustomShapeParameterPair aPosition
;
636 if(anotherAny
>>= aPosition
)
637 dumpPositionAsElement(aPosition
);
640 uno::Any anotherAny
= xPropSet
->getPropertyValue("Polar");
641 drawing::EnhancedCustomShapeParameterPair aPolar
;
642 if(anotherAny
>>= aPolar
)
643 dumpPolarAsElement(aPolar
);
646 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefX");
647 sal_Int32 aRefX
= sal_Int32();
648 if(anotherAny
>>= aRefX
)
649 dumpRefXAsAttribute(aRefX
);
652 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefY");
653 sal_Int32 aRefY
= sal_Int32();
654 if(anotherAny
>>= aRefY
)
655 dumpRefYAsAttribute(aRefY
);
658 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefAngle");
659 sal_Int32 aRefAngle
= sal_Int32();
660 if(anotherAny
>>= aRefAngle
)
661 dumpRefAngleAsAttribute(aRefAngle
);
664 uno::Any anotherAny
= xPropSet
->getPropertyValue("RefR");
665 sal_Int32 aRefR
= sal_Int32();
666 if(anotherAny
>>= aRefR
)
667 dumpRefRAsAttribute(aRefR
);
670 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeXMinimum");
671 drawing::EnhancedCustomShapeParameter aRangeXMinimum
;
672 if(anotherAny
>>= aRangeXMinimum
)
673 dumpRangeXMinimumAsElement(aRangeXMinimum
);
676 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeXMaximum");
677 drawing::EnhancedCustomShapeParameter aRangeXMaximum
;
678 if(anotherAny
>>= aRangeXMaximum
)
679 dumpRangeXMaximumAsElement(aRangeXMaximum
);
682 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeYMinimum");
683 drawing::EnhancedCustomShapeParameter aRangeYMinimum
;
684 if(anotherAny
>>= aRangeYMinimum
)
685 dumpRangeYMinimumAsElement(aRangeYMinimum
);
688 uno::Any anotherAny
= xPropSet
->getPropertyValue("RangeYMaximum");
689 drawing::EnhancedCustomShapeParameter aRangeYMaximum
;
690 if(anotherAny
>>= aRangeYMaximum
)
691 dumpRangeYMaximumAsElement(aRangeYMaximum
);
694 uno::Any anotherAny
= xPropSet
->getPropertyValue("RadiusRangeMinimum");
695 drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum
;
696 if(anotherAny
>>= aRadiusRangeMinimum
)
697 dumpRadiusRangeMinimumAsElement(aRadiusRangeMinimum
);
700 uno::Any anotherAny
= xPropSet
->getPropertyValue("RadiusRangeMaximum");
701 drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum
;
702 if(anotherAny
>>= aRadiusRangeMaximum
)
703 dumpRadiusRangeMaximumAsElement(aRadiusRangeMaximum
);
707 void EnhancedShapeDumper::dumpSwitchedAsAttribute(bool bSwitched
)
710 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("switched"), "%s", "true");
712 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("switched"), "%s", "false");
715 void EnhancedShapeDumper::dumpPositionAsElement(const drawing::EnhancedCustomShapeParameterPair
& aPosition
)
717 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Position" ));
718 dumpEnhancedCustomShapeParameterPair(aPosition
);
719 (void)xmlTextWriterEndElement( xmlWriter
);
722 void EnhancedShapeDumper::dumpPolarAsElement(const drawing::EnhancedCustomShapeParameterPair
& aPolar
)
724 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Polar" ));
725 dumpEnhancedCustomShapeParameterPair(aPolar
);
726 (void)xmlTextWriterEndElement( xmlWriter
);
729 void EnhancedShapeDumper::dumpRefXAsAttribute(sal_Int32 aRefX
)
731 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refX"), "%" SAL_PRIdINT32
, aRefX
);
734 void EnhancedShapeDumper::dumpRefYAsAttribute(sal_Int32 aRefY
)
736 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refY"), "%" SAL_PRIdINT32
, aRefY
);
739 void EnhancedShapeDumper::dumpRefAngleAsAttribute(sal_Int32 aRefAngle
)
741 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refAngle"), "%" SAL_PRIdINT32
, aRefAngle
);
744 void EnhancedShapeDumper::dumpRefRAsAttribute(sal_Int32 aRefR
)
746 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("refR"), "%" SAL_PRIdINT32
, aRefR
);
749 void EnhancedShapeDumper::dumpEnhancedCustomShapeParameter(
750 const drawing::EnhancedCustomShapeParameter
& aParameter
)
752 uno::Any aAny
= aParameter
.Value
;
759 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
760 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
762 else if(aAny
>>= nValue
)
764 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%" SAL_PRIdINT32
, nValue
);
766 else if(aAny
>>= fValue
)
768 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%f", fValue
);
770 else if(aAny
>>= bValue
)
772 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s", (bValue
? "true": "false"));
774 sal_Int32 aType
= aParameter
.Type
;
775 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("type"), "%" SAL_PRIdINT32
, aType
);
778 void EnhancedShapeDumper::dumpRangeXMinimumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeXMinimum
)
780 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeXMinimum" ));
781 dumpEnhancedCustomShapeParameter(aRangeXMinimum
);
782 (void)xmlTextWriterEndElement( xmlWriter
);
785 void EnhancedShapeDumper::dumpRangeXMaximumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeXMaximum
)
787 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeXMaximum" ));
788 dumpEnhancedCustomShapeParameter(aRangeXMaximum
);
789 (void)xmlTextWriterEndElement( xmlWriter
);
792 void EnhancedShapeDumper::dumpRangeYMinimumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeYMinimum
)
794 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeYMinimum" ));
795 dumpEnhancedCustomShapeParameter(aRangeYMinimum
);
796 (void)xmlTextWriterEndElement( xmlWriter
);
799 void EnhancedShapeDumper::dumpRangeYMaximumAsElement(const drawing::EnhancedCustomShapeParameter
& aRangeYMaximum
)
801 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RangeYMaximum" ));
802 dumpEnhancedCustomShapeParameter(aRangeYMaximum
);
803 (void)xmlTextWriterEndElement( xmlWriter
);
806 void EnhancedShapeDumper::dumpRadiusRangeMinimumAsElement(const drawing::EnhancedCustomShapeParameter
& aRadiusRangeMinimum
)
808 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RadiusRangeMinimum" ));
809 dumpEnhancedCustomShapeParameter(aRadiusRangeMinimum
);
810 (void)xmlTextWriterEndElement( xmlWriter
);
813 void EnhancedShapeDumper::dumpRadiusRangeMaximumAsElement(const drawing::EnhancedCustomShapeParameter
& aRadiusRangeMaximum
)
815 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "RadiusRangeMaximum" ));
816 dumpEnhancedCustomShapeParameter(aRadiusRangeMaximum
);
817 (void)xmlTextWriterEndElement( xmlWriter
);
821 // ---------- EnhancedCustomShapePath.idl ---------------
824 void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
827 uno::Any anotherAny
= xPropSet
->getPropertyValue("Coordinates");
828 uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
> aCoordinates
;
829 if(anotherAny
>>= aCoordinates
)
830 dumpCoordinatesAsElement(aCoordinates
);
833 uno::Any anotherAny
= xPropSet
->getPropertyValue("Segments");
834 uno::Sequence
< drawing::EnhancedCustomShapeSegment
> aSegments
;
835 if(anotherAny
>>= aSegments
)
836 dumpSegmentsAsElement(aSegments
);
839 uno::Any anotherAny
= xPropSet
->getPropertyValue("StretchX");
840 sal_Int32 aStretchX
= sal_Int32();
841 if(anotherAny
>>= aStretchX
)
842 dumpStretchXAsAttribute(aStretchX
);
845 uno::Any anotherAny
= xPropSet
->getPropertyValue("StretchY");
846 sal_Int32 aStretchY
= sal_Int32();
847 if(anotherAny
>>= aStretchY
)
848 dumpStretchYAsAttribute(aStretchY
);
851 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextFrames");
852 uno::Sequence
< drawing::EnhancedCustomShapeTextFrame
> aTextFrames
;
853 if(anotherAny
>>= aTextFrames
)
854 dumpTextFramesAsElement(aTextFrames
);
857 uno::Any anotherAny
= xPropSet
->getPropertyValue("GluePoints");
858 uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
> aGluePoints
;
859 if(anotherAny
>>= aGluePoints
)
860 dumpGluePointsAsElement(aGluePoints
);
863 uno::Any anotherAny
= xPropSet
->getPropertyValue("GluePointLeavingDirections");
864 uno::Sequence
< double > aGluePointLeavingDirections
;
865 if(anotherAny
>>= aGluePointLeavingDirections
)
866 dumpGluePointLeavingDirectionsAsElement(aGluePointLeavingDirections
);
869 uno::Any anotherAny
= xPropSet
->getPropertyValue("GluePointType");
870 sal_Int32 aGluePointType
= sal_Int32();
871 if(anotherAny
>>= aGluePointType
)
872 dumpGluePointTypeAsAttribute(aGluePointType
);
875 uno::Any anotherAny
= xPropSet
->getPropertyValue("ExtrusionAllowed");
876 bool bExtrusionAllowed
;
877 if(anotherAny
>>= bExtrusionAllowed
)
878 dumpExtrusionAllowedAsAttribute(bExtrusionAllowed
);
881 uno::Any anotherAny
= xPropSet
->getPropertyValue("ConcentricGradientFillAllowed");
882 bool bConcentricGradientFillAllowed
;
883 if(anotherAny
>>= bConcentricGradientFillAllowed
)
884 dumpConcentricGradientFillAllowedAsAttribute(bConcentricGradientFillAllowed
);
887 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPathAllowed");
888 bool bTextPathAllowed
;
889 if(anotherAny
>>= bTextPathAllowed
)
890 dumpTextPathAllowedAsAttribute(bTextPathAllowed
);
893 uno::Any anotherAny
= xPropSet
->getPropertyValue("SubViewSize");
894 uno::Sequence
< awt::Size
> aSubViewSize
;
895 if(anotherAny
>>= aSubViewSize
)
896 dumpSubViewSizeAsElement(aSubViewSize
);
900 void EnhancedShapeDumper::dumpCoordinatesAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
>& aCoordinates
)
902 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Coordinates" ));
903 for (const auto& i
: aCoordinates
)
905 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeParameterPair" ));
906 dumpEnhancedCustomShapeParameterPair(i
);
907 (void)xmlTextWriterEndElement( xmlWriter
);
909 (void)xmlTextWriterEndElement( xmlWriter
);
912 void EnhancedShapeDumper::dumpSegmentsAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeSegment
>& aSegments
)
914 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Segments" ));
915 for (const auto& i
: aSegments
)
917 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeSegment" ));
918 sal_Int32 aCommand
= i
.Command
;
919 sal_Int32 aCount
= i
.Count
;
920 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("command"), "%" SAL_PRIdINT32
, aCommand
);
921 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("count"), "%" SAL_PRIdINT32
, aCount
);
922 (void)xmlTextWriterEndElement( xmlWriter
);
924 (void)xmlTextWriterEndElement( xmlWriter
);
927 void EnhancedShapeDumper::dumpStretchXAsAttribute(sal_Int32 aStretchX
)
929 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("stretchX"), "%" SAL_PRIdINT32
, aStretchX
);
932 void EnhancedShapeDumper::dumpStretchYAsAttribute(sal_Int32 aStretchY
)
934 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("stretchY"), "%" SAL_PRIdINT32
, aStretchY
);
937 void EnhancedShapeDumper::dumpTextFramesAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeTextFrame
>& aTextFrames
)
939 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "TextFrames" ));
940 for (const auto& i
: aTextFrames
)
942 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeTextFrame" ));
944 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "TopLeft" ));
945 dumpEnhancedCustomShapeParameterPair(i
.TopLeft
);
946 (void)xmlTextWriterEndElement( xmlWriter
);
948 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "BottomRight" ));
949 dumpEnhancedCustomShapeParameterPair(i
.BottomRight
);
950 (void)xmlTextWriterEndElement( xmlWriter
);
952 (void)xmlTextWriterEndElement( xmlWriter
);
954 (void)xmlTextWriterEndElement( xmlWriter
);
957 void EnhancedShapeDumper::dumpGluePointsAsElement(const uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
>& aGluePoints
)
959 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "GluePoints" ));
960 for (const auto& i
: aGluePoints
)
962 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "EnhancedCustomShapeParameterPair" ));
963 dumpEnhancedCustomShapeParameterPair(i
);
964 (void)xmlTextWriterEndElement( xmlWriter
);
966 (void)xmlTextWriterEndElement( xmlWriter
);
969 void EnhancedShapeDumper::dumpGluePointLeavingDirectionsAsElement(const uno::Sequence
< double >& aGluePointLeavingDirections
)
971 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "GluePointLeavingDirections" ));
972 for (const auto& i
: aGluePointLeavingDirections
)
974 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("value"), "%f", i
);
976 (void)xmlTextWriterEndElement( xmlWriter
);
979 void EnhancedShapeDumper::dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType
)
981 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("gluePointType"), "%" SAL_PRIdINT32
, aGluePointType
);
984 void EnhancedShapeDumper::dumpExtrusionAllowedAsAttribute(bool bExtrusionAllowed
)
986 if(bExtrusionAllowed
)
987 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionAllowed"), "%s", "true");
989 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("extrusionAllowed"), "%s", "false");
992 void EnhancedShapeDumper::dumpConcentricGradientFillAllowedAsAttribute(bool bConcentricGradientFillAllowed
)
994 if(bConcentricGradientFillAllowed
)
995 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("concentricGradientFillAllowed"), "%s", "true");
997 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("concentricGradientFillAllowed"), "%s", "false");
1000 void EnhancedShapeDumper::dumpTextPathAllowedAsAttribute(bool bTextPathAllowed
)
1002 if(bTextPathAllowed
)
1003 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathAllowed"), "%s", "true");
1005 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathAllowed"), "%s", "false");
1008 void EnhancedShapeDumper::dumpSubViewSizeAsElement(const uno::Sequence
< awt::Size
>& aSubViewSize
)
1010 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "SubViewSize" ));
1011 for (const auto& i
: aSubViewSize
)
1013 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Size" ));
1014 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("width"), "%" SAL_PRIdINT32
, i
.Width
);
1015 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("height"), "%" SAL_PRIdINT32
, i
.Height
);
1016 (void)xmlTextWriterEndElement( xmlWriter
);
1018 (void)xmlTextWriterEndElement( xmlWriter
);
1022 // ---------- EnhancedCustomShapeTextPath.idl ---------------
1025 void EnhancedShapeDumper::dumpEnhancedCustomShapeTextPathService(const uno::Reference
< beans::XPropertySet
>& xPropSet
)
1028 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPath");
1030 if(anotherAny
>>= bTextPath
)
1031 dumpTextPathAsAttribute(bTextPath
);
1034 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextPathMode");
1035 drawing::EnhancedCustomShapeTextPathMode eTextPathMode
;
1036 if(anotherAny
>>= eTextPathMode
)
1037 dumpTextPathModeAsAttribute(eTextPathMode
);
1040 uno::Any anotherAny
= xPropSet
->getPropertyValue("ScaleX");
1042 if(anotherAny
>>= bScaleX
)
1043 dumpScaleXAsAttribute(bScaleX
);
1047 void EnhancedShapeDumper::dumpTextPathAsAttribute(bool bTextPath
)
1050 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPath"), "%s", "true");
1052 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPath"), "%s", "false");
1055 void EnhancedShapeDumper::dumpTextPathModeAsAttribute(drawing::EnhancedCustomShapeTextPathMode eTextPathMode
)
1057 switch(eTextPathMode
)
1059 case drawing::EnhancedCustomShapeTextPathMode_NORMAL
:
1060 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathMode"), "%s", "NORMAL");
1062 case drawing::EnhancedCustomShapeTextPathMode_PATH
:
1063 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathMode"), "%s", "PATH");
1065 case drawing::EnhancedCustomShapeTextPathMode_SHAPE
:
1066 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textPathMode"), "%s", "SHAPE");
1073 void EnhancedShapeDumper::dumpScaleXAsAttribute(bool bScaleX
)
1076 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("scaleX"), "%s", "true");
1078 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("scaleX"), "%s", "false");
1081 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */