Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : */
9 :
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>
19 : #include <iostream>
20 : #include <rtl/ustring.hxx>
21 :
22 : #define DEBUG_DUMPER 0
23 :
24 : using namespace com::sun::star;
25 : //class XShapeDumper
26 :
27 7 : XShapeDumper::XShapeDumper()
28 : {
29 :
30 7 : }
31 :
32 : namespace {
33 :
34 : // FUNCTION DECLARATIONS
35 :
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);
40 :
41 : // FillProperties.idl
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);
64 :
65 : // LineProperties.idl
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);
81 :
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);
86 :
87 : // CharacterProperties.idl
88 : void dumpCharHeightAsAttribute(float fHeight, xmlTextWriterPtr xmlWriter);
89 : void dumpCharColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter);
90 :
91 : // TextProperties.idl
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);
115 :
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);
122 :
123 : //Shape.idl
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);
136 :
137 : // CustomShape.idl
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);
142 :
143 : // XShape.idl
144 : void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter);
145 : void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter);
146 :
147 : // the rest
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);
159 :
160 :
161 208 : int writeCallback(void* pContext, const char* sBuffer, int nLen)
162 : {
163 208 : OStringBuffer* pBuffer = static_cast<OStringBuffer*>(pContext);
164 208 : pBuffer->append(sBuffer);
165 208 : return nLen;
166 : }
167 :
168 16 : int closeCallback(void* )
169 : {
170 16 : return 0;
171 : }
172 :
173 : // ----------------------------------------
174 : // ---------- FillProperties.idl ----------
175 : // ----------------------------------------
176 138 : void dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter)
177 : {
178 138 : switch(eFillStyle)
179 : {
180 : case drawing::FillStyle_NONE:
181 21 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "NONE");
182 21 : break;
183 : case drawing::FillStyle_SOLID:
184 52 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "SOLID");
185 52 : break;
186 : case drawing::FillStyle_GRADIENT:
187 10 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "GRADIENT");
188 10 : break;
189 : case drawing::FillStyle_HATCH:
190 55 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "HATCH");
191 55 : break;
192 : case drawing::FillStyle_BITMAP:
193 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "BITMAP");
194 0 : break;
195 : default:
196 0 : break;
197 : }
198 138 : }
199 :
200 138 : void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter)
201 : {
202 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillColor"), "%06x", (unsigned int) aColor);
203 138 : }
204 :
205 138 : void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter)
206 : {
207 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32, aTransparence);
208 138 : }
209 :
210 138 : void dumpFillTransparenceGradientNameAsAttribute(OUString sTranspGradName, xmlTextWriterPtr xmlWriter)
211 : {
212 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s",
213 138 : OUStringToOString(sTranspGradName, RTL_TEXTENCODING_UTF8).getStr());
214 138 : }
215 :
216 : //because there's more awt::Gradient properties to dump
217 276 : void dumpGradientProperty(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter)
218 : {
219 276 : switch(aGradient.Style) //enum GradientStyle
220 : {
221 : case awt::GradientStyle_LINEAR:
222 273 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "LINEAR");
223 273 : break;
224 : case awt::GradientStyle_AXIAL:
225 1 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "AXIAL");
226 1 : break;
227 : case awt::GradientStyle_RADIAL:
228 1 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RADIAL");
229 1 : break;
230 : case awt::GradientStyle_ELLIPTICAL:
231 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ELLIPTICAL");
232 0 : break;
233 : case awt::GradientStyle_SQUARE:
234 1 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "SQUARE");
235 1 : break;
236 : case awt::GradientStyle_RECT:
237 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT");
238 0 : break;
239 : default:
240 0 : break;
241 : }
242 276 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startColor"), "%06x", (unsigned int) aGradient.StartColor);
243 276 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endColor"), "%06x", (unsigned int) aGradient.EndColor);
244 276 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.Angle);
245 276 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("border"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.Border);
246 276 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("xOffset"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.XOffset);
247 276 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("yOffset"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.YOffset);
248 276 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StartIntensity);
249 276 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.EndIntensity);
250 276 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StepCount);
251 276 : }
252 :
253 138 : void dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter)
254 : {
255 138 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillTransparenceGradient" ));
256 138 : dumpGradientProperty(aTranspGrad, xmlWriter);
257 138 : xmlTextWriterEndElement( xmlWriter );
258 138 : }
259 :
260 414 : void dumpFillGradientNameAsAttribute(OUString sGradName, xmlTextWriterPtr xmlWriter)
261 : {
262 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s",
263 414 : OUStringToOString(sGradName, RTL_TEXTENCODING_UTF8).getStr());
264 414 : }
265 :
266 138 : void dumpFillGradientAsElement(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter)
267 : {
268 138 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillGradient" ));
269 138 : dumpGradientProperty(aGradient, xmlWriter);
270 138 : xmlTextWriterEndElement( xmlWriter );
271 138 : }
272 :
273 138 : void dumpFillHatchAsElement(drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter)
274 : {
275 138 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillHatch" ));
276 138 : switch(aHatch.Style)
277 : {
278 : case drawing::HatchStyle_SINGLE:
279 110 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "SINGLE");
280 110 : break;
281 : case drawing::HatchStyle_DOUBLE:
282 19 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "DOUBLE");
283 19 : break;
284 : case drawing::HatchStyle_TRIPLE:
285 9 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "TRIPLE");
286 9 : break;
287 : default:
288 0 : break;
289 : }
290 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("color"), "%06x", (unsigned int) aHatch.Color);
291 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Distance);
292 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Angle);
293 138 : xmlTextWriterEndElement( xmlWriter );
294 138 : }
295 :
296 138 : void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter)
297 : {
298 138 : if(bBackground)
299 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "true");
300 : else
301 138 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "false");
302 138 : }
303 :
304 138 : void dumpFillBitmapAsElement(uno::Reference<awt::XBitmap> xBitmap, xmlTextWriterPtr xmlWriter)
305 : {
306 138 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillBitmap" ));
307 138 : if (xBitmap.is())
308 : {
309 132 : awt::Size const aSize = xBitmap->getSize();
310 132 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aSize.Width);
311 132 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aSize.Height);
312 : }
313 138 : xmlTextWriterEndElement( xmlWriter );
314 138 : }
315 :
316 138 : void dumpFillBitmapURLAsAttribute(OUString sBitmapURL, xmlTextWriterPtr xmlWriter)
317 : {
318 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapURL"), "%s",
319 138 : OUStringToOString(sBitmapURL, RTL_TEXTENCODING_UTF8).getStr());
320 138 : }
321 :
322 138 : void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter)
323 : {
324 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetX"), "%" SAL_PRIdINT32, aBitmapPositionOffsetX);
325 138 : }
326 :
327 138 : void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter)
328 : {
329 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetY"), "%" SAL_PRIdINT32, aBitmapPositionOffsetY);
330 138 : }
331 :
332 138 : void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter)
333 : {
334 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetX"), "%" SAL_PRIdINT32, aBitmapOffsetX);
335 138 : }
336 :
337 138 : void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter)
338 : {
339 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetY"), "%" SAL_PRIdINT32, aBitmapOffsetY);
340 138 : }
341 :
342 138 : void dumpFillBitmapRectanglePointAsAttribute(drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter)
343 : {
344 138 : switch(eBitmapRectanglePoint)
345 : {
346 : case drawing::RectanglePoint_LEFT_TOP:
347 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_TOP");
348 0 : break;
349 : case drawing::RectanglePoint_MIDDLE_TOP:
350 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_TOP");
351 0 : break;
352 : case drawing::RectanglePoint_RIGHT_TOP:
353 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_TOP");
354 0 : break;
355 : case drawing::RectanglePoint_LEFT_MIDDLE:
356 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_MIDDLE");
357 0 : break;
358 : case drawing::RectanglePoint_MIDDLE_MIDDLE:
359 138 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_MIDDLE");
360 138 : break;
361 : case drawing::RectanglePoint_RIGHT_MIDDLE:
362 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_MIDDLE");
363 0 : break;
364 : case drawing::RectanglePoint_LEFT_BOTTOM:
365 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_BOTTOM");
366 0 : break;
367 : case drawing::RectanglePoint_MIDDLE_BOTTOM:
368 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_BOTTOM");
369 0 : break;
370 : case drawing::RectanglePoint_RIGHT_BOTTOM:
371 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_BOTTOM");
372 0 : break;
373 : default:
374 0 : break;
375 : }
376 138 : }
377 :
378 138 : void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter)
379 : {
380 138 : if(bBitmapLogicalSize)
381 138 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "true");
382 : else
383 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "false");
384 138 : }
385 :
386 138 : void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter)
387 : {
388 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeX"), "%" SAL_PRIdINT32, aBitmapSizeX);
389 138 : }
390 :
391 138 : void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter)
392 : {
393 138 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeY"), "%" SAL_PRIdINT32, aBitmapSizeY);
394 138 : }
395 :
396 138 : void dumpFillBitmapModeAsAttribute(drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter)
397 : {
398 138 : switch(eBitmapMode)
399 : {
400 : case drawing::BitmapMode_REPEAT:
401 138 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "REPEAT");
402 138 : break;
403 : case drawing::BitmapMode_STRETCH:
404 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "STRETCH");
405 0 : break;
406 : case drawing::BitmapMode_NO_REPEAT:
407 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "NO_REPEAT");
408 0 : break;
409 : default:
410 0 : break;
411 : }
412 138 : }
413 :
414 138 : void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter)
415 : {
416 138 : if(bBitmapStretch)
417 138 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "true");
418 : else
419 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "false");
420 138 : }
421 :
422 138 : void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter)
423 : {
424 138 : if(bBitmapTile)
425 138 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "true");
426 : else
427 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "false");
428 138 : }
429 :
430 : // ----------------------------------------
431 : // ---------- LineProperties.idl ----------
432 : // ----------------------------------------
433 :
434 142 : void dumpLineStyleAsAttribute(drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter)
435 : {
436 142 : switch(eLineStyle)
437 : {
438 : case drawing::LineStyle_NONE:
439 8 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "NONE");
440 8 : break;
441 : case drawing::LineStyle_SOLID:
442 134 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "SOLID");
443 134 : break;
444 : case drawing::LineStyle_DASH:
445 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "DASH");
446 0 : break;
447 : default:
448 0 : break;
449 : }
450 142 : }
451 :
452 142 : void dumpLineDashAsElement(drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter)
453 : {
454 142 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineDash" ));
455 142 : switch(aLineDash.Style)
456 : {
457 : case drawing::DashStyle_RECT:
458 142 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT");
459 142 : break;
460 : case drawing::DashStyle_ROUND:
461 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUND");
462 0 : break;
463 : case drawing::DashStyle_RECTRELATIVE:
464 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECTRELATIVE");
465 0 : break;
466 : case drawing::DashStyle_ROUNDRELATIVE:
467 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUNDRELATIVE");
468 0 : break;
469 : default:
470 0 : break;
471 : }
472 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dots"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dots);
473 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dotLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DotLen);
474 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashes"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dashes);
475 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DashLen);
476 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Distance);
477 142 : xmlTextWriterEndElement( xmlWriter );
478 142 : }
479 :
480 142 : void dumpLineDashNameAsAttribute(OUString sLineDashName, xmlTextWriterPtr xmlWriter)
481 : {
482 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineDashName"), "%s",
483 142 : OUStringToOString(sLineDashName, RTL_TEXTENCODING_UTF8).getStr());
484 142 : }
485 :
486 142 : void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter)
487 : {
488 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineColor"), "%06x", (unsigned int) aLineColor);
489 142 : }
490 :
491 142 : void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter)
492 : {
493 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32, aLineTransparence);
494 142 : }
495 :
496 142 : void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter)
497 : {
498 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32, aLineWidth);
499 142 : }
500 :
501 142 : void dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter)
502 : {
503 142 : switch(eLineJoint)
504 : {
505 : case drawing::LineJoint_NONE:
506 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "NONE");
507 0 : break;
508 : case drawing::LineJoint_MIDDLE:
509 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MIDDLE");
510 0 : break;
511 : case drawing::LineJoint_BEVEL:
512 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "BEVEL");
513 0 : break;
514 : case drawing::LineJoint_MITER:
515 54 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MITER");
516 54 : break;
517 : case drawing::LineJoint_ROUND:
518 88 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "ROUND");
519 88 : break;
520 : default:
521 0 : break;
522 : }
523 142 : }
524 :
525 142 : void dumpLineStartNameAsAttribute(OUString sLineStartName, xmlTextWriterPtr xmlWriter)
526 : {
527 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s",
528 142 : OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr());
529 142 : }
530 :
531 142 : void dumpLineEndNameAsAttribute(OUString sLineEndName, xmlTextWriterPtr xmlWriter)
532 : {
533 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndName"), "%s",
534 142 : OUStringToOString(sLineEndName, RTL_TEXTENCODING_UTF8).getStr());
535 142 : }
536 :
537 292 : void dumpPolyPolygonBezierCoords(drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter)
538 : {
539 292 : dumpPointSequenceSequence(aPolyPolygonBezierCoords.Coordinates, &aPolyPolygonBezierCoords.Flags, xmlWriter);
540 292 : }
541 :
542 142 : void dumpLineStartAsElement(drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter)
543 : {
544 142 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineStart" ));
545 142 : dumpPolyPolygonBezierCoords(aLineStart, xmlWriter);
546 142 : xmlTextWriterEndElement( xmlWriter );
547 142 : }
548 :
549 142 : void dumpLineEndAsElement(drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter)
550 : {
551 142 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineEnd" ));
552 142 : dumpPolyPolygonBezierCoords(aLineEnd, xmlWriter);
553 142 : xmlTextWriterEndElement( xmlWriter );
554 142 : }
555 :
556 142 : void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter)
557 : {
558 142 : if(bLineStartCenter)
559 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "true");
560 : else
561 142 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "false");
562 142 : }
563 :
564 142 : void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter)
565 : {
566 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32, aLineStartWidth);
567 142 : }
568 :
569 142 : void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter)
570 : {
571 142 : if(bLineEndCenter)
572 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "true");
573 : else
574 142 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "false");
575 142 : }
576 :
577 142 : void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter)
578 : {
579 142 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32, aLineEndWidth);
580 142 : }
581 :
582 : // -----------------------------------------------
583 : // ---------- PolyPolygonDescriptor.idl ----------
584 : // -----------------------------------------------
585 :
586 11 : void dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter)
587 : {
588 11 : switch(ePolygonKind)
589 : {
590 : case drawing::PolygonKind_LINE:
591 3 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "LINE");
592 3 : break;
593 : case drawing::PolygonKind_POLY:
594 3 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "POLY");
595 3 : break;
596 : case drawing::PolygonKind_PLIN:
597 1 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PLIN");
598 1 : break;
599 : case drawing::PolygonKind_PATHLINE:
600 2 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHLINE");
601 2 : break;
602 : case drawing::PolygonKind_PATHFILL:
603 2 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHFILL");
604 2 : break;
605 : case drawing::PolygonKind_FREELINE:
606 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREELINE");
607 0 : break;
608 : case drawing::PolygonKind_FREEFILL:
609 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREEFILL");
610 0 : break;
611 : case drawing::PolygonKind_PATHPOLY:
612 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPOLY");
613 0 : break;
614 : case drawing::PolygonKind_PATHPLIN:
615 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPLIN");
616 0 : break;
617 : default:
618 0 : break;
619 : }
620 11 : }
621 :
622 306 : void dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence, uno::Sequence<uno::Sequence< drawing::PolygonFlags > >* pFlags, xmlTextWriterPtr xmlWriter)
623 : {
624 : // LibreOffice proudly presents - The Sequenception
625 306 : uno::Sequence<uno::Sequence< awt::Point > > pointSequenceSequence = aPointSequenceSequence;
626 306 : sal_Int32 nPointsSequence = pointSequenceSequence.getLength();
627 :
628 333 : for (sal_Int32 i = 0; i < nPointsSequence; ++i)
629 : {
630 27 : uno::Sequence< awt::Point > pointSequence = pointSequenceSequence[i];
631 27 : sal_Int32 nPoints = pointSequence.getLength();
632 :
633 54 : uno::Sequence< drawing::PolygonFlags> flagsSequence;
634 27 : if(pFlags)
635 13 : flagsSequence = (*pFlags)[i];
636 :
637 27 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "pointSequence" ));
638 :
639 553 : for(sal_Int32 j = 0; j < nPoints; ++j)
640 : {
641 526 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "point" ));
642 526 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, pointSequence[j].X);
643 526 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, pointSequence[j].Y);
644 :
645 526 : if(pFlags)
646 : {
647 428 : switch(flagsSequence[j])
648 : {
649 : case drawing::PolygonFlags_NORMAL:
650 158 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "NORMAL");
651 158 : break;
652 : case drawing::PolygonFlags_SMOOTH:
653 2 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SMOOTH");
654 2 : break;
655 : case drawing::PolygonFlags_CONTROL:
656 252 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "CONTROL");
657 252 : break;
658 : case drawing::PolygonFlags_SYMMETRIC:
659 16 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SYMMETRIC");
660 16 : break;
661 : default:
662 0 : break;
663 : }
664 : }
665 :
666 526 : xmlTextWriterEndElement( xmlWriter );
667 : }
668 27 : xmlTextWriterEndElement( xmlWriter );
669 333 : }
670 306 : }
671 :
672 7 : void dumpPolyPolygonAsElement(drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter)
673 : {
674 7 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygon" ));
675 7 : dumpPointSequenceSequence(aPolyPolygon, NULL, xmlWriter);
676 7 : xmlTextWriterEndElement( xmlWriter );
677 7 : }
678 :
679 7 : void dumpGeometryAsElement(drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter)
680 : {
681 7 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" ));
682 7 : dumpPointSequenceSequence(aGeometry, NULL, xmlWriter);
683 7 : xmlTextWriterEndElement( xmlWriter );
684 7 : }
685 :
686 : // CharacterProperties.idl
687 143 : void dumpCharHeightAsAttribute(float fHeight, xmlTextWriterPtr xmlWriter)
688 : {
689 143 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fontHeight"), "%f", fHeight );
690 143 : }
691 :
692 143 : void dumpCharColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter)
693 : {
694 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fontColor"), "%06x", (unsigned int) aColor);
695 143 : }
696 :
697 : // ----------------------------------------
698 : // ---------- TextProperties.idl ----------
699 : // ----------------------------------------
700 :
701 0 : void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter)
702 : {
703 0 : if(bIsNumbering)
704 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "true");
705 : else
706 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "false");
707 0 : }
708 :
709 143 : void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter)
710 : {
711 143 : if(bTextAutoGrowHeight)
712 18 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "true");
713 : else
714 125 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "false");
715 143 : }
716 :
717 143 : void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter)
718 : {
719 143 : if(bTextAutoGrowWidth)
720 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "true");
721 : else
722 143 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "false");
723 143 : }
724 :
725 143 : void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter)
726 : {
727 143 : if(bTextContourFrame)
728 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "true");
729 : else
730 143 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "false");
731 143 : }
732 :
733 143 : void dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter)
734 : {
735 143 : switch(eTextFitToSize)
736 : {
737 : case drawing::TextFitToSizeType_NONE:
738 142 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "NONE");
739 142 : break;
740 : case drawing::TextFitToSizeType_PROPORTIONAL:
741 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "PROPORTIONAL");
742 0 : break;
743 : case drawing::TextFitToSizeType_ALLLINES:
744 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "ALLLINES");
745 0 : break;
746 : case drawing::TextFitToSizeType_AUTOFIT:
747 1 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "AUTOFIT");
748 1 : break;
749 : default:
750 0 : break;
751 : }
752 143 : }
753 :
754 143 : void dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter)
755 : {
756 143 : switch(eTextHorizontalAdjust)
757 : {
758 : case drawing::TextHorizontalAdjust_LEFT:
759 2 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "LEFT");
760 2 : break;
761 : case drawing::TextHorizontalAdjust_CENTER:
762 2 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "CENTER");
763 2 : break;
764 : case drawing::TextHorizontalAdjust_RIGHT:
765 2 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "RIGHT");
766 2 : break;
767 : case drawing::TextHorizontalAdjust_BLOCK:
768 137 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK");
769 137 : break;
770 : default:
771 0 : break;
772 : }
773 143 : }
774 :
775 143 : void dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter)
776 : {
777 143 : switch(eTextVerticalAdjust)
778 : {
779 : case drawing::TextVerticalAdjust_TOP:
780 10 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "TOP");
781 10 : break;
782 : case drawing::TextVerticalAdjust_CENTER:
783 133 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "CENTER");
784 133 : break;
785 : case drawing::TextVerticalAdjust_BOTTOM:
786 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BOTTOM");
787 0 : break;
788 : case drawing::TextVerticalAdjust_BLOCK:
789 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BLOCK");
790 0 : break;
791 : default:
792 0 : break;
793 : }
794 143 : }
795 :
796 143 : void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter)
797 : {
798 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32, aTextLeftDistance);
799 143 : }
800 :
801 143 : void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter)
802 : {
803 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32, aTextRightDistance);
804 143 : }
805 :
806 143 : void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter)
807 : {
808 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32, aTextUpperDistance);
809 143 : }
810 :
811 143 : void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter)
812 : {
813 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32, aTextLowerDistance);
814 143 : }
815 :
816 143 : void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter)
817 : {
818 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32, aTextMaximumFrameHeight);
819 143 : }
820 :
821 143 : void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter)
822 : {
823 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32, aTextMaximumFrameWidth);
824 143 : }
825 :
826 143 : void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter)
827 : {
828 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32, aTextMinimumFrameHeight);
829 143 : }
830 :
831 143 : void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter)
832 : {
833 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32, aTextMinimumFrameWidth);
834 143 : }
835 :
836 143 : void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter)
837 : {
838 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32, aTextAnimationAmount);
839 143 : }
840 :
841 143 : void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter)
842 : {
843 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32, aTextAnimationCount);
844 143 : }
845 :
846 143 : void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter)
847 : {
848 143 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32, aTextAnimationDelay);
849 143 : }
850 :
851 143 : void dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter)
852 : {
853 143 : switch(eTextAnimationDirection)
854 : {
855 : case drawing::TextAnimationDirection_LEFT:
856 143 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "LEFT");
857 143 : break;
858 : case drawing::TextAnimationDirection_RIGHT:
859 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "RIGHT");
860 0 : break;
861 : case drawing::TextAnimationDirection_UP:
862 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "UP");
863 0 : break;
864 : case drawing::TextAnimationDirection_DOWN:
865 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "DOWN");
866 0 : break;
867 : default:
868 0 : break;
869 : }
870 143 : }
871 :
872 143 : void dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter)
873 : {
874 143 : switch(eTextAnimationKind)
875 : {
876 : case drawing::TextAnimationKind_NONE:
877 143 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "NONE");
878 143 : break;
879 : case drawing::TextAnimationKind_BLINK:
880 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "BLINK");
881 0 : break;
882 : case drawing::TextAnimationKind_SCROLL:
883 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SCROLL");
884 0 : break;
885 : case drawing::TextAnimationKind_ALTERNATE:
886 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "ALTERNATE");
887 0 : break;
888 : case drawing::TextAnimationKind_SLIDE:
889 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SLIDE");
890 0 : break;
891 : default:
892 0 : break;
893 : }
894 143 : }
895 :
896 143 : void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter)
897 : {
898 143 : if(bTextAnimationStartInside)
899 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "true");
900 : else
901 143 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "false");
902 143 : }
903 :
904 143 : void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter)
905 : {
906 143 : if(bTextAnimationStopInside)
907 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "true");
908 : else
909 143 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "false");
910 143 : }
911 :
912 143 : void dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode, xmlTextWriterPtr xmlWriter)
913 : {
914 143 : switch(eTextWritingMode)
915 : {
916 : case text::WritingMode_LR_TB:
917 143 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "LR_TB");
918 143 : break;
919 : case text::WritingMode_RL_TB:
920 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "RL_TB");
921 0 : break;
922 : case text::WritingMode_TB_RL:
923 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "TB_RL");
924 0 : break;
925 : default:
926 0 : break;
927 : }
928 143 : }
929 :
930 : // ------------------------------------------
931 : // ---------- ShadowProperties.idl ----------
932 : // ------------------------------------------
933 :
934 18 : void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter)
935 : {
936 18 : if(bShadow)
937 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "true");
938 : else
939 18 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "false");
940 18 : }
941 :
942 18 : void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter)
943 : {
944 18 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowColor"), "%06x", (unsigned int) aShadowColor);
945 18 : }
946 :
947 18 : void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter)
948 : {
949 18 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32, aShadowTransparence);
950 18 : }
951 :
952 18 : void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter)
953 : {
954 18 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowXDistance"), "%" SAL_PRIdINT32, aShadowXDistance);
955 18 : }
956 :
957 18 : void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter)
958 : {
959 18 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32, aShadowYDistance);
960 18 : }
961 :
962 : // -------------------------------
963 : // ---------- Shape.idl ----------
964 : // -------------------------------
965 :
966 144 : void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter)
967 : {
968 144 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("zOrder"), "%" SAL_PRIdINT32, aZOrder);
969 144 : }
970 :
971 144 : void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter)
972 : {
973 144 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID);
974 144 : }
975 :
976 144 : void dumpLayerNameAsAttribute(OUString sLayerName, xmlTextWriterPtr xmlWriter)
977 : {
978 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s",
979 144 : OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr());
980 144 : }
981 :
982 144 : void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter)
983 : {
984 144 : if(bVisible)
985 144 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "true");
986 : else
987 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "false");
988 144 : }
989 :
990 144 : void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter)
991 : {
992 144 : if(bPrintable)
993 144 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "true");
994 : else
995 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "false");
996 144 : }
997 :
998 144 : void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter)
999 : {
1000 144 : if(bMoveProtect)
1001 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "true");
1002 : else
1003 144 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false");
1004 144 : }
1005 :
1006 144 : void dumpNameAsAttribute(OUString sName, xmlTextWriterPtr xmlWriter)
1007 : {
1008 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s",
1009 144 : OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr());
1010 144 : }
1011 :
1012 144 : void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter)
1013 : {
1014 144 : if(bSizeProtect)
1015 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "true");
1016 : else
1017 144 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false");
1018 144 : }
1019 :
1020 432 : void dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aHomogenMatrixLine3, xmlTextWriterPtr xmlWriter)
1021 : {
1022 432 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column1"), "%f", aHomogenMatrixLine3.Column1);
1023 432 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column2"), "%f", aHomogenMatrixLine3.Column2);
1024 432 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", aHomogenMatrixLine3.Column3);
1025 432 : }
1026 :
1027 144 : void dumpTransformationAsElement(drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter)
1028 : {
1029 144 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Transformation" ));
1030 : {
1031 144 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line1" ));
1032 144 : dumpHomogenMatrixLine3(aTransformation.Line1, xmlWriter);
1033 144 : xmlTextWriterEndElement( xmlWriter );
1034 144 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line2" ));
1035 144 : dumpHomogenMatrixLine3(aTransformation.Line2, xmlWriter);
1036 144 : xmlTextWriterEndElement( xmlWriter );
1037 144 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line3" ));
1038 144 : dumpHomogenMatrixLine3(aTransformation.Line3, xmlWriter);
1039 144 : xmlTextWriterEndElement( xmlWriter );
1040 : }
1041 144 : xmlTextWriterEndElement( xmlWriter );
1042 144 : }
1043 :
1044 144 : void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter)
1045 : {
1046 144 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder);
1047 144 : }
1048 :
1049 0 : void dumpHyperlinkAsAttribute(OUString sHyperlink, xmlTextWriterPtr xmlWriter)
1050 : {
1051 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("hyperlink"), "%s",
1052 0 : OUStringToOString(sHyperlink, RTL_TEXTENCODING_UTF8).getStr());
1053 0 : }
1054 :
1055 : // --------------------------------
1056 : // ---------- XShape.idl ----------
1057 : // --------------------------------
1058 :
1059 146 : void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter)
1060 : {
1061 146 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X);
1062 146 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y);
1063 146 : }
1064 :
1065 146 : void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter)
1066 : {
1067 146 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width);
1068 146 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height);
1069 146 : }
1070 :
1071 146 : void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter )
1072 : {
1073 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s",
1074 146 : OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr());
1075 146 : }
1076 :
1077 : // -------------------------------------
1078 : // ---------- CustomShape.idl ----------
1079 : // -------------------------------------
1080 :
1081 125 : void dumpCustomShapeEngineAsAttribute(OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter)
1082 : {
1083 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeEngine"), "%s",
1084 125 : OUStringToOString(sCustomShapeEngine, RTL_TEXTENCODING_UTF8).getStr());
1085 125 : }
1086 :
1087 125 : void dumpCustomShapeDataAsAttribute(OUString sCustomShapeData, xmlTextWriterPtr xmlWriter)
1088 : {
1089 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeData"), "%s",
1090 125 : OUStringToOString(sCustomShapeData, RTL_TEXTENCODING_UTF8).getStr());
1091 125 : }
1092 :
1093 1400 : void dumpPropertyValueAsElement(const beans::PropertyValue& rPropertyValue, xmlTextWriterPtr xmlWriter)
1094 : {
1095 1400 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" ));
1096 :
1097 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s",
1098 1400 : OUStringToOString(rPropertyValue.Name, RTL_TEXTENCODING_UTF8).getStr());
1099 :
1100 1400 : uno::Any aAny = rPropertyValue.Value;
1101 2800 : OUString sValue;
1102 : float fValue;
1103 : sal_Int32 nValue;
1104 : sal_Bool bValue;
1105 1400 : awt::Rectangle aRectangleValue;
1106 2800 : uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues;
1107 2800 : uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates;
1108 2800 : uno::Sequence< drawing::EnhancedCustomShapeSegment > aSegments;
1109 2800 : uno::Sequence< beans::PropertyValue > aPropSeq;
1110 1400 : if(aAny >>= sValue)
1111 : {
1112 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s",
1113 125 : OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
1114 : }
1115 1275 : else if(aAny >>= nValue)
1116 : {
1117 97 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%" SAL_PRIdINT32, nValue);
1118 : }
1119 1178 : else if(aAny >>= fValue)
1120 : {
1121 0 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%f", fValue);
1122 : }
1123 1178 : else if(aAny >>= bValue)
1124 : {
1125 194 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", (bValue? "true": "false"));
1126 : }
1127 984 : else if(rPropertyValue.Name == "ViewBox" && (aAny >>= aRectangleValue))
1128 : {
1129 124 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1130 124 : enhancedDumper.dumpViewBoxAsElement(aRectangleValue);
1131 : }
1132 860 : else if(rPropertyValue.Name == "AdjustmentValues" && (aAny >>= aAdjustmentValues))
1133 : {
1134 125 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1135 125 : enhancedDumper.dumpAdjustmentValuesAsElement(aAdjustmentValues);
1136 : }
1137 735 : else if(rPropertyValue.Name == "Coordinates" && (aAny >>= aCoordinates))
1138 : {
1139 125 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1140 125 : enhancedDumper.dumpCoordinatesAsElement(aCoordinates);
1141 : }
1142 610 : else if(rPropertyValue.Name == "Segments" && (aAny >>= aSegments))
1143 : {
1144 125 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1145 125 : enhancedDumper.dumpSegmentsAsElement(aSegments);
1146 : }
1147 485 : else if(aAny >>= aPropSeq)
1148 : {
1149 181 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( OUStringToOString(rPropertyValue.Name, RTL_TEXTENCODING_UTF8).getStr() ));
1150 :
1151 181 : sal_Int32 i = 0, nCount = aPropSeq.getLength();
1152 620 : for ( ; i < nCount; i++ )
1153 439 : dumpPropertyValueAsElement(aPropSeq[ i ], xmlWriter);
1154 :
1155 181 : xmlTextWriterEndElement(xmlWriter);
1156 : }
1157 : // TODO more, if necessary
1158 :
1159 1400 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("handle"), "%" SAL_PRIdINT32, rPropertyValue.Handle);
1160 :
1161 1400 : switch(rPropertyValue.State)
1162 : {
1163 : case beans::PropertyState_DIRECT_VALUE:
1164 1400 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
1165 1400 : break;
1166 : case beans::PropertyState_DEFAULT_VALUE:
1167 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE");
1168 0 : break;
1169 : case beans::PropertyState_AMBIGUOUS_VALUE:
1170 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE");
1171 0 : break;
1172 : default:
1173 0 : break;
1174 : }
1175 2800 : xmlTextWriterEndElement( xmlWriter );
1176 1400 : }
1177 :
1178 125 : void dumpCustomShapeGeometryAsElement(uno::Sequence< beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter)
1179 : {
1180 125 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "CustomShapeGeometry" ));
1181 :
1182 125 : sal_Int32 nLength = aCustomShapeGeometry.getLength();
1183 1086 : for (sal_Int32 i = 0; i < nLength; ++i)
1184 961 : dumpPropertyValueAsElement(aCustomShapeGeometry[i], xmlWriter);
1185 :
1186 125 : xmlTextWriterEndElement( xmlWriter );
1187 125 : }
1188 :
1189 0 : void dumpCustomShapeReplacementURLAsAttribute(OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter)
1190 : {
1191 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeReplacementURL"), "%s",
1192 0 : OUStringToOString(sCustomShapeReplacementURL, RTL_TEXTENCODING_UTF8).getStr());
1193 0 : }
1194 :
1195 : // methods dumping whole services
1196 :
1197 143 : void dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1198 : {
1199 143 : uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo();
1200 143 : if(xInfo->hasPropertyByName("CharHeight"))
1201 : {
1202 143 : uno::Any anotherAny = xPropSet->getPropertyValue("CharHeight");
1203 : float fHeight;
1204 143 : if(anotherAny >>= fHeight)
1205 143 : dumpCharHeightAsAttribute(fHeight, xmlWriter);
1206 : }
1207 143 : if(xInfo->hasPropertyByName("CharColor"))
1208 : {
1209 143 : uno::Any anotherAny = xPropSet->getPropertyValue("CharColor");
1210 143 : sal_Int32 aColor = sal_Int32();
1211 143 : if(anotherAny >>= aColor)
1212 143 : dumpCharColorAsAttribute(aColor, xmlWriter);
1213 : }
1214 : // TODO - more properties from CharacterProperties.idl (similar to above)
1215 :
1216 143 : if(xInfo->hasPropertyByName("IsNumbering"))
1217 : {
1218 0 : uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering");
1219 0 : sal_Bool bIsNumbering = sal_Bool();
1220 0 : if(anotherAny >>= bIsNumbering)
1221 0 : dumpIsNumberingAsAttribute(bIsNumbering, xmlWriter);
1222 : }
1223 : {
1224 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowHeight");
1225 143 : sal_Bool bTextAutoGrowHeight = sal_Bool();
1226 143 : if(anotherAny >>= bTextAutoGrowHeight)
1227 143 : dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight, xmlWriter);
1228 : }
1229 : {
1230 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowWidth");
1231 143 : sal_Bool bTextAutoGrowWidth = sal_Bool();
1232 143 : if(anotherAny >>= bTextAutoGrowWidth)
1233 143 : dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter);
1234 : }
1235 : {
1236 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextContourFrame");
1237 143 : sal_Bool bTextContourFrame = sal_Bool();
1238 143 : if(anotherAny >>= bTextContourFrame)
1239 143 : dumpTextContourFrameAsAttribute(bTextContourFrame, xmlWriter);
1240 : }
1241 : {
1242 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextFitToSize");
1243 : drawing::TextFitToSizeType eTextFitToSize;
1244 143 : if(anotherAny >>= eTextFitToSize)
1245 143 : dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter);
1246 : }
1247 : {
1248 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust");
1249 : drawing::TextHorizontalAdjust eTextHorizontalAdjust;
1250 143 : if(anotherAny >>= eTextHorizontalAdjust)
1251 143 : dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter);
1252 : }
1253 : {
1254 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust");
1255 : drawing::TextVerticalAdjust eTextVerticalAdjust;
1256 143 : if(anotherAny >>= eTextVerticalAdjust)
1257 143 : dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter);
1258 : }
1259 : {
1260 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextLeftDistance");
1261 143 : sal_Int32 aTextLeftDistance = sal_Int32();
1262 143 : if(anotherAny >>= aTextLeftDistance)
1263 143 : dumpTextLeftDistanceAsAttribute(aTextLeftDistance, xmlWriter);
1264 : }
1265 : {
1266 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextRightDistance");
1267 143 : sal_Int32 aTextRightDistance = sal_Int32();
1268 143 : if(anotherAny >>= aTextRightDistance)
1269 143 : dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter);
1270 : }
1271 : {
1272 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextUpperDistance");
1273 143 : sal_Int32 aTextUpperDistance = sal_Int32();
1274 143 : if(anotherAny >>= aTextUpperDistance)
1275 143 : dumpTextUpperDistanceAsAttribute(aTextUpperDistance, xmlWriter);
1276 : }
1277 : {
1278 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextLowerDistance");
1279 143 : sal_Int32 aTextLowerDistance = sal_Int32();
1280 143 : if(anotherAny >>= aTextLowerDistance)
1281 143 : dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter);
1282 : }
1283 : {
1284 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameHeight");
1285 143 : sal_Int32 aTextMaximumFrameHeight = sal_Int32();
1286 143 : if(anotherAny >>= aTextMaximumFrameHeight)
1287 143 : dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight, xmlWriter);
1288 : }
1289 : {
1290 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameWidth");
1291 143 : sal_Int32 aTextMaximumFrameWidth = sal_Int32();
1292 143 : if(anotherAny >>= aTextMaximumFrameWidth)
1293 143 : dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter);
1294 : }
1295 : {
1296 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameHeight");
1297 143 : sal_Int32 aTextMinimumFrameHeight = sal_Int32();
1298 143 : if(anotherAny >>= aTextMinimumFrameHeight)
1299 143 : dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight, xmlWriter);
1300 : }
1301 : {
1302 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameWidth");
1303 143 : sal_Int32 aTextMinimumFrameWidth = sal_Int32();
1304 143 : if(anotherAny >>= aTextMinimumFrameWidth)
1305 143 : dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter);
1306 : }
1307 : {
1308 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationAmount");
1309 143 : sal_Int32 aTextAnimationAmount = sal_Int32();
1310 143 : if(anotherAny >>= aTextAnimationAmount)
1311 143 : dumpTextAnimationAmountAsAttribute(aTextAnimationAmount, xmlWriter);
1312 : }
1313 : {
1314 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationCount");
1315 143 : sal_Int32 aTextAnimationCount = sal_Int32();
1316 143 : if(anotherAny >>= aTextAnimationCount)
1317 143 : dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter);
1318 : }
1319 : {
1320 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDelay");
1321 143 : sal_Int32 aTextAnimationDelay = sal_Int32();
1322 143 : if(anotherAny >>= aTextAnimationDelay)
1323 143 : dumpTextAnimationDelayAsAttribute(aTextAnimationDelay, xmlWriter);
1324 : }
1325 : {
1326 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDirection");
1327 : drawing::TextAnimationDirection eTextAnimationDirection;
1328 143 : if(anotherAny >>= eTextAnimationDirection)
1329 143 : dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter);
1330 : }
1331 : {
1332 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationKind");
1333 : drawing::TextAnimationKind eTextAnimationKind;
1334 143 : if(anotherAny >>= eTextAnimationKind)
1335 143 : dumpTextAnimationKindAsAttribute(eTextAnimationKind, xmlWriter);
1336 : }
1337 : {
1338 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStartInside");
1339 143 : sal_Bool bTextAnimationStartInside = sal_Bool();
1340 143 : if(anotherAny >>= bTextAnimationStartInside)
1341 143 : dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter);
1342 : }
1343 : {
1344 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStopInside");
1345 143 : sal_Bool bTextAnimationStopInside = sal_Bool();
1346 143 : if(anotherAny >>= bTextAnimationStopInside)
1347 143 : dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside, xmlWriter);
1348 : }
1349 : {
1350 143 : uno::Any anotherAny = xPropSet->getPropertyValue("TextWritingMode");
1351 : text::WritingMode eTextWritingMode;
1352 143 : if(anotherAny >>= eTextWritingMode)
1353 143 : dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter);
1354 143 : }
1355 143 : }
1356 :
1357 138 : void dumpFillPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1358 : {
1359 : {
1360 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle");
1361 : drawing::FillStyle eFillStyle;
1362 138 : if(anotherAny >>= eFillStyle)
1363 138 : dumpFillStyleAsAttribute(eFillStyle, xmlWriter);
1364 : }
1365 : {
1366 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillColor");
1367 138 : sal_Int32 aColor = sal_Int32();
1368 138 : if(anotherAny >>= aColor)
1369 138 : dumpFillColorAsAttribute(aColor, xmlWriter);
1370 : }
1371 : {
1372 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparence");
1373 138 : sal_Int32 aTransparence = sal_Int32();
1374 138 : if(anotherAny >>= aTransparence)
1375 138 : dumpFillTransparenceAsAttribute(aTransparence, xmlWriter);
1376 : }
1377 : {
1378 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradientName");
1379 276 : OUString sTranspGradName;
1380 138 : if(anotherAny >>= sTranspGradName)
1381 276 : dumpFillTransparenceGradientNameAsAttribute(sTranspGradName, xmlWriter);
1382 : }
1383 : {
1384 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradient");
1385 138 : awt::Gradient aTranspGrad;
1386 138 : if(anotherAny >>= aTranspGrad)
1387 138 : dumpFillTransparenceGradientAsElement(aTranspGrad, xmlWriter);
1388 : }
1389 : {
1390 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillGradientName");
1391 276 : OUString sGradName;
1392 138 : if(anotherAny >>= sGradName)
1393 276 : dumpFillGradientNameAsAttribute(sGradName, xmlWriter);
1394 : }
1395 : {
1396 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillGradient");
1397 138 : awt::Gradient aGradient;
1398 138 : if(anotherAny >>= aGradient)
1399 138 : dumpFillGradientAsElement(aGradient, xmlWriter);
1400 : }
1401 : {
1402 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillHatchName");
1403 276 : OUString sHatchName;
1404 138 : if(anotherAny >>= sHatchName)
1405 276 : dumpFillGradientNameAsAttribute(sHatchName, xmlWriter);
1406 : }
1407 : {
1408 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillHatch");
1409 138 : drawing::Hatch aHatch;
1410 138 : if(anotherAny >>= aHatch)
1411 138 : dumpFillHatchAsElement(aHatch, xmlWriter);
1412 : }
1413 : {
1414 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBackground");
1415 138 : sal_Bool bFillBackground = sal_Bool();
1416 138 : if(anotherAny >>= bFillBackground)
1417 138 : dumpFillBackgroundAsAttribute(bFillBackground, xmlWriter);
1418 : }
1419 : {
1420 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapName");
1421 276 : OUString sBitmapName;
1422 138 : if(anotherAny >>= sBitmapName)
1423 276 : dumpFillGradientNameAsAttribute(sBitmapName, xmlWriter);
1424 : }
1425 : {
1426 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmap");
1427 276 : uno::Reference<awt::XBitmap> xBitmap;
1428 138 : if(anotherAny >>= xBitmap)
1429 276 : dumpFillBitmapAsElement(xBitmap, xmlWriter);
1430 : }
1431 : {
1432 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapURL");
1433 276 : OUString sBitmapURL;
1434 138 : if(anotherAny >>= sBitmapURL)
1435 276 : dumpFillBitmapURLAsAttribute(sBitmapURL, xmlWriter);
1436 : }
1437 : {
1438 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetX");
1439 138 : sal_Int32 aBitmapPositionOffsetX = sal_Int32();
1440 138 : if(anotherAny >>= aBitmapPositionOffsetX)
1441 138 : dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX, xmlWriter);
1442 : }
1443 : {
1444 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetY");
1445 138 : sal_Int32 aBitmapPositionOffsetY = sal_Int32();
1446 138 : if(anotherAny >>= aBitmapPositionOffsetY)
1447 138 : dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY, xmlWriter);
1448 : }
1449 : {
1450 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetX");
1451 138 : sal_Int32 aBitmapOffsetX = sal_Int32();
1452 138 : if(anotherAny >>= aBitmapOffsetX)
1453 138 : dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX, xmlWriter);
1454 : }
1455 : {
1456 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetY");
1457 138 : sal_Int32 aBitmapOffsetY = sal_Int32();
1458 138 : if(anotherAny >>= aBitmapOffsetY)
1459 138 : dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY, xmlWriter);
1460 : }
1461 : {
1462 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapRectanglePoint");
1463 : drawing::RectanglePoint eBitmapRectanglePoint;
1464 138 : if(anotherAny >>= eBitmapRectanglePoint)
1465 138 : dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint, xmlWriter);
1466 : }
1467 : {
1468 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapLogicalSize");
1469 138 : sal_Bool bBitmapLogicalSize = sal_Bool();
1470 138 : if(anotherAny >>= bBitmapLogicalSize)
1471 138 : dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize, xmlWriter);
1472 : }
1473 : {
1474 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeX");
1475 138 : sal_Int32 aBitmapSizeX = sal_Int32();
1476 138 : if(anotherAny >>= aBitmapSizeX)
1477 138 : dumpFillBitmapSizeXAsAttribute(aBitmapSizeX, xmlWriter);
1478 : }
1479 : {
1480 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeY");
1481 138 : sal_Int32 aBitmapSizeY = sal_Int32();
1482 138 : if(anotherAny >>= aBitmapSizeY)
1483 138 : dumpFillBitmapSizeYAsAttribute(aBitmapSizeY, xmlWriter);
1484 : }
1485 : {
1486 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapMode");
1487 : drawing::BitmapMode eBitmapMode;
1488 138 : if(anotherAny >>= eBitmapMode)
1489 138 : dumpFillBitmapModeAsAttribute(eBitmapMode, xmlWriter);
1490 : }
1491 : {
1492 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapStretch");
1493 138 : sal_Bool bBitmapStretch = sal_Bool();
1494 138 : if(anotherAny >>= bBitmapStretch)
1495 138 : dumpFillBitmapStretchAsAttribute(bBitmapStretch, xmlWriter);
1496 : }
1497 : {
1498 138 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapTile");
1499 138 : sal_Bool bBitmapTile = sal_Bool();
1500 138 : if(anotherAny >>= bBitmapTile)
1501 138 : dumpFillBitmapTileAsAttribute(bBitmapTile, xmlWriter);
1502 : }
1503 138 : }
1504 :
1505 142 : void dumpLinePropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1506 : {
1507 : {
1508 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStyle");
1509 : drawing::LineStyle eLineStyle;
1510 142 : if(anotherAny >>= eLineStyle)
1511 142 : dumpLineStyleAsAttribute(eLineStyle, xmlWriter);
1512 : }
1513 : {
1514 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineDash");
1515 142 : drawing::LineDash aLineDash;
1516 142 : if(anotherAny >>= aLineDash)
1517 142 : dumpLineDashAsElement(aLineDash, xmlWriter);
1518 : }
1519 : {
1520 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineDashName");
1521 284 : OUString sLineDashName;
1522 142 : if(anotherAny >>= sLineDashName)
1523 284 : dumpLineDashNameAsAttribute(sLineDashName, xmlWriter);
1524 : }
1525 : {
1526 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineColor");
1527 142 : sal_Int32 aLineColor = sal_Int32();
1528 142 : if(anotherAny >>= aLineColor)
1529 142 : dumpLineColorAsAttribute(aLineColor, xmlWriter);
1530 : }
1531 : {
1532 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineTransparence");
1533 142 : sal_Int32 aLineTransparence = sal_Int32();
1534 142 : if(anotherAny >>= aLineTransparence)
1535 142 : dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter);
1536 : }
1537 : {
1538 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineWidth");
1539 142 : sal_Int32 aLineWidth = sal_Int32();
1540 142 : if(anotherAny >>= aLineWidth)
1541 142 : dumpLineWidthAsAttribute(aLineWidth, xmlWriter);
1542 : }
1543 : {
1544 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineJoint");
1545 : drawing::LineJoint eLineJoint;
1546 142 : if(anotherAny >>= eLineJoint)
1547 142 : dumpLineJointAsAttribute(eLineJoint, xmlWriter);
1548 : }
1549 : {
1550 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStartName");
1551 284 : OUString sLineStartName;
1552 142 : if(anotherAny >>= sLineStartName)
1553 284 : dumpLineStartNameAsAttribute(sLineStartName, xmlWriter);
1554 : }
1555 : {
1556 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineEndName");
1557 284 : OUString sLineEndName;
1558 142 : if(anotherAny >>= sLineEndName)
1559 284 : dumpLineEndNameAsAttribute(sLineEndName, xmlWriter);
1560 : }
1561 : {
1562 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStart");
1563 284 : drawing::PolyPolygonBezierCoords aLineStart;
1564 142 : if(anotherAny >>= aLineStart)
1565 284 : dumpLineStartAsElement(aLineStart, xmlWriter);
1566 : }
1567 : {
1568 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineEnd");
1569 284 : drawing::PolyPolygonBezierCoords aLineEnd;
1570 142 : if(anotherAny >>= aLineEnd)
1571 284 : dumpLineEndAsElement(aLineEnd, xmlWriter);
1572 : }
1573 : {
1574 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStartCenter");
1575 142 : sal_Bool bLineStartCenter = sal_Bool();
1576 142 : if(anotherAny >>= bLineStartCenter)
1577 142 : dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter);
1578 : }
1579 : {
1580 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStartWidth");
1581 142 : sal_Int32 aLineStartWidth = sal_Int32();
1582 142 : if(anotherAny >>= aLineStartWidth)
1583 142 : dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter);
1584 : }
1585 : {
1586 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineEndCenter");
1587 142 : sal_Bool bLineEndCenter = sal_Bool();
1588 142 : if(anotherAny >>= bLineEndCenter)
1589 142 : dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter);
1590 : }
1591 : {
1592 142 : uno::Any anotherAny = xPropSet->getPropertyValue("LineEndWidth");
1593 142 : sal_Int32 aLineEndWidth = sal_Int32();
1594 142 : if(anotherAny >>= aLineEndWidth)
1595 142 : dumpLineEndWidthAsAttribute(aLineEndWidth, xmlWriter);
1596 : }
1597 142 : }
1598 :
1599 18 : void dumpShadowPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1600 : {
1601 : {
1602 18 : uno::Any anotherAny = xPropSet->getPropertyValue("Shadow");
1603 18 : sal_Bool bShadow = sal_Bool();
1604 18 : if(anotherAny >>= bShadow)
1605 18 : dumpShadowAsAttribute(bShadow, xmlWriter);
1606 : }
1607 : {
1608 18 : uno::Any anotherAny = xPropSet->getPropertyValue("ShadowColor");
1609 18 : sal_Int32 aShadowColor = sal_Int32();
1610 18 : if(anotherAny >>= aShadowColor)
1611 18 : dumpShadowColorAsAttribute(aShadowColor, xmlWriter);
1612 : }
1613 : {
1614 18 : uno::Any anotherAny = xPropSet->getPropertyValue("ShadowTransparence");
1615 18 : sal_Int32 aShadowTransparence = sal_Int32();
1616 18 : if(anotherAny >>= aShadowTransparence)
1617 18 : dumpShadowTransparenceAsAttribute(aShadowTransparence, xmlWriter);
1618 : }
1619 : {
1620 18 : uno::Any anotherAny = xPropSet->getPropertyValue("ShadowXDistance");
1621 18 : sal_Int32 aShadowXDistance = sal_Int32();
1622 18 : if(anotherAny >>= aShadowXDistance)
1623 18 : dumpShadowXDistanceAsAttribute(aShadowXDistance, xmlWriter);
1624 : }
1625 : {
1626 18 : uno::Any anotherAny = xPropSet->getPropertyValue("ShadowYDistance");
1627 18 : sal_Int32 aShadowYDistance = sal_Int32();
1628 18 : if(anotherAny >>= aShadowYDistance)
1629 18 : dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter);
1630 : }
1631 18 : }
1632 :
1633 7 : void dumpPolyPolygonDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1634 : {
1635 : {
1636 7 : uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind");
1637 : drawing::PolygonKind ePolygonKind;
1638 7 : if(anotherAny >>= ePolygonKind)
1639 7 : dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter);
1640 : }
1641 : {
1642 7 : uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygon");
1643 14 : drawing::PointSequenceSequence aPolyPolygon;
1644 7 : if(anotherAny >>= aPolyPolygon)
1645 14 : dumpPolyPolygonAsElement(aPolyPolygon, xmlWriter);
1646 : }
1647 : {
1648 7 : uno::Any anotherAny = xPropSet->getPropertyValue("Geometry");
1649 14 : drawing::PointSequenceSequence aGeometry;
1650 7 : if(anotherAny >>= aGeometry)
1651 14 : dumpGeometryAsElement(aGeometry, xmlWriter);
1652 : }
1653 7 : }
1654 :
1655 144 : void dumpShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1656 : {
1657 144 : uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo();
1658 : {
1659 144 : uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder");
1660 144 : sal_Int32 aZOrder = sal_Int32();
1661 144 : if(anotherAny >>= aZOrder)
1662 144 : dumpZOrderAsAttribute(aZOrder, xmlWriter);
1663 : }
1664 : {
1665 144 : uno::Any anotherAny = xPropSet->getPropertyValue("LayerID");
1666 144 : sal_Int32 aLayerID = sal_Int32();
1667 144 : if(anotherAny >>= aLayerID)
1668 144 : dumpLayerIDAsAttribute(aLayerID, xmlWriter);
1669 : }
1670 : {
1671 144 : uno::Any anotherAny = xPropSet->getPropertyValue("LayerName");
1672 288 : OUString sLayerName;
1673 144 : if(anotherAny >>= sLayerName)
1674 288 : dumpLayerNameAsAttribute(sLayerName, xmlWriter);
1675 : }
1676 : {
1677 144 : uno::Any anotherAny = xPropSet->getPropertyValue("Visible");
1678 144 : sal_Bool bVisible = sal_Bool();
1679 144 : if(anotherAny >>= bVisible)
1680 144 : dumpVisibleAsAttribute(bVisible, xmlWriter);
1681 : }
1682 : {
1683 144 : uno::Any anotherAny = xPropSet->getPropertyValue("Printable");
1684 144 : sal_Bool bPrintable = sal_Bool();
1685 144 : if(anotherAny >>= bPrintable)
1686 144 : dumpPrintableAsAttribute(bPrintable, xmlWriter);
1687 : }
1688 : {
1689 144 : uno::Any anotherAny = xPropSet->getPropertyValue("MoveProtect");
1690 144 : sal_Bool bMoveProtect = sal_Bool();
1691 144 : if(anotherAny >>= bMoveProtect)
1692 144 : dumpMoveProtectAsAttribute(bMoveProtect, xmlWriter);
1693 : }
1694 : {
1695 144 : uno::Any anotherAny = xPropSet->getPropertyValue("Name");
1696 288 : OUString sName;
1697 144 : if(anotherAny >>= sName)
1698 288 : dumpNameAsAttribute(sName, xmlWriter);
1699 : }
1700 : {
1701 144 : uno::Any anotherAny = xPropSet->getPropertyValue("SizeProtect");
1702 144 : sal_Bool bSizeProtect = sal_Bool();
1703 144 : if(anotherAny >>= bSizeProtect)
1704 144 : dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter);
1705 : }
1706 : {
1707 144 : uno::Any anotherAny = xPropSet->getPropertyValue("Transformation");
1708 144 : drawing::HomogenMatrix3 aTransformation;
1709 144 : if(anotherAny >>= aTransformation)
1710 144 : dumpTransformationAsElement(aTransformation, xmlWriter);
1711 : }
1712 : {
1713 144 : uno::Any anotherAny = xPropSet->getPropertyValue("NavigationOrder");
1714 144 : sal_Int32 aNavigationOrder = sal_Int32();
1715 144 : if(anotherAny >>= aNavigationOrder)
1716 144 : dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter);
1717 : }
1718 144 : if(xInfo->hasPropertyByName("Hyperlink"))
1719 : {
1720 0 : uno::Any anotherAny = xPropSet->getPropertyValue("Hyperlink");
1721 0 : OUString sHyperlink;
1722 0 : if(anotherAny >>= sHyperlink)
1723 0 : dumpHyperlinkAsAttribute(sHyperlink, xmlWriter);
1724 144 : }
1725 144 : }
1726 :
1727 4 : void dumpPolyPolygonBezierDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1728 : {
1729 : {
1730 4 : uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind");
1731 : drawing::PolygonKind ePolygonKind;
1732 4 : if(anotherAny >>= ePolygonKind)
1733 4 : dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter);
1734 : }
1735 : {
1736 4 : uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygonBezier");
1737 8 : drawing::PolyPolygonBezierCoords aPolyPolygonBezier;
1738 4 : if(anotherAny >>= aPolyPolygonBezier)
1739 8 : dumpPolyPolygonBezierCoords(aPolyPolygonBezier, xmlWriter);
1740 : }
1741 : {
1742 4 : uno::Any anotherAny = xPropSet->getPropertyValue("Geometry");
1743 8 : drawing::PolyPolygonBezierCoords aGeometry;
1744 4 : if(anotherAny >>= aGeometry)
1745 8 : dumpPolyPolygonBezierCoords(aGeometry, xmlWriter);
1746 : }
1747 4 : }
1748 :
1749 125 : void dumpCustomShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1750 : {
1751 125 : uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo();
1752 : {
1753 125 : uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeEngine");
1754 250 : OUString sCustomShapeEngine;
1755 125 : if(anotherAny >>= sCustomShapeEngine)
1756 250 : dumpCustomShapeEngineAsAttribute(sCustomShapeEngine, xmlWriter);
1757 : }
1758 : {
1759 125 : uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeData");
1760 250 : OUString sCustomShapeData;
1761 125 : if(anotherAny >>= sCustomShapeData)
1762 250 : dumpCustomShapeDataAsAttribute(sCustomShapeData, xmlWriter);
1763 : }
1764 : {
1765 125 : uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeGeometry");
1766 250 : uno::Sequence< beans::PropertyValue> aCustomShapeGeometry;
1767 125 : if(anotherAny >>= aCustomShapeGeometry)
1768 250 : dumpCustomShapeGeometryAsElement(aCustomShapeGeometry, xmlWriter);
1769 : }
1770 125 : if(xInfo->hasPropertyByName("CustomShapeReplacementURL"))
1771 : {
1772 0 : uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeReplacementURL");
1773 0 : OUString sCustomShapeReplacementURL;
1774 0 : if(anotherAny >>= sCustomShapeReplacementURL)
1775 0 : dumpCustomShapeReplacementURLAsAttribute(sCustomShapeReplacementURL, xmlWriter);
1776 125 : }
1777 125 : }
1778 :
1779 146 : void dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter)
1780 : {
1781 146 : xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) );
1782 146 : uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW);
1783 292 : uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo();
1784 292 : OUString aName;
1785 :
1786 146 : dumpPositionAsAttribute(xShape->getPosition(), xmlWriter);
1787 146 : dumpSizeAsAttribute(xShape->getSize(), xmlWriter);
1788 292 : uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW);
1789 146 : dumpShapeDescriptorAsAttribute(xDescr, xmlWriter);
1790 :
1791 : // uno::Sequence<beans::Property> aProperties = xPropSetInfo->getProperties();
1792 :
1793 292 : uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW );
1794 292 : uno::Sequence< OUString > aServiceNames = xServiceInfo->getSupportedServiceNames();
1795 :
1796 292 : uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo();
1797 146 : if(xInfo->hasPropertyByName("Name"))
1798 : {
1799 144 : uno::Any aAny = xPropSet->getPropertyValue("Name");
1800 144 : if (aAny >>= aName)
1801 : {
1802 144 : if (!aName.isEmpty())
1803 65 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
1804 144 : }
1805 : }
1806 :
1807 : try
1808 : {
1809 146 : if (xServiceInfo->supportsService("com.sun.star.drawing.Text"))
1810 : {
1811 143 : uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW);
1812 286 : OUString aText = xText->getString();
1813 143 : if(!aText.isEmpty())
1814 145 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr());
1815 : }
1816 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties"))
1817 143 : dumpTextPropertiesService(xPropSet, xmlWriter);
1818 :
1819 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
1820 : {
1821 1 : uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW);
1822 1 : dumpXShapes(xShapes, xmlWriter);
1823 : }
1824 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.FillProperties"))
1825 138 : dumpFillPropertiesService(xPropSet, xmlWriter);
1826 :
1827 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.LineProperties"))
1828 142 : dumpLinePropertiesService(xPropSet, xmlWriter);
1829 :
1830 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonDescriptor"))
1831 7 : dumpPolyPolygonDescriptorService(xPropSet, xmlWriter);
1832 :
1833 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.ShadowProperties"))
1834 18 : dumpShadowPropertiesService(xPropSet, xmlWriter);
1835 :
1836 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.Shape"))
1837 144 : dumpShapeService(xPropSet, xmlWriter);
1838 :
1839 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonBezierDescriptor"))
1840 4 : dumpPolyPolygonBezierDescriptorService(xPropSet, xmlWriter);
1841 :
1842 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.CustomShape"))
1843 125 : dumpCustomShapeService(xPropSet, xmlWriter);
1844 :
1845 : // EnhancedShapeDumper used
1846 :
1847 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeExtrusion"))
1848 : {
1849 0 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1850 0 : enhancedDumper.dumpEnhancedCustomShapeExtrusionService(xPropSet);
1851 : }
1852 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeGeometry"))
1853 : {
1854 0 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1855 0 : enhancedDumper.dumpEnhancedCustomShapeGeometryService(xPropSet);
1856 : }
1857 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeHandle"))
1858 : {
1859 0 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1860 0 : enhancedDumper.dumpEnhancedCustomShapeHandleService(xPropSet);
1861 : }
1862 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapePath"))
1863 : {
1864 0 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1865 0 : enhancedDumper.dumpEnhancedCustomShapePathService(xPropSet);
1866 : }
1867 146 : if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeTextPath"))
1868 : {
1869 0 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1870 0 : enhancedDumper.dumpEnhancedCustomShapeTextPathService(xPropSet);
1871 : }
1872 : } // end of the 'try' block
1873 0 : catch (const beans::UnknownPropertyException& e)
1874 : {
1875 0 : std::cout << "Exception caught in XShapeDumper.cxx: " << e.Message << std::endl;
1876 : }
1877 :
1878 : #if DEBUG_DUMPER
1879 : sal_Int32 nServices = aServiceNames.getLength();
1880 : for (sal_Int32 i = 0; i < nServices; ++i)
1881 : {
1882 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ServiceName" ));
1883 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( "name" ), "%s", OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr());
1884 : xmlTextWriterEndElement( xmlWriter );
1885 : }
1886 : #endif
1887 :
1888 292 : xmlTextWriterEndElement( xmlWriter );
1889 146 : }
1890 :
1891 17 : void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter )
1892 : {
1893 17 : xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) );
1894 17 : uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW);
1895 17 : sal_Int32 nLength = xIA->getCount();
1896 163 : for (sal_Int32 i = 0; i < nLength; ++i)
1897 : {
1898 146 : uno::Reference< drawing::XShape > xShape( xIA->getByIndex( i ), uno::UNO_QUERY_THROW );
1899 146 : dumpXShape( xShape, xmlWriter );
1900 146 : }
1901 :
1902 17 : xmlTextWriterEndElement( xmlWriter );
1903 17 : }
1904 : } //end of namespace
1905 :
1906 16 : OUString XShapeDumper::dump(uno::Reference<drawing::XShapes> xPageShapes)
1907 : {
1908 :
1909 16 : OStringBuffer aString;
1910 16 : xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL );
1911 16 : xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer );
1912 16 : xmlTextWriterSetIndent( xmlWriter, 1 );
1913 :
1914 16 : xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL );
1915 :
1916 : try
1917 : {
1918 16 : dumpXShapes( xPageShapes, xmlWriter );
1919 : }
1920 0 : catch (const beans::UnknownPropertyException& e)
1921 : {
1922 0 : std::cout << "Exception caught in XShapeDumper: " << e.Message << std::endl;
1923 : }
1924 :
1925 16 : xmlTextWriterEndDocument( xmlWriter );
1926 16 : xmlFreeTextWriter( xmlWriter );
1927 :
1928 16 : return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8);
1929 408 : }
1930 :
|