From ec5b681bbeeb800e67dd228616c29694a9f7a400 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 19:07:31 +0200 Subject: Started dumping EnhancedCustomShapeTextPath service & added TextPath property Change-Id: I4945ee8cba2d9d4fc9f374cf0002dbdb99d6df28 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 4 ++++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 23 ++++++++++++++++++++++ drawinglayer/source/dumper/XShapeDumper.cxx | 5 +++++ 3 files changed, 32 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 74c231cfb484..7fc85597dc9e 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -136,6 +136,10 @@ public: void dumpTextPathAllowedAsAttribute(sal_Bool bTextPathAllowed); void dumpSubViewSizeAsElement(com::sun::star::uno::Sequence< com::sun::star::awt::Size > aSubViewSize); + // EnhancedCustomShapePath.idl + void dumpEnhancedCustomShapeTextPathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); + void dumpTextPathAsAttribute(sal_Bool bTextPath); + private: xmlTextWriterPtr xmlWriter; }; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 735919b16cbc..a880d6b3972c 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -1017,3 +1017,26 @@ void EnhancedShapeDumper::dumpSubViewSizeAsElement(uno::Sequence< awt::Size > aS } xmlTextWriterEndElement( xmlWriter ); } + +// ---------------------------------------------------------- +// ---------- EnhancedCustomShapeTextPath.idl --------------- +// ---------------------------------------------------------- + +void EnhancedShapeDumper::dumpEnhancedCustomShapeTextPathService(uno::Reference< beans::XPropertySet > xPropSet) +{ + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextPath"); + sal_Bool bTextPath; + if(anotherAny >>= bTextPath) + dumpTextPathAsAttribute(bTextPath); + } +} + +void EnhancedShapeDumper::dumpTextPathAsAttribute(sal_Bool bTextPath) +{ + if(bTextPath) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPath"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPath"), "%s", "false"); +} + diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index c1c89418a2ca..1503bbe28230 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1833,6 +1833,11 @@ namespace { EnhancedShapeDumper enhancedDumper(xmlWriter); enhancedDumper.dumpEnhancedCustomShapePathService(xPropSet); } + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeTextPath")) + { + EnhancedShapeDumper enhancedDumper(xmlWriter); + enhancedDumper.dumpEnhancedCustomShapeTextPathService(xPropSet); + } } // end of the 'try' block catch (com::sun::star::beans::UnknownPropertyException &e) { -- cgit