summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorArtur Dorda <artur.dorda+libo@gmail.com>2012-06-08 13:29:08 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-12 03:10:04 +0200
commit4eaadab609f0dd54df4945fc646e4a35a358df98 (patch)
tree8c995667b7f8cb8aaef214752b5643481efa824d /drawinglayer
parent9baac7f405e1e3ba54cb126c2d392f1d77c77e09 (diff)
Added dumping [property] LineDash
Change-Id: I9191ea0c30910b244d13a3b14a0822fa615baada
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/inc/drawinglayer/XShapeDumper.hxx3
-rw-r--r--drawinglayer/source/dumper/XShapeDumper.cxx34
2 files changed, 37 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx
index 88c42e9382aa..92dc06e6a38c 100644
--- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx
+++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx
@@ -36,7 +36,9 @@
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/drawing/RectanglePoint.hpp>
#include <com/sun/star/drawing/BitmapMode.hpp>
+
#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/LineDash.hpp>
#ifndef ChartViewDumper_hxx
#define ChartViewDumper_hxx
@@ -78,6 +80,7 @@ private:
// LineProperties.idl
void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter);
+ void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter);
void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter);
void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter);
diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx
index d79dcfe61327..f551b556ab8a 100644
--- a/drawinglayer/source/dumper/XShapeDumper.cxx
+++ b/drawinglayer/source/dumper/XShapeDumper.cxx
@@ -350,6 +350,34 @@ namespace {
}
}
+ void XShapeDumper::dumpLineDashAsElement(drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter)
+ {
+ xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineDash" ));
+ switch(aLineDash.Style)
+ {
+ case drawing::DashStyle_RECT:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT");
+ break;
+ case drawing::DashStyle_ROUND:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUND");
+ break;
+ case drawing::DashStyle_RECTRELATIVE:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECTRELATIVE");
+ break;
+ case drawing::DashStyle_ROUNDRELATIVE:
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUNDRELATIVE");
+ break;
+ default:
+ break;
+ }
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dots"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dots);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dotLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DotLen);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashes"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dashes);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DashLen);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Distance);
+ xmlTextWriterEndElement( xmlWriter );
+ }
+
void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter)
{
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X);
@@ -559,6 +587,12 @@ namespace {
if(anotherAny >>= eLineStyle)
dumpLineStyleAsAttribute(eLineStyle, xmlWriter);
}
+ {
+ uno::Any anotherAny = xPropSet->getPropertyValue("LineDash");
+ drawing::LineDash aLineDash;
+ if(anotherAny >>= aLineDash)
+ dumpLineDashAsElement(aLineDash, xmlWriter);
+ }
}
#if DEBUG_DUMPER