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 <drawinglayer/XShapeDumper.hxx>
11 #include "EnhancedShapeDumper.hxx"
12 #include <com/sun/star/drawing/XShapes.hpp>
13 #include <com/sun/star/drawing/XShape.hpp>
14 #include <com/sun/star/drawing/FillStyle.hpp>
15 #include <com/sun/star/awt/Gradient.hpp>
16 #include <com/sun/star/drawing/Hatch.hpp>
17 #include <com/sun/star/awt/XBitmap.hpp>
18 #include <com/sun/star/drawing/RectanglePoint.hpp>
19 #include <com/sun/star/drawing/BitmapMode.hpp>
21 #include <com/sun/star/drawing/LineStyle.hpp>
22 #include <com/sun/star/drawing/LineDash.hpp>
23 #include <com/sun/star/drawing/LineJoint.hpp>
24 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
26 #include <com/sun/star/drawing/PolygonKind.hpp>
28 #include <com/sun/star/drawing/TextFitToSizeType.hpp>
29 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
30 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
31 #include <com/sun/star/drawing/TextAnimationDirection.hpp>
32 #include <com/sun/star/drawing/TextAnimationKind.hpp>
33 #include <com/sun/star/text/WritingMode.hpp>
35 #include <com/sun/star/drawing/HomogenMatrixLine3.hpp>
36 #include <com/sun/star/drawing/HomogenMatrix3.hpp>
38 #include <com/sun/star/beans/PropertyValue.hpp>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <com/sun/star/beans/XPropertySet.hpp>
41 #include <com/sun/star/text/XText.hpp>
42 #include <rtl/strbuf.hxx>
43 #include <libxml/xmlwriter.h>
45 #include <string_view>
46 #include <rtl/ustring.hxx>
48 #define DEBUG_DUMPER 0
50 using namespace com::sun::star
;
54 // FUNCTION DECLARATIONS
56 // auxiliary functions
57 void dumpGradientProperty(const css::awt::Gradient
& rGradient
, xmlTextWriterPtr xmlWriter
);
58 void dumpPolyPolygonBezierCoords(const css::drawing::PolyPolygonBezierCoords
& rPolyPolygonBezierCoords
, xmlTextWriterPtr xmlWriter
);
59 void dumpPointSequenceSequence(const css::drawing::PointSequenceSequence
& rPointSequenceSequence
, const uno::Sequence
<uno::Sequence
<drawing::PolygonFlags
> >*, xmlTextWriterPtr xmlWriter
);
60 void dumpPropertyValueAsElement(const beans::PropertyValue
& rPropertyValue
, xmlTextWriterPtr xmlWriter
);
63 void dumpFillStyleAsAttribute(css::drawing::FillStyle eFillStyle
, xmlTextWriterPtr xmlWriter
);
64 void dumpFillColorAsAttribute(sal_Int32 aColor
, xmlTextWriterPtr xmlWriter
);
65 void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence
, xmlTextWriterPtr xmlWriter
);
66 void dumpFillTransparenceGradientNameAsAttribute(std::u16string_view sTranspGradName
, xmlTextWriterPtr xmlWriter
);
67 void dumpFillTransparenceGradientAsElement(const css::awt::Gradient
& rTranspGrad
, xmlTextWriterPtr xmlWriter
);
68 void dumpFillGradientNameAsAttribute(std::u16string_view sGradName
, xmlTextWriterPtr xmlWriter
);
69 void dumpFillGradientAsElement(const css::awt::Gradient
& rGradient
, xmlTextWriterPtr xmlWriter
);
70 void dumpFillHatchAsElement(const css::drawing::Hatch
& rHatch
, xmlTextWriterPtr xmlWriter
);
71 void dumpFillBackgroundAsAttribute(bool bBackground
, xmlTextWriterPtr xmlWriter
);
72 void dumpFillBitmapAsElement(const css::uno::Reference
<css::awt::XBitmap
>& xBitmap
, xmlTextWriterPtr xmlWriter
);
73 void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX
, xmlTextWriterPtr xmlWriter
);
74 void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY
, xmlTextWriterPtr xmlWriter
);
75 void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX
, xmlTextWriterPtr xmlWriter
);
76 void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY
, xmlTextWriterPtr xmlWriter
);
77 void dumpFillBitmapRectanglePointAsAttribute(css::drawing::RectanglePoint eBitmapRectanglePoint
, xmlTextWriterPtr xmlWriter
);
78 void dumpFillBitmapLogicalSizeAsAttribute(bool bBitmapLogicalSize
, xmlTextWriterPtr xmlWriter
);
79 void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX
, xmlTextWriterPtr xmlWriter
);
80 void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY
, xmlTextWriterPtr xmlWriter
);
81 void dumpFillBitmapModeAsAttribute(css::drawing::BitmapMode eBitmapMode
, xmlTextWriterPtr xmlWriter
);
82 void dumpFillBitmapStretchAsAttribute(bool bBitmapStretch
, xmlTextWriterPtr xmlWriter
);
83 void dumpFillBitmapTileAsAttribute(bool bBitmapTile
, xmlTextWriterPtr xmlWriter
);
86 void dumpLineStyleAsAttribute(css::drawing::LineStyle eLineStyle
, xmlTextWriterPtr xmlWriter
);
87 void dumpLineDashAsElement(const css::drawing::LineDash
& rLineDash
, xmlTextWriterPtr xmlWriter
);
88 void dumpLineDashNameAsAttribute(std::u16string_view sLineDashName
, xmlTextWriterPtr xmlWriter
);
89 void dumpLineColorAsAttribute(sal_Int32 aLineColor
, xmlTextWriterPtr xmlWriter
);
90 void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence
, xmlTextWriterPtr xmlWriter
);
91 void dumpLineWidthAsAttribute(sal_Int32 aLineWidth
, xmlTextWriterPtr xmlWriter
);
92 void dumpLineJointAsAttribute(css::drawing::LineJoint eLineJoint
, xmlTextWriterPtr xmlWriter
);
93 void dumpLineStartNameAsAttribute(std::u16string_view sLineStartName
, xmlTextWriterPtr xmlWriter
);
94 void dumpLineEndNameAsAttribute(std::u16string_view sLineEndName
, xmlTextWriterPtr xmlWriter
);
95 void dumpLineStartAsElement(const css::drawing::PolyPolygonBezierCoords
& rLineStart
, xmlTextWriterPtr xmlWriter
);
96 void dumpLineEndAsElement(const css::drawing::PolyPolygonBezierCoords
& rLineEnd
, xmlTextWriterPtr xmlWriter
);
97 void dumpLineStartCenterAsAttribute(bool bLineStartCenter
, xmlTextWriterPtr xmlWriter
);
98 void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth
, xmlTextWriterPtr xmlWriter
);
99 void dumpLineEndCenterAsAttribute(bool bLineEndCenter
, xmlTextWriterPtr xmlWriter
);
100 void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth
, xmlTextWriterPtr xmlWriter
);
102 // PolyPolygonDescriptor.idl
103 void dumpPolygonKindAsAttribute(css::drawing::PolygonKind ePolygonKind
, xmlTextWriterPtr xmlWriter
);
104 void dumpPolyPolygonAsElement(const css::drawing::PointSequenceSequence
& rPolyPolygon
, xmlTextWriterPtr xmlWriter
);
105 void dumpGeometryAsElement(const css::drawing::PointSequenceSequence
& rGeometry
, xmlTextWriterPtr xmlWriter
);
107 // CharacterProperties.idl
108 void dumpCharHeightAsAttribute(float fHeight
, xmlTextWriterPtr xmlWriter
);
109 void dumpCharColorAsAttribute(sal_Int32 aColor
, xmlTextWriterPtr xmlWriter
);
111 // TextProperties.idl
112 void dumpIsNumberingAsAttribute(bool bIsNumbering
, xmlTextWriterPtr xmlWriter
);
113 void dumpTextAutoGrowHeightAsAttribute(bool bTextAutoGrowHeight
, xmlTextWriterPtr xmlWriter
);
114 void dumpTextAutoGrowWidthAsAttribute(bool bTextAutoGrowWidth
, xmlTextWriterPtr xmlWriter
);
115 void dumpTextContourFrameAsAttribute(bool bTextContourFrame
, xmlTextWriterPtr xmlWriter
);
116 void dumpTextFitToSizeAsAttribute(css::drawing::TextFitToSizeType eTextFitToSize
, xmlTextWriterPtr xmlWriter
);
117 void dumpTextHorizontalAdjustAsAttribute(css::drawing::TextHorizontalAdjust eTextHorizontalAdjust
, xmlTextWriterPtr xmlWriter
);
118 void dumpTextVerticalAdjustAsAttribute(css::drawing::TextVerticalAdjust eTextVerticalAdjust
, xmlTextWriterPtr xmlWriter
);
119 void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance
, xmlTextWriterPtr xmlWriter
);
120 void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance
, xmlTextWriterPtr xmlWriter
);
121 void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance
, xmlTextWriterPtr xmlWriter
);
122 void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance
, xmlTextWriterPtr xmlWriter
);
123 void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight
, xmlTextWriterPtr xmlWriter
);
124 void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth
, xmlTextWriterPtr xmlWriter
);
125 void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight
, xmlTextWriterPtr xmlWriter
);
126 void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth
, xmlTextWriterPtr xmlWriter
);
127 void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount
, xmlTextWriterPtr xmlWriter
);
128 void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount
, xmlTextWriterPtr xmlWriter
);
129 void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay
, xmlTextWriterPtr xmlWriter
);
130 void dumpTextAnimationDirectionAsAttribute(css::drawing::TextAnimationDirection eTextAnimationDirection
, xmlTextWriterPtr xmlWriter
);
131 void dumpTextAnimationKindAsAttribute(css::drawing::TextAnimationKind eTextAnimationKind
, xmlTextWriterPtr xmlWriter
);
132 void dumpTextAnimationStartInsideAsAttribute(bool bTextAnimationStartInside
, xmlTextWriterPtr xmlWriter
);
133 void dumpTextAnimationStopInsideAsAttribute(bool bTextAnimationStopInside
, xmlTextWriterPtr xmlWriter
);
134 void dumpTextWritingModeAsAttribute(css::text::WritingMode eWritingMode
, xmlTextWriterPtr xmlWriter
);
136 // ShadowProperties.idl
137 void dumpShadowAsAttribute(bool bShadow
, xmlTextWriterPtr xmlWriter
);
138 void dumpShadowColorAsAttribute(sal_Int32 aShadowColor
, xmlTextWriterPtr xmlWriter
);
139 void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence
, xmlTextWriterPtr xmlWriter
);
140 void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance
, xmlTextWriterPtr xmlWriter
);
141 void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance
, xmlTextWriterPtr xmlWriter
);
144 void dumpZOrderAsAttribute(sal_Int32 aZOrder
, xmlTextWriterPtr xmlWriter
);
145 void dumpLayerIDAsAttribute(sal_Int32 aLayerID
, xmlTextWriterPtr xmlWriter
);
146 void dumpLayerNameAsAttribute(std::u16string_view sLayerName
, xmlTextWriterPtr xmlWriter
);
147 void dumpVisibleAsAttribute(bool bVisible
, xmlTextWriterPtr xmlWriter
);
148 void dumpPrintableAsAttribute(bool bPrintable
, xmlTextWriterPtr xmlWriter
);
149 void dumpMoveProtectAsAttribute(bool bMoveProtect
, xmlTextWriterPtr xmlWriter
);
150 void dumpNameAsAttribute(std::u16string_view sName
, xmlTextWriterPtr xmlWriter
);
151 void dumpSizeProtectAsAttribute(bool bSizeProtect
, xmlTextWriterPtr xmlWriter
);
152 void dumpHomogenMatrixLine3(const css::drawing::HomogenMatrixLine3
& rLine
, xmlTextWriterPtr xmlWriter
);
153 void dumpTransformationAsElement(const css::drawing::HomogenMatrix3
& rTransformation
, xmlTextWriterPtr xmlWriter
);
154 void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder
, xmlTextWriterPtr xmlWriter
);
155 void dumpHyperlinkAsAttribute(std::u16string_view sHyperlink
, xmlTextWriterPtr xmlWriter
);
156 void dumpInteropGrabBagAsElement(const uno::Sequence
< beans::PropertyValue
>& aInteropGrabBag
, xmlTextWriterPtr xmlWriter
);
159 void dumpCustomShapeEngineAsAttribute(std::u16string_view sCustomShapeEngine
, xmlTextWriterPtr xmlWriter
);
160 void dumpCustomShapeDataAsAttribute(
161 std::u16string_view sCustomShapeData
, xmlTextWriterPtr xmlWriter
);
162 void dumpCustomShapeGeometryAsElement(const css::uno::Sequence
< css::beans::PropertyValue
>& aCustomShapeGeometry
, xmlTextWriterPtr xmlWriter
);
163 void dumpCustomShapeReplacementURLAsAttribute(std::u16string_view sCustomShapeReplacementURL
, xmlTextWriterPtr xmlWriter
);
166 void dumpPositionAsAttribute(const css::awt::Point
& rPoint
, xmlTextWriterPtr xmlWriter
);
167 void dumpSizeAsAttribute(const css::awt::Size
& rSize
, xmlTextWriterPtr xmlWriter
);
170 void dumpShapeDescriptorAsAttribute( const css::uno::Reference
< css::drawing::XShapeDescriptor
>& xDescr
, xmlTextWriterPtr xmlWriter
);
171 void dumpXShape(const css::uno::Reference
< css::drawing::XShape
>& xShape
, xmlTextWriterPtr xmlWriter
, bool bDumpInteropProperties
);
172 void dumpXShapes( const css::uno::Reference
< css::drawing::XShapes
>& xShapes
, xmlTextWriterPtr xmlWriter
, bool bDumpInteropProperties
);
173 void dumpTextPropertiesService(const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
);
174 void dumpFillPropertiesService(const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
);
175 void dumpLinePropertiesService(const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
);
176 void dumpShadowPropertiesService(const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
);
177 void dumpPolyPolygonDescriptorService(const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
);
178 void dumpShapeService(const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
, bool bDumpInteropProperties
);
179 void dumpPolyPolygonBezierDescriptorService(const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
);
180 void dumpCustomShapeService(const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
);
183 int writeCallback(void* pContext
, const char* sBuffer
, int nLen
)
185 OStringBuffer
* pBuffer
= static_cast<OStringBuffer
*>(pContext
);
186 pBuffer
->append(sBuffer
);
190 int closeCallback(void* )
198 // ---------- FillProperties.idl ----------
200 void dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle
, xmlTextWriterPtr xmlWriter
)
204 case drawing::FillStyle_NONE
:
205 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "NONE");
207 case drawing::FillStyle_SOLID
:
208 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "SOLID");
210 case drawing::FillStyle_GRADIENT
:
211 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "GRADIENT");
213 case drawing::FillStyle_HATCH
:
214 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "HATCH");
216 case drawing::FillStyle_BITMAP
:
217 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "BITMAP");
224 void dumpFillColorAsAttribute(sal_Int32 aColor
, xmlTextWriterPtr xmlWriter
)
226 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillColor"), "%06x", static_cast<unsigned int>(aColor
));
229 void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence
, xmlTextWriterPtr xmlWriter
)
231 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32
, aTransparence
);
234 void dumpFillTransparenceGradientNameAsAttribute(std::u16string_view sTranspGradName
, xmlTextWriterPtr xmlWriter
)
236 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillTransparenceGradientName"), "%s",
237 OUStringToOString(sTranspGradName
, RTL_TEXTENCODING_UTF8
).getStr());
240 //because there's more awt::Gradient properties to dump
241 void dumpGradientProperty(const awt::Gradient
& rGradient
, xmlTextWriterPtr xmlWriter
)
243 switch (rGradient
.Style
) //enum GradientStyle
245 case awt::GradientStyle_LINEAR
:
246 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "LINEAR");
248 case awt::GradientStyle_AXIAL
:
249 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "AXIAL");
251 case awt::GradientStyle_RADIAL
:
252 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "RADIAL");
254 case awt::GradientStyle_ELLIPTICAL
:
255 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "ELLIPTICAL");
257 case awt::GradientStyle_SQUARE
:
258 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "SQUARE");
260 case awt::GradientStyle_RECT
:
261 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "RECT");
266 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("startColor"), "%06x", static_cast<unsigned int>(rGradient
.StartColor
));
267 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("endColor"), "%06x", static_cast<unsigned int>(rGradient
.EndColor
));
268 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("angle"), "%" SAL_PRIdINT32
, static_cast<sal_Int32
>(rGradient
.Angle
));
269 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("border"), "%" SAL_PRIdINT32
, static_cast<sal_Int32
>(rGradient
.Border
));
270 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("xOffset"), "%" SAL_PRIdINT32
, static_cast<sal_Int32
>(rGradient
.XOffset
));
271 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("yOffset"), "%" SAL_PRIdINT32
, static_cast<sal_Int32
>(rGradient
.YOffset
));
272 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32
, static_cast<sal_Int32
>(rGradient
.StartIntensity
));
273 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32
, static_cast<sal_Int32
>(rGradient
.EndIntensity
));
274 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("stepCount"), "%" SAL_PRIdINT32
, static_cast<sal_Int32
>(rGradient
.StepCount
));
277 void dumpFillTransparenceGradientAsElement(const awt::Gradient
& rTranspGrad
, xmlTextWriterPtr xmlWriter
)
279 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FillTransparenceGradient" ));
280 dumpGradientProperty(rTranspGrad
, xmlWriter
);
281 (void)xmlTextWriterEndElement( xmlWriter
);
284 void dumpFillGradientNameAsAttribute(std::u16string_view sGradName
, xmlTextWriterPtr xmlWriter
)
286 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillGradientName"), "%s",
287 OUStringToOString(sGradName
, RTL_TEXTENCODING_UTF8
).getStr());
290 void dumpFillGradientAsElement(const awt::Gradient
& rGradient
, xmlTextWriterPtr xmlWriter
)
292 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FillGradient" ));
293 dumpGradientProperty(rGradient
, xmlWriter
);
294 (void)xmlTextWriterEndElement( xmlWriter
);
297 void dumpFillHatchAsElement(const drawing::Hatch
& rHatch
, xmlTextWriterPtr xmlWriter
)
299 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FillHatch" ));
300 switch (rHatch
.Style
)
302 case drawing::HatchStyle_SINGLE
:
303 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "SINGLE");
305 case drawing::HatchStyle_DOUBLE
:
306 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "DOUBLE");
308 case drawing::HatchStyle_TRIPLE
:
309 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "TRIPLE");
314 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("color"), "%06x", static_cast<unsigned int>(rHatch
.Color
));
315 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("distance"), "%" SAL_PRIdINT32
, rHatch
.Distance
);
316 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("angle"), "%" SAL_PRIdINT32
, rHatch
.Angle
);
317 (void)xmlTextWriterEndElement( xmlWriter
);
320 void dumpFillBackgroundAsAttribute(bool bBackground
, xmlTextWriterPtr xmlWriter
)
323 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBackground"), "%s", "true");
325 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBackground"), "%s", "false");
328 void dumpFillBitmapAsElement(const uno::Reference
<awt::XBitmap
>& xBitmap
, xmlTextWriterPtr xmlWriter
)
330 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FillBitmap" ));
333 awt::Size
const aSize
= xBitmap
->getSize();
334 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("width"), "%" SAL_PRIdINT32
, aSize
.Width
);
335 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("height"), "%" SAL_PRIdINT32
, aSize
.Height
);
337 (void)xmlTextWriterEndElement( xmlWriter
);
340 void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX
, xmlTextWriterPtr xmlWriter
)
342 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapPositionOffsetX"), "%" SAL_PRIdINT32
, aBitmapPositionOffsetX
);
345 void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY
, xmlTextWriterPtr xmlWriter
)
347 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapPositionOffsetY"), "%" SAL_PRIdINT32
, aBitmapPositionOffsetY
);
350 void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX
, xmlTextWriterPtr xmlWriter
)
352 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapOffsetX"), "%" SAL_PRIdINT32
, aBitmapOffsetX
);
355 void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY
, xmlTextWriterPtr xmlWriter
)
357 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapOffsetY"), "%" SAL_PRIdINT32
, aBitmapOffsetY
);
360 void dumpFillBitmapRectanglePointAsAttribute(drawing::RectanglePoint eBitmapRectanglePoint
, xmlTextWriterPtr xmlWriter
)
362 switch(eBitmapRectanglePoint
)
364 case drawing::RectanglePoint_LEFT_TOP
:
365 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_TOP");
367 case drawing::RectanglePoint_MIDDLE_TOP
:
368 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_TOP");
370 case drawing::RectanglePoint_RIGHT_TOP
:
371 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_TOP");
373 case drawing::RectanglePoint_LEFT_MIDDLE
:
374 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_MIDDLE");
376 case drawing::RectanglePoint_MIDDLE_MIDDLE
:
377 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_MIDDLE");
379 case drawing::RectanglePoint_RIGHT_MIDDLE
:
380 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_MIDDLE");
382 case drawing::RectanglePoint_LEFT_BOTTOM
:
383 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_BOTTOM");
385 case drawing::RectanglePoint_MIDDLE_BOTTOM
:
386 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_BOTTOM");
388 case drawing::RectanglePoint_RIGHT_BOTTOM
:
389 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_BOTTOM");
396 void dumpFillBitmapLogicalSizeAsAttribute(bool bBitmapLogicalSize
, xmlTextWriterPtr xmlWriter
)
398 if(bBitmapLogicalSize
)
399 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapLogicalSize"), "%s", "true");
401 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapLogicalSize"), "%s", "false");
404 void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX
, xmlTextWriterPtr xmlWriter
)
406 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapSizeX"), "%" SAL_PRIdINT32
, aBitmapSizeX
);
409 void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY
, xmlTextWriterPtr xmlWriter
)
411 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapSizeY"), "%" SAL_PRIdINT32
, aBitmapSizeY
);
414 void dumpFillBitmapModeAsAttribute(drawing::BitmapMode eBitmapMode
, xmlTextWriterPtr xmlWriter
)
418 case drawing::BitmapMode_REPEAT
:
419 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapMode"), "%s", "REPEAT");
421 case drawing::BitmapMode_STRETCH
:
422 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapMode"), "%s", "STRETCH");
424 case drawing::BitmapMode_NO_REPEAT
:
425 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapMode"), "%s", "NO_REPEAT");
432 void dumpFillBitmapStretchAsAttribute(bool bBitmapStretch
, xmlTextWriterPtr xmlWriter
)
435 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapStretch"), "%s", "true");
437 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapStretch"), "%s", "false");
440 void dumpFillBitmapTileAsAttribute(bool bBitmapTile
, xmlTextWriterPtr xmlWriter
)
443 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapTile"), "%s", "true");
445 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapTile"), "%s", "false");
449 // ---------- LineProperties.idl ----------
452 void dumpLineStyleAsAttribute(drawing::LineStyle eLineStyle
, xmlTextWriterPtr xmlWriter
)
456 case drawing::LineStyle_NONE
:
457 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStyle"), "%s", "NONE");
459 case drawing::LineStyle_SOLID
:
460 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStyle"), "%s", "SOLID");
462 case drawing::LineStyle_DASH
:
463 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStyle"), "%s", "DASH");
470 void dumpLineDashAsElement(const drawing::LineDash
& rLineDash
, xmlTextWriterPtr xmlWriter
)
472 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "LineDash" ));
473 switch (rLineDash
.Style
)
475 case drawing::DashStyle_RECT
:
476 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "RECT");
478 case drawing::DashStyle_ROUND
:
479 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "ROUND");
481 case drawing::DashStyle_RECTRELATIVE
:
482 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "RECTRELATIVE");
484 case drawing::DashStyle_ROUNDRELATIVE
:
485 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "ROUNDRELATIVE");
490 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("dots"), "%" SAL_PRIdINT32
, static_cast<sal_Int32
>(rLineDash
.Dots
));
491 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("dotLen"), "%" SAL_PRIdINT32
, rLineDash
.DotLen
);
492 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("dashes"), "%" SAL_PRIdINT32
, static_cast<sal_Int32
>(rLineDash
.Dashes
));
493 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("dashLen"), "%" SAL_PRIdINT32
, rLineDash
.DashLen
);
494 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("distance"), "%" SAL_PRIdINT32
, rLineDash
.Distance
);
495 (void)xmlTextWriterEndElement( xmlWriter
);
498 void dumpLineDashNameAsAttribute(std::u16string_view sLineDashName
, xmlTextWriterPtr xmlWriter
)
500 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineDashName"), "%s",
501 OUStringToOString(sLineDashName
, RTL_TEXTENCODING_UTF8
).getStr());
504 void dumpLineColorAsAttribute(sal_Int32 aLineColor
, xmlTextWriterPtr xmlWriter
)
506 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineColor"), "%06x", static_cast<unsigned int>(aLineColor
));
509 void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence
, xmlTextWriterPtr xmlWriter
)
511 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32
, aLineTransparence
);
514 void dumpLineWidthAsAttribute(sal_Int32 aLineWidth
, xmlTextWriterPtr xmlWriter
)
516 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32
, aLineWidth
);
519 void dumpLineJointAsAttribute(drawing::LineJoint eLineJoint
, xmlTextWriterPtr xmlWriter
)
523 case drawing::LineJoint_NONE
:
524 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "NONE");
526 case drawing::LineJoint_MIDDLE
:
527 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "MIDDLE");
529 case drawing::LineJoint_BEVEL
:
530 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "BEVEL");
532 case drawing::LineJoint_MITER
:
533 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "MITER");
535 case drawing::LineJoint_ROUND
:
536 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "ROUND");
543 void dumpLineStartNameAsAttribute(std::u16string_view sLineStartName
, xmlTextWriterPtr xmlWriter
)
545 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineStartName"), "%s",
546 OUStringToOString(sLineStartName
, RTL_TEXTENCODING_UTF8
).getStr());
549 void dumpLineEndNameAsAttribute(std::u16string_view sLineEndName
, xmlTextWriterPtr xmlWriter
)
551 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineEndName"), "%s",
552 OUStringToOString(sLineEndName
, RTL_TEXTENCODING_UTF8
).getStr());
555 void dumpPolyPolygonBezierCoords(const drawing::PolyPolygonBezierCoords
& rPolyPolygonBezierCoords
, xmlTextWriterPtr xmlWriter
)
557 dumpPointSequenceSequence(rPolyPolygonBezierCoords
.Coordinates
, &rPolyPolygonBezierCoords
.Flags
, xmlWriter
);
560 void dumpLineStartAsElement(const drawing::PolyPolygonBezierCoords
& rLineStart
, xmlTextWriterPtr xmlWriter
)
562 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "LineStart" ));
563 dumpPolyPolygonBezierCoords(rLineStart
, xmlWriter
);
564 (void)xmlTextWriterEndElement( xmlWriter
);
567 void dumpLineEndAsElement(const drawing::PolyPolygonBezierCoords
& rLineEnd
, xmlTextWriterPtr xmlWriter
)
569 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "LineEnd" ));
570 dumpPolyPolygonBezierCoords(rLineEnd
, xmlWriter
);
571 (void)xmlTextWriterEndElement( xmlWriter
);
574 void dumpLineStartCenterAsAttribute(bool bLineStartCenter
, xmlTextWriterPtr xmlWriter
)
577 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStartCenter"), "%s", "true");
579 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStartCenter"), "%s", "false");
582 void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth
, xmlTextWriterPtr xmlWriter
)
584 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32
, aLineStartWidth
);
587 void dumpLineEndCenterAsAttribute(bool bLineEndCenter
, xmlTextWriterPtr xmlWriter
)
590 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineEndCenter"), "%s", "true");
592 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineEndCenter"), "%s", "false");
595 void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth
, xmlTextWriterPtr xmlWriter
)
597 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32
, aLineEndWidth
);
601 // ---------- PolyPolygonDescriptor.idl ----------
604 void dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind
, xmlTextWriterPtr xmlWriter
)
608 case drawing::PolygonKind_LINE
:
609 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "LINE");
611 case drawing::PolygonKind_POLY
:
612 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "POLY");
614 case drawing::PolygonKind_PLIN
:
615 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PLIN");
617 case drawing::PolygonKind_PATHLINE
:
618 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PATHLINE");
620 case drawing::PolygonKind_PATHFILL
:
621 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PATHFILL");
623 case drawing::PolygonKind_FREELINE
:
624 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "FREELINE");
626 case drawing::PolygonKind_FREEFILL
:
627 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "FREEFILL");
629 case drawing::PolygonKind_PATHPOLY
:
630 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PATHPOLY");
632 case drawing::PolygonKind_PATHPLIN
:
633 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PATHPLIN");
640 void dumpPointSequenceSequence(const drawing::PointSequenceSequence
& aPointSequenceSequence
, const uno::Sequence
<uno::Sequence
< drawing::PolygonFlags
> >* pFlags
, xmlTextWriterPtr xmlWriter
)
642 // LibreOffice proudly presents - The Sequenception
643 sal_Int32 nPointsSequence
= aPointSequenceSequence
.getLength();
645 for (sal_Int32 i
= 0; i
< nPointsSequence
; ++i
)
647 const uno::Sequence
< awt::Point
>& pointSequence
= aPointSequenceSequence
[i
];
648 sal_Int32 nPoints
= pointSequence
.getLength();
650 uno::Sequence
< drawing::PolygonFlags
> flagsSequence
;
652 flagsSequence
= (*pFlags
)[i
];
654 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "pointSequence" ));
656 for(sal_Int32 j
= 0; j
< nPoints
; ++j
)
658 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "point" ));
659 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("positionX"), "%" SAL_PRIdINT32
, pointSequence
[j
].X
);
660 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("positionY"), "%" SAL_PRIdINT32
, pointSequence
[j
].Y
);
664 switch(flagsSequence
[j
])
666 case drawing::PolygonFlags_NORMAL
:
667 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonFlags"), "%s", "NORMAL");
669 case drawing::PolygonFlags_SMOOTH
:
670 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonFlags"), "%s", "SMOOTH");
672 case drawing::PolygonFlags_CONTROL
:
673 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonFlags"), "%s", "CONTROL");
675 case drawing::PolygonFlags_SYMMETRIC
:
676 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonFlags"), "%s", "SYMMETRIC");
683 (void)xmlTextWriterEndElement( xmlWriter
);
685 (void)xmlTextWriterEndElement( xmlWriter
);
689 void dumpPolyPolygonAsElement(const drawing::PointSequenceSequence
& rPolyPolygon
, xmlTextWriterPtr xmlWriter
)
691 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PolyPolygon" ));
692 dumpPointSequenceSequence(rPolyPolygon
, nullptr, xmlWriter
);
693 (void)xmlTextWriterEndElement( xmlWriter
);
696 void dumpGeometryAsElement(const drawing::PointSequenceSequence
& aGeometry
, xmlTextWriterPtr xmlWriter
)
698 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Geometry" ));
699 dumpPointSequenceSequence(aGeometry
, nullptr, xmlWriter
);
700 (void)xmlTextWriterEndElement( xmlWriter
);
703 // CharacterProperties.idl
704 void dumpCharHeightAsAttribute(float fHeight
, xmlTextWriterPtr xmlWriter
)
706 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fontHeight"), "%f", fHeight
);
709 void dumpCharColorAsAttribute(sal_Int32 aColor
, xmlTextWriterPtr xmlWriter
)
711 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fontColor"), "%06x", static_cast<unsigned int>(aColor
));
715 // ---------- TextProperties.idl ----------
718 void dumpIsNumberingAsAttribute(bool bIsNumbering
, xmlTextWriterPtr xmlWriter
)
721 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("isNumbering"), "%s", "true");
723 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("isNumbering"), "%s", "false");
726 void dumpTextAutoGrowHeightAsAttribute(bool bTextAutoGrowHeight
, xmlTextWriterPtr xmlWriter
)
728 if(bTextAutoGrowHeight
)
729 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAutoGrowHeight"), "%s", "true");
731 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAutoGrowHeight"), "%s", "false");
734 void dumpTextAutoGrowWidthAsAttribute(bool bTextAutoGrowWidth
, xmlTextWriterPtr xmlWriter
)
736 if(bTextAutoGrowWidth
)
737 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAutoGrowWidth"), "%s", "true");
739 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAutoGrowWidth"), "%s", "false");
742 void dumpTextContourFrameAsAttribute(bool bTextContourFrame
, xmlTextWriterPtr xmlWriter
)
744 if(bTextContourFrame
)
745 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textContourFrame"), "%s", "true");
747 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textContourFrame"), "%s", "false");
750 void dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize
, xmlTextWriterPtr xmlWriter
)
752 switch(eTextFitToSize
)
754 case drawing::TextFitToSizeType_NONE
:
755 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textFitToSize"), "%s", "NONE");
757 case drawing::TextFitToSizeType_PROPORTIONAL
:
758 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textFitToSize"), "%s", "PROPORTIONAL");
760 case drawing::TextFitToSizeType_ALLLINES
:
761 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textFitToSize"), "%s", "ALLLINES");
763 case drawing::TextFitToSizeType_AUTOFIT
:
764 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textFitToSize"), "%s", "AUTOFIT");
771 void dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust
, xmlTextWriterPtr xmlWriter
)
773 switch(eTextHorizontalAdjust
)
775 case drawing::TextHorizontalAdjust_LEFT
:
776 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textHorizontalAdjust"), "%s", "LEFT");
778 case drawing::TextHorizontalAdjust_CENTER
:
779 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textHorizontalAdjust"), "%s", "CENTER");
781 case drawing::TextHorizontalAdjust_RIGHT
:
782 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textHorizontalAdjust"), "%s", "RIGHT");
784 case drawing::TextHorizontalAdjust_BLOCK
:
785 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK");
792 void dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust
, xmlTextWriterPtr xmlWriter
)
794 switch(eTextVerticalAdjust
)
796 case drawing::TextVerticalAdjust_TOP
:
797 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textVerticalAdjust"), "%s", "TOP");
799 case drawing::TextVerticalAdjust_CENTER
:
800 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textVerticalAdjust"), "%s", "CENTER");
802 case drawing::TextVerticalAdjust_BOTTOM
:
803 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textVerticalAdjust"), "%s", "BOTTOM");
805 case drawing::TextVerticalAdjust_BLOCK
:
806 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textVerticalAdjust"), "%s", "BLOCK");
813 void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance
, xmlTextWriterPtr xmlWriter
)
815 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32
, aTextLeftDistance
);
818 void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance
, xmlTextWriterPtr xmlWriter
)
820 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32
, aTextRightDistance
);
823 void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance
, xmlTextWriterPtr xmlWriter
)
825 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32
, aTextUpperDistance
);
828 void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance
, xmlTextWriterPtr xmlWriter
)
830 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32
, aTextLowerDistance
);
833 void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight
, xmlTextWriterPtr xmlWriter
)
835 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32
, aTextMaximumFrameHeight
);
838 void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth
, xmlTextWriterPtr xmlWriter
)
840 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32
, aTextMaximumFrameWidth
);
843 void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight
, xmlTextWriterPtr xmlWriter
)
845 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32
, aTextMinimumFrameHeight
);
848 void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth
, xmlTextWriterPtr xmlWriter
)
850 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32
, aTextMinimumFrameWidth
);
853 void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount
, xmlTextWriterPtr xmlWriter
)
855 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32
, aTextAnimationAmount
);
858 void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount
, xmlTextWriterPtr xmlWriter
)
860 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32
, aTextAnimationCount
);
863 void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay
, xmlTextWriterPtr xmlWriter
)
865 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32
, aTextAnimationDelay
);
868 void dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection
, xmlTextWriterPtr xmlWriter
)
870 switch(eTextAnimationDirection
)
872 case drawing::TextAnimationDirection_LEFT
:
873 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationDirection"), "%s", "LEFT");
875 case drawing::TextAnimationDirection_RIGHT
:
876 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationDirection"), "%s", "RIGHT");
878 case drawing::TextAnimationDirection_UP
:
879 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationDirection"), "%s", "UP");
881 case drawing::TextAnimationDirection_DOWN
:
882 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationDirection"), "%s", "DOWN");
889 void dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind
, xmlTextWriterPtr xmlWriter
)
891 switch(eTextAnimationKind
)
893 case drawing::TextAnimationKind_NONE
:
894 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "NONE");
896 case drawing::TextAnimationKind_BLINK
:
897 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "BLINK");
899 case drawing::TextAnimationKind_SCROLL
:
900 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "SCROLL");
902 case drawing::TextAnimationKind_ALTERNATE
:
903 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "ALTERNATE");
905 case drawing::TextAnimationKind_SLIDE
:
906 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "SLIDE");
913 void dumpTextAnimationStartInsideAsAttribute(bool bTextAnimationStartInside
, xmlTextWriterPtr xmlWriter
)
915 if(bTextAnimationStartInside
)
916 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationStartInside"), "%s", "true");
918 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationStartInside"), "%s", "false");
921 void dumpTextAnimationStopInsideAsAttribute(bool bTextAnimationStopInside
, xmlTextWriterPtr xmlWriter
)
923 if(bTextAnimationStopInside
)
924 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationStopInside"), "%s", "true");
926 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationStopInside"), "%s", "false");
929 void dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode
, xmlTextWriterPtr xmlWriter
)
931 switch(eTextWritingMode
)
933 case text::WritingMode_LR_TB
:
934 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textWritingMode"), "%s", "LR_TB");
936 case text::WritingMode_RL_TB
:
937 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textWritingMode"), "%s", "RL_TB");
939 case text::WritingMode_TB_RL
:
940 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textWritingMode"), "%s", "TB_RL");
948 // ---------- ShadowProperties.idl ----------
951 void dumpShadowAsAttribute(bool bShadow
, xmlTextWriterPtr xmlWriter
)
954 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadow"), "%s", "true");
956 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadow"), "%s", "false");
959 void dumpShadowColorAsAttribute(sal_Int32 aShadowColor
, xmlTextWriterPtr xmlWriter
)
961 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("shadowColor"), "%06x", static_cast<unsigned int>(aShadowColor
));
964 void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence
, xmlTextWriterPtr xmlWriter
)
966 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32
, aShadowTransparence
);
969 void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance
, xmlTextWriterPtr xmlWriter
)
971 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("shadowXDistance"), "%" SAL_PRIdINT32
, aShadowXDistance
);
974 void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance
, xmlTextWriterPtr xmlWriter
)
976 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32
, aShadowYDistance
);
980 // ---------- Shape.idl ----------
983 void dumpZOrderAsAttribute(sal_Int32 aZOrder
, xmlTextWriterPtr xmlWriter
)
985 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("zOrder"), "%" SAL_PRIdINT32
, aZOrder
);
988 void dumpLayerIDAsAttribute(sal_Int32 aLayerID
, xmlTextWriterPtr xmlWriter
)
990 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("layerID"), "%" SAL_PRIdINT32
, aLayerID
);
993 void dumpLayerNameAsAttribute(std::u16string_view sLayerName
, xmlTextWriterPtr xmlWriter
)
995 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("layerName"), "%s",
996 OUStringToOString(sLayerName
, RTL_TEXTENCODING_UTF8
).getStr());
999 void dumpVisibleAsAttribute(bool bVisible
, xmlTextWriterPtr xmlWriter
)
1002 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("visible"), "%s", "true");
1004 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("visible"), "%s", "false");
1007 void dumpPrintableAsAttribute(bool bPrintable
, xmlTextWriterPtr xmlWriter
)
1010 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("printable"), "%s", "true");
1012 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("printable"), "%s", "false");
1015 void dumpMoveProtectAsAttribute(bool bMoveProtect
, xmlTextWriterPtr xmlWriter
)
1018 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("moveProtect"), "%s", "true");
1020 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("moveProtect"), "%s", "false");
1023 void dumpNameAsAttribute(std::u16string_view sName
, xmlTextWriterPtr xmlWriter
)
1025 if(!sName
.empty() && !m_bNameDumped
)
1027 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s", OUStringToOString(sName
, RTL_TEXTENCODING_UTF8
).getStr());
1028 m_bNameDumped
= true;
1032 void dumpSizeProtectAsAttribute(bool bSizeProtect
, xmlTextWriterPtr xmlWriter
)
1035 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("sizeProtect"), "%s", "true");
1037 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("sizeProtect"), "%s", "false");
1040 void dumpHomogenMatrixLine3(const drawing::HomogenMatrixLine3
& rHomogenMatrixLine3
, xmlTextWriterPtr xmlWriter
)
1042 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("column1"), "%f", rHomogenMatrixLine3
.Column1
);
1043 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("column2"), "%f", rHomogenMatrixLine3
.Column2
);
1044 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("column3"), "%f", rHomogenMatrixLine3
.Column3
);
1047 void dumpTransformationAsElement(const drawing::HomogenMatrix3
& rTransformation
, xmlTextWriterPtr xmlWriter
)
1049 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Transformation" ));
1051 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Line1" ));
1052 dumpHomogenMatrixLine3(rTransformation
.Line1
, xmlWriter
);
1053 (void)xmlTextWriterEndElement( xmlWriter
);
1054 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Line2" ));
1055 dumpHomogenMatrixLine3(rTransformation
.Line2
, xmlWriter
);
1056 (void)xmlTextWriterEndElement( xmlWriter
);
1057 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Line3" ));
1058 dumpHomogenMatrixLine3(rTransformation
.Line3
, xmlWriter
);
1059 (void)xmlTextWriterEndElement( xmlWriter
);
1061 (void)xmlTextWriterEndElement( xmlWriter
);
1064 void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder
, xmlTextWriterPtr xmlWriter
)
1066 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32
, aNavigationOrder
);
1069 void dumpHyperlinkAsAttribute(std::u16string_view sHyperlink
, xmlTextWriterPtr xmlWriter
)
1071 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("hyperlink"), "%s",
1072 OUStringToOString(sHyperlink
, RTL_TEXTENCODING_UTF8
).getStr());
1075 void dumpInteropGrabBagAsElement(const uno::Sequence
< beans::PropertyValue
>& aInteropGrabBag
, xmlTextWriterPtr xmlWriter
)
1077 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "InteropGrabBag" ));
1079 for (const auto& item
: aInteropGrabBag
)
1080 dumpPropertyValueAsElement(item
, xmlWriter
);
1082 (void)xmlTextWriterEndElement( xmlWriter
);
1086 // ---------- XShape.idl ----------
1089 void dumpPositionAsAttribute(const awt::Point
& rPoint
, xmlTextWriterPtr xmlWriter
)
1091 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("positionX"), "%" SAL_PRIdINT32
, rPoint
.X
);
1092 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("positionY"), "%" SAL_PRIdINT32
, rPoint
.Y
);
1095 void dumpSizeAsAttribute(const awt::Size
& rSize
, xmlTextWriterPtr xmlWriter
)
1097 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("sizeX"), "%" SAL_PRIdINT32
, rSize
.Width
);
1098 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("sizeY"), "%" SAL_PRIdINT32
, rSize
.Height
);
1101 void dumpShapeDescriptorAsAttribute( const uno::Reference
< drawing::XShapeDescriptor
>& xDescr
, xmlTextWriterPtr xmlWriter
)
1103 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("type"), "%s",
1104 OUStringToOString(xDescr
->getShapeType(), RTL_TEXTENCODING_UTF8
).getStr());
1108 // ---------- CustomShape.idl ----------
1111 void dumpCustomShapeEngineAsAttribute(std::u16string_view sCustomShapeEngine
, xmlTextWriterPtr xmlWriter
)
1113 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("customShapeEngine"), "%s",
1114 OUStringToOString(sCustomShapeEngine
, RTL_TEXTENCODING_UTF8
).getStr());
1117 void dumpCustomShapeDataAsAttribute(
1118 std::u16string_view sCustomShapeData
, xmlTextWriterPtr xmlWriter
)
1120 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("customShapeData"), "%s",
1121 OUStringToOString(sCustomShapeData
, RTL_TEXTENCODING_UTF8
).getStr());
1124 void dumpPropertyValueAsElement(const beans::PropertyValue
& rPropertyValue
, xmlTextWriterPtr xmlWriter
)
1126 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PropertyValue" ));
1128 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s",
1129 OUStringToOString(rPropertyValue
.Name
, RTL_TEXTENCODING_UTF8
).getStr());
1131 uno::Any aAny
= rPropertyValue
.Value
;
1132 if(OUString sValue
; aAny
>>= sValue
)
1134 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
1135 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
1137 else if(sal_Int32 nValue
; aAny
>>= nValue
)
1139 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%" SAL_PRIdINT32
, nValue
);
1141 else if(float fValue
; aAny
>>= fValue
)
1143 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%f", fValue
);
1145 else if(bool bValue
; aAny
>>= bValue
)
1147 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s", (bValue
? "true": "false"));
1149 else if(awt::Rectangle aRectangleValue
;
1150 rPropertyValue
.Name
== "ViewBox" && (aAny
>>= aRectangleValue
))
1152 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1153 enhancedDumper
.dumpViewBoxAsElement(aRectangleValue
);
1155 else if(uno::Sequence
< drawing::EnhancedCustomShapeAdjustmentValue
> aAdjustmentValues
;
1156 rPropertyValue
.Name
== "AdjustmentValues" && (aAny
>>= aAdjustmentValues
))
1158 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1159 enhancedDumper
.dumpAdjustmentValuesAsElement(aAdjustmentValues
);
1161 else if(uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
> aCoordinates
;
1162 rPropertyValue
.Name
== "Coordinates" && (aAny
>>= aCoordinates
))
1164 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1165 enhancedDumper
.dumpCoordinatesAsElement(aCoordinates
);
1167 else if(uno::Sequence
< drawing::EnhancedCustomShapeSegment
> aSegments
;
1168 rPropertyValue
.Name
== "Segments" && (aAny
>>= aSegments
))
1170 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1171 enhancedDumper
.dumpSegmentsAsElement(aSegments
);
1173 else if(uno::Sequence
< beans::PropertyValue
> aPropSeq
; aAny
>>= aPropSeq
)
1175 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( OUStringToOString(rPropertyValue
.Name
, RTL_TEXTENCODING_UTF8
).getStr() ));
1177 sal_Int32 i
= 0, nCount
= aPropSeq
.getLength();
1178 for ( ; i
< nCount
; i
++ )
1179 dumpPropertyValueAsElement(aPropSeq
[ i
], xmlWriter
);
1181 (void)xmlTextWriterEndElement(xmlWriter
);
1184 // TODO: Add here dumping of XDocument for future OOX Smart-Art
1187 // TODO more, if necessary
1189 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("handle"), "%" SAL_PRIdINT32
, rPropertyValue
.Handle
);
1191 switch(rPropertyValue
.State
)
1193 case beans::PropertyState_DIRECT_VALUE
:
1194 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
1196 case beans::PropertyState_DEFAULT_VALUE
:
1197 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
1199 case beans::PropertyState_AMBIGUOUS_VALUE
:
1200 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
1205 (void)xmlTextWriterEndElement( xmlWriter
);
1208 void dumpCustomShapeGeometryAsElement(const uno::Sequence
< beans::PropertyValue
>& aCustomShapeGeometry
, xmlTextWriterPtr xmlWriter
)
1210 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "CustomShapeGeometry" ));
1212 sal_Int32 nLength
= aCustomShapeGeometry
.getLength();
1213 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
1214 dumpPropertyValueAsElement(aCustomShapeGeometry
[i
], xmlWriter
);
1216 (void)xmlTextWriterEndElement( xmlWriter
);
1219 void dumpCustomShapeReplacementURLAsAttribute(std::u16string_view sCustomShapeReplacementURL
, xmlTextWriterPtr xmlWriter
)
1221 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("customShapeReplacementURL"), "%s",
1222 OUStringToOString(sCustomShapeReplacementURL
, RTL_TEXTENCODING_UTF8
).getStr());
1225 // methods dumping whole services
1227 void dumpTextPropertiesService(const uno::Reference
< beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
)
1229 uno::Reference
< beans::XPropertySetInfo
> xInfo
= xPropSet
->getPropertySetInfo();
1230 if(xInfo
->hasPropertyByName(u
"CharHeight"_ustr
))
1232 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"CharHeight"_ustr
);
1234 if(anotherAny
>>= fHeight
)
1235 dumpCharHeightAsAttribute(fHeight
, xmlWriter
);
1237 if(xInfo
->hasPropertyByName(u
"CharColor"_ustr
))
1239 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"CharColor"_ustr
);
1240 sal_Int32 aColor
= sal_Int32();
1241 if(anotherAny
>>= aColor
)
1242 dumpCharColorAsAttribute(aColor
, xmlWriter
);
1244 // TODO - more properties from CharacterProperties.idl (similar to above)
1246 if(xInfo
->hasPropertyByName(u
"IsNumbering"_ustr
))
1248 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"IsNumbering"_ustr
);
1250 if(anotherAny
>>= bIsNumbering
)
1251 dumpIsNumberingAsAttribute(bIsNumbering
, xmlWriter
);
1254 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextAutoGrowHeight"_ustr
);
1255 bool bTextAutoGrowHeight
;
1256 if(anotherAny
>>= bTextAutoGrowHeight
)
1257 dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight
, xmlWriter
);
1260 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextAutoGrowWidth"_ustr
);
1261 bool bTextAutoGrowWidth
;
1262 if(anotherAny
>>= bTextAutoGrowWidth
)
1263 dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth
, xmlWriter
);
1266 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextContourFrame"_ustr
);
1267 bool bTextContourFrame
;
1268 if(anotherAny
>>= bTextContourFrame
)
1269 dumpTextContourFrameAsAttribute(bTextContourFrame
, xmlWriter
);
1272 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextFitToSize"_ustr
);
1273 drawing::TextFitToSizeType eTextFitToSize
;
1274 if(anotherAny
>>= eTextFitToSize
)
1275 dumpTextFitToSizeAsAttribute(eTextFitToSize
, xmlWriter
);
1278 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextHorizontalAdjust"_ustr
);
1279 drawing::TextHorizontalAdjust eTextHorizontalAdjust
;
1280 if(anotherAny
>>= eTextHorizontalAdjust
)
1281 dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust
, xmlWriter
);
1284 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextVerticalAdjust"_ustr
);
1285 drawing::TextVerticalAdjust eTextVerticalAdjust
;
1286 if(anotherAny
>>= eTextVerticalAdjust
)
1287 dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust
, xmlWriter
);
1290 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextLeftDistance"_ustr
);
1291 sal_Int32 aTextLeftDistance
= sal_Int32();
1292 if(anotherAny
>>= aTextLeftDistance
)
1293 dumpTextLeftDistanceAsAttribute(aTextLeftDistance
, xmlWriter
);
1296 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextRightDistance"_ustr
);
1297 sal_Int32 aTextRightDistance
= sal_Int32();
1298 if(anotherAny
>>= aTextRightDistance
)
1299 dumpTextRightDistanceAsAttribute(aTextRightDistance
, xmlWriter
);
1302 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextUpperDistance"_ustr
);
1303 sal_Int32 aTextUpperDistance
= sal_Int32();
1304 if(anotherAny
>>= aTextUpperDistance
)
1305 dumpTextUpperDistanceAsAttribute(aTextUpperDistance
, xmlWriter
);
1308 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextLowerDistance"_ustr
);
1309 sal_Int32 aTextLowerDistance
= sal_Int32();
1310 if(anotherAny
>>= aTextLowerDistance
)
1311 dumpTextLowerDistanceAsAttribute(aTextLowerDistance
, xmlWriter
);
1314 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextMaximumFrameHeight"_ustr
);
1315 sal_Int32 aTextMaximumFrameHeight
= sal_Int32();
1316 if(anotherAny
>>= aTextMaximumFrameHeight
)
1317 dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight
, xmlWriter
);
1320 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextMaximumFrameWidth"_ustr
);
1321 sal_Int32 aTextMaximumFrameWidth
= sal_Int32();
1322 if(anotherAny
>>= aTextMaximumFrameWidth
)
1323 dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth
, xmlWriter
);
1326 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextMinimumFrameHeight"_ustr
);
1327 sal_Int32 aTextMinimumFrameHeight
= sal_Int32();
1328 if(anotherAny
>>= aTextMinimumFrameHeight
)
1329 dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight
, xmlWriter
);
1332 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextMinimumFrameWidth"_ustr
);
1333 sal_Int32 aTextMinimumFrameWidth
= sal_Int32();
1334 if(anotherAny
>>= aTextMinimumFrameWidth
)
1335 dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth
, xmlWriter
);
1338 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextAnimationAmount"_ustr
);
1339 sal_Int32 aTextAnimationAmount
= sal_Int32();
1340 if(anotherAny
>>= aTextAnimationAmount
)
1341 dumpTextAnimationAmountAsAttribute(aTextAnimationAmount
, xmlWriter
);
1344 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextAnimationCount"_ustr
);
1345 sal_Int32 aTextAnimationCount
= sal_Int32();
1346 if(anotherAny
>>= aTextAnimationCount
)
1347 dumpTextAnimationCountAsAttribute(aTextAnimationCount
, xmlWriter
);
1350 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextAnimationDelay"_ustr
);
1351 sal_Int32 aTextAnimationDelay
= sal_Int32();
1352 if(anotherAny
>>= aTextAnimationDelay
)
1353 dumpTextAnimationDelayAsAttribute(aTextAnimationDelay
, xmlWriter
);
1356 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextAnimationDirection"_ustr
);
1357 drawing::TextAnimationDirection eTextAnimationDirection
;
1358 if(anotherAny
>>= eTextAnimationDirection
)
1359 dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection
, xmlWriter
);
1362 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextAnimationKind"_ustr
);
1363 drawing::TextAnimationKind eTextAnimationKind
;
1364 if(anotherAny
>>= eTextAnimationKind
)
1365 dumpTextAnimationKindAsAttribute(eTextAnimationKind
, xmlWriter
);
1368 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextAnimationStartInside"_ustr
);
1369 bool bTextAnimationStartInside
;
1370 if(anotherAny
>>= bTextAnimationStartInside
)
1371 dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside
, xmlWriter
);
1374 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextAnimationStopInside"_ustr
);
1375 bool bTextAnimationStopInside
;
1376 if(anotherAny
>>= bTextAnimationStopInside
)
1377 dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside
, xmlWriter
);
1380 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"TextWritingMode"_ustr
);
1381 text::WritingMode eTextWritingMode
;
1382 if(anotherAny
>>= eTextWritingMode
)
1383 dumpTextWritingModeAsAttribute(eTextWritingMode
, xmlWriter
);
1387 void dumpFillPropertiesService(const uno::Reference
< beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
)
1390 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillStyle"_ustr
);
1391 drawing::FillStyle eFillStyle
;
1392 if(anotherAny
>>= eFillStyle
)
1393 dumpFillStyleAsAttribute(eFillStyle
, xmlWriter
);
1396 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillColor"_ustr
);
1397 sal_Int32 aColor
= sal_Int32();
1398 if(anotherAny
>>= aColor
)
1399 dumpFillColorAsAttribute(aColor
, xmlWriter
);
1402 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillTransparence"_ustr
);
1403 sal_Int32 aTransparence
= sal_Int32();
1404 if(anotherAny
>>= aTransparence
)
1405 dumpFillTransparenceAsAttribute(aTransparence
, xmlWriter
);
1408 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillTransparenceGradientName"_ustr
);
1409 OUString sTranspGradName
;
1410 if(anotherAny
>>= sTranspGradName
)
1411 dumpFillTransparenceGradientNameAsAttribute(sTranspGradName
, xmlWriter
);
1414 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillTransparenceGradient"_ustr
);
1415 awt::Gradient aTranspGrad
;
1416 if(anotherAny
>>= aTranspGrad
)
1417 dumpFillTransparenceGradientAsElement(aTranspGrad
, xmlWriter
);
1420 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillGradientName"_ustr
);
1422 if(anotherAny
>>= sGradName
)
1423 dumpFillGradientNameAsAttribute(sGradName
, xmlWriter
);
1426 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillGradient"_ustr
);
1427 awt::Gradient aGradient
;
1428 if(anotherAny
>>= aGradient
)
1429 dumpFillGradientAsElement(aGradient
, xmlWriter
);
1432 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillHatchName"_ustr
);
1433 OUString sHatchName
;
1434 if(anotherAny
>>= sHatchName
)
1435 dumpFillGradientNameAsAttribute(sHatchName
, xmlWriter
);
1438 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillHatch"_ustr
);
1439 drawing::Hatch aHatch
;
1440 if(anotherAny
>>= aHatch
)
1441 dumpFillHatchAsElement(aHatch
, xmlWriter
);
1444 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBackground"_ustr
);
1445 bool bFillBackground
;
1446 if(anotherAny
>>= bFillBackground
)
1447 dumpFillBackgroundAsAttribute(bFillBackground
, xmlWriter
);
1450 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapName"_ustr
);
1451 OUString sBitmapName
;
1452 if(anotherAny
>>= sBitmapName
)
1453 dumpFillGradientNameAsAttribute(sBitmapName
, xmlWriter
);
1456 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmap"_ustr
);
1457 uno::Reference
<awt::XBitmap
> xBitmap
;
1458 if(anotherAny
>>= xBitmap
)
1459 dumpFillBitmapAsElement(xBitmap
, xmlWriter
);
1462 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapPositionOffsetX"_ustr
);
1463 sal_Int32 aBitmapPositionOffsetX
= sal_Int32();
1464 if(anotherAny
>>= aBitmapPositionOffsetX
)
1465 dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX
, xmlWriter
);
1468 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapPositionOffsetY"_ustr
);
1469 sal_Int32 aBitmapPositionOffsetY
= sal_Int32();
1470 if(anotherAny
>>= aBitmapPositionOffsetY
)
1471 dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY
, xmlWriter
);
1474 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapOffsetX"_ustr
);
1475 sal_Int32 aBitmapOffsetX
= sal_Int32();
1476 if(anotherAny
>>= aBitmapOffsetX
)
1477 dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX
, xmlWriter
);
1480 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapOffsetY"_ustr
);
1481 sal_Int32 aBitmapOffsetY
= sal_Int32();
1482 if(anotherAny
>>= aBitmapOffsetY
)
1483 dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY
, xmlWriter
);
1486 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapRectanglePoint"_ustr
);
1487 drawing::RectanglePoint eBitmapRectanglePoint
;
1488 if(anotherAny
>>= eBitmapRectanglePoint
)
1489 dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint
, xmlWriter
);
1492 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapLogicalSize"_ustr
);
1493 bool bBitmapLogicalSize
;
1494 if(anotherAny
>>= bBitmapLogicalSize
)
1495 dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize
, xmlWriter
);
1498 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapSizeX"_ustr
);
1499 sal_Int32 aBitmapSizeX
= sal_Int32();
1500 if(anotherAny
>>= aBitmapSizeX
)
1501 dumpFillBitmapSizeXAsAttribute(aBitmapSizeX
, xmlWriter
);
1504 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapSizeY"_ustr
);
1505 sal_Int32 aBitmapSizeY
= sal_Int32();
1506 if(anotherAny
>>= aBitmapSizeY
)
1507 dumpFillBitmapSizeYAsAttribute(aBitmapSizeY
, xmlWriter
);
1510 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapMode"_ustr
);
1511 drawing::BitmapMode eBitmapMode
;
1512 if(anotherAny
>>= eBitmapMode
)
1513 dumpFillBitmapModeAsAttribute(eBitmapMode
, xmlWriter
);
1516 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapStretch"_ustr
);
1517 bool bBitmapStretch
;
1518 if(anotherAny
>>= bBitmapStretch
)
1519 dumpFillBitmapStretchAsAttribute(bBitmapStretch
, xmlWriter
);
1522 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"FillBitmapTile"_ustr
);
1524 if(anotherAny
>>= bBitmapTile
)
1525 dumpFillBitmapTileAsAttribute(bBitmapTile
, xmlWriter
);
1529 void dumpLinePropertiesService(const uno::Reference
< beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
)
1532 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineStyle"_ustr
);
1533 drawing::LineStyle eLineStyle
;
1534 if(anotherAny
>>= eLineStyle
)
1535 dumpLineStyleAsAttribute(eLineStyle
, xmlWriter
);
1538 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineDash"_ustr
);
1539 drawing::LineDash aLineDash
;
1540 if(anotherAny
>>= aLineDash
)
1541 dumpLineDashAsElement(aLineDash
, xmlWriter
);
1544 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineDashName"_ustr
);
1545 OUString sLineDashName
;
1546 if(anotherAny
>>= sLineDashName
)
1547 dumpLineDashNameAsAttribute(sLineDashName
, xmlWriter
);
1550 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineColor"_ustr
);
1551 sal_Int32 aLineColor
= sal_Int32();
1552 if(anotherAny
>>= aLineColor
)
1553 dumpLineColorAsAttribute(aLineColor
, xmlWriter
);
1556 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineTransparence"_ustr
);
1557 sal_Int32 aLineTransparence
= sal_Int32();
1558 if(anotherAny
>>= aLineTransparence
)
1559 dumpLineTransparenceAsAttribute(aLineTransparence
, xmlWriter
);
1562 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineWidth"_ustr
);
1563 sal_Int32 aLineWidth
= sal_Int32();
1564 if(anotherAny
>>= aLineWidth
)
1565 dumpLineWidthAsAttribute(aLineWidth
, xmlWriter
);
1568 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineJoint"_ustr
);
1569 drawing::LineJoint eLineJoint
;
1570 if(anotherAny
>>= eLineJoint
)
1571 dumpLineJointAsAttribute(eLineJoint
, xmlWriter
);
1574 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineStartName"_ustr
);
1575 OUString sLineStartName
;
1576 if(anotherAny
>>= sLineStartName
)
1577 dumpLineStartNameAsAttribute(sLineStartName
, xmlWriter
);
1580 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineEndName"_ustr
);
1581 OUString sLineEndName
;
1582 if(anotherAny
>>= sLineEndName
)
1583 dumpLineEndNameAsAttribute(sLineEndName
, xmlWriter
);
1586 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineStart"_ustr
);
1587 drawing::PolyPolygonBezierCoords aLineStart
;
1588 if(anotherAny
>>= aLineStart
)
1589 dumpLineStartAsElement(aLineStart
, xmlWriter
);
1592 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineEnd"_ustr
);
1593 drawing::PolyPolygonBezierCoords aLineEnd
;
1594 if(anotherAny
>>= aLineEnd
)
1595 dumpLineEndAsElement(aLineEnd
, xmlWriter
);
1598 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineStartCenter"_ustr
);
1599 bool bLineStartCenter
;
1600 if(anotherAny
>>= bLineStartCenter
)
1601 dumpLineStartCenterAsAttribute(bLineStartCenter
, xmlWriter
);
1604 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineStartWidth"_ustr
);
1605 sal_Int32 aLineStartWidth
= sal_Int32();
1606 if(anotherAny
>>= aLineStartWidth
)
1607 dumpLineStartWidthAsAttribute(aLineStartWidth
, xmlWriter
);
1610 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineEndCenter"_ustr
);
1611 bool bLineEndCenter
;
1612 if(anotherAny
>>= bLineEndCenter
)
1613 dumpLineEndCenterAsAttribute(bLineEndCenter
, xmlWriter
);
1616 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LineEndWidth"_ustr
);
1617 sal_Int32 aLineEndWidth
= sal_Int32();
1618 if(anotherAny
>>= aLineEndWidth
)
1619 dumpLineEndWidthAsAttribute(aLineEndWidth
, xmlWriter
);
1623 void dumpShadowPropertiesService(const uno::Reference
< beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
)
1626 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"Shadow"_ustr
);
1628 if(anotherAny
>>= bShadow
)
1629 dumpShadowAsAttribute(bShadow
, xmlWriter
);
1632 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"ShadowColor"_ustr
);
1633 sal_Int32 aShadowColor
= sal_Int32();
1634 if(anotherAny
>>= aShadowColor
)
1635 dumpShadowColorAsAttribute(aShadowColor
, xmlWriter
);
1638 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"ShadowTransparence"_ustr
);
1639 sal_Int32 aShadowTransparence
= sal_Int32();
1640 if(anotherAny
>>= aShadowTransparence
)
1641 dumpShadowTransparenceAsAttribute(aShadowTransparence
, xmlWriter
);
1644 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"ShadowXDistance"_ustr
);
1645 sal_Int32 aShadowXDistance
= sal_Int32();
1646 if(anotherAny
>>= aShadowXDistance
)
1647 dumpShadowXDistanceAsAttribute(aShadowXDistance
, xmlWriter
);
1650 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"ShadowYDistance"_ustr
);
1651 sal_Int32 aShadowYDistance
= sal_Int32();
1652 if(anotherAny
>>= aShadowYDistance
)
1653 dumpShadowYDistanceAsAttribute(aShadowYDistance
, xmlWriter
);
1657 void dumpPolyPolygonDescriptorService(const uno::Reference
< beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
)
1660 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"PolygonKind"_ustr
);
1661 drawing::PolygonKind ePolygonKind
;
1662 if(anotherAny
>>= ePolygonKind
)
1663 dumpPolygonKindAsAttribute(ePolygonKind
, xmlWriter
);
1666 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"PolyPolygon"_ustr
);
1667 drawing::PointSequenceSequence aPolyPolygon
;
1668 if(anotherAny
>>= aPolyPolygon
)
1669 dumpPolyPolygonAsElement(aPolyPolygon
, xmlWriter
);
1672 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"Geometry"_ustr
);
1673 drawing::PointSequenceSequence aGeometry
;
1674 if(anotherAny
>>= aGeometry
)
1675 dumpGeometryAsElement(aGeometry
, xmlWriter
);
1679 void dumpShapeService(const uno::Reference
< beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
, bool bDumpInteropProperties
)
1681 uno::Reference
< beans::XPropertySetInfo
> xInfo
= xPropSet
->getPropertySetInfo();
1683 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"ZOrder"_ustr
);
1684 sal_Int32 aZOrder
= sal_Int32();
1685 if(anotherAny
>>= aZOrder
)
1686 dumpZOrderAsAttribute(aZOrder
, xmlWriter
);
1689 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LayerID"_ustr
);
1690 sal_Int32 aLayerID
= sal_Int32();
1691 if(anotherAny
>>= aLayerID
)
1692 dumpLayerIDAsAttribute(aLayerID
, xmlWriter
);
1695 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"LayerName"_ustr
);
1696 OUString sLayerName
;
1697 if(anotherAny
>>= sLayerName
)
1698 dumpLayerNameAsAttribute(sLayerName
, xmlWriter
);
1701 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"Visible"_ustr
);
1703 if(anotherAny
>>= bVisible
)
1704 dumpVisibleAsAttribute(bVisible
, xmlWriter
);
1707 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"Printable"_ustr
);
1709 if(anotherAny
>>= bPrintable
)
1710 dumpPrintableAsAttribute(bPrintable
, xmlWriter
);
1713 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"MoveProtect"_ustr
);
1715 if(anotherAny
>>= bMoveProtect
)
1716 dumpMoveProtectAsAttribute(bMoveProtect
, xmlWriter
);
1719 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"Name"_ustr
);
1721 if(anotherAny
>>= sName
)
1722 dumpNameAsAttribute(sName
, xmlWriter
);
1725 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"SizeProtect"_ustr
);
1727 if(anotherAny
>>= bSizeProtect
)
1728 dumpSizeProtectAsAttribute(bSizeProtect
, xmlWriter
);
1731 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"Transformation"_ustr
);
1732 drawing::HomogenMatrix3 aTransformation
;
1733 if(anotherAny
>>= aTransformation
)
1734 dumpTransformationAsElement(aTransformation
, xmlWriter
);
1737 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"NavigationOrder"_ustr
);
1738 sal_Int32 aNavigationOrder
= sal_Int32();
1739 if(anotherAny
>>= aNavigationOrder
)
1740 dumpNavigationOrderAsAttribute(aNavigationOrder
, xmlWriter
);
1742 if(xInfo
->hasPropertyByName(u
"Hyperlink"_ustr
))
1744 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"Hyperlink"_ustr
);
1745 OUString sHyperlink
;
1746 if(anotherAny
>>= sHyperlink
)
1747 dumpHyperlinkAsAttribute(sHyperlink
, xmlWriter
);
1749 if(xInfo
->hasPropertyByName(u
"InteropGrabBag"_ustr
) && bDumpInteropProperties
)
1751 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"InteropGrabBag"_ustr
);
1752 uno::Sequence
< beans::PropertyValue
> aInteropGrabBag
;
1753 if(anotherAny
>>= aInteropGrabBag
)
1754 dumpInteropGrabBagAsElement(aInteropGrabBag
, xmlWriter
);
1758 void dumpPolyPolygonBezierDescriptorService(const uno::Reference
< beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
)
1761 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"PolygonKind"_ustr
);
1762 drawing::PolygonKind ePolygonKind
;
1763 if(anotherAny
>>= ePolygonKind
)
1764 dumpPolygonKindAsAttribute(ePolygonKind
, xmlWriter
);
1767 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"PolyPolygonBezier"_ustr
);
1768 drawing::PolyPolygonBezierCoords aPolyPolygonBezier
;
1769 if(anotherAny
>>= aPolyPolygonBezier
)
1770 dumpPolyPolygonBezierCoords(aPolyPolygonBezier
, xmlWriter
);
1773 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"Geometry"_ustr
);
1774 drawing::PolyPolygonBezierCoords aGeometry
;
1775 if(anotherAny
>>= aGeometry
)
1776 dumpPolyPolygonBezierCoords(aGeometry
, xmlWriter
);
1780 void dumpCustomShapeService(const uno::Reference
< beans::XPropertySet
>& xPropSet
, xmlTextWriterPtr xmlWriter
)
1782 uno::Reference
< beans::XPropertySetInfo
> xInfo
= xPropSet
->getPropertySetInfo();
1784 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"CustomShapeEngine"_ustr
);
1785 OUString sCustomShapeEngine
;
1786 if(anotherAny
>>= sCustomShapeEngine
)
1787 dumpCustomShapeEngineAsAttribute(sCustomShapeEngine
, xmlWriter
);
1790 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"CustomShapeData"_ustr
);
1791 OUString sCustomShapeData
;
1792 if(anotherAny
>>= sCustomShapeData
)
1793 dumpCustomShapeDataAsAttribute(sCustomShapeData
, xmlWriter
);
1796 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"CustomShapeGeometry"_ustr
);
1797 uno::Sequence
< beans::PropertyValue
> aCustomShapeGeometry
;
1798 if(anotherAny
>>= aCustomShapeGeometry
)
1799 dumpCustomShapeGeometryAsElement(aCustomShapeGeometry
, xmlWriter
);
1801 if(xInfo
->hasPropertyByName(u
"CustomShapeReplacementURL"_ustr
))
1803 uno::Any anotherAny
= xPropSet
->getPropertyValue(u
"CustomShapeReplacementURL"_ustr
);
1804 OUString sCustomShapeReplacementURL
;
1805 if(anotherAny
>>= sCustomShapeReplacementURL
)
1806 dumpCustomShapeReplacementURLAsAttribute(sCustomShapeReplacementURL
, xmlWriter
);
1810 void dumpXShape(const uno::Reference
< drawing::XShape
>& xShape
, xmlTextWriterPtr xmlWriter
, bool bDumpInteropProperties
)
1812 (void)xmlTextWriterStartElement( xmlWriter
, BAD_CAST( "XShape" ) );
1813 uno::Reference
< beans::XPropertySet
> xPropSet(xShape
, uno::UNO_QUERY_THROW
);
1815 m_bNameDumped
= false;
1817 dumpPositionAsAttribute(xShape
->getPosition(), xmlWriter
);
1818 dumpSizeAsAttribute(xShape
->getSize(), xmlWriter
);
1819 uno::Reference
< drawing::XShapeDescriptor
> xDescr(xShape
, uno::UNO_QUERY_THROW
);
1820 dumpShapeDescriptorAsAttribute(xDescr
, xmlWriter
);
1822 // uno::Sequence<beans::Property> aProperties = xPropSetInfo->getProperties();
1824 uno::Reference
< lang::XServiceInfo
> xServiceInfo( xShape
, uno::UNO_QUERY_THROW
);
1826 uno::Reference
< beans::XPropertySetInfo
> xInfo
= xPropSet
->getPropertySetInfo();
1827 if(xInfo
->hasPropertyByName(u
"Name"_ustr
))
1829 uno::Any aAny
= xPropSet
->getPropertyValue(u
"Name"_ustr
);
1830 if ((aAny
>>= aName
) && !aName
.isEmpty())
1832 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("name"), "%s", OUStringToOString(aName
, RTL_TEXTENCODING_UTF8
).getStr());
1833 m_bNameDumped
= true;
1839 if (xServiceInfo
->supportsService(u
"com.sun.star.drawing.Text"_ustr
))
1841 uno::Reference
< text::XText
> xText(xShape
, uno::UNO_QUERY_THROW
);
1842 OUString aText
= xText
->getString();
1843 if(!aText
.isEmpty())
1844 (void)xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("text"), "%s", OUStringToOString(aText
, RTL_TEXTENCODING_UTF8
).getStr());
1846 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.TextProperties"_ustr
))
1847 dumpTextPropertiesService(xPropSet
, xmlWriter
);
1849 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.GroupShape"_ustr
))
1851 uno::Reference
< drawing::XShapes
> xShapes(xShape
, uno::UNO_QUERY_THROW
);
1852 dumpXShapes(xShapes
, xmlWriter
, bDumpInteropProperties
);
1854 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.FillProperties"_ustr
))
1855 dumpFillPropertiesService(xPropSet
, xmlWriter
);
1857 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.LineProperties"_ustr
))
1858 dumpLinePropertiesService(xPropSet
, xmlWriter
);
1860 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.PolyPolygonDescriptor"_ustr
))
1861 dumpPolyPolygonDescriptorService(xPropSet
, xmlWriter
);
1863 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.ShadowProperties"_ustr
))
1864 dumpShadowPropertiesService(xPropSet
, xmlWriter
);
1866 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.Shape"_ustr
))
1867 dumpShapeService(xPropSet
, xmlWriter
, bDumpInteropProperties
);
1869 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.PolyPolygonBezierDescriptor"_ustr
))
1870 dumpPolyPolygonBezierDescriptorService(xPropSet
, xmlWriter
);
1872 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.CustomShape"_ustr
))
1873 dumpCustomShapeService(xPropSet
, xmlWriter
);
1875 // EnhancedShapeDumper used
1877 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.EnhancedCustomShapeExtrusion"_ustr
))
1879 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1880 enhancedDumper
.dumpEnhancedCustomShapeExtrusionService(xPropSet
);
1882 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.EnhancedCustomShapeGeometry"_ustr
))
1884 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1885 enhancedDumper
.dumpEnhancedCustomShapeGeometryService(xPropSet
);
1887 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.EnhancedCustomShapeHandle"_ustr
))
1889 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1890 enhancedDumper
.dumpEnhancedCustomShapeHandleService(xPropSet
);
1892 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.EnhancedCustomShapePath"_ustr
))
1894 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1895 enhancedDumper
.dumpEnhancedCustomShapePathService(xPropSet
);
1897 if(xServiceInfo
->supportsService(u
"com.sun.star.drawing.EnhancedCustomShapeTextPath"_ustr
))
1899 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1900 enhancedDumper
.dumpEnhancedCustomShapeTextPathService(xPropSet
);
1902 } // end of the 'try' block
1903 catch (const beans::UnknownPropertyException
& e
)
1905 std::cout
<< "Exception caught in XShapeDumper.cxx: " << e
.Message
<< std::endl
;
1909 uno::Sequence
< OUString
> aServiceNames
= xServiceInfo
->getSupportedServiceNames();
1910 sal_Int32 nServices
= aServiceNames
.getLength();
1911 for (sal_Int32 i
= 0; i
< nServices
; ++i
)
1913 (void)xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "ServiceName" ));
1914 (void)xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST( "name" ), "%s", OUStringToOString(aServiceNames
[i
], RTL_TEXTENCODING_UTF8
).getStr());
1915 (void)xmlTextWriterEndElement( xmlWriter
);
1919 (void)xmlTextWriterEndElement( xmlWriter
);
1922 void dumpXShapes( const uno::Reference
< drawing::XShapes
>& xShapes
, xmlTextWriterPtr xmlWriter
, bool bDumpInteropProperties
)
1924 (void)xmlTextWriterStartElement( xmlWriter
, BAD_CAST( "XShapes" ) );
1925 uno::Reference
< container::XIndexAccess
> xIA( xShapes
, uno::UNO_QUERY_THROW
);
1926 sal_Int32 nLength
= xIA
->getCount();
1927 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
1929 uno::Reference
< drawing::XShape
> xShape( xIA
->getByIndex( i
), uno::UNO_QUERY_THROW
);
1930 dumpXShape( xShape
, xmlWriter
, bDumpInteropProperties
);
1933 (void)xmlTextWriterEndElement( xmlWriter
);
1935 } //end of namespace
1937 OUString
XShapeDumper::dump(const uno::Reference
<drawing::XShapes
>& xPageShapes
, bool bDumpInteropProperties
)
1939 OStringBuffer aString
;
1940 xmlOutputBufferPtr xmlOutBuffer
= xmlOutputBufferCreateIO( writeCallback
, closeCallback
, &aString
, nullptr );
1941 xmlTextWriterPtr xmlWriter
= xmlNewTextWriter( xmlOutBuffer
);
1942 xmlTextWriterSetIndent( xmlWriter
, 1 );
1944 (void)xmlTextWriterStartDocument( xmlWriter
, nullptr, nullptr, nullptr );
1948 dumpXShapes( xPageShapes
, xmlWriter
, bDumpInteropProperties
);
1950 catch (const beans::UnknownPropertyException
& e
)
1952 std::cout
<< "Exception caught in XShapeDumper: " << e
.Message
<< std::endl
;
1955 (void)xmlTextWriterEndDocument( xmlWriter
);
1956 xmlFreeTextWriter( xmlWriter
);
1958 return OUString::fromUtf8(aString
);
1961 OUString
XShapeDumper::dump(const uno::Reference
<drawing::XShape
>& xPageShapes
, bool bDumpInteropProperties
)
1963 OStringBuffer aString
;
1964 xmlOutputBufferPtr xmlOutBuffer
= xmlOutputBufferCreateIO( writeCallback
, closeCallback
, &aString
, nullptr );
1965 xmlTextWriterPtr xmlWriter
= xmlNewTextWriter( xmlOutBuffer
);
1966 xmlTextWriterSetIndent( xmlWriter
, 1 );
1968 (void)xmlTextWriterStartDocument( xmlWriter
, nullptr, nullptr, nullptr );
1972 dumpXShape( xPageShapes
, xmlWriter
, bDumpInteropProperties
);
1974 catch (const beans::UnknownPropertyException
& e
)
1976 std::cout
<< "Exception caught in XShapeDumper: " << e
.Message
<< std::endl
;
1979 (void)xmlTextWriterEndDocument( xmlWriter
);
1980 xmlFreeTextWriter( xmlWriter
);
1982 return OUString::fromUtf8(aString
);
1985 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */