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 12 : XShapeDumper::XShapeDumper()
28 : {
29 :
30 12 : }
31 :
32 : namespace {
33 :
34 : // FUNCTION DECLARATIONS
35 :
36 : // auxiliary functions
37 : void dumpGradientProperty(const css::awt::Gradient& rGradient, xmlTextWriterPtr xmlWriter);
38 : void dumpPolyPolygonBezierCoords(const css::drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter);
39 : void dumpPointSequenceSequence(const com::sun::star::drawing::PointSequenceSequence& rPointSequenceSequence, const 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(const css::awt::Gradient& rTranspGrad, xmlTextWriterPtr xmlWriter);
48 : void dumpFillGradientNameAsAttribute(const OUString& sGradName, xmlTextWriterPtr xmlWriter);
49 : void dumpFillGradientAsElement(const css::awt::Gradient& rGradient, xmlTextWriterPtr xmlWriter);
50 : void dumpFillHatchAsElement(const css::drawing::Hatch& rHatch, 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(const css::drawing::LineDash& rLineDash, 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(const css::drawing::PolyPolygonBezierCoords& rLineStart, xmlTextWriterPtr xmlWriter);
77 : void dumpLineEndAsElement(const css::drawing::PolyPolygonBezierCoords& rLineEnd, 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(const com::sun::star::drawing::PointSequenceSequence& rPolyPolygon, xmlTextWriterPtr xmlWriter);
86 : void dumpGeometryAsElement(const com::sun::star::drawing::PointSequenceSequence& rGeometry, 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(const css::drawing::HomogenMatrixLine3& rLine, xmlTextWriterPtr xmlWriter);
134 : void dumpTransformationAsElement(const css::drawing::HomogenMatrix3& rTransformation, xmlTextWriterPtr xmlWriter);
135 : void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter);
136 : void dumpHyperlinkAsAttribute(const OUString& sHyperlink, xmlTextWriterPtr xmlWriter);
137 : void dumpInteropGrabBagAsElement(const 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(const 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 330 : int writeCallback(void* pContext, const char* sBuffer, int nLen)
164 : {
165 330 : OStringBuffer* pBuffer = static_cast<OStringBuffer*>(pContext);
166 330 : pBuffer->append(sBuffer);
167 330 : return nLen;
168 : }
169 :
170 21 : int closeCallback(void* )
171 : {
172 21 : return 0;
173 : }
174 :
175 : bool m_bNameDumped;
176 :
177 :
178 : // ---------- FillProperties.idl ----------
179 :
180 254 : void dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter)
181 : {
182 254 : 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 60 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "SOLID");
189 60 : 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 254 : }
203 :
204 254 : void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter)
205 : {
206 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillColor"), "%06x", (unsigned int) aColor);
207 254 : }
208 :
209 254 : void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter)
210 : {
211 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32, aTransparence);
212 254 : }
213 :
214 254 : void dumpFillTransparenceGradientNameAsAttribute(const OUString& sTranspGradName, xmlTextWriterPtr xmlWriter)
215 : {
216 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s",
217 254 : OUStringToOString(sTranspGradName, RTL_TEXTENCODING_UTF8).getStr());
218 254 : }
219 :
220 : //because there's more awt::Gradient properties to dump
221 508 : void dumpGradientProperty(const awt::Gradient& rGradient, xmlTextWriterPtr xmlWriter)
222 : {
223 508 : switch (rGradient.Style) //enum GradientStyle
224 : {
225 : case awt::GradientStyle_LINEAR:
226 505 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "LINEAR");
227 505 : break;
228 : case awt::GradientStyle_AXIAL:
229 1 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "AXIAL");
230 1 : 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 508 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startColor"), "%06x", (unsigned int) rGradient.StartColor);
247 508 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endColor"), "%06x", (unsigned int) rGradient.EndColor);
248 508 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.Angle);
249 508 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("border"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.Border);
250 508 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("xOffset"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.XOffset);
251 508 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("yOffset"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.YOffset);
252 508 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.StartIntensity);
253 508 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.EndIntensity);
254 508 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.StepCount);
255 508 : }
256 :
257 254 : void dumpFillTransparenceGradientAsElement(const awt::Gradient& rTranspGrad, xmlTextWriterPtr xmlWriter)
258 : {
259 254 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillTransparenceGradient" ));
260 254 : dumpGradientProperty(rTranspGrad, xmlWriter);
261 254 : xmlTextWriterEndElement( xmlWriter );
262 254 : }
263 :
264 762 : void dumpFillGradientNameAsAttribute(const OUString& sGradName, xmlTextWriterPtr xmlWriter)
265 : {
266 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s",
267 762 : OUStringToOString(sGradName, RTL_TEXTENCODING_UTF8).getStr());
268 762 : }
269 :
270 254 : void dumpFillGradientAsElement(const awt::Gradient& rGradient, xmlTextWriterPtr xmlWriter)
271 : {
272 254 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillGradient" ));
273 254 : dumpGradientProperty(rGradient, xmlWriter);
274 254 : xmlTextWriterEndElement( xmlWriter );
275 254 : }
276 :
277 254 : void dumpFillHatchAsElement(const drawing::Hatch& rHatch, xmlTextWriterPtr xmlWriter)
278 : {
279 254 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillHatch" ));
280 254 : switch (rHatch.Style)
281 : {
282 : case drawing::HatchStyle_SINGLE:
283 226 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "SINGLE");
284 226 : 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 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("color"), "%06x", (unsigned int) rHatch.Color);
295 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) rHatch.Distance);
296 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) rHatch.Angle);
297 254 : xmlTextWriterEndElement( xmlWriter );
298 254 : }
299 :
300 254 : void dumpFillBackgroundAsAttribute(bool bBackground, xmlTextWriterPtr xmlWriter)
301 : {
302 254 : if(bBackground)
303 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "true");
304 : else
305 254 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "false");
306 254 : }
307 :
308 254 : void dumpFillBitmapAsElement(uno::Reference<awt::XBitmap> xBitmap, xmlTextWriterPtr xmlWriter)
309 : {
310 254 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillBitmap" ));
311 254 : if (xBitmap.is())
312 : {
313 247 : awt::Size const aSize = xBitmap->getSize();
314 247 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aSize.Width);
315 247 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aSize.Height);
316 : }
317 254 : xmlTextWriterEndElement( xmlWriter );
318 254 : }
319 :
320 254 : void dumpFillBitmapURLAsAttribute(const OUString& sBitmapURL, xmlTextWriterPtr xmlWriter)
321 : {
322 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapURL"), "%s",
323 254 : OUStringToOString(sBitmapURL, RTL_TEXTENCODING_UTF8).getStr());
324 254 : }
325 :
326 254 : void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter)
327 : {
328 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetX"), "%" SAL_PRIdINT32, aBitmapPositionOffsetX);
329 254 : }
330 :
331 254 : void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter)
332 : {
333 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetY"), "%" SAL_PRIdINT32, aBitmapPositionOffsetY);
334 254 : }
335 :
336 254 : void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter)
337 : {
338 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetX"), "%" SAL_PRIdINT32, aBitmapOffsetX);
339 254 : }
340 :
341 254 : void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter)
342 : {
343 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetY"), "%" SAL_PRIdINT32, aBitmapOffsetY);
344 254 : }
345 :
346 254 : void dumpFillBitmapRectanglePointAsAttribute(drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter)
347 : {
348 254 : 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 254 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_MIDDLE");
364 254 : 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 254 : }
381 :
382 254 : void dumpFillBitmapLogicalSizeAsAttribute(bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter)
383 : {
384 254 : if(bBitmapLogicalSize)
385 254 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "true");
386 : else
387 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "false");
388 254 : }
389 :
390 254 : void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter)
391 : {
392 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeX"), "%" SAL_PRIdINT32, aBitmapSizeX);
393 254 : }
394 :
395 254 : void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter)
396 : {
397 254 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeY"), "%" SAL_PRIdINT32, aBitmapSizeY);
398 254 : }
399 :
400 254 : void dumpFillBitmapModeAsAttribute(drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter)
401 : {
402 254 : switch(eBitmapMode)
403 : {
404 : case drawing::BitmapMode_REPEAT:
405 254 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "REPEAT");
406 254 : 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 254 : }
417 :
418 254 : void dumpFillBitmapStretchAsAttribute(bool bBitmapStretch, xmlTextWriterPtr xmlWriter)
419 : {
420 254 : if(bBitmapStretch)
421 254 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "true");
422 : else
423 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "false");
424 254 : }
425 :
426 254 : void dumpFillBitmapTileAsAttribute(bool bBitmapTile, xmlTextWriterPtr xmlWriter)
427 : {
428 254 : if(bBitmapTile)
429 254 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "true");
430 : else
431 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "false");
432 254 : }
433 :
434 :
435 : // ---------- LineProperties.idl ----------
436 :
437 :
438 258 : void dumpLineStyleAsAttribute(drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter)
439 : {
440 258 : switch(eLineStyle)
441 : {
442 : case drawing::LineStyle_NONE:
443 67 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "NONE");
444 67 : break;
445 : case drawing::LineStyle_SOLID:
446 191 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "SOLID");
447 191 : 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 258 : }
455 :
456 258 : void dumpLineDashAsElement(const drawing::LineDash& rLineDash, xmlTextWriterPtr xmlWriter)
457 : {
458 258 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineDash" ));
459 258 : switch (rLineDash.Style)
460 : {
461 : case drawing::DashStyle_RECT:
462 258 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT");
463 258 : 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 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dots"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.Dots);
477 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dotLen"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.DotLen);
478 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashes"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.Dashes);
479 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashLen"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.DashLen);
480 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.Distance);
481 258 : xmlTextWriterEndElement( xmlWriter );
482 258 : }
483 :
484 258 : void dumpLineDashNameAsAttribute(const OUString& sLineDashName, xmlTextWriterPtr xmlWriter)
485 : {
486 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineDashName"), "%s",
487 258 : OUStringToOString(sLineDashName, RTL_TEXTENCODING_UTF8).getStr());
488 258 : }
489 :
490 258 : void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter)
491 : {
492 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineColor"), "%06x", (unsigned int) aLineColor);
493 258 : }
494 :
495 258 : void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter)
496 : {
497 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32, aLineTransparence);
498 258 : }
499 :
500 258 : void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter)
501 : {
502 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32, aLineWidth);
503 258 : }
504 :
505 258 : void dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter)
506 : {
507 258 : 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 204 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "ROUND");
523 204 : break;
524 : default:
525 0 : break;
526 : }
527 258 : }
528 :
529 258 : void dumpLineStartNameAsAttribute(const OUString& sLineStartName, xmlTextWriterPtr xmlWriter)
530 : {
531 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s",
532 258 : OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr());
533 258 : }
534 :
535 258 : void dumpLineEndNameAsAttribute(const OUString& sLineEndName, xmlTextWriterPtr xmlWriter)
536 : {
537 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndName"), "%s",
538 258 : OUStringToOString(sLineEndName, RTL_TEXTENCODING_UTF8).getStr());
539 258 : }
540 :
541 524 : void dumpPolyPolygonBezierCoords(const drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter)
542 : {
543 524 : dumpPointSequenceSequence(rPolyPolygonBezierCoords.Coordinates, &rPolyPolygonBezierCoords.Flags, xmlWriter);
544 524 : }
545 :
546 258 : void dumpLineStartAsElement(const drawing::PolyPolygonBezierCoords& rLineStart, xmlTextWriterPtr xmlWriter)
547 : {
548 258 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineStart" ));
549 258 : dumpPolyPolygonBezierCoords(rLineStart, xmlWriter);
550 258 : xmlTextWriterEndElement( xmlWriter );
551 258 : }
552 :
553 258 : void dumpLineEndAsElement(const drawing::PolyPolygonBezierCoords& rLineEnd, xmlTextWriterPtr xmlWriter)
554 : {
555 258 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineEnd" ));
556 258 : dumpPolyPolygonBezierCoords(rLineEnd, xmlWriter);
557 258 : xmlTextWriterEndElement( xmlWriter );
558 258 : }
559 :
560 258 : void dumpLineStartCenterAsAttribute(bool bLineStartCenter, xmlTextWriterPtr xmlWriter)
561 : {
562 258 : if(bLineStartCenter)
563 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "true");
564 : else
565 258 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "false");
566 258 : }
567 :
568 258 : void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter)
569 : {
570 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32, aLineStartWidth);
571 258 : }
572 :
573 258 : void dumpLineEndCenterAsAttribute(bool bLineEndCenter, xmlTextWriterPtr xmlWriter)
574 : {
575 258 : if(bLineEndCenter)
576 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "true");
577 : else
578 258 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "false");
579 258 : }
580 :
581 258 : void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter)
582 : {
583 258 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32, aLineEndWidth);
584 258 : }
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 538 : void dumpPointSequenceSequence(const drawing::PointSequenceSequence& aPointSequenceSequence, const uno::Sequence<uno::Sequence< drawing::PolygonFlags > >* pFlags, xmlTextWriterPtr xmlWriter)
627 : {
628 : // LibreOffice proudly presents - The Sequenception
629 538 : uno::Sequence<uno::Sequence< awt::Point > > pointSequenceSequence = aPointSequenceSequence;
630 538 : sal_Int32 nPointsSequence = pointSequenceSequence.getLength();
631 :
632 565 : 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 565 : }
674 538 : }
675 :
676 7 : void dumpPolyPolygonAsElement(const drawing::PointSequenceSequence& rPolyPolygon, xmlTextWriterPtr xmlWriter)
677 : {
678 7 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygon" ));
679 7 : dumpPointSequenceSequence(rPolyPolygon, NULL, xmlWriter);
680 7 : xmlTextWriterEndElement( xmlWriter );
681 7 : }
682 :
683 7 : void dumpGeometryAsElement(const 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 260 : void dumpCharHeightAsAttribute(float fHeight, xmlTextWriterPtr xmlWriter)
692 : {
693 260 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fontHeight"), "%f", fHeight );
694 260 : }
695 :
696 260 : void dumpCharColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter)
697 : {
698 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fontColor"), "%06x", (unsigned int) aColor);
699 260 : }
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 260 : void dumpTextAutoGrowHeightAsAttribute(bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter)
714 : {
715 260 : if(bTextAutoGrowHeight)
716 18 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "true");
717 : else
718 242 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "false");
719 260 : }
720 :
721 260 : void dumpTextAutoGrowWidthAsAttribute(bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter)
722 : {
723 260 : if(bTextAutoGrowWidth)
724 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "true");
725 : else
726 260 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "false");
727 260 : }
728 :
729 260 : void dumpTextContourFrameAsAttribute(bool bTextContourFrame, xmlTextWriterPtr xmlWriter)
730 : {
731 260 : if(bTextContourFrame)
732 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "true");
733 : else
734 260 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "false");
735 260 : }
736 :
737 260 : void dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter)
738 : {
739 260 : switch(eTextFitToSize)
740 : {
741 : case drawing::TextFitToSizeType_NONE:
742 258 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "NONE");
743 258 : 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 260 : }
757 :
758 260 : void dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter)
759 : {
760 260 : 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 254 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK");
773 254 : break;
774 : default:
775 0 : break;
776 : }
777 260 : }
778 :
779 260 : void dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter)
780 : {
781 260 : switch(eTextVerticalAdjust)
782 : {
783 : case drawing::TextVerticalAdjust_TOP:
784 70 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "TOP");
785 70 : 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 260 : }
799 :
800 260 : void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter)
801 : {
802 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32, aTextLeftDistance);
803 260 : }
804 :
805 260 : void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter)
806 : {
807 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32, aTextRightDistance);
808 260 : }
809 :
810 260 : void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter)
811 : {
812 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32, aTextUpperDistance);
813 260 : }
814 :
815 260 : void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter)
816 : {
817 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32, aTextLowerDistance);
818 260 : }
819 :
820 260 : void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter)
821 : {
822 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32, aTextMaximumFrameHeight);
823 260 : }
824 :
825 260 : void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter)
826 : {
827 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32, aTextMaximumFrameWidth);
828 260 : }
829 :
830 260 : void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter)
831 : {
832 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32, aTextMinimumFrameHeight);
833 260 : }
834 :
835 260 : void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter)
836 : {
837 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32, aTextMinimumFrameWidth);
838 260 : }
839 :
840 260 : void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter)
841 : {
842 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32, aTextAnimationAmount);
843 260 : }
844 :
845 260 : void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter)
846 : {
847 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32, aTextAnimationCount);
848 260 : }
849 :
850 260 : void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter)
851 : {
852 260 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32, aTextAnimationDelay);
853 260 : }
854 :
855 260 : void dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter)
856 : {
857 260 : switch(eTextAnimationDirection)
858 : {
859 : case drawing::TextAnimationDirection_LEFT:
860 260 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "LEFT");
861 260 : 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 260 : }
875 :
876 260 : void dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter)
877 : {
878 260 : switch(eTextAnimationKind)
879 : {
880 : case drawing::TextAnimationKind_NONE:
881 260 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "NONE");
882 260 : 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 260 : }
899 :
900 260 : void dumpTextAnimationStartInsideAsAttribute(bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter)
901 : {
902 260 : if(bTextAnimationStartInside)
903 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "true");
904 : else
905 260 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "false");
906 260 : }
907 :
908 260 : void dumpTextAnimationStopInsideAsAttribute(bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter)
909 : {
910 260 : if(bTextAnimationStopInside)
911 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "true");
912 : else
913 260 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "false");
914 260 : }
915 :
916 260 : void dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode, xmlTextWriterPtr xmlWriter)
917 : {
918 260 : switch(eTextWritingMode)
919 : {
920 : case text::WritingMode_LR_TB:
921 260 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "LR_TB");
922 260 : 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 260 : }
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 263 : void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter)
971 : {
972 263 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("zOrder"), "%" SAL_PRIdINT32, aZOrder);
973 263 : }
974 :
975 263 : void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter)
976 : {
977 263 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID);
978 263 : }
979 :
980 263 : void dumpLayerNameAsAttribute(const OUString& sLayerName, xmlTextWriterPtr xmlWriter)
981 : {
982 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s",
983 263 : OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr());
984 263 : }
985 :
986 263 : void dumpVisibleAsAttribute(bool bVisible, xmlTextWriterPtr xmlWriter)
987 : {
988 263 : if(bVisible)
989 263 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "true");
990 : else
991 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "false");
992 263 : }
993 :
994 263 : void dumpPrintableAsAttribute(bool bPrintable, xmlTextWriterPtr xmlWriter)
995 : {
996 263 : if(bPrintable)
997 263 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "true");
998 : else
999 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "false");
1000 263 : }
1001 :
1002 263 : void dumpMoveProtectAsAttribute(bool bMoveProtect, xmlTextWriterPtr xmlWriter)
1003 : {
1004 263 : if(bMoveProtect)
1005 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "true");
1006 : else
1007 263 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false");
1008 263 : }
1009 :
1010 263 : void dumpNameAsAttribute(const OUString& sName, xmlTextWriterPtr xmlWriter)
1011 : {
1012 263 : 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 263 : }
1018 :
1019 263 : void dumpSizeProtectAsAttribute(bool bSizeProtect, xmlTextWriterPtr xmlWriter)
1020 : {
1021 263 : if(bSizeProtect)
1022 0 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "true");
1023 : else
1024 263 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false");
1025 263 : }
1026 :
1027 789 : void dumpHomogenMatrixLine3(const drawing::HomogenMatrixLine3& rHomogenMatrixLine3, xmlTextWriterPtr xmlWriter)
1028 : {
1029 789 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column1"), "%f", rHomogenMatrixLine3.Column1);
1030 789 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column2"), "%f", rHomogenMatrixLine3.Column2);
1031 789 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", rHomogenMatrixLine3.Column3);
1032 789 : }
1033 :
1034 263 : void dumpTransformationAsElement(const drawing::HomogenMatrix3& rTransformation, xmlTextWriterPtr xmlWriter)
1035 : {
1036 263 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Transformation" ));
1037 : {
1038 263 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line1" ));
1039 263 : dumpHomogenMatrixLine3(rTransformation.Line1, xmlWriter);
1040 263 : xmlTextWriterEndElement( xmlWriter );
1041 263 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line2" ));
1042 263 : dumpHomogenMatrixLine3(rTransformation.Line2, xmlWriter);
1043 263 : xmlTextWriterEndElement( xmlWriter );
1044 263 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line3" ));
1045 263 : dumpHomogenMatrixLine3(rTransformation.Line3, xmlWriter);
1046 263 : xmlTextWriterEndElement( xmlWriter );
1047 : }
1048 263 : xmlTextWriterEndElement( xmlWriter );
1049 263 : }
1050 :
1051 263 : void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter)
1052 : {
1053 263 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder);
1054 263 : }
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(const 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 266 : void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter)
1078 : {
1079 266 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X);
1080 266 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y);
1081 266 : }
1082 :
1083 266 : void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter)
1084 : {
1085 266 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width);
1086 266 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height);
1087 266 : }
1088 :
1089 266 : void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter )
1090 : {
1091 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s",
1092 266 : OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr());
1093 266 : }
1094 :
1095 :
1096 : // ---------- CustomShape.idl ----------
1097 :
1098 :
1099 240 : void dumpCustomShapeEngineAsAttribute(const OUString& sCustomShapeEngine, xmlTextWriterPtr xmlWriter)
1100 : {
1101 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeEngine"), "%s",
1102 240 : OUStringToOString(sCustomShapeEngine, RTL_TEXTENCODING_UTF8).getStr());
1103 240 : }
1104 :
1105 240 : void dumpCustomShapeDataAsAttribute(const OUString& sCustomShapeData, xmlTextWriterPtr xmlWriter)
1106 : {
1107 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeData"), "%s",
1108 240 : OUStringToOString(sCustomShapeData, RTL_TEXTENCODING_UTF8).getStr());
1109 240 : }
1110 :
1111 2784 : void dumpPropertyValueAsElement(const beans::PropertyValue& rPropertyValue, xmlTextWriterPtr xmlWriter)
1112 : {
1113 2784 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" ));
1114 :
1115 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s",
1116 2784 : OUStringToOString(rPropertyValue.Name, RTL_TEXTENCODING_UTF8).getStr());
1117 :
1118 2784 : uno::Any aAny = rPropertyValue.Value;
1119 5568 : OUString sValue;
1120 : float fValue;
1121 : sal_Int32 nValue;
1122 : bool bValue;
1123 2784 : awt::Rectangle aRectangleValue;
1124 5568 : uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues;
1125 5568 : uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates;
1126 5568 : uno::Sequence< drawing::EnhancedCustomShapeSegment > aSegments;
1127 5568 : uno::Sequence< beans::PropertyValue > aPropSeq;
1128 2784 : if(aAny >>= sValue)
1129 : {
1130 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s",
1131 240 : OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
1132 : }
1133 2544 : else if(aAny >>= nValue)
1134 : {
1135 156 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%" SAL_PRIdINT32, nValue);
1136 : }
1137 2388 : else if(aAny >>= fValue)
1138 : {
1139 0 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%f", fValue);
1140 : }
1141 2388 : else if(aAny >>= bValue)
1142 : {
1143 483 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", (bValue? "true": "false"));
1144 : }
1145 1905 : else if(rPropertyValue.Name == "ViewBox" && (aAny >>= aRectangleValue))
1146 : {
1147 239 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1148 239 : enhancedDumper.dumpViewBoxAsElement(aRectangleValue);
1149 : }
1150 1666 : else if(rPropertyValue.Name == "AdjustmentValues" && (aAny >>= aAdjustmentValues))
1151 : {
1152 240 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1153 240 : enhancedDumper.dumpAdjustmentValuesAsElement(aAdjustmentValues);
1154 : }
1155 1426 : else if(rPropertyValue.Name == "Coordinates" && (aAny >>= aCoordinates))
1156 : {
1157 240 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1158 240 : enhancedDumper.dumpCoordinatesAsElement(aCoordinates);
1159 : }
1160 1186 : else if(rPropertyValue.Name == "Segments" && (aAny >>= aSegments))
1161 : {
1162 240 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1163 240 : enhancedDumper.dumpSegmentsAsElement(aSegments);
1164 : }
1165 946 : else if(aAny >>= aPropSeq)
1166 : {
1167 463 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( OUStringToOString(rPropertyValue.Name, RTL_TEXTENCODING_UTF8).getStr() ));
1168 :
1169 463 : sal_Int32 i = 0, nCount = aPropSeq.getLength();
1170 1248 : for ( ; i < nCount; i++ )
1171 785 : dumpPropertyValueAsElement(aPropSeq[ i ], xmlWriter);
1172 :
1173 463 : 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 2784 : xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("handle"), "%" SAL_PRIdINT32, rPropertyValue.Handle);
1182 :
1183 2784 : switch(rPropertyValue.State)
1184 : {
1185 : case beans::PropertyState_DIRECT_VALUE:
1186 2784 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE");
1187 2784 : 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 5568 : xmlTextWriterEndElement( xmlWriter );
1198 2784 : }
1199 :
1200 240 : void dumpCustomShapeGeometryAsElement(const uno::Sequence< beans::PropertyValue>& aCustomShapeGeometry, xmlTextWriterPtr xmlWriter)
1201 : {
1202 240 : xmlTextWriterStartElement(xmlWriter, BAD_CAST( "CustomShapeGeometry" ));
1203 :
1204 240 : sal_Int32 nLength = aCustomShapeGeometry.getLength();
1205 2239 : for (sal_Int32 i = 0; i < nLength; ++i)
1206 1999 : dumpPropertyValueAsElement(aCustomShapeGeometry[i], xmlWriter);
1207 :
1208 240 : xmlTextWriterEndElement( xmlWriter );
1209 240 : }
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 260 : void dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1220 : {
1221 260 : uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo();
1222 260 : if(xInfo->hasPropertyByName("CharHeight"))
1223 : {
1224 260 : uno::Any anotherAny = xPropSet->getPropertyValue("CharHeight");
1225 : float fHeight;
1226 260 : if(anotherAny >>= fHeight)
1227 260 : dumpCharHeightAsAttribute(fHeight, xmlWriter);
1228 : }
1229 260 : if(xInfo->hasPropertyByName("CharColor"))
1230 : {
1231 260 : uno::Any anotherAny = xPropSet->getPropertyValue("CharColor");
1232 260 : sal_Int32 aColor = sal_Int32();
1233 260 : if(anotherAny >>= aColor)
1234 260 : dumpCharColorAsAttribute(aColor, xmlWriter);
1235 : }
1236 : // TODO - more properties from CharacterProperties.idl (similar to above)
1237 :
1238 260 : 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 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowHeight");
1247 : bool bTextAutoGrowHeight;
1248 260 : if(anotherAny >>= bTextAutoGrowHeight)
1249 260 : dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight, xmlWriter);
1250 : }
1251 : {
1252 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowWidth");
1253 : bool bTextAutoGrowWidth;
1254 260 : if(anotherAny >>= bTextAutoGrowWidth)
1255 260 : dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter);
1256 : }
1257 : {
1258 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextContourFrame");
1259 : bool bTextContourFrame;
1260 260 : if(anotherAny >>= bTextContourFrame)
1261 260 : dumpTextContourFrameAsAttribute(bTextContourFrame, xmlWriter);
1262 : }
1263 : {
1264 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextFitToSize");
1265 : drawing::TextFitToSizeType eTextFitToSize;
1266 260 : if(anotherAny >>= eTextFitToSize)
1267 260 : dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter);
1268 : }
1269 : {
1270 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust");
1271 : drawing::TextHorizontalAdjust eTextHorizontalAdjust;
1272 260 : if(anotherAny >>= eTextHorizontalAdjust)
1273 260 : dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter);
1274 : }
1275 : {
1276 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust");
1277 : drawing::TextVerticalAdjust eTextVerticalAdjust;
1278 260 : if(anotherAny >>= eTextVerticalAdjust)
1279 260 : dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter);
1280 : }
1281 : {
1282 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextLeftDistance");
1283 260 : sal_Int32 aTextLeftDistance = sal_Int32();
1284 260 : if(anotherAny >>= aTextLeftDistance)
1285 260 : dumpTextLeftDistanceAsAttribute(aTextLeftDistance, xmlWriter);
1286 : }
1287 : {
1288 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextRightDistance");
1289 260 : sal_Int32 aTextRightDistance = sal_Int32();
1290 260 : if(anotherAny >>= aTextRightDistance)
1291 260 : dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter);
1292 : }
1293 : {
1294 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextUpperDistance");
1295 260 : sal_Int32 aTextUpperDistance = sal_Int32();
1296 260 : if(anotherAny >>= aTextUpperDistance)
1297 260 : dumpTextUpperDistanceAsAttribute(aTextUpperDistance, xmlWriter);
1298 : }
1299 : {
1300 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextLowerDistance");
1301 260 : sal_Int32 aTextLowerDistance = sal_Int32();
1302 260 : if(anotherAny >>= aTextLowerDistance)
1303 260 : dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter);
1304 : }
1305 : {
1306 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameHeight");
1307 260 : sal_Int32 aTextMaximumFrameHeight = sal_Int32();
1308 260 : if(anotherAny >>= aTextMaximumFrameHeight)
1309 260 : dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight, xmlWriter);
1310 : }
1311 : {
1312 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameWidth");
1313 260 : sal_Int32 aTextMaximumFrameWidth = sal_Int32();
1314 260 : if(anotherAny >>= aTextMaximumFrameWidth)
1315 260 : dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter);
1316 : }
1317 : {
1318 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameHeight");
1319 260 : sal_Int32 aTextMinimumFrameHeight = sal_Int32();
1320 260 : if(anotherAny >>= aTextMinimumFrameHeight)
1321 260 : dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight, xmlWriter);
1322 : }
1323 : {
1324 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameWidth");
1325 260 : sal_Int32 aTextMinimumFrameWidth = sal_Int32();
1326 260 : if(anotherAny >>= aTextMinimumFrameWidth)
1327 260 : dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter);
1328 : }
1329 : {
1330 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationAmount");
1331 260 : sal_Int32 aTextAnimationAmount = sal_Int32();
1332 260 : if(anotherAny >>= aTextAnimationAmount)
1333 260 : dumpTextAnimationAmountAsAttribute(aTextAnimationAmount, xmlWriter);
1334 : }
1335 : {
1336 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationCount");
1337 260 : sal_Int32 aTextAnimationCount = sal_Int32();
1338 260 : if(anotherAny >>= aTextAnimationCount)
1339 260 : dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter);
1340 : }
1341 : {
1342 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDelay");
1343 260 : sal_Int32 aTextAnimationDelay = sal_Int32();
1344 260 : if(anotherAny >>= aTextAnimationDelay)
1345 260 : dumpTextAnimationDelayAsAttribute(aTextAnimationDelay, xmlWriter);
1346 : }
1347 : {
1348 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDirection");
1349 : drawing::TextAnimationDirection eTextAnimationDirection;
1350 260 : if(anotherAny >>= eTextAnimationDirection)
1351 260 : dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter);
1352 : }
1353 : {
1354 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationKind");
1355 : drawing::TextAnimationKind eTextAnimationKind;
1356 260 : if(anotherAny >>= eTextAnimationKind)
1357 260 : dumpTextAnimationKindAsAttribute(eTextAnimationKind, xmlWriter);
1358 : }
1359 : {
1360 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStartInside");
1361 : bool bTextAnimationStartInside;
1362 260 : if(anotherAny >>= bTextAnimationStartInside)
1363 260 : dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter);
1364 : }
1365 : {
1366 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStopInside");
1367 : bool bTextAnimationStopInside;
1368 260 : if(anotherAny >>= bTextAnimationStopInside)
1369 260 : dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside, xmlWriter);
1370 : }
1371 : {
1372 260 : uno::Any anotherAny = xPropSet->getPropertyValue("TextWritingMode");
1373 : text::WritingMode eTextWritingMode;
1374 260 : if(anotherAny >>= eTextWritingMode)
1375 260 : dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter);
1376 260 : }
1377 260 : }
1378 :
1379 254 : void dumpFillPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1380 : {
1381 : {
1382 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle");
1383 : drawing::FillStyle eFillStyle;
1384 254 : if(anotherAny >>= eFillStyle)
1385 254 : dumpFillStyleAsAttribute(eFillStyle, xmlWriter);
1386 : }
1387 : {
1388 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillColor");
1389 254 : sal_Int32 aColor = sal_Int32();
1390 254 : if(anotherAny >>= aColor)
1391 254 : dumpFillColorAsAttribute(aColor, xmlWriter);
1392 : }
1393 : {
1394 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparence");
1395 254 : sal_Int32 aTransparence = sal_Int32();
1396 254 : if(anotherAny >>= aTransparence)
1397 254 : dumpFillTransparenceAsAttribute(aTransparence, xmlWriter);
1398 : }
1399 : {
1400 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradientName");
1401 508 : OUString sTranspGradName;
1402 254 : if(anotherAny >>= sTranspGradName)
1403 508 : dumpFillTransparenceGradientNameAsAttribute(sTranspGradName, xmlWriter);
1404 : }
1405 : {
1406 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradient");
1407 254 : awt::Gradient aTranspGrad;
1408 254 : if(anotherAny >>= aTranspGrad)
1409 254 : dumpFillTransparenceGradientAsElement(aTranspGrad, xmlWriter);
1410 : }
1411 : {
1412 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillGradientName");
1413 508 : OUString sGradName;
1414 254 : if(anotherAny >>= sGradName)
1415 508 : dumpFillGradientNameAsAttribute(sGradName, xmlWriter);
1416 : }
1417 : {
1418 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillGradient");
1419 254 : awt::Gradient aGradient;
1420 254 : if(anotherAny >>= aGradient)
1421 254 : dumpFillGradientAsElement(aGradient, xmlWriter);
1422 : }
1423 : {
1424 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillHatchName");
1425 508 : OUString sHatchName;
1426 254 : if(anotherAny >>= sHatchName)
1427 508 : dumpFillGradientNameAsAttribute(sHatchName, xmlWriter);
1428 : }
1429 : {
1430 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillHatch");
1431 254 : drawing::Hatch aHatch;
1432 254 : if(anotherAny >>= aHatch)
1433 254 : dumpFillHatchAsElement(aHatch, xmlWriter);
1434 : }
1435 : {
1436 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBackground");
1437 : bool bFillBackground;
1438 254 : if(anotherAny >>= bFillBackground)
1439 254 : dumpFillBackgroundAsAttribute(bFillBackground, xmlWriter);
1440 : }
1441 : {
1442 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapName");
1443 508 : OUString sBitmapName;
1444 254 : if(anotherAny >>= sBitmapName)
1445 508 : dumpFillGradientNameAsAttribute(sBitmapName, xmlWriter);
1446 : }
1447 : {
1448 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmap");
1449 508 : uno::Reference<awt::XBitmap> xBitmap;
1450 254 : if(anotherAny >>= xBitmap)
1451 508 : dumpFillBitmapAsElement(xBitmap, xmlWriter);
1452 : }
1453 : {
1454 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapURL");
1455 508 : OUString sBitmapURL;
1456 254 : if(anotherAny >>= sBitmapURL)
1457 508 : dumpFillBitmapURLAsAttribute(sBitmapURL, xmlWriter);
1458 : }
1459 : {
1460 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetX");
1461 254 : sal_Int32 aBitmapPositionOffsetX = sal_Int32();
1462 254 : if(anotherAny >>= aBitmapPositionOffsetX)
1463 254 : dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX, xmlWriter);
1464 : }
1465 : {
1466 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetY");
1467 254 : sal_Int32 aBitmapPositionOffsetY = sal_Int32();
1468 254 : if(anotherAny >>= aBitmapPositionOffsetY)
1469 254 : dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY, xmlWriter);
1470 : }
1471 : {
1472 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetX");
1473 254 : sal_Int32 aBitmapOffsetX = sal_Int32();
1474 254 : if(anotherAny >>= aBitmapOffsetX)
1475 254 : dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX, xmlWriter);
1476 : }
1477 : {
1478 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetY");
1479 254 : sal_Int32 aBitmapOffsetY = sal_Int32();
1480 254 : if(anotherAny >>= aBitmapOffsetY)
1481 254 : dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY, xmlWriter);
1482 : }
1483 : {
1484 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapRectanglePoint");
1485 : drawing::RectanglePoint eBitmapRectanglePoint;
1486 254 : if(anotherAny >>= eBitmapRectanglePoint)
1487 254 : dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint, xmlWriter);
1488 : }
1489 : {
1490 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapLogicalSize");
1491 : bool bBitmapLogicalSize;
1492 254 : if(anotherAny >>= bBitmapLogicalSize)
1493 254 : dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize, xmlWriter);
1494 : }
1495 : {
1496 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeX");
1497 254 : sal_Int32 aBitmapSizeX = sal_Int32();
1498 254 : if(anotherAny >>= aBitmapSizeX)
1499 254 : dumpFillBitmapSizeXAsAttribute(aBitmapSizeX, xmlWriter);
1500 : }
1501 : {
1502 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeY");
1503 254 : sal_Int32 aBitmapSizeY = sal_Int32();
1504 254 : if(anotherAny >>= aBitmapSizeY)
1505 254 : dumpFillBitmapSizeYAsAttribute(aBitmapSizeY, xmlWriter);
1506 : }
1507 : {
1508 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapMode");
1509 : drawing::BitmapMode eBitmapMode;
1510 254 : if(anotherAny >>= eBitmapMode)
1511 254 : dumpFillBitmapModeAsAttribute(eBitmapMode, xmlWriter);
1512 : }
1513 : {
1514 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapStretch");
1515 : bool bBitmapStretch;
1516 254 : if(anotherAny >>= bBitmapStretch)
1517 254 : dumpFillBitmapStretchAsAttribute(bBitmapStretch, xmlWriter);
1518 : }
1519 : {
1520 254 : uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapTile");
1521 : bool bBitmapTile;
1522 254 : if(anotherAny >>= bBitmapTile)
1523 254 : dumpFillBitmapTileAsAttribute(bBitmapTile, xmlWriter);
1524 : }
1525 254 : }
1526 :
1527 258 : void dumpLinePropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1528 : {
1529 : {
1530 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStyle");
1531 : drawing::LineStyle eLineStyle;
1532 258 : if(anotherAny >>= eLineStyle)
1533 258 : dumpLineStyleAsAttribute(eLineStyle, xmlWriter);
1534 : }
1535 : {
1536 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineDash");
1537 258 : drawing::LineDash aLineDash;
1538 258 : if(anotherAny >>= aLineDash)
1539 258 : dumpLineDashAsElement(aLineDash, xmlWriter);
1540 : }
1541 : {
1542 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineDashName");
1543 516 : OUString sLineDashName;
1544 258 : if(anotherAny >>= sLineDashName)
1545 516 : dumpLineDashNameAsAttribute(sLineDashName, xmlWriter);
1546 : }
1547 : {
1548 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineColor");
1549 258 : sal_Int32 aLineColor = sal_Int32();
1550 258 : if(anotherAny >>= aLineColor)
1551 258 : dumpLineColorAsAttribute(aLineColor, xmlWriter);
1552 : }
1553 : {
1554 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineTransparence");
1555 258 : sal_Int32 aLineTransparence = sal_Int32();
1556 258 : if(anotherAny >>= aLineTransparence)
1557 258 : dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter);
1558 : }
1559 : {
1560 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineWidth");
1561 258 : sal_Int32 aLineWidth = sal_Int32();
1562 258 : if(anotherAny >>= aLineWidth)
1563 258 : dumpLineWidthAsAttribute(aLineWidth, xmlWriter);
1564 : }
1565 : {
1566 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineJoint");
1567 : drawing::LineJoint eLineJoint;
1568 258 : if(anotherAny >>= eLineJoint)
1569 258 : dumpLineJointAsAttribute(eLineJoint, xmlWriter);
1570 : }
1571 : {
1572 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStartName");
1573 516 : OUString sLineStartName;
1574 258 : if(anotherAny >>= sLineStartName)
1575 516 : dumpLineStartNameAsAttribute(sLineStartName, xmlWriter);
1576 : }
1577 : {
1578 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineEndName");
1579 516 : OUString sLineEndName;
1580 258 : if(anotherAny >>= sLineEndName)
1581 516 : dumpLineEndNameAsAttribute(sLineEndName, xmlWriter);
1582 : }
1583 : {
1584 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStart");
1585 516 : drawing::PolyPolygonBezierCoords aLineStart;
1586 258 : if(anotherAny >>= aLineStart)
1587 516 : dumpLineStartAsElement(aLineStart, xmlWriter);
1588 : }
1589 : {
1590 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineEnd");
1591 516 : drawing::PolyPolygonBezierCoords aLineEnd;
1592 258 : if(anotherAny >>= aLineEnd)
1593 516 : dumpLineEndAsElement(aLineEnd, xmlWriter);
1594 : }
1595 : {
1596 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStartCenter");
1597 : bool bLineStartCenter;
1598 258 : if(anotherAny >>= bLineStartCenter)
1599 258 : dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter);
1600 : }
1601 : {
1602 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineStartWidth");
1603 258 : sal_Int32 aLineStartWidth = sal_Int32();
1604 258 : if(anotherAny >>= aLineStartWidth)
1605 258 : dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter);
1606 : }
1607 : {
1608 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineEndCenter");
1609 : bool bLineEndCenter;
1610 258 : if(anotherAny >>= bLineEndCenter)
1611 258 : dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter);
1612 : }
1613 : {
1614 258 : uno::Any anotherAny = xPropSet->getPropertyValue("LineEndWidth");
1615 258 : sal_Int32 aLineEndWidth = sal_Int32();
1616 258 : if(anotherAny >>= aLineEndWidth)
1617 258 : dumpLineEndWidthAsAttribute(aLineEndWidth, xmlWriter);
1618 : }
1619 258 : }
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 263 : void dumpShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter, bool bDumpInteropProperties)
1678 : {
1679 263 : uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo();
1680 : {
1681 263 : uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder");
1682 263 : sal_Int32 aZOrder = sal_Int32();
1683 263 : if(anotherAny >>= aZOrder)
1684 263 : dumpZOrderAsAttribute(aZOrder, xmlWriter);
1685 : }
1686 : {
1687 263 : uno::Any anotherAny = xPropSet->getPropertyValue("LayerID");
1688 263 : sal_Int32 aLayerID = sal_Int32();
1689 263 : if(anotherAny >>= aLayerID)
1690 263 : dumpLayerIDAsAttribute(aLayerID, xmlWriter);
1691 : }
1692 : {
1693 263 : uno::Any anotherAny = xPropSet->getPropertyValue("LayerName");
1694 526 : OUString sLayerName;
1695 263 : if(anotherAny >>= sLayerName)
1696 526 : dumpLayerNameAsAttribute(sLayerName, xmlWriter);
1697 : }
1698 : {
1699 263 : uno::Any anotherAny = xPropSet->getPropertyValue("Visible");
1700 : bool bVisible;
1701 263 : if(anotherAny >>= bVisible)
1702 263 : dumpVisibleAsAttribute(bVisible, xmlWriter);
1703 : }
1704 : {
1705 263 : uno::Any anotherAny = xPropSet->getPropertyValue("Printable");
1706 : bool bPrintable;
1707 263 : if(anotherAny >>= bPrintable)
1708 263 : dumpPrintableAsAttribute(bPrintable, xmlWriter);
1709 : }
1710 : {
1711 263 : uno::Any anotherAny = xPropSet->getPropertyValue("MoveProtect");
1712 : bool bMoveProtect;
1713 263 : if(anotherAny >>= bMoveProtect)
1714 263 : dumpMoveProtectAsAttribute(bMoveProtect, xmlWriter);
1715 : }
1716 : {
1717 263 : uno::Any anotherAny = xPropSet->getPropertyValue("Name");
1718 526 : OUString sName;
1719 263 : if(anotherAny >>= sName)
1720 526 : dumpNameAsAttribute(sName, xmlWriter);
1721 : }
1722 : {
1723 263 : uno::Any anotherAny = xPropSet->getPropertyValue("SizeProtect");
1724 : bool bSizeProtect;
1725 263 : if(anotherAny >>= bSizeProtect)
1726 263 : dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter);
1727 : }
1728 : {
1729 263 : uno::Any anotherAny = xPropSet->getPropertyValue("Transformation");
1730 263 : drawing::HomogenMatrix3 aTransformation;
1731 263 : if(anotherAny >>= aTransformation)
1732 263 : dumpTransformationAsElement(aTransformation, xmlWriter);
1733 : }
1734 : {
1735 263 : uno::Any anotherAny = xPropSet->getPropertyValue("NavigationOrder");
1736 263 : sal_Int32 aNavigationOrder = sal_Int32();
1737 263 : if(anotherAny >>= aNavigationOrder)
1738 263 : dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter);
1739 : }
1740 263 : 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 263 : 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 263 : }
1754 263 : }
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 240 : void dumpCustomShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter)
1779 : {
1780 240 : uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo();
1781 : {
1782 240 : uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeEngine");
1783 480 : OUString sCustomShapeEngine;
1784 240 : if(anotherAny >>= sCustomShapeEngine)
1785 480 : dumpCustomShapeEngineAsAttribute(sCustomShapeEngine, xmlWriter);
1786 : }
1787 : {
1788 240 : uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeData");
1789 480 : OUString sCustomShapeData;
1790 240 : if(anotherAny >>= sCustomShapeData)
1791 480 : dumpCustomShapeDataAsAttribute(sCustomShapeData, xmlWriter);
1792 : }
1793 : {
1794 240 : uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeGeometry");
1795 480 : uno::Sequence< beans::PropertyValue> aCustomShapeGeometry;
1796 240 : if(anotherAny >>= aCustomShapeGeometry)
1797 480 : dumpCustomShapeGeometryAsElement(aCustomShapeGeometry, xmlWriter);
1798 : }
1799 240 : 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 240 : }
1806 240 : }
1807 :
1808 266 : void dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter, bool bDumpInteropProperties)
1809 : {
1810 266 : xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) );
1811 266 : uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW);
1812 532 : uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo();
1813 532 : OUString aName;
1814 266 : m_bNameDumped = false;
1815 :
1816 266 : dumpPositionAsAttribute(xShape->getPosition(), xmlWriter);
1817 266 : dumpSizeAsAttribute(xShape->getSize(), xmlWriter);
1818 532 : uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW);
1819 266 : dumpShapeDescriptorAsAttribute(xDescr, xmlWriter);
1820 :
1821 : // uno::Sequence<beans::Property> aProperties = xPropSetInfo->getProperties();
1822 :
1823 532 : uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW );
1824 :
1825 532 : uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo();
1826 266 : if(xInfo->hasPropertyByName("Name"))
1827 : {
1828 266 : uno::Any aAny = xPropSet->getPropertyValue("Name");
1829 266 : if (aAny >>= aName)
1830 : {
1831 266 : if (!aName.isEmpty())
1832 : {
1833 73 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
1834 73 : m_bNameDumped = true;
1835 : }
1836 266 : }
1837 : }
1838 :
1839 : try
1840 : {
1841 266 : if (xServiceInfo->supportsService("com.sun.star.drawing.Text"))
1842 : {
1843 260 : uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW);
1844 520 : OUString aText = xText->getString();
1845 260 : if(!aText.isEmpty())
1846 321 : xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr());
1847 : }
1848 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties"))
1849 260 : dumpTextPropertiesService(xPropSet, xmlWriter);
1850 :
1851 266 : 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 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.FillProperties"))
1857 254 : dumpFillPropertiesService(xPropSet, xmlWriter);
1858 :
1859 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.LineProperties"))
1860 258 : dumpLinePropertiesService(xPropSet, xmlWriter);
1861 :
1862 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonDescriptor"))
1863 7 : dumpPolyPolygonDescriptorService(xPropSet, xmlWriter);
1864 :
1865 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.ShadowProperties"))
1866 20 : dumpShadowPropertiesService(xPropSet, xmlWriter);
1867 :
1868 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.Shape"))
1869 263 : dumpShapeService(xPropSet, xmlWriter, bDumpInteropProperties);
1870 :
1871 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonBezierDescriptor"))
1872 4 : dumpPolyPolygonBezierDescriptorService(xPropSet, xmlWriter);
1873 :
1874 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.CustomShape"))
1875 240 : dumpCustomShapeService(xPropSet, xmlWriter);
1876 :
1877 : // EnhancedShapeDumper used
1878 :
1879 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeExtrusion"))
1880 : {
1881 0 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1882 0 : enhancedDumper.dumpEnhancedCustomShapeExtrusionService(xPropSet);
1883 : }
1884 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeGeometry"))
1885 : {
1886 0 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1887 0 : enhancedDumper.dumpEnhancedCustomShapeGeometryService(xPropSet);
1888 : }
1889 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeHandle"))
1890 : {
1891 0 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1892 0 : enhancedDumper.dumpEnhancedCustomShapeHandleService(xPropSet);
1893 : }
1894 266 : if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapePath"))
1895 : {
1896 0 : EnhancedShapeDumper enhancedDumper(xmlWriter);
1897 0 : enhancedDumper.dumpEnhancedCustomShapePathService(xPropSet);
1898 : }
1899 266 : 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 532 : xmlTextWriterEndElement( xmlWriter );
1922 266 : }
1923 :
1924 24 : void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter, bool bDumpInteropProperties )
1925 : {
1926 24 : xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) );
1927 24 : uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW);
1928 24 : sal_Int32 nLength = xIA->getCount();
1929 290 : for (sal_Int32 i = 0; i < nLength; ++i)
1930 : {
1931 266 : uno::Reference< drawing::XShape > xShape( xIA->getByIndex( i ), uno::UNO_QUERY_THROW );
1932 266 : dumpXShape( xShape, xmlWriter, bDumpInteropProperties );
1933 266 : }
1934 :
1935 24 : xmlTextWriterEndElement( xmlWriter );
1936 24 : }
1937 : } //end of namespace
1938 :
1939 21 : OUString XShapeDumper::dump(uno::Reference<drawing::XShapes> xPageShapes, bool bDumpInteropProperties)
1940 : {
1941 21 : OStringBuffer aString;
1942 21 : xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL );
1943 21 : xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer );
1944 21 : xmlTextWriterSetIndent( xmlWriter, 1 );
1945 :
1946 21 : xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL );
1947 :
1948 : try
1949 : {
1950 21 : dumpXShapes( xPageShapes, xmlWriter, bDumpInteropProperties );
1951 : }
1952 0 : catch (const beans::UnknownPropertyException& e)
1953 : {
1954 0 : std::cout << "Exception caught in XShapeDumper: " << e.Message << std::endl;
1955 : }
1956 :
1957 21 : xmlTextWriterEndDocument( xmlWriter );
1958 21 : xmlFreeTextWriter( xmlWriter );
1959 :
1960 21 : return OUString::fromUtf8(aString.makeStringAndClear());
1961 : }
1962 :
1963 0 : OUString XShapeDumper::dump(uno::Reference<drawing::XShape> xPageShapes, bool bDumpInteropProperties)
1964 : {
1965 0 : OStringBuffer aString;
1966 0 : xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL );
1967 0 : xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer );
1968 0 : xmlTextWriterSetIndent( xmlWriter, 1 );
1969 :
1970 0 : xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL );
1971 :
1972 : try
1973 : {
1974 0 : dumpXShape( xPageShapes, xmlWriter, bDumpInteropProperties );
1975 : }
1976 0 : catch (const beans::UnknownPropertyException& e)
1977 : {
1978 0 : std::cout << "Exception caught in XShapeDumper: " << e.Message << std::endl;
1979 : }
1980 :
1981 0 : xmlTextWriterEndDocument( xmlWriter );
1982 0 : xmlFreeTextWriter( xmlWriter );
1983 :
1984 0 : return OUString::fromUtf8(aString.makeStringAndClear());
1985 753 : }
1986 :
1987 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|