drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 8 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 60 ++++++++++++++++++ drawinglayer/source/dumper/XShapeDumper.cxx | 5 + 3 files changed, 73 insertions(+)
New commits: commit 1d1f0b647f5da8c811488bf6887d0a0d0dafccf2 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Wed Jul 4 19:10:45 2012 +0200 Added dumping TextPathMode & ScaleX properties Change-Id: Ib31fc84424d4a57e8f3bcca2054016c5809b6f10 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 7fc8559..7bad73c 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -46,6 +46,8 @@ #include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp> #include <com/sun/star/awt/Size.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp> + #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -139,6 +141,8 @@ public: // EnhancedCustomShapePath.idl void dumpEnhancedCustomShapeTextPathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpTextPathAsAttribute(sal_Bool bTextPath); + void dumpTextPathModeAsAttribute(com::sun::star::drawing::EnhancedCustomShapeTextPathMode eTextPathMode); + void dumpScaleXAsAttribute(sal_Bool bScaleX); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index a880d6b..7ecbb3c 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -1030,6 +1030,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeTextPathService(uno::Reference< if(anotherAny >>= bTextPath) dumpTextPathAsAttribute(bTextPath); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextPathMode"); + drawing::EnhancedCustomShapeTextPathMode eTextPathMode; + if(anotherAny >>= eTextPathMode) + dumpTextPathModeAsAttribute(eTextPathMode); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ScaleX"); + sal_Bool bScaleX; + if(anotherAny >>= bScaleX) + dumpScaleXAsAttribute(bScaleX); + } } void EnhancedShapeDumper::dumpTextPathAsAttribute(sal_Bool bTextPath) @@ -1040,3 +1052,28 @@ void EnhancedShapeDumper::dumpTextPathAsAttribute(sal_Bool bTextPath) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPath"), "%s", "false"); } +void EnhancedShapeDumper::dumpTextPathModeAsAttribute(drawing::EnhancedCustomShapeTextPathMode eTextPathMode) +{ + switch(eTextPathMode) + { + case drawing::EnhancedCustomShapeTextPathMode_NORMAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPathMode"), "%s", "NORMAL"); + break; + case drawing::EnhancedCustomShapeTextPathMode_PATH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPathMode"), "%s", "PATH"); + break; + case drawing::EnhancedCustomShapeTextPathMode_SHAPE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPathMode"), "%s", "SHAPE"); + break; + default: + break; + } +} + +void EnhancedShapeDumper::dumpScaleXAsAttribute(sal_Bool bScaleX) +{ + if(bScaleX) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("scaleX"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("scaleX"), "%s", "false"); +} commit 335b0b924453e869457727bca78e0f890ca3219e Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Wed Jul 4 19:07:31 2012 +0200 Started dumping EnhancedCustomShapeTextPath service & added TextPath property Change-Id: I4945ee8cba2d9d4fc9f374cf0002dbdb99d6df28 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 74c231c..7fc8559 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 735919b..a880d6b 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 c1c8941..1503bbe 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) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits