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