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