summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Dorda <artur.dorda+libo@gmail.com>2012-07-04 03:30:51 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-12 03:10:16 +0200
commitdf84989340e73a18d47b2dd0c4f37d223ff90618 (patch)
treeadc9daee87b9df25f6a6df248a20f100e9b21ba6
parenta2f212927728a4c0d8f2497b6d9335fc0cd37680 (diff)
Added properties ViewBox & MirroredX
Change-Id: I0ab8e656a46688f28cdaa095e54cf23a64cff83c
-rw-r--r--drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx4
-rw-r--r--drawinglayer/source/dumper/EnhancedShapeDumper.cxx32
2 files changed, 36 insertions, 0 deletions
diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx
index a461a88e1634..74f434fa01ba 100644
--- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx
+++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx
@@ -35,6 +35,8 @@
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+
#ifndef EnhancedShapeDumper_hxx
#define EnhancedShapeDumper_hxx
@@ -81,6 +83,8 @@ public:
// EnhancedCustomShapeGeometry.idl
void dumpEnhancedCustomShapeGeometryService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet);
void dumpTypeAsAttribute(rtl::OUString sType);
+ void dumpViewBoxAsElement(com::sun::star::awt::Rectangle aViewBox);
+ void dumpMirroredXAsAttribute(sal_Bool bMirroredX);
private:
xmlTextWriterPtr xmlWriter;
diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx
index 10f7572d3adc..94970998582f 100644
--- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx
+++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx
@@ -403,9 +403,41 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference<
if(anotherAny >>= sType)
dumpTypeAsAttribute(sType);
}
+ {
+ uno::Any anotherAny = xPropSet->getPropertyValue("ViewBox");
+ awt::Rectangle aViewBox;
+ if(anotherAny >>= aViewBox)
+ dumpViewBoxAsElement(aViewBox);
+ }
+ {
+ uno::Any anotherAny = xPropSet->getPropertyValue("MirroredX");
+ sal_Bool bMirroredX;
+ if(anotherAny >>= bMirroredX)
+ dumpMirroredXAsAttribute(bMirroredX);
+ }
}
void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType)
{
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s",
rtl::OUStringToOString(sType, RTL_TEXTENCODING_UTF8).getStr());
}
+
+void EnhancedShapeDumper::dumpViewBoxAsElement(awt::Rectangle aViewBox)
+ {
+ xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ViewBox" ));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("x"), "%" SAL_PRIdINT32, aViewBox.X);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("y"), "%" SAL_PRIdINT32, aViewBox.Y);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aViewBox.Width);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aViewBox.Height);
+ xmlTextWriterEndElement( xmlWriter );
+ }
+
+void EnhancedShapeDumper::dumpMirroredXAsAttribute(sal_Bool bMirroredX)
+ {
+ if(bMirroredX)
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredX"), "%s", "true");
+ else
+ xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredX"), "%s", "false");
+ }
+
+