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/lang/XServiceInfo.hpp>
15 #include <com/sun/star/beans/XPropertySet.hpp>
16 #include <com/sun/star/text/XText.hpp>
17 #include <rtl/strbuf.hxx>
18 #include <libxml/xmlwriter.h>
20 #include <rtl/ustring.hxx>
22 #define DEBUG_DUMPER 0
24 using namespace com::sun::star
;
27 XShapeDumper::XShapeDumper()
34 // FUNCTION DECLARATIONS
36 // auxiliary functions
37 void dumpGradientProperty(com::sun::star::awt::Gradient aGradient
, xmlTextWriterPtr xmlWriter
);
38 void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords
, xmlTextWriterPtr xmlWriter
);
39 void dumpPointSequenceSequence(com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence
, uno::Sequence
<uno::Sequence
<drawing::PolygonFlags
> >*, xmlTextWriterPtr xmlWriter
);
42 void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle
, xmlTextWriterPtr xmlWriter
);
43 void dumpFillColorAsAttribute(sal_Int32 aColor
, xmlTextWriterPtr xmlWriter
);
44 void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence
, xmlTextWriterPtr xmlWriter
);
45 void dumpFillTransparenceGradientNameAsAttribute(OUString sTranspGradName
, xmlTextWriterPtr xmlWriter
);
46 void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad
, xmlTextWriterPtr xmlWriter
);
47 void dumpFillGradientNameAsAttribute(OUString sGradName
, xmlTextWriterPtr xmlWriter
);
48 void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient
, xmlTextWriterPtr xmlWriter
);
49 void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch
, xmlTextWriterPtr xmlWriter
);
50 void dumpFillBackgroundAsAttribute(sal_Bool bBackground
, xmlTextWriterPtr xmlWriter
);
51 void dumpFillBitmapAsElement(com::sun::star::uno::Reference
<com::sun::star::awt::XBitmap
> xBitmap
, xmlTextWriterPtr xmlWriter
);
52 void dumpFillBitmapURLAsAttribute(OUString sBitmapURL
, xmlTextWriterPtr xmlWriter
);
53 void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX
, xmlTextWriterPtr xmlWriter
);
54 void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY
, xmlTextWriterPtr xmlWriter
);
55 void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX
, xmlTextWriterPtr xmlWriter
);
56 void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY
, xmlTextWriterPtr xmlWriter
);
57 void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint
, xmlTextWriterPtr xmlWriter
);
58 void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize
, xmlTextWriterPtr xmlWriter
);
59 void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX
, xmlTextWriterPtr xmlWriter
);
60 void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY
, xmlTextWriterPtr xmlWriter
);
61 void dumpFillBitmapModeAsAttribute(com::sun::star::drawing::BitmapMode eBitmapMode
, xmlTextWriterPtr xmlWriter
);
62 void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch
, xmlTextWriterPtr xmlWriter
);
63 void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile
, xmlTextWriterPtr xmlWriter
);
66 void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle
, xmlTextWriterPtr xmlWriter
);
67 void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash
, xmlTextWriterPtr xmlWriter
);
68 void dumpLineDashNameAsAttribute(OUString sLineDashName
, xmlTextWriterPtr xmlWriter
);
69 void dumpLineColorAsAttribute(sal_Int32 aLineColor
, xmlTextWriterPtr xmlWriter
);
70 void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence
, xmlTextWriterPtr xmlWriter
);
71 void dumpLineWidthAsAttribute(sal_Int32 aLineWidth
, xmlTextWriterPtr xmlWriter
);
72 void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint
, xmlTextWriterPtr xmlWriter
);
73 void dumpLineStartNameAsAttribute(OUString sLineStartName
, xmlTextWriterPtr xmlWriter
);
74 void dumpLineEndNameAsAttribute(OUString sLineEndName
, xmlTextWriterPtr xmlWriter
);
75 void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart
, xmlTextWriterPtr xmlWriter
);
76 void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd
, xmlTextWriterPtr xmlWriter
);
77 void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter
, xmlTextWriterPtr xmlWriter
);
78 void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth
, xmlTextWriterPtr xmlWriter
);
79 void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter
, xmlTextWriterPtr xmlWriter
);
80 void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth
, xmlTextWriterPtr xmlWriter
);
82 // PolyPolygonDescriptor.idl
83 void dumpPolygonKindAsAttribute(com::sun::star::drawing::PolygonKind ePolygonKind
, xmlTextWriterPtr xmlWriter
);
84 void dumpPolyPolygonAsElement(com::sun::star::drawing::PointSequenceSequence aPolyPolygon
, xmlTextWriterPtr xmlWriter
);
85 void dumpGeometryAsElement(com::sun::star::drawing::PointSequenceSequence aGeometry
, xmlTextWriterPtr xmlWriter
);
87 // CharacterProperties.idl
88 void dumpCharHeightAsAttribute(float fHeight
, xmlTextWriterPtr xmlWriter
);
89 void dumpCharColorAsAttribute(sal_Int32 aColor
, xmlTextWriterPtr xmlWriter
);
92 void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering
, xmlTextWriterPtr xmlWriter
);
93 void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight
, xmlTextWriterPtr xmlWriter
);
94 void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth
, xmlTextWriterPtr xmlWriter
);
95 void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame
, xmlTextWriterPtr xmlWriter
);
96 void dumpTextFitToSizeAsAttribute(com::sun::star::drawing::TextFitToSizeType eTextFitToSize
, xmlTextWriterPtr xmlWriter
);
97 void dumpTextHorizontalAdjustAsAttribute(com::sun::star::drawing::TextHorizontalAdjust eTextHorizontalAdjust
, xmlTextWriterPtr xmlWriter
);
98 void dumpTextVerticalAdjustAsAttribute(com::sun::star::drawing::TextVerticalAdjust eTextVerticalAdjust
, xmlTextWriterPtr xmlWriter
);
99 void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance
, xmlTextWriterPtr xmlWriter
);
100 void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance
, xmlTextWriterPtr xmlWriter
);
101 void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance
, xmlTextWriterPtr xmlWriter
);
102 void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance
, xmlTextWriterPtr xmlWriter
);
103 void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight
, xmlTextWriterPtr xmlWriter
);
104 void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth
, xmlTextWriterPtr xmlWriter
);
105 void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight
, xmlTextWriterPtr xmlWriter
);
106 void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth
, xmlTextWriterPtr xmlWriter
);
107 void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount
, xmlTextWriterPtr xmlWriter
);
108 void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount
, xmlTextWriterPtr xmlWriter
);
109 void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay
, xmlTextWriterPtr xmlWriter
);
110 void dumpTextAnimationDirectionAsAttribute(com::sun::star::drawing::TextAnimationDirection eTextAnimationDirection
, xmlTextWriterPtr xmlWriter
);
111 void dumpTextAnimationKindAsAttribute(com::sun::star::drawing::TextAnimationKind eTextAnimationKind
, xmlTextWriterPtr xmlWriter
);
112 void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside
, xmlTextWriterPtr xmlWriter
);
113 void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside
, xmlTextWriterPtr xmlWriter
);
114 void dumpTextWritingModeAsAttribute(com::sun::star::text::WritingMode eWritingMode
, xmlTextWriterPtr xmlWriter
);
116 // ShadowProperties.idl
117 void dumpShadowAsAttribute(sal_Bool bShadow
, xmlTextWriterPtr xmlWriter
);
118 void dumpShadowColorAsAttribute(sal_Int32 aShadowColor
, xmlTextWriterPtr xmlWriter
);
119 void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence
, xmlTextWriterPtr xmlWriter
);
120 void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance
, xmlTextWriterPtr xmlWriter
);
121 void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance
, xmlTextWriterPtr xmlWriter
);
124 void dumpZOrderAsAttribute(sal_Int32 aZOrder
, xmlTextWriterPtr xmlWriter
);
125 void dumpLayerIDAsAttribute(sal_Int32 aLayerID
, xmlTextWriterPtr xmlWriter
);
126 void dumpLayerNameAsAttribute(OUString sLayerName
, xmlTextWriterPtr xmlWriter
);
127 void dumpVisibleAsAttribute(sal_Bool bVisible
, xmlTextWriterPtr xmlWriter
);
128 void dumpPrintableAsAttribute(sal_Bool bPrintable
, xmlTextWriterPtr xmlWriter
);
129 void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect
, xmlTextWriterPtr xmlWriter
);
130 void dumpNameAsAttribute(OUString sName
, xmlTextWriterPtr xmlWriter
);
131 void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect
, xmlTextWriterPtr xmlWriter
);
132 void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine
, xmlTextWriterPtr xmlWriter
);
133 void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 aTransformation
, xmlTextWriterPtr xmlWriter
);
134 void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder
, xmlTextWriterPtr xmlWriter
);
135 void dumpHyperlinkAsAttribute(OUString sHyperlink
, xmlTextWriterPtr xmlWriter
);
138 void dumpCustomShapeEngineAsAttribute(OUString sCustomShapeEngine
, xmlTextWriterPtr xmlWriter
);
139 void dumpCustomShapeDataAsAttribute(OUString sCustomShapeData
, xmlTextWriterPtr xmlWriter
);
140 void dumpCustomShapeGeometryAsElement(com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> aCustomShapeGeometry
, xmlTextWriterPtr xmlWriter
);
141 void dumpCustomShapeReplacementURLAsAttribute(OUString sCustomShapeReplacementURL
, xmlTextWriterPtr xmlWriter
);
144 void dumpPositionAsAttribute(const com::sun::star::awt::Point
& rPoint
, xmlTextWriterPtr xmlWriter
);
145 void dumpSizeAsAttribute(const com::sun::star::awt::Size
& rSize
, xmlTextWriterPtr xmlWriter
);
148 void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference
< com::sun::star::drawing::XShapeDescriptor
> xDescr
, xmlTextWriterPtr xmlWriter
);
149 void dumpXShape(com::sun::star::uno::Reference
< com::sun::star::drawing::XShape
> xShape
, xmlTextWriterPtr xmlWriter
);
150 void dumpXShapes( com::sun::star::uno::Reference
< com::sun::star::drawing::XShapes
> xShapes
, xmlTextWriterPtr xmlWriter
);
151 void dumpTextPropertiesService(com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
);
152 void dumpFillPropertiesService(com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
);
153 void dumpLinePropertiesService(com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
);
154 void dumpShadowPropertiesService(com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
);
155 void dumpPolyPolygonDescriptorService(com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
);
156 void dumpShapeService(com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
);
157 void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
);
158 void dumpCustomShapeService(com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
);
161 int writeCallback(void* pContext
, const char* sBuffer
, int nLen
)
163 OStringBuffer
* pBuffer
= static_cast<OStringBuffer
*>(pContext
);
164 pBuffer
->append(sBuffer
);
168 int closeCallback(void* )
173 // ----------------------------------------
174 // ---------- FillProperties.idl ----------
175 // ----------------------------------------
176 void dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle
, xmlTextWriterPtr xmlWriter
)
180 case drawing::FillStyle_NONE
:
181 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "NONE");
183 case drawing::FillStyle_SOLID
:
184 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "SOLID");
186 case drawing::FillStyle_GRADIENT
:
187 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "GRADIENT");
189 case drawing::FillStyle_HATCH
:
190 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "HATCH");
192 case drawing::FillStyle_BITMAP
:
193 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillStyle"), "%s", "BITMAP");
200 void dumpFillColorAsAttribute(sal_Int32 aColor
, xmlTextWriterPtr xmlWriter
)
202 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillColor"), "%06x", (unsigned int) aColor
);
205 void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence
, xmlTextWriterPtr xmlWriter
)
207 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32
, aTransparence
);
210 void dumpFillTransparenceGradientNameAsAttribute(OUString sTranspGradName
, xmlTextWriterPtr xmlWriter
)
212 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillTransparenceGradientName"), "%s",
213 OUStringToOString(sTranspGradName
, RTL_TEXTENCODING_UTF8
).getStr());
216 //because there's more awt::Gradient properties to dump
217 void dumpGradientProperty(awt::Gradient aGradient
, xmlTextWriterPtr xmlWriter
)
219 switch(aGradient
.Style
) //enum GradientStyle
221 case awt::GradientStyle_LINEAR
:
222 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "LINEAR");
224 case awt::GradientStyle_AXIAL
:
225 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "AXIAL");
227 case awt::GradientStyle_RADIAL
:
228 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "RADIAL");
230 case awt::GradientStyle_ELLIPTICAL
:
231 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "ELLIPTICAL");
233 case awt::GradientStyle_SQUARE
:
234 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "SQUARE");
236 case awt::GradientStyle_RECT
:
237 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "RECT");
242 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("startColor"), "%06x", (unsigned int) aGradient
.StartColor
);
243 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("endColor"), "%06x", (unsigned int) aGradient
.EndColor
);
244 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("angle"), "%" SAL_PRIdINT32
, (sal_Int32
) aGradient
.Angle
);
245 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("border"), "%" SAL_PRIdINT32
, (sal_Int32
) aGradient
.Border
);
246 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("xOffset"), "%" SAL_PRIdINT32
, (sal_Int32
) aGradient
.XOffset
);
247 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("yOffset"), "%" SAL_PRIdINT32
, (sal_Int32
) aGradient
.YOffset
);
248 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32
, (sal_Int32
) aGradient
.StartIntensity
);
249 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32
, (sal_Int32
) aGradient
.EndIntensity
);
250 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("stepCount"), "%" SAL_PRIdINT32
, (sal_Int32
) aGradient
.StepCount
);
253 void dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad
, xmlTextWriterPtr xmlWriter
)
255 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FillTransparenceGradient" ));
256 dumpGradientProperty(aTranspGrad
, xmlWriter
);
257 xmlTextWriterEndElement( xmlWriter
);
260 void dumpFillGradientNameAsAttribute(OUString sGradName
, xmlTextWriterPtr xmlWriter
)
262 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillGradientName"), "%s",
263 OUStringToOString(sGradName
, RTL_TEXTENCODING_UTF8
).getStr());
266 void dumpFillGradientAsElement(awt::Gradient aGradient
, xmlTextWriterPtr xmlWriter
)
268 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FillGradient" ));
269 dumpGradientProperty(aGradient
, xmlWriter
);
270 xmlTextWriterEndElement( xmlWriter
);
273 void dumpFillHatchAsElement(drawing::Hatch aHatch
, xmlTextWriterPtr xmlWriter
)
275 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FillHatch" ));
278 case drawing::HatchStyle_SINGLE
:
279 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "SINGLE");
281 case drawing::HatchStyle_DOUBLE
:
282 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "DOUBLE");
284 case drawing::HatchStyle_TRIPLE
:
285 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "TRIPLE");
290 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("color"), "%06x", (unsigned int) aHatch
.Color
);
291 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("distance"), "%" SAL_PRIdINT32
, (sal_Int32
) aHatch
.Distance
);
292 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("angle"), "%" SAL_PRIdINT32
, (sal_Int32
) aHatch
.Angle
);
293 xmlTextWriterEndElement( xmlWriter
);
296 void dumpFillBackgroundAsAttribute(sal_Bool bBackground
, xmlTextWriterPtr xmlWriter
)
299 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBackground"), "%s", "true");
301 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBackground"), "%s", "false");
304 void dumpFillBitmapAsElement(uno::Reference
<awt::XBitmap
> xBitmap
, xmlTextWriterPtr xmlWriter
)
306 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "FillBitmap" ));
309 awt::Size
const aSize
= xBitmap
->getSize();
310 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("width"), "%" SAL_PRIdINT32
, aSize
.Width
);
311 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("height"), "%" SAL_PRIdINT32
, aSize
.Height
);
313 xmlTextWriterEndElement( xmlWriter
);
316 void dumpFillBitmapURLAsAttribute(OUString sBitmapURL
, xmlTextWriterPtr xmlWriter
)
318 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapURL"), "%s",
319 OUStringToOString(sBitmapURL
, RTL_TEXTENCODING_UTF8
).getStr());
322 void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX
, xmlTextWriterPtr xmlWriter
)
324 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapPositionOffsetX"), "%" SAL_PRIdINT32
, aBitmapPositionOffsetX
);
327 void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY
, xmlTextWriterPtr xmlWriter
)
329 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapPositionOffsetY"), "%" SAL_PRIdINT32
, aBitmapPositionOffsetY
);
332 void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX
, xmlTextWriterPtr xmlWriter
)
334 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapOffsetX"), "%" SAL_PRIdINT32
, aBitmapOffsetX
);
337 void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY
, xmlTextWriterPtr xmlWriter
)
339 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapOffsetY"), "%" SAL_PRIdINT32
, aBitmapOffsetY
);
342 void dumpFillBitmapRectanglePointAsAttribute(drawing::RectanglePoint eBitmapRectanglePoint
, xmlTextWriterPtr xmlWriter
)
344 switch(eBitmapRectanglePoint
)
346 case drawing::RectanglePoint_LEFT_TOP
:
347 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_TOP");
349 case drawing::RectanglePoint_MIDDLE_TOP
:
350 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_TOP");
352 case drawing::RectanglePoint_RIGHT_TOP
:
353 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_TOP");
355 case drawing::RectanglePoint_LEFT_MIDDLE
:
356 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_MIDDLE");
358 case drawing::RectanglePoint_MIDDLE_MIDDLE
:
359 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_MIDDLE");
361 case drawing::RectanglePoint_RIGHT_MIDDLE
:
362 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_MIDDLE");
364 case drawing::RectanglePoint_LEFT_BOTTOM
:
365 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_BOTTOM");
367 case drawing::RectanglePoint_MIDDLE_BOTTOM
:
368 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_BOTTOM");
370 case drawing::RectanglePoint_RIGHT_BOTTOM
:
371 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_BOTTOM");
378 void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize
, xmlTextWriterPtr xmlWriter
)
380 if(bBitmapLogicalSize
)
381 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapLogicalSize"), "%s", "true");
383 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapLogicalSize"), "%s", "false");
386 void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX
, xmlTextWriterPtr xmlWriter
)
388 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapSizeX"), "%" SAL_PRIdINT32
, aBitmapSizeX
);
391 void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY
, xmlTextWriterPtr xmlWriter
)
393 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fillBitmapSizeY"), "%" SAL_PRIdINT32
, aBitmapSizeY
);
396 void dumpFillBitmapModeAsAttribute(drawing::BitmapMode eBitmapMode
, xmlTextWriterPtr xmlWriter
)
400 case drawing::BitmapMode_REPEAT
:
401 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapMode"), "%s", "REPEAT");
403 case drawing::BitmapMode_STRETCH
:
404 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapMode"), "%s", "STRETCH");
406 case drawing::BitmapMode_NO_REPEAT
:
407 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapMode"), "%s", "NO_REPEAT");
414 void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch
, xmlTextWriterPtr xmlWriter
)
417 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapStretch"), "%s", "true");
419 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapStretch"), "%s", "false");
422 void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile
, xmlTextWriterPtr xmlWriter
)
425 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapTile"), "%s", "true");
427 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fillBitmapTile"), "%s", "false");
430 // ----------------------------------------
431 // ---------- LineProperties.idl ----------
432 // ----------------------------------------
434 void dumpLineStyleAsAttribute(drawing::LineStyle eLineStyle
, xmlTextWriterPtr xmlWriter
)
438 case drawing::LineStyle_NONE
:
439 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStyle"), "%s", "NONE");
441 case drawing::LineStyle_SOLID
:
442 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStyle"), "%s", "SOLID");
444 case drawing::LineStyle_DASH
:
445 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStyle"), "%s", "DASH");
452 void dumpLineDashAsElement(drawing::LineDash aLineDash
, xmlTextWriterPtr xmlWriter
)
454 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "LineDash" ));
455 switch(aLineDash
.Style
)
457 case drawing::DashStyle_RECT
:
458 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "RECT");
460 case drawing::DashStyle_ROUND
:
461 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "ROUND");
463 case drawing::DashStyle_RECTRELATIVE
:
464 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "RECTRELATIVE");
466 case drawing::DashStyle_ROUNDRELATIVE
:
467 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("style"), "%s", "ROUNDRELATIVE");
472 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("dots"), "%" SAL_PRIdINT32
, (sal_Int32
) aLineDash
.Dots
);
473 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("dotLen"), "%" SAL_PRIdINT32
, (sal_Int32
) aLineDash
.DotLen
);
474 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("dashes"), "%" SAL_PRIdINT32
, (sal_Int32
) aLineDash
.Dashes
);
475 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("dashLen"), "%" SAL_PRIdINT32
, (sal_Int32
) aLineDash
.DashLen
);
476 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("distance"), "%" SAL_PRIdINT32
, (sal_Int32
) aLineDash
.Distance
);
477 xmlTextWriterEndElement( xmlWriter
);
480 void dumpLineDashNameAsAttribute(OUString sLineDashName
, xmlTextWriterPtr xmlWriter
)
482 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineDashName"), "%s",
483 OUStringToOString(sLineDashName
, RTL_TEXTENCODING_UTF8
).getStr());
486 void dumpLineColorAsAttribute(sal_Int32 aLineColor
, xmlTextWriterPtr xmlWriter
)
488 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineColor"), "%06x", (unsigned int) aLineColor
);
491 void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence
, xmlTextWriterPtr xmlWriter
)
493 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32
, aLineTransparence
);
496 void dumpLineWidthAsAttribute(sal_Int32 aLineWidth
, xmlTextWriterPtr xmlWriter
)
498 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32
, aLineWidth
);
501 void dumpLineJointAsAttribute(drawing::LineJoint eLineJoint
, xmlTextWriterPtr xmlWriter
)
505 case drawing::LineJoint_NONE
:
506 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "NONE");
508 case drawing::LineJoint_MIDDLE
:
509 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "MIDDLE");
511 case drawing::LineJoint_BEVEL
:
512 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "BEVEL");
514 case drawing::LineJoint_MITER
:
515 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "MITER");
517 case drawing::LineJoint_ROUND
:
518 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineJoint"), "%s", "ROUND");
525 void dumpLineStartNameAsAttribute(OUString sLineStartName
, xmlTextWriterPtr xmlWriter
)
527 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineStartName"), "%s",
528 OUStringToOString(sLineStartName
, RTL_TEXTENCODING_UTF8
).getStr());
531 void dumpLineEndNameAsAttribute(OUString sLineEndName
, xmlTextWriterPtr xmlWriter
)
533 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineEndName"), "%s",
534 OUStringToOString(sLineEndName
, RTL_TEXTENCODING_UTF8
).getStr());
537 void dumpPolyPolygonBezierCoords(drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords
, xmlTextWriterPtr xmlWriter
)
539 dumpPointSequenceSequence(aPolyPolygonBezierCoords
.Coordinates
, &aPolyPolygonBezierCoords
.Flags
, xmlWriter
);
542 void dumpLineStartAsElement(drawing::PolyPolygonBezierCoords aLineStart
, xmlTextWriterPtr xmlWriter
)
544 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "LineStart" ));
545 dumpPolyPolygonBezierCoords(aLineStart
, xmlWriter
);
546 xmlTextWriterEndElement( xmlWriter
);
549 void dumpLineEndAsElement(drawing::PolyPolygonBezierCoords aLineEnd
, xmlTextWriterPtr xmlWriter
)
551 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "LineEnd" ));
552 dumpPolyPolygonBezierCoords(aLineEnd
, xmlWriter
);
553 xmlTextWriterEndElement( xmlWriter
);
556 void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter
, xmlTextWriterPtr xmlWriter
)
559 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStartCenter"), "%s", "true");
561 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineStartCenter"), "%s", "false");
564 void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth
, xmlTextWriterPtr xmlWriter
)
566 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32
, aLineStartWidth
);
569 void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter
, xmlTextWriterPtr xmlWriter
)
572 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineEndCenter"), "%s", "true");
574 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("lineEndCenter"), "%s", "false");
577 void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth
, xmlTextWriterPtr xmlWriter
)
579 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32
, aLineEndWidth
);
582 // -----------------------------------------------
583 // ---------- PolyPolygonDescriptor.idl ----------
584 // -----------------------------------------------
586 void dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind
, xmlTextWriterPtr xmlWriter
)
590 case drawing::PolygonKind_LINE
:
591 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "LINE");
593 case drawing::PolygonKind_POLY
:
594 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "POLY");
596 case drawing::PolygonKind_PLIN
:
597 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PLIN");
599 case drawing::PolygonKind_PATHLINE
:
600 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PATHLINE");
602 case drawing::PolygonKind_PATHFILL
:
603 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PATHFILL");
605 case drawing::PolygonKind_FREELINE
:
606 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "FREELINE");
608 case drawing::PolygonKind_FREEFILL
:
609 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "FREEFILL");
611 case drawing::PolygonKind_PATHPOLY
:
612 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PATHPOLY");
614 case drawing::PolygonKind_PATHPLIN
:
615 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonKind"), "%s", "PATHPLIN");
622 void dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence
, uno::Sequence
<uno::Sequence
< drawing::PolygonFlags
> >* pFlags
, xmlTextWriterPtr xmlWriter
)
624 // LibreOffice proudly presents - The Sequenception
625 uno::Sequence
<uno::Sequence
< awt::Point
> > pointSequenceSequence
= aPointSequenceSequence
;
626 sal_Int32 nPointsSequence
= pointSequenceSequence
.getLength();
628 for (sal_Int32 i
= 0; i
< nPointsSequence
; ++i
)
630 uno::Sequence
< awt::Point
> pointSequence
= pointSequenceSequence
[i
];
631 sal_Int32 nPoints
= pointSequence
.getLength();
633 uno::Sequence
< drawing::PolygonFlags
> flagsSequence
;
635 flagsSequence
= (*pFlags
)[i
];
637 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "pointSequence" ));
639 for(sal_Int32 j
= 0; j
< nPoints
; ++j
)
641 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "point" ));
642 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("positionX"), "%" SAL_PRIdINT32
, pointSequence
[j
].X
);
643 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("positionY"), "%" SAL_PRIdINT32
, pointSequence
[j
].Y
);
647 switch(flagsSequence
[j
])
649 case drawing::PolygonFlags_NORMAL
:
650 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonFlags"), "%s", "NORMAL");
652 case drawing::PolygonFlags_SMOOTH
:
653 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonFlags"), "%s", "SMOOTH");
655 case drawing::PolygonFlags_CONTROL
:
656 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonFlags"), "%s", "CONTROL");
658 case drawing::PolygonFlags_SYMMETRIC
:
659 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("polygonFlags"), "%s", "SYMMETRIC");
666 xmlTextWriterEndElement( xmlWriter
);
668 xmlTextWriterEndElement( xmlWriter
);
672 void dumpPolyPolygonAsElement(drawing::PointSequenceSequence aPolyPolygon
, xmlTextWriterPtr xmlWriter
)
674 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PolyPolygon" ));
675 dumpPointSequenceSequence(aPolyPolygon
, NULL
, xmlWriter
);
676 xmlTextWriterEndElement( xmlWriter
);
679 void dumpGeometryAsElement(drawing::PointSequenceSequence aGeometry
, xmlTextWriterPtr xmlWriter
)
681 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Geometry" ));
682 dumpPointSequenceSequence(aGeometry
, NULL
, xmlWriter
);
683 xmlTextWriterEndElement( xmlWriter
);
686 // CharacterProperties.idl
687 void dumpCharHeightAsAttribute(float fHeight
, xmlTextWriterPtr xmlWriter
)
689 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("fontHeight"), "%f", fHeight
);
692 void dumpCharColorAsAttribute(sal_Int32 aColor
, xmlTextWriterPtr xmlWriter
)
694 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("fontColor"), "%06x", (unsigned int) aColor
);
697 // ----------------------------------------
698 // ---------- TextProperties.idl ----------
699 // ----------------------------------------
701 void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering
, xmlTextWriterPtr xmlWriter
)
704 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("isNumbering"), "%s", "true");
706 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("isNumbering"), "%s", "false");
709 void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight
, xmlTextWriterPtr xmlWriter
)
711 if(bTextAutoGrowHeight
)
712 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAutoGrowHeight"), "%s", "true");
714 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAutoGrowHeight"), "%s", "false");
717 void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth
, xmlTextWriterPtr xmlWriter
)
719 if(bTextAutoGrowWidth
)
720 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAutoGrowWidth"), "%s", "true");
722 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAutoGrowWidth"), "%s", "false");
725 void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame
, xmlTextWriterPtr xmlWriter
)
727 if(bTextContourFrame
)
728 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textContourFrame"), "%s", "true");
730 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textContourFrame"), "%s", "false");
733 void dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize
, xmlTextWriterPtr xmlWriter
)
735 switch(eTextFitToSize
)
737 case drawing::TextFitToSizeType_NONE
:
738 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textFitToSize"), "%s", "NONE");
740 case drawing::TextFitToSizeType_PROPORTIONAL
:
741 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textFitToSize"), "%s", "PROPORTIONAL");
743 case drawing::TextFitToSizeType_ALLLINES
:
744 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textFitToSize"), "%s", "ALLLINES");
746 case drawing::TextFitToSizeType_AUTOFIT
:
747 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textFitToSize"), "%s", "AUTOFIT");
754 void dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust
, xmlTextWriterPtr xmlWriter
)
756 switch(eTextHorizontalAdjust
)
758 case drawing::TextHorizontalAdjust_LEFT
:
759 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textHorizontalAdjust"), "%s", "LEFT");
761 case drawing::TextHorizontalAdjust_CENTER
:
762 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textHorizontalAdjust"), "%s", "CENTER");
764 case drawing::TextHorizontalAdjust_RIGHT
:
765 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textHorizontalAdjust"), "%s", "RIGHT");
767 case drawing::TextHorizontalAdjust_BLOCK
:
768 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK");
775 void dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust
, xmlTextWriterPtr xmlWriter
)
777 switch(eTextVerticalAdjust
)
779 case drawing::TextVerticalAdjust_TOP
:
780 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textVerticalAdjust"), "%s", "TOP");
782 case drawing::TextVerticalAdjust_CENTER
:
783 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textVerticalAdjust"), "%s", "CENTER");
785 case drawing::TextVerticalAdjust_BOTTOM
:
786 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textVerticalAdjust"), "%s", "BOTTOM");
788 case drawing::TextVerticalAdjust_BLOCK
:
789 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textVerticalAdjust"), "%s", "BLOCK");
796 void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance
, xmlTextWriterPtr xmlWriter
)
798 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32
, aTextLeftDistance
);
801 void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance
, xmlTextWriterPtr xmlWriter
)
803 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32
, aTextRightDistance
);
806 void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance
, xmlTextWriterPtr xmlWriter
)
808 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32
, aTextUpperDistance
);
811 void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance
, xmlTextWriterPtr xmlWriter
)
813 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32
, aTextLowerDistance
);
816 void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight
, xmlTextWriterPtr xmlWriter
)
818 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32
, aTextMaximumFrameHeight
);
821 void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth
, xmlTextWriterPtr xmlWriter
)
823 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32
, aTextMaximumFrameWidth
);
826 void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight
, xmlTextWriterPtr xmlWriter
)
828 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32
, aTextMinimumFrameHeight
);
831 void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth
, xmlTextWriterPtr xmlWriter
)
833 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32
, aTextMinimumFrameWidth
);
836 void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount
, xmlTextWriterPtr xmlWriter
)
838 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32
, aTextAnimationAmount
);
841 void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount
, xmlTextWriterPtr xmlWriter
)
843 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32
, aTextAnimationCount
);
846 void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay
, xmlTextWriterPtr xmlWriter
)
848 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32
, aTextAnimationDelay
);
851 void dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection
, xmlTextWriterPtr xmlWriter
)
853 switch(eTextAnimationDirection
)
855 case drawing::TextAnimationDirection_LEFT
:
856 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationDirection"), "%s", "LEFT");
858 case drawing::TextAnimationDirection_RIGHT
:
859 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationDirection"), "%s", "RIGHT");
861 case drawing::TextAnimationDirection_UP
:
862 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationDirection"), "%s", "UP");
864 case drawing::TextAnimationDirection_DOWN
:
865 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationDirection"), "%s", "DOWN");
872 void dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind
, xmlTextWriterPtr xmlWriter
)
874 switch(eTextAnimationKind
)
876 case drawing::TextAnimationKind_NONE
:
877 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "NONE");
879 case drawing::TextAnimationKind_BLINK
:
880 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "BLINK");
882 case drawing::TextAnimationKind_SCROLL
:
883 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "SCROLL");
885 case drawing::TextAnimationKind_ALTERNATE
:
886 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "ALTERNATE");
888 case drawing::TextAnimationKind_SLIDE
:
889 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationKind"), "%s", "SLIDE");
896 void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside
, xmlTextWriterPtr xmlWriter
)
898 if(bTextAnimationStartInside
)
899 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationStartInside"), "%s", "true");
901 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationStartInside"), "%s", "false");
904 void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside
, xmlTextWriterPtr xmlWriter
)
906 if(bTextAnimationStopInside
)
907 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationStopInside"), "%s", "true");
909 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textAnimationStopInside"), "%s", "false");
912 void dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode
, xmlTextWriterPtr xmlWriter
)
914 switch(eTextWritingMode
)
916 case text::WritingMode_LR_TB
:
917 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textWritingMode"), "%s", "LR_TB");
919 case text::WritingMode_RL_TB
:
920 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textWritingMode"), "%s", "RL_TB");
922 case text::WritingMode_TB_RL
:
923 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("textWritingMode"), "%s", "TB_RL");
930 // ------------------------------------------
931 // ---------- ShadowProperties.idl ----------
932 // ------------------------------------------
934 void dumpShadowAsAttribute(sal_Bool bShadow
, xmlTextWriterPtr xmlWriter
)
937 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadow"), "%s", "true");
939 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("shadow"), "%s", "false");
942 void dumpShadowColorAsAttribute(sal_Int32 aShadowColor
, xmlTextWriterPtr xmlWriter
)
944 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("shadowColor"), "%06x", (unsigned int) aShadowColor
);
947 void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence
, xmlTextWriterPtr xmlWriter
)
949 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32
, aShadowTransparence
);
952 void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance
, xmlTextWriterPtr xmlWriter
)
954 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("shadowXDistance"), "%" SAL_PRIdINT32
, aShadowXDistance
);
957 void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance
, xmlTextWriterPtr xmlWriter
)
959 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32
, aShadowYDistance
);
962 // -------------------------------
963 // ---------- Shape.idl ----------
964 // -------------------------------
966 void dumpZOrderAsAttribute(sal_Int32 aZOrder
, xmlTextWriterPtr xmlWriter
)
968 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("zOrder"), "%" SAL_PRIdINT32
, aZOrder
);
971 void dumpLayerIDAsAttribute(sal_Int32 aLayerID
, xmlTextWriterPtr xmlWriter
)
973 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("layerID"), "%" SAL_PRIdINT32
, aLayerID
);
976 void dumpLayerNameAsAttribute(OUString sLayerName
, xmlTextWriterPtr xmlWriter
)
978 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("layerName"), "%s",
979 OUStringToOString(sLayerName
, RTL_TEXTENCODING_UTF8
).getStr());
982 void dumpVisibleAsAttribute(sal_Bool bVisible
, xmlTextWriterPtr xmlWriter
)
985 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("visible"), "%s", "true");
987 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("visible"), "%s", "false");
990 void dumpPrintableAsAttribute(sal_Bool bPrintable
, xmlTextWriterPtr xmlWriter
)
993 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("printable"), "%s", "true");
995 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("printable"), "%s", "false");
998 void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect
, xmlTextWriterPtr xmlWriter
)
1001 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("moveProtect"), "%s", "true");
1003 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("moveProtect"), "%s", "false");
1006 void dumpNameAsAttribute(OUString sName
, xmlTextWriterPtr xmlWriter
)
1008 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s",
1009 OUStringToOString(sName
, RTL_TEXTENCODING_UTF8
).getStr());
1012 void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect
, xmlTextWriterPtr xmlWriter
)
1015 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("sizeProtect"), "%s", "true");
1017 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("sizeProtect"), "%s", "false");
1020 void dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aHomogenMatrixLine3
, xmlTextWriterPtr xmlWriter
)
1022 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("column1"), "%f", aHomogenMatrixLine3
.Column1
);
1023 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("column2"), "%f", aHomogenMatrixLine3
.Column2
);
1024 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("column3"), "%f", aHomogenMatrixLine3
.Column3
);
1027 void dumpTransformationAsElement(drawing::HomogenMatrix3 aTransformation
, xmlTextWriterPtr xmlWriter
)
1029 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Transformation" ));
1031 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Line1" ));
1032 dumpHomogenMatrixLine3(aTransformation
.Line1
, xmlWriter
);
1033 xmlTextWriterEndElement( xmlWriter
);
1034 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Line2" ));
1035 dumpHomogenMatrixLine3(aTransformation
.Line2
, xmlWriter
);
1036 xmlTextWriterEndElement( xmlWriter
);
1037 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "Line3" ));
1038 dumpHomogenMatrixLine3(aTransformation
.Line3
, xmlWriter
);
1039 xmlTextWriterEndElement( xmlWriter
);
1041 xmlTextWriterEndElement( xmlWriter
);
1044 void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder
, xmlTextWriterPtr xmlWriter
)
1046 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32
, aNavigationOrder
);
1049 void dumpHyperlinkAsAttribute(OUString sHyperlink
, xmlTextWriterPtr xmlWriter
)
1051 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("hyperlink"), "%s",
1052 OUStringToOString(sHyperlink
, RTL_TEXTENCODING_UTF8
).getStr());
1055 // --------------------------------
1056 // ---------- XShape.idl ----------
1057 // --------------------------------
1059 void dumpPositionAsAttribute(const awt::Point
& rPoint
, xmlTextWriterPtr xmlWriter
)
1061 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("positionX"), "%" SAL_PRIdINT32
, rPoint
.X
);
1062 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("positionY"), "%" SAL_PRIdINT32
, rPoint
.Y
);
1065 void dumpSizeAsAttribute(const awt::Size
& rSize
, xmlTextWriterPtr xmlWriter
)
1067 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("sizeX"), "%" SAL_PRIdINT32
, rSize
.Width
);
1068 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("sizeY"), "%" SAL_PRIdINT32
, rSize
.Height
);
1071 void dumpShapeDescriptorAsAttribute( uno::Reference
< drawing::XShapeDescriptor
> xDescr
, xmlTextWriterPtr xmlWriter
)
1073 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("type"), "%s",
1074 OUStringToOString(xDescr
->getShapeType(), RTL_TEXTENCODING_UTF8
).getStr());
1077 // -------------------------------------
1078 // ---------- CustomShape.idl ----------
1079 // -------------------------------------
1081 void dumpCustomShapeEngineAsAttribute(OUString sCustomShapeEngine
, xmlTextWriterPtr xmlWriter
)
1083 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("customShapeEngine"), "%s",
1084 OUStringToOString(sCustomShapeEngine
, RTL_TEXTENCODING_UTF8
).getStr());
1087 void dumpCustomShapeDataAsAttribute(OUString sCustomShapeData
, xmlTextWriterPtr xmlWriter
)
1089 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("customShapeData"), "%s",
1090 OUStringToOString(sCustomShapeData
, RTL_TEXTENCODING_UTF8
).getStr());
1093 void dumpPropertyValueAsElement(const beans::PropertyValue
& rPropertyValue
, xmlTextWriterPtr xmlWriter
)
1095 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "PropertyValue" ));
1097 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("name"), "%s",
1098 OUStringToOString(rPropertyValue
.Name
, RTL_TEXTENCODING_UTF8
).getStr());
1100 uno::Any aAny
= rPropertyValue
.Value
;
1105 awt::Rectangle aRectangleValue
;
1106 uno::Sequence
< drawing::EnhancedCustomShapeAdjustmentValue
> aAdjustmentValues
;
1107 uno::Sequence
< drawing::EnhancedCustomShapeParameterPair
> aCoordinates
;
1108 uno::Sequence
< drawing::EnhancedCustomShapeSegment
> aSegments
;
1109 uno::Sequence
< beans::PropertyValue
> aPropSeq
;
1112 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s",
1113 OUStringToOString(sValue
, RTL_TEXTENCODING_UTF8
).getStr());
1115 else if(aAny
>>= nValue
)
1117 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%" SAL_PRIdINT32
, nValue
);
1119 else if(aAny
>>= fValue
)
1121 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%f", fValue
);
1123 else if(aAny
>>= bValue
)
1125 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("value"), "%s", (bValue
? "true": "false"));
1127 else if(rPropertyValue
.Name
== "ViewBox" && (aAny
>>= aRectangleValue
))
1129 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1130 enhancedDumper
.dumpViewBoxAsElement(aRectangleValue
);
1132 else if(rPropertyValue
.Name
== "AdjustmentValues" && (aAny
>>= aAdjustmentValues
))
1134 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1135 enhancedDumper
.dumpAdjustmentValuesAsElement(aAdjustmentValues
);
1137 else if(rPropertyValue
.Name
== "Coordinates" && (aAny
>>= aCoordinates
))
1139 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1140 enhancedDumper
.dumpCoordinatesAsElement(aCoordinates
);
1142 else if(rPropertyValue
.Name
== "Segments" && (aAny
>>= aSegments
))
1144 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1145 enhancedDumper
.dumpSegmentsAsElement(aSegments
);
1147 else if(aAny
>>= aPropSeq
)
1149 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( OUStringToOString(rPropertyValue
.Name
, RTL_TEXTENCODING_UTF8
).getStr() ));
1151 sal_Int32 i
= 0, nCount
= aPropSeq
.getLength();
1152 for ( ; i
< nCount
; i
++ )
1153 dumpPropertyValueAsElement(aPropSeq
[ i
], xmlWriter
);
1155 xmlTextWriterEndElement(xmlWriter
);
1157 // TODO more, if necessary
1159 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("handle"), "%" SAL_PRIdINT32
, rPropertyValue
.Handle
);
1161 switch(rPropertyValue
.State
)
1163 case beans::PropertyState_DIRECT_VALUE
:
1164 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
1166 case beans::PropertyState_DEFAULT_VALUE
:
1167 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
1169 case beans::PropertyState_AMBIGUOUS_VALUE
:
1170 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
1175 xmlTextWriterEndElement( xmlWriter
);
1178 void dumpCustomShapeGeometryAsElement(uno::Sequence
< beans::PropertyValue
> aCustomShapeGeometry
, xmlTextWriterPtr xmlWriter
)
1180 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "CustomShapeGeometry" ));
1182 sal_Int32 nLength
= aCustomShapeGeometry
.getLength();
1183 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
1184 dumpPropertyValueAsElement(aCustomShapeGeometry
[i
], xmlWriter
);
1186 xmlTextWriterEndElement( xmlWriter
);
1189 void dumpCustomShapeReplacementURLAsAttribute(OUString sCustomShapeReplacementURL
, xmlTextWriterPtr xmlWriter
)
1191 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST("customShapeReplacementURL"), "%s",
1192 OUStringToOString(sCustomShapeReplacementURL
, RTL_TEXTENCODING_UTF8
).getStr());
1195 // methods dumping whole services
1197 void dumpTextPropertiesService(uno::Reference
< beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
)
1199 uno::Reference
< beans::XPropertySetInfo
> xInfo
= xPropSet
->getPropertySetInfo();
1200 if(xInfo
->hasPropertyByName("CharHeight"))
1202 uno::Any anotherAny
= xPropSet
->getPropertyValue("CharHeight");
1204 if(anotherAny
>>= fHeight
)
1205 dumpCharHeightAsAttribute(fHeight
, xmlWriter
);
1207 if(xInfo
->hasPropertyByName("CharColor"))
1209 uno::Any anotherAny
= xPropSet
->getPropertyValue("CharColor");
1210 sal_Int32 aColor
= sal_Int32();
1211 if(anotherAny
>>= aColor
)
1212 dumpCharColorAsAttribute(aColor
, xmlWriter
);
1214 // TODO - more properties from CharacterProperties.idl (similar to above)
1216 if(xInfo
->hasPropertyByName("IsNumbering"))
1218 uno::Any anotherAny
= xPropSet
->getPropertyValue("IsNumbering");
1219 sal_Bool bIsNumbering
= sal_Bool();
1220 if(anotherAny
>>= bIsNumbering
)
1221 dumpIsNumberingAsAttribute(bIsNumbering
, xmlWriter
);
1224 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextAutoGrowHeight");
1225 sal_Bool bTextAutoGrowHeight
= sal_Bool();
1226 if(anotherAny
>>= bTextAutoGrowHeight
)
1227 dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight
, xmlWriter
);
1230 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextAutoGrowWidth");
1231 sal_Bool bTextAutoGrowWidth
= sal_Bool();
1232 if(anotherAny
>>= bTextAutoGrowWidth
)
1233 dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth
, xmlWriter
);
1236 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextContourFrame");
1237 sal_Bool bTextContourFrame
= sal_Bool();
1238 if(anotherAny
>>= bTextContourFrame
)
1239 dumpTextContourFrameAsAttribute(bTextContourFrame
, xmlWriter
);
1242 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextFitToSize");
1243 drawing::TextFitToSizeType eTextFitToSize
;
1244 if(anotherAny
>>= eTextFitToSize
)
1245 dumpTextFitToSizeAsAttribute(eTextFitToSize
, xmlWriter
);
1248 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextHorizontalAdjust");
1249 drawing::TextHorizontalAdjust eTextHorizontalAdjust
;
1250 if(anotherAny
>>= eTextHorizontalAdjust
)
1251 dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust
, xmlWriter
);
1254 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextVerticalAdjust");
1255 drawing::TextVerticalAdjust eTextVerticalAdjust
;
1256 if(anotherAny
>>= eTextVerticalAdjust
)
1257 dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust
, xmlWriter
);
1260 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextLeftDistance");
1261 sal_Int32 aTextLeftDistance
= sal_Int32();
1262 if(anotherAny
>>= aTextLeftDistance
)
1263 dumpTextLeftDistanceAsAttribute(aTextLeftDistance
, xmlWriter
);
1266 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextRightDistance");
1267 sal_Int32 aTextRightDistance
= sal_Int32();
1268 if(anotherAny
>>= aTextRightDistance
)
1269 dumpTextRightDistanceAsAttribute(aTextRightDistance
, xmlWriter
);
1272 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextUpperDistance");
1273 sal_Int32 aTextUpperDistance
= sal_Int32();
1274 if(anotherAny
>>= aTextUpperDistance
)
1275 dumpTextUpperDistanceAsAttribute(aTextUpperDistance
, xmlWriter
);
1278 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextLowerDistance");
1279 sal_Int32 aTextLowerDistance
= sal_Int32();
1280 if(anotherAny
>>= aTextLowerDistance
)
1281 dumpTextLowerDistanceAsAttribute(aTextLowerDistance
, xmlWriter
);
1284 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextMaximumFrameHeight");
1285 sal_Int32 aTextMaximumFrameHeight
= sal_Int32();
1286 if(anotherAny
>>= aTextMaximumFrameHeight
)
1287 dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight
, xmlWriter
);
1290 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextMaximumFrameWidth");
1291 sal_Int32 aTextMaximumFrameWidth
= sal_Int32();
1292 if(anotherAny
>>= aTextMaximumFrameWidth
)
1293 dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth
, xmlWriter
);
1296 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextMinimumFrameHeight");
1297 sal_Int32 aTextMinimumFrameHeight
= sal_Int32();
1298 if(anotherAny
>>= aTextMinimumFrameHeight
)
1299 dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight
, xmlWriter
);
1302 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextMinimumFrameWidth");
1303 sal_Int32 aTextMinimumFrameWidth
= sal_Int32();
1304 if(anotherAny
>>= aTextMinimumFrameWidth
)
1305 dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth
, xmlWriter
);
1308 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextAnimationAmount");
1309 sal_Int32 aTextAnimationAmount
= sal_Int32();
1310 if(anotherAny
>>= aTextAnimationAmount
)
1311 dumpTextAnimationAmountAsAttribute(aTextAnimationAmount
, xmlWriter
);
1314 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextAnimationCount");
1315 sal_Int32 aTextAnimationCount
= sal_Int32();
1316 if(anotherAny
>>= aTextAnimationCount
)
1317 dumpTextAnimationCountAsAttribute(aTextAnimationCount
, xmlWriter
);
1320 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextAnimationDelay");
1321 sal_Int32 aTextAnimationDelay
= sal_Int32();
1322 if(anotherAny
>>= aTextAnimationDelay
)
1323 dumpTextAnimationDelayAsAttribute(aTextAnimationDelay
, xmlWriter
);
1326 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextAnimationDirection");
1327 drawing::TextAnimationDirection eTextAnimationDirection
;
1328 if(anotherAny
>>= eTextAnimationDirection
)
1329 dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection
, xmlWriter
);
1332 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextAnimationKind");
1333 drawing::TextAnimationKind eTextAnimationKind
;
1334 if(anotherAny
>>= eTextAnimationKind
)
1335 dumpTextAnimationKindAsAttribute(eTextAnimationKind
, xmlWriter
);
1338 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextAnimationStartInside");
1339 sal_Bool bTextAnimationStartInside
= sal_Bool();
1340 if(anotherAny
>>= bTextAnimationStartInside
)
1341 dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside
, xmlWriter
);
1344 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextAnimationStopInside");
1345 sal_Bool bTextAnimationStopInside
= sal_Bool();
1346 if(anotherAny
>>= bTextAnimationStopInside
)
1347 dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside
, xmlWriter
);
1350 uno::Any anotherAny
= xPropSet
->getPropertyValue("TextWritingMode");
1351 text::WritingMode eTextWritingMode
;
1352 if(anotherAny
>>= eTextWritingMode
)
1353 dumpTextWritingModeAsAttribute(eTextWritingMode
, xmlWriter
);
1357 void dumpFillPropertiesService(uno::Reference
< beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
)
1360 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillStyle");
1361 drawing::FillStyle eFillStyle
;
1362 if(anotherAny
>>= eFillStyle
)
1363 dumpFillStyleAsAttribute(eFillStyle
, xmlWriter
);
1366 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillColor");
1367 sal_Int32 aColor
= sal_Int32();
1368 if(anotherAny
>>= aColor
)
1369 dumpFillColorAsAttribute(aColor
, xmlWriter
);
1372 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillTransparence");
1373 sal_Int32 aTransparence
= sal_Int32();
1374 if(anotherAny
>>= aTransparence
)
1375 dumpFillTransparenceAsAttribute(aTransparence
, xmlWriter
);
1378 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillTransparenceGradientName");
1379 OUString sTranspGradName
;
1380 if(anotherAny
>>= sTranspGradName
)
1381 dumpFillTransparenceGradientNameAsAttribute(sTranspGradName
, xmlWriter
);
1384 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillTransparenceGradient");
1385 awt::Gradient aTranspGrad
;
1386 if(anotherAny
>>= aTranspGrad
)
1387 dumpFillTransparenceGradientAsElement(aTranspGrad
, xmlWriter
);
1390 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillGradientName");
1392 if(anotherAny
>>= sGradName
)
1393 dumpFillGradientNameAsAttribute(sGradName
, xmlWriter
);
1396 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillGradient");
1397 awt::Gradient aGradient
;
1398 if(anotherAny
>>= aGradient
)
1399 dumpFillGradientAsElement(aGradient
, xmlWriter
);
1402 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillHatchName");
1403 OUString sHatchName
;
1404 if(anotherAny
>>= sHatchName
)
1405 dumpFillGradientNameAsAttribute(sHatchName
, xmlWriter
);
1408 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillHatch");
1409 drawing::Hatch aHatch
;
1410 if(anotherAny
>>= aHatch
)
1411 dumpFillHatchAsElement(aHatch
, xmlWriter
);
1414 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBackground");
1415 sal_Bool bFillBackground
= sal_Bool();
1416 if(anotherAny
>>= bFillBackground
)
1417 dumpFillBackgroundAsAttribute(bFillBackground
, xmlWriter
);
1420 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapName");
1421 OUString sBitmapName
;
1422 if(anotherAny
>>= sBitmapName
)
1423 dumpFillGradientNameAsAttribute(sBitmapName
, xmlWriter
);
1426 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmap");
1427 uno::Reference
<awt::XBitmap
> xBitmap
;
1428 if(anotherAny
>>= xBitmap
)
1429 dumpFillBitmapAsElement(xBitmap
, xmlWriter
);
1432 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapURL");
1433 OUString sBitmapURL
;
1434 if(anotherAny
>>= sBitmapURL
)
1435 dumpFillBitmapURLAsAttribute(sBitmapURL
, xmlWriter
);
1438 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapPositionOffsetX");
1439 sal_Int32 aBitmapPositionOffsetX
= sal_Int32();
1440 if(anotherAny
>>= aBitmapPositionOffsetX
)
1441 dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX
, xmlWriter
);
1444 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapPositionOffsetY");
1445 sal_Int32 aBitmapPositionOffsetY
= sal_Int32();
1446 if(anotherAny
>>= aBitmapPositionOffsetY
)
1447 dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY
, xmlWriter
);
1450 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapOffsetX");
1451 sal_Int32 aBitmapOffsetX
= sal_Int32();
1452 if(anotherAny
>>= aBitmapOffsetX
)
1453 dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX
, xmlWriter
);
1456 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapOffsetY");
1457 sal_Int32 aBitmapOffsetY
= sal_Int32();
1458 if(anotherAny
>>= aBitmapOffsetY
)
1459 dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY
, xmlWriter
);
1462 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapRectanglePoint");
1463 drawing::RectanglePoint eBitmapRectanglePoint
;
1464 if(anotherAny
>>= eBitmapRectanglePoint
)
1465 dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint
, xmlWriter
);
1468 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapLogicalSize");
1469 sal_Bool bBitmapLogicalSize
= sal_Bool();
1470 if(anotherAny
>>= bBitmapLogicalSize
)
1471 dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize
, xmlWriter
);
1474 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapSizeX");
1475 sal_Int32 aBitmapSizeX
= sal_Int32();
1476 if(anotherAny
>>= aBitmapSizeX
)
1477 dumpFillBitmapSizeXAsAttribute(aBitmapSizeX
, xmlWriter
);
1480 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapSizeY");
1481 sal_Int32 aBitmapSizeY
= sal_Int32();
1482 if(anotherAny
>>= aBitmapSizeY
)
1483 dumpFillBitmapSizeYAsAttribute(aBitmapSizeY
, xmlWriter
);
1486 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapMode");
1487 drawing::BitmapMode eBitmapMode
;
1488 if(anotherAny
>>= eBitmapMode
)
1489 dumpFillBitmapModeAsAttribute(eBitmapMode
, xmlWriter
);
1492 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapStretch");
1493 sal_Bool bBitmapStretch
= sal_Bool();
1494 if(anotherAny
>>= bBitmapStretch
)
1495 dumpFillBitmapStretchAsAttribute(bBitmapStretch
, xmlWriter
);
1498 uno::Any anotherAny
= xPropSet
->getPropertyValue("FillBitmapTile");
1499 sal_Bool bBitmapTile
= sal_Bool();
1500 if(anotherAny
>>= bBitmapTile
)
1501 dumpFillBitmapTileAsAttribute(bBitmapTile
, xmlWriter
);
1505 void dumpLinePropertiesService(uno::Reference
< beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
)
1508 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineStyle");
1509 drawing::LineStyle eLineStyle
;
1510 if(anotherAny
>>= eLineStyle
)
1511 dumpLineStyleAsAttribute(eLineStyle
, xmlWriter
);
1514 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineDash");
1515 drawing::LineDash aLineDash
;
1516 if(anotherAny
>>= aLineDash
)
1517 dumpLineDashAsElement(aLineDash
, xmlWriter
);
1520 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineDashName");
1521 OUString sLineDashName
;
1522 if(anotherAny
>>= sLineDashName
)
1523 dumpLineDashNameAsAttribute(sLineDashName
, xmlWriter
);
1526 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineColor");
1527 sal_Int32 aLineColor
= sal_Int32();
1528 if(anotherAny
>>= aLineColor
)
1529 dumpLineColorAsAttribute(aLineColor
, xmlWriter
);
1532 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineTransparence");
1533 sal_Int32 aLineTransparence
= sal_Int32();
1534 if(anotherAny
>>= aLineTransparence
)
1535 dumpLineTransparenceAsAttribute(aLineTransparence
, xmlWriter
);
1538 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineWidth");
1539 sal_Int32 aLineWidth
= sal_Int32();
1540 if(anotherAny
>>= aLineWidth
)
1541 dumpLineWidthAsAttribute(aLineWidth
, xmlWriter
);
1544 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineJoint");
1545 drawing::LineJoint eLineJoint
;
1546 if(anotherAny
>>= eLineJoint
)
1547 dumpLineJointAsAttribute(eLineJoint
, xmlWriter
);
1550 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineStartName");
1551 OUString sLineStartName
;
1552 if(anotherAny
>>= sLineStartName
)
1553 dumpLineStartNameAsAttribute(sLineStartName
, xmlWriter
);
1556 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineEndName");
1557 OUString sLineEndName
;
1558 if(anotherAny
>>= sLineEndName
)
1559 dumpLineEndNameAsAttribute(sLineEndName
, xmlWriter
);
1562 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineStart");
1563 drawing::PolyPolygonBezierCoords aLineStart
;
1564 if(anotherAny
>>= aLineStart
)
1565 dumpLineStartAsElement(aLineStart
, xmlWriter
);
1568 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineEnd");
1569 drawing::PolyPolygonBezierCoords aLineEnd
;
1570 if(anotherAny
>>= aLineEnd
)
1571 dumpLineEndAsElement(aLineEnd
, xmlWriter
);
1574 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineStartCenter");
1575 sal_Bool bLineStartCenter
= sal_Bool();
1576 if(anotherAny
>>= bLineStartCenter
)
1577 dumpLineStartCenterAsAttribute(bLineStartCenter
, xmlWriter
);
1580 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineStartWidth");
1581 sal_Int32 aLineStartWidth
= sal_Int32();
1582 if(anotherAny
>>= aLineStartWidth
)
1583 dumpLineStartWidthAsAttribute(aLineStartWidth
, xmlWriter
);
1586 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineEndCenter");
1587 sal_Bool bLineEndCenter
= sal_Bool();
1588 if(anotherAny
>>= bLineEndCenter
)
1589 dumpLineEndCenterAsAttribute(bLineEndCenter
, xmlWriter
);
1592 uno::Any anotherAny
= xPropSet
->getPropertyValue("LineEndWidth");
1593 sal_Int32 aLineEndWidth
= sal_Int32();
1594 if(anotherAny
>>= aLineEndWidth
)
1595 dumpLineEndWidthAsAttribute(aLineEndWidth
, xmlWriter
);
1599 void dumpShadowPropertiesService(uno::Reference
< beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
)
1602 uno::Any anotherAny
= xPropSet
->getPropertyValue("Shadow");
1603 sal_Bool bShadow
= sal_Bool();
1604 if(anotherAny
>>= bShadow
)
1605 dumpShadowAsAttribute(bShadow
, xmlWriter
);
1608 uno::Any anotherAny
= xPropSet
->getPropertyValue("ShadowColor");
1609 sal_Int32 aShadowColor
= sal_Int32();
1610 if(anotherAny
>>= aShadowColor
)
1611 dumpShadowColorAsAttribute(aShadowColor
, xmlWriter
);
1614 uno::Any anotherAny
= xPropSet
->getPropertyValue("ShadowTransparence");
1615 sal_Int32 aShadowTransparence
= sal_Int32();
1616 if(anotherAny
>>= aShadowTransparence
)
1617 dumpShadowTransparenceAsAttribute(aShadowTransparence
, xmlWriter
);
1620 uno::Any anotherAny
= xPropSet
->getPropertyValue("ShadowXDistance");
1621 sal_Int32 aShadowXDistance
= sal_Int32();
1622 if(anotherAny
>>= aShadowXDistance
)
1623 dumpShadowXDistanceAsAttribute(aShadowXDistance
, xmlWriter
);
1626 uno::Any anotherAny
= xPropSet
->getPropertyValue("ShadowYDistance");
1627 sal_Int32 aShadowYDistance
= sal_Int32();
1628 if(anotherAny
>>= aShadowYDistance
)
1629 dumpShadowYDistanceAsAttribute(aShadowYDistance
, xmlWriter
);
1633 void dumpPolyPolygonDescriptorService(uno::Reference
< beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
)
1636 uno::Any anotherAny
= xPropSet
->getPropertyValue("PolygonKind");
1637 drawing::PolygonKind ePolygonKind
;
1638 if(anotherAny
>>= ePolygonKind
)
1639 dumpPolygonKindAsAttribute(ePolygonKind
, xmlWriter
);
1642 uno::Any anotherAny
= xPropSet
->getPropertyValue("PolyPolygon");
1643 drawing::PointSequenceSequence aPolyPolygon
;
1644 if(anotherAny
>>= aPolyPolygon
)
1645 dumpPolyPolygonAsElement(aPolyPolygon
, xmlWriter
);
1648 uno::Any anotherAny
= xPropSet
->getPropertyValue("Geometry");
1649 drawing::PointSequenceSequence aGeometry
;
1650 if(anotherAny
>>= aGeometry
)
1651 dumpGeometryAsElement(aGeometry
, xmlWriter
);
1655 void dumpShapeService(uno::Reference
< beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
)
1657 uno::Reference
< beans::XPropertySetInfo
> xInfo
= xPropSet
->getPropertySetInfo();
1659 uno::Any anotherAny
= xPropSet
->getPropertyValue("ZOrder");
1660 sal_Int32 aZOrder
= sal_Int32();
1661 if(anotherAny
>>= aZOrder
)
1662 dumpZOrderAsAttribute(aZOrder
, xmlWriter
);
1665 uno::Any anotherAny
= xPropSet
->getPropertyValue("LayerID");
1666 sal_Int32 aLayerID
= sal_Int32();
1667 if(anotherAny
>>= aLayerID
)
1668 dumpLayerIDAsAttribute(aLayerID
, xmlWriter
);
1671 uno::Any anotherAny
= xPropSet
->getPropertyValue("LayerName");
1672 OUString sLayerName
;
1673 if(anotherAny
>>= sLayerName
)
1674 dumpLayerNameAsAttribute(sLayerName
, xmlWriter
);
1677 uno::Any anotherAny
= xPropSet
->getPropertyValue("Visible");
1678 sal_Bool bVisible
= sal_Bool();
1679 if(anotherAny
>>= bVisible
)
1680 dumpVisibleAsAttribute(bVisible
, xmlWriter
);
1683 uno::Any anotherAny
= xPropSet
->getPropertyValue("Printable");
1684 sal_Bool bPrintable
= sal_Bool();
1685 if(anotherAny
>>= bPrintable
)
1686 dumpPrintableAsAttribute(bPrintable
, xmlWriter
);
1689 uno::Any anotherAny
= xPropSet
->getPropertyValue("MoveProtect");
1690 sal_Bool bMoveProtect
= sal_Bool();
1691 if(anotherAny
>>= bMoveProtect
)
1692 dumpMoveProtectAsAttribute(bMoveProtect
, xmlWriter
);
1695 uno::Any anotherAny
= xPropSet
->getPropertyValue("Name");
1697 if(anotherAny
>>= sName
)
1698 dumpNameAsAttribute(sName
, xmlWriter
);
1701 uno::Any anotherAny
= xPropSet
->getPropertyValue("SizeProtect");
1702 sal_Bool bSizeProtect
= sal_Bool();
1703 if(anotherAny
>>= bSizeProtect
)
1704 dumpSizeProtectAsAttribute(bSizeProtect
, xmlWriter
);
1707 uno::Any anotherAny
= xPropSet
->getPropertyValue("Transformation");
1708 drawing::HomogenMatrix3 aTransformation
;
1709 if(anotherAny
>>= aTransformation
)
1710 dumpTransformationAsElement(aTransformation
, xmlWriter
);
1713 uno::Any anotherAny
= xPropSet
->getPropertyValue("NavigationOrder");
1714 sal_Int32 aNavigationOrder
= sal_Int32();
1715 if(anotherAny
>>= aNavigationOrder
)
1716 dumpNavigationOrderAsAttribute(aNavigationOrder
, xmlWriter
);
1718 if(xInfo
->hasPropertyByName("Hyperlink"))
1720 uno::Any anotherAny
= xPropSet
->getPropertyValue("Hyperlink");
1721 OUString sHyperlink
;
1722 if(anotherAny
>>= sHyperlink
)
1723 dumpHyperlinkAsAttribute(sHyperlink
, xmlWriter
);
1727 void dumpPolyPolygonBezierDescriptorService(uno::Reference
< beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
)
1730 uno::Any anotherAny
= xPropSet
->getPropertyValue("PolygonKind");
1731 drawing::PolygonKind ePolygonKind
;
1732 if(anotherAny
>>= ePolygonKind
)
1733 dumpPolygonKindAsAttribute(ePolygonKind
, xmlWriter
);
1736 uno::Any anotherAny
= xPropSet
->getPropertyValue("PolyPolygonBezier");
1737 drawing::PolyPolygonBezierCoords aPolyPolygonBezier
;
1738 if(anotherAny
>>= aPolyPolygonBezier
)
1739 dumpPolyPolygonBezierCoords(aPolyPolygonBezier
, xmlWriter
);
1742 uno::Any anotherAny
= xPropSet
->getPropertyValue("Geometry");
1743 drawing::PolyPolygonBezierCoords aGeometry
;
1744 if(anotherAny
>>= aGeometry
)
1745 dumpPolyPolygonBezierCoords(aGeometry
, xmlWriter
);
1749 void dumpCustomShapeService(uno::Reference
< beans::XPropertySet
> xPropSet
, xmlTextWriterPtr xmlWriter
)
1751 uno::Reference
< beans::XPropertySetInfo
> xInfo
= xPropSet
->getPropertySetInfo();
1753 uno::Any anotherAny
= xPropSet
->getPropertyValue("CustomShapeEngine");
1754 OUString sCustomShapeEngine
;
1755 if(anotherAny
>>= sCustomShapeEngine
)
1756 dumpCustomShapeEngineAsAttribute(sCustomShapeEngine
, xmlWriter
);
1759 uno::Any anotherAny
= xPropSet
->getPropertyValue("CustomShapeData");
1760 OUString sCustomShapeData
;
1761 if(anotherAny
>>= sCustomShapeData
)
1762 dumpCustomShapeDataAsAttribute(sCustomShapeData
, xmlWriter
);
1765 uno::Any anotherAny
= xPropSet
->getPropertyValue("CustomShapeGeometry");
1766 uno::Sequence
< beans::PropertyValue
> aCustomShapeGeometry
;
1767 if(anotherAny
>>= aCustomShapeGeometry
)
1768 dumpCustomShapeGeometryAsElement(aCustomShapeGeometry
, xmlWriter
);
1770 if(xInfo
->hasPropertyByName("CustomShapeReplacementURL"))
1772 uno::Any anotherAny
= xPropSet
->getPropertyValue("CustomShapeReplacementURL");
1773 OUString sCustomShapeReplacementURL
;
1774 if(anotherAny
>>= sCustomShapeReplacementURL
)
1775 dumpCustomShapeReplacementURLAsAttribute(sCustomShapeReplacementURL
, xmlWriter
);
1779 void dumpXShape(uno::Reference
< drawing::XShape
> xShape
, xmlTextWriterPtr xmlWriter
)
1781 xmlTextWriterStartElement( xmlWriter
, BAD_CAST( "XShape" ) );
1782 uno::Reference
< beans::XPropertySet
> xPropSet(xShape
, uno::UNO_QUERY_THROW
);
1783 uno::Reference
<beans::XPropertySetInfo
> xPropSetInfo
= xPropSet
->getPropertySetInfo();
1786 dumpPositionAsAttribute(xShape
->getPosition(), xmlWriter
);
1787 dumpSizeAsAttribute(xShape
->getSize(), xmlWriter
);
1788 uno::Reference
< drawing::XShapeDescriptor
> xDescr(xShape
, uno::UNO_QUERY_THROW
);
1789 dumpShapeDescriptorAsAttribute(xDescr
, xmlWriter
);
1791 // uno::Sequence<beans::Property> aProperties = xPropSetInfo->getProperties();
1793 uno::Reference
< lang::XServiceInfo
> xServiceInfo( xShape
, uno::UNO_QUERY_THROW
);
1794 uno::Sequence
< OUString
> aServiceNames
= xServiceInfo
->getSupportedServiceNames();
1796 uno::Reference
< beans::XPropertySetInfo
> xInfo
= xPropSet
->getPropertySetInfo();
1797 if(xInfo
->hasPropertyByName("Name"))
1799 uno::Any aAny
= xPropSet
->getPropertyValue("Name");
1802 if (!aName
.isEmpty())
1803 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("name"), "%s", OUStringToOString(aName
, RTL_TEXTENCODING_UTF8
).getStr());
1809 if (xServiceInfo
->supportsService("com.sun.star.drawing.Text"))
1811 uno::Reference
< text::XText
> xText(xShape
, uno::UNO_QUERY_THROW
);
1812 OUString aText
= xText
->getString();
1813 if(!aText
.isEmpty())
1814 xmlTextWriterWriteFormatAttribute( xmlWriter
, BAD_CAST("text"), "%s", OUStringToOString(aText
, RTL_TEXTENCODING_UTF8
).getStr());
1816 if(xServiceInfo
->supportsService("com.sun.star.drawing.TextProperties"))
1817 dumpTextPropertiesService(xPropSet
, xmlWriter
);
1819 if(xServiceInfo
->supportsService("com.sun.star.drawing.GroupShape"))
1821 uno::Reference
< drawing::XShapes
> xShapes(xShape
, uno::UNO_QUERY_THROW
);
1822 dumpXShapes(xShapes
, xmlWriter
);
1824 if(xServiceInfo
->supportsService("com.sun.star.drawing.FillProperties"))
1825 dumpFillPropertiesService(xPropSet
, xmlWriter
);
1827 if(xServiceInfo
->supportsService("com.sun.star.drawing.LineProperties"))
1828 dumpLinePropertiesService(xPropSet
, xmlWriter
);
1830 if(xServiceInfo
->supportsService("com.sun.star.drawing.PolyPolygonDescriptor"))
1831 dumpPolyPolygonDescriptorService(xPropSet
, xmlWriter
);
1833 if(xServiceInfo
->supportsService("com.sun.star.drawing.ShadowProperties"))
1834 dumpShadowPropertiesService(xPropSet
, xmlWriter
);
1836 if(xServiceInfo
->supportsService("com.sun.star.drawing.Shape"))
1837 dumpShapeService(xPropSet
, xmlWriter
);
1839 if(xServiceInfo
->supportsService("com.sun.star.drawing.PolyPolygonBezierDescriptor"))
1840 dumpPolyPolygonBezierDescriptorService(xPropSet
, xmlWriter
);
1842 if(xServiceInfo
->supportsService("com.sun.star.drawing.CustomShape"))
1843 dumpCustomShapeService(xPropSet
, xmlWriter
);
1845 // EnhancedShapeDumper used
1847 if(xServiceInfo
->supportsService("com.sun.star.drawing.EnhancedCustomShapeExtrusion"))
1849 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1850 enhancedDumper
.dumpEnhancedCustomShapeExtrusionService(xPropSet
);
1852 if(xServiceInfo
->supportsService("com.sun.star.drawing.EnhancedCustomShapeGeometry"))
1854 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1855 enhancedDumper
.dumpEnhancedCustomShapeGeometryService(xPropSet
);
1857 if(xServiceInfo
->supportsService("com.sun.star.drawing.EnhancedCustomShapeHandle"))
1859 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1860 enhancedDumper
.dumpEnhancedCustomShapeHandleService(xPropSet
);
1862 if(xServiceInfo
->supportsService("com.sun.star.drawing.EnhancedCustomShapePath"))
1864 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1865 enhancedDumper
.dumpEnhancedCustomShapePathService(xPropSet
);
1867 if(xServiceInfo
->supportsService("com.sun.star.drawing.EnhancedCustomShapeTextPath"))
1869 EnhancedShapeDumper
enhancedDumper(xmlWriter
);
1870 enhancedDumper
.dumpEnhancedCustomShapeTextPathService(xPropSet
);
1872 } // end of the 'try' block
1873 catch (const beans::UnknownPropertyException
& e
)
1875 std::cout
<< "Exception caught in XShapeDumper.cxx: " << e
.Message
<< std::endl
;
1879 sal_Int32 nServices
= aServiceNames
.getLength();
1880 for (sal_Int32 i
= 0; i
< nServices
; ++i
)
1882 xmlTextWriterStartElement(xmlWriter
, BAD_CAST( "ServiceName" ));
1883 xmlTextWriterWriteFormatAttribute(xmlWriter
, BAD_CAST( "name" ), "%s", OUStringToOString(aServiceNames
[i
], RTL_TEXTENCODING_UTF8
).getStr());
1884 xmlTextWriterEndElement( xmlWriter
);
1888 xmlTextWriterEndElement( xmlWriter
);
1891 void dumpXShapes( uno::Reference
< drawing::XShapes
> xShapes
, xmlTextWriterPtr xmlWriter
)
1893 xmlTextWriterStartElement( xmlWriter
, BAD_CAST( "XShapes" ) );
1894 uno::Reference
< container::XIndexAccess
> xIA( xShapes
, uno::UNO_QUERY_THROW
);
1895 sal_Int32 nLength
= xIA
->getCount();
1896 for (sal_Int32 i
= 0; i
< nLength
; ++i
)
1898 uno::Reference
< drawing::XShape
> xShape( xIA
->getByIndex( i
), uno::UNO_QUERY_THROW
);
1899 dumpXShape( xShape
, xmlWriter
);
1902 xmlTextWriterEndElement( xmlWriter
);
1904 } //end of namespace
1906 OUString
XShapeDumper::dump(uno::Reference
<drawing::XShapes
> xPageShapes
)
1909 OStringBuffer aString
;
1910 xmlOutputBufferPtr xmlOutBuffer
= xmlOutputBufferCreateIO( writeCallback
, closeCallback
, &aString
, NULL
);
1911 xmlTextWriterPtr xmlWriter
= xmlNewTextWriter( xmlOutBuffer
);
1912 xmlTextWriterSetIndent( xmlWriter
, 1 );
1914 xmlTextWriterStartDocument( xmlWriter
, NULL
, NULL
, NULL
);
1918 dumpXShapes( xPageShapes
, xmlWriter
);
1920 catch (const beans::UnknownPropertyException
& e
)
1922 std::cout
<< "Exception caught in XShapeDumper: " << e
.Message
<< std::endl
;
1925 xmlTextWriterEndDocument( xmlWriter
);
1926 xmlFreeTextWriter( xmlWriter
);
1928 return OStringToOUString(aString
.makeStringAndClear(), RTL_TEXTENCODING_UTF8
);