LCOV - code coverage report
Current view: top level - drawinglayer/source/dumper - XShapeDumper.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 1 1059 0.1 %
Date: 2014-04-14 Functions: 2 110 1.8 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10