From df84989340e73a18d47b2dd0c4f37d223ff90618 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 03:30:51 +0200 Subject: Added properties ViewBox & MirroredX Change-Id: I0ab8e656a46688f28cdaa095e54cf23a64cff83c --- drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'drawinglayer/source/dumper') 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"); + } + + -- cgit