diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-07-04 03:30:51 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-12 03:10:16 +0200 |
commit | df84989340e73a18d47b2dd0c4f37d223ff90618 (patch) | |
tree | adc9daee87b9df25f6a6df248a20f100e9b21ba6 /drawinglayer/source/dumper/EnhancedShapeDumper.cxx | |
parent | a2f212927728a4c0d8f2497b6d9335fc0cd37680 (diff) |
Added properties ViewBox & MirroredX
Change-Id: I0ab8e656a46688f28cdaa095e54cf23a64cff83c
Diffstat (limited to 'drawinglayer/source/dumper/EnhancedShapeDumper.cxx')
-rw-r--r-- | drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
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"); + } + + |