From 16b57ee7cc05e4bf08eef63c7b491ba8de294357 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 26 May 2012 01:11:53 +0200 Subject: Unfinished dumper code Change-Id: I353c93498c2e0cc8fd4450f0348dfceedb763b51 --- drawinglayer/Library_drawinglayer.mk | 2 + drawinglayer/Package_inc.mk | 1 + drawinglayer/inc/drawinglayer/ChartViewDumper.hxx | 50 +++++++ drawinglayer/source/dumper/ChartViewDumper.cxx | 159 ++++++++++++++++++++++ 4 files changed, 212 insertions(+) create mode 100644 drawinglayer/inc/drawinglayer/ChartViewDumper.hxx create mode 100644 drawinglayer/source/dumper/ChartViewDumper.cxx (limited to 'drawinglayer') diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk index 94ab023682ea..37e0cdd9e7b6 100644 --- a/drawinglayer/Library_drawinglayer.mk +++ b/drawinglayer/Library_drawinglayer.mk @@ -31,6 +31,7 @@ $(eval $(call gb_Library_use_package,drawinglayer,drawinglayer_inc)) $(eval $(call gb_Library_set_include,drawinglayer,\ $$(INCLUDE) \ + -I$(SRCDIR)/drawinglayer/inc \ )) $(eval $(call gb_Library_add_defs,drawinglayer,\ @@ -171,6 +172,7 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\ drawinglayer/source/processor3d/zbufferprocessor3d \ drawinglayer/source/texture/texture3d \ drawinglayer/source/texture/texture \ + drawinglayer/source/dumper/ChartViewDumper \ )) # vim: set noet sw=4 ts=4: diff --git a/drawinglayer/Package_inc.mk b/drawinglayer/Package_inc.mk index 4cc1d34c530d..51c52ce838ea 100644 --- a/drawinglayer/Package_inc.mk +++ b/drawinglayer/Package_inc.mk @@ -137,5 +137,6 @@ $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/ $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/zbufferprocessor3d.hxx,drawinglayer/processor3d/zbufferprocessor3d.hxx)) $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/texture/texture3d.hxx,drawinglayer/texture/texture3d.hxx)) $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/texture/texture.hxx,drawinglayer/texture/texture.hxx)) +$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/ChartViewDumper.hxx,drawinglayer/ChartViewDumper.hxx)) # vim: set noet sw=4 ts=4: diff --git a/drawinglayer/inc/drawinglayer/ChartViewDumper.hxx b/drawinglayer/inc/drawinglayer/ChartViewDumper.hxx new file mode 100644 index 000000000000..b7f355213a28 --- /dev/null +++ b/drawinglayer/inc/drawinglayer/ChartViewDumper.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Artur Dorda (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include +#include +#include + +#ifndef ChartViewDumper_hxx +#define ChartViewDumper_hxx + +class ChartViewDumper +{ + +public: + ChartViewDumper(); + int writeCallback(void* pContext, const char* sBuffer, int nLen); + void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); + void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); + void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); + void dumpXShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, xmlTextWriterPtr xmlWriter); + void dumpXShapes( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); + rtl::OUString dump(); + +}; +#endif diff --git a/drawinglayer/source/dumper/ChartViewDumper.cxx b/drawinglayer/source/dumper/ChartViewDumper.cxx new file mode 100644 index 000000000000..5d3c03761242 --- /dev/null +++ b/drawinglayer/source/dumper/ChartViewDumper.cxx @@ -0,0 +1,159 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Artur Dorda (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include +#include +#include +#include +#include +#include +#include + + +#define DEBUG_DUMPER 0 + +using namespace com::sun::star; +//class ChartViewDumper +namespace +{ + void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); + + int writeCallback(void* pContext, const char* sBuffer, int nLen) + { + rtl::OStringBuffer* pBuffer = static_cast(pContext); + pBuffer->append(sBuffer); + return nLen; + } + + int closeCallback(void* ) + { + return 0; + } + + void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y); + } + + void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height); + } + + void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); + } + + void dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); + + dumpPositionAsAttribute(xShape->getPosition(), xmlWriter); + dumpSizeAsAttribute(xShape->getSize(), xmlWriter); + uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW); + dumpShapeDescriptorAsAttribute(xDescr, xmlWriter); + + uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW ); + uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames(); + + uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("Name"); + rtl::OUString aName; + if (aAny >>= aName) + { + if (!aName.isEmpty()) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr()); + } + if (xServiceInfo->supportsService("com.sun.star.drawing.Text")) + { + uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW); + rtl::OUString aText = xText->getString(); + if(!aText.isEmpty()) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); + } + else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) + { + uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW); + dumpXShapes(xShapes, xmlWriter); + } + + #if DEBUG_DUMPER + sal_Int32 nServices = aServiceNames.getLength(); + for (sal_Int32 i = 0; i < nServices; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ServiceName" )); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( "name" ), "%s", rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr()); + xmlTextWriterEndElement( xmlWriter ); + } + #endif + + xmlTextWriterEndElement( xmlWriter ); + } + + void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ) + { + xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) ); + uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW); + sal_Int32 nLength = xIA->getCount(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + uno::Reference< drawing::XShape > xShape( xIA->getByIndex( i ), uno::UNO_QUERY_THROW ); + dumpXShape( xShape, xmlWriter ); + } + + xmlTextWriterEndElement( xmlWriter ); + } + + rtl::OUString dump() throw (uno::RuntimeException) + { + impl_updateView(); + uno::Reference xPageShapes( ShapeFactory(m_xShapeFactory) + .getOrCreateChartRootShape( m_xDrawPage ) ); + + if (!xPageShapes.is()) + return rtl::OUString(); + + rtl::OStringBuffer aString; + xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL ); + xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer ); + xmlTextWriterSetIndent( xmlWriter, 1 ); + + xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL ); + + dumpXShapes( xPageShapes, xmlWriter ); + + xmlTextWriterEndDocument( xmlWriter ); + xmlFreeTextWriter( xmlWriter ); + + return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); + } + +} //end of namespace -- cgit From ea18a422cd2ec0bc3a8e8e569576c09828e45d39 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 1 Jun 2012 19:54:53 +0200 Subject: Working version of XShapeDumper Change-Id: I4f4d37abdb1865d0bc05f01518d854872235121f --- drawinglayer/Library_drawinglayer.mk | 6 +- drawinglayer/Package_inc.mk | 2 +- drawinglayer/inc/drawinglayer/ChartViewDumper.hxx | 50 ------- drawinglayer/source/dumper/ChartViewDumper.cxx | 159 ---------------------- 4 files changed, 6 insertions(+), 211 deletions(-) delete mode 100644 drawinglayer/inc/drawinglayer/ChartViewDumper.hxx delete mode 100644 drawinglayer/source/dumper/ChartViewDumper.cxx (limited to 'drawinglayer') diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk index 37e0cdd9e7b6..202211858278 100644 --- a/drawinglayer/Library_drawinglayer.mk +++ b/drawinglayer/Library_drawinglayer.mk @@ -40,6 +40,10 @@ $(eval $(call gb_Library_add_defs,drawinglayer,\ $(eval $(call gb_Library_use_sdk_api,drawinglayer)) +$(eval $(call gb_Library_use_externals,drawinglayer,\ + libxml2 \ +)) + $(eval $(call gb_Library_use_libraries,drawinglayer,\ basegfx \ canvastools \ @@ -172,7 +176,7 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\ drawinglayer/source/processor3d/zbufferprocessor3d \ drawinglayer/source/texture/texture3d \ drawinglayer/source/texture/texture \ - drawinglayer/source/dumper/ChartViewDumper \ + drawinglayer/source/dumper/XShapeDumper \ )) # vim: set noet sw=4 ts=4: diff --git a/drawinglayer/Package_inc.mk b/drawinglayer/Package_inc.mk index 51c52ce838ea..7d41e6c2b5d8 100644 --- a/drawinglayer/Package_inc.mk +++ b/drawinglayer/Package_inc.mk @@ -137,6 +137,6 @@ $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/ $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/zbufferprocessor3d.hxx,drawinglayer/processor3d/zbufferprocessor3d.hxx)) $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/texture/texture3d.hxx,drawinglayer/texture/texture3d.hxx)) $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/texture/texture.hxx,drawinglayer/texture/texture.hxx)) -$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/ChartViewDumper.hxx,drawinglayer/ChartViewDumper.hxx)) +$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/XShapeDumper.hxx,drawinglayer/XShapeDumper.hxx)) # vim: set noet sw=4 ts=4: diff --git a/drawinglayer/inc/drawinglayer/ChartViewDumper.hxx b/drawinglayer/inc/drawinglayer/ChartViewDumper.hxx deleted file mode 100644 index b7f355213a28..000000000000 --- a/drawinglayer/inc/drawinglayer/ChartViewDumper.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * Version: MPL 1.1 / GPLv3+ / LGPLv3+ - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License or as specified alternatively below. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * Major Contributor(s): - * Copyright (C) 2012 Artur Dorda (initial developer) - * - * All Rights Reserved. - * - * For minor contributions see the git repository. - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 3 or later (the "GPLv3+"), or - * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), - * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable - * instead of those above. - */ - -#include -#include -#include - -#ifndef ChartViewDumper_hxx -#define ChartViewDumper_hxx - -class ChartViewDumper -{ - -public: - ChartViewDumper(); - int writeCallback(void* pContext, const char* sBuffer, int nLen); - void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); - void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); - void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); - void dumpXShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, xmlTextWriterPtr xmlWriter); - void dumpXShapes( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); - rtl::OUString dump(); - -}; -#endif diff --git a/drawinglayer/source/dumper/ChartViewDumper.cxx b/drawinglayer/source/dumper/ChartViewDumper.cxx deleted file mode 100644 index 5d3c03761242..000000000000 --- a/drawinglayer/source/dumper/ChartViewDumper.cxx +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * Version: MPL 1.1 / GPLv3+ / LGPLv3+ - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License or as specified alternatively below. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * Major Contributor(s): - * Copyright (C) 2012 Artur Dorda (initial developer) - * - * All Rights Reserved. - * - * For minor contributions see the git repository. - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 3 or later (the "GPLv3+"), or - * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), - * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable - * instead of those above. - */ - -#include -#include -#include -#include -#include -#include -#include - - -#define DEBUG_DUMPER 0 - -using namespace com::sun::star; -//class ChartViewDumper -namespace -{ - void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); - - int writeCallback(void* pContext, const char* sBuffer, int nLen) - { - rtl::OStringBuffer* pBuffer = static_cast(pContext); - pBuffer->append(sBuffer); - return nLen; - } - - int closeCallback(void* ) - { - return 0; - } - - void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y); - } - - void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height); - } - - void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); - } - - void dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); - - dumpPositionAsAttribute(xShape->getPosition(), xmlWriter); - dumpSizeAsAttribute(xShape->getSize(), xmlWriter); - uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW); - dumpShapeDescriptorAsAttribute(xDescr, xmlWriter); - - uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW ); - uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames(); - - uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW); - uno::Any aAny = xPropSet->getPropertyValue("Name"); - rtl::OUString aName; - if (aAny >>= aName) - { - if (!aName.isEmpty()) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr()); - } - if (xServiceInfo->supportsService("com.sun.star.drawing.Text")) - { - uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW); - rtl::OUString aText = xText->getString(); - if(!aText.isEmpty()) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); - } - else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) - { - uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW); - dumpXShapes(xShapes, xmlWriter); - } - - #if DEBUG_DUMPER - sal_Int32 nServices = aServiceNames.getLength(); - for (sal_Int32 i = 0; i < nServices; ++i) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ServiceName" )); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( "name" ), "%s", rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr()); - xmlTextWriterEndElement( xmlWriter ); - } - #endif - - xmlTextWriterEndElement( xmlWriter ); - } - - void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ) - { - xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) ); - uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW); - sal_Int32 nLength = xIA->getCount(); - for (sal_Int32 i = 0; i < nLength; ++i) - { - uno::Reference< drawing::XShape > xShape( xIA->getByIndex( i ), uno::UNO_QUERY_THROW ); - dumpXShape( xShape, xmlWriter ); - } - - xmlTextWriterEndElement( xmlWriter ); - } - - rtl::OUString dump() throw (uno::RuntimeException) - { - impl_updateView(); - uno::Reference xPageShapes( ShapeFactory(m_xShapeFactory) - .getOrCreateChartRootShape( m_xDrawPage ) ); - - if (!xPageShapes.is()) - return rtl::OUString(); - - rtl::OStringBuffer aString; - xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL ); - xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer ); - xmlTextWriterSetIndent( xmlWriter, 1 ); - - xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL ); - - dumpXShapes( xPageShapes, xmlWriter ); - - xmlTextWriterEndDocument( xmlWriter ); - xmlFreeTextWriter( xmlWriter ); - - return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); - } - -} //end of namespace -- cgit From 16917e46f08f644644656f8e95ec0a2daabc7013 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Mon, 4 Jun 2012 16:49:51 +0200 Subject: Start of dumping FillProperties service. Added [property] FillStyle Change-Id: Ie49170eb6e2226fb94b5ea50e365cd70b2c43c5a --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 54 +++++++ drawinglayer/source/dumper/XShapeDumper.cxx | 192 +++++++++++++++++++++++++ 2 files changed, 246 insertions(+) create mode 100644 drawinglayer/inc/drawinglayer/XShapeDumper.hxx create mode 100644 drawinglayer/source/dumper/XShapeDumper.cxx (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx new file mode 100644 index 000000000000..9e3bcf61a74d --- /dev/null +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Artur Dorda (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include +#include +#include +#include +#include + +#ifndef ChartViewDumper_hxx +#define ChartViewDumper_hxx + +class DRAWINGLAYER_DLLPUBLIC XShapeDumper +{ + +public: + XShapeDumper(); + rtl::OUString dump(com::sun::star::uno::Reference xPageShapes); + +private: + void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); + void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); + void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); + void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); + void dumpXShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, xmlTextWriterPtr xmlWriter); + void dumpXShapes( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); + +}; +#endif diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx new file mode 100644 index 000000000000..92e12d1a3c39 --- /dev/null +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -0,0 +1,192 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Artur Dorda (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include +#include +#include +#include +#include +#include +#include + + +#define DEBUG_DUMPER 0 + +using namespace com::sun::star; +//class XShapeDumper + +namespace { + + int writeCallback(void* pContext, const char* sBuffer, int nLen) + { + rtl::OStringBuffer* pBuffer = static_cast(pContext); + pBuffer->append(sBuffer); + return nLen; + } + + int closeCallback(void* ) + { + return 0; + } +} //end of namespace + + XShapeDumper::XShapeDumper() + { + + } + // ---------------------------------------- + // ---------- FillProperties.idl ---------- + // ---------------------------------------- + void XShapeDumper::dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter) + { + switch(eFillStyle) + { + case drawing::FillStyle_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "NONE"); + break; + case drawing::FillStyle_SOLID: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "SOLID"); + break; + case drawing::FillStyle_GRADIENT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "GRADIENT"); + break; + case drawing::FillStyle_HATCH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "HATCH"); + break; + case drawing::FillStyle_BITMAP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "BITMAP"); + break; + default: + break; + } + } + + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y); + } + + void XShapeDumper::dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height); + } + + void XShapeDumper::dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); + } + + void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); + + dumpPositionAsAttribute(xShape->getPosition(), xmlWriter); + dumpSizeAsAttribute(xShape->getSize(), xmlWriter); + uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW); + dumpShapeDescriptorAsAttribute(xDescr, xmlWriter); + + uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW ); + uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames(); + + uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("Name"); + rtl::OUString aName; + if (aAny >>= aName) + { + if (!aName.isEmpty()) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr()); + } + if (xServiceInfo->supportsService("com.sun.star.drawing.Text")) + { + uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW); + rtl::OUString aText = xText->getString(); + if(!aText.isEmpty()) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); + } + else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) + { + uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW); + dumpXShapes(xShapes, xmlWriter); + } + else if(xServiceInfo->supportsService("com.sun.star.drawing.FillStyle")) + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); + drawing::FillStyle eFillStyle; + if( anotherAny >>= eFillStyle) + { + dumpFillStyleAsAttribute(eFillStyle, xmlWriter); + } + } + + #if DEBUG_DUMPER + sal_Int32 nServices = aServiceNames.getLength(); + for (sal_Int32 i = 0; i < nServices; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ServiceName" )); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( "name" ), "%s", rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr()); + xmlTextWriterEndElement( xmlWriter ); + } + #endif + + xmlTextWriterEndElement( xmlWriter ); + } + + void XShapeDumper::dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ) + { + xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) ); + uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW); + sal_Int32 nLength = xIA->getCount(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + uno::Reference< drawing::XShape > xShape( xIA->getByIndex( i ), uno::UNO_QUERY_THROW ); + dumpXShape( xShape, xmlWriter ); + } + + xmlTextWriterEndElement( xmlWriter ); + } + + rtl::OUString XShapeDumper::dump(uno::Reference xPageShapes) + { + + rtl::OStringBuffer aString; + xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL ); + xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer ); + xmlTextWriterSetIndent( xmlWriter, 1 ); + + xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL ); + + dumpXShapes( xPageShapes, xmlWriter ); + + xmlTextWriterEndDocument( xmlWriter ); + xmlFreeTextWriter( xmlWriter ); + + return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); + } + -- cgit From 73f620f431131a8aa920c3ac2c18a92ef25aac3e Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Mon, 4 Jun 2012 22:02:15 +0200 Subject: Added dumping [property] FillColor Change-Id: I5c5edfaac3540af0c99dd034e511688b3bedd26f --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 9e3bcf61a74d..d316a457757d 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -44,6 +44,7 @@ public: private: void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); + void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 92e12d1a3c39..6a3b8d9a3a04 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -86,6 +86,11 @@ namespace { } } + void XShapeDumper::dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, aColor); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -106,18 +111,21 @@ namespace { void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); + uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW); + uno::Reference xPropSetInfo = xPropSet->getPropertySetInfo(); + rtl::OUString aName; dumpPositionAsAttribute(xShape->getPosition(), xmlWriter); dumpSizeAsAttribute(xShape->getSize(), xmlWriter); uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW); dumpShapeDescriptorAsAttribute(xDescr, xmlWriter); + // uno::Sequence aProperties = xPropSetInfo->getProperties(); + uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW ); uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames(); - uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW); uno::Any aAny = xPropSet->getPropertyValue("Name"); - rtl::OUString aName; if (aAny >>= aName) { if (!aName.isEmpty()) @@ -140,8 +148,15 @@ namespace { uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); drawing::FillStyle eFillStyle; if( anotherAny >>= eFillStyle) - { dumpFillStyleAsAttribute(eFillStyle, xmlWriter); + } + else if(xServiceInfo->supportsService("com.sun.star.util.Color")) + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillColor"); + sal_Int32 aColor; + if(anotherAny >>= aColor) + { + dumpFillColorAsAttribute(aColor, xmlWriter); } } -- cgit From 9cd748dc55cceb6a44d1fa8de1b00897233151e5 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 5 Jun 2012 02:05:32 +0200 Subject: Way of dumping properties corrected Change-Id: I48e269547f4ee06c5cc7ea2407997a70c6d21044 --- drawinglayer/source/dumper/XShapeDumper.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 6a3b8d9a3a04..5844c0e0c9af 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -143,20 +143,20 @@ namespace { uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW); dumpXShapes(xShapes, xmlWriter); } - else if(xServiceInfo->supportsService("com.sun.star.drawing.FillStyle")) + else if(xServiceInfo->supportsService("com.sun.star.drawing.FillProperties")) { - uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); - drawing::FillStyle eFillStyle; - if( anotherAny >>= eFillStyle) + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); + drawing::FillStyle eFillStyle; + if(anotherAny >>= eFillStyle) dumpFillStyleAsAttribute(eFillStyle, xmlWriter); - } - else if(xServiceInfo->supportsService("com.sun.star.util.Color")) - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillColor"); - sal_Int32 aColor; - if(anotherAny >>= aColor) + } + { - dumpFillColorAsAttribute(aColor, xmlWriter); + uno::Any anotherAny = xPropSet->getPropertyValue("FillColor"); + sal_Int32 aColor; + if(anotherAny >>= aColor) + dumpFillColorAsAttribute(aColor, xmlWriter); } } -- cgit From 1ae18926dff98d1a97fb7e3efb17c098add2fe7b Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 5 Jun 2012 02:20:21 +0200 Subject: Added dumping [property] FillTransparence and ignoring .patch files Change-Id: I676a811a618b381f4a99010e40fdf1627cea7067 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index d316a457757d..744b46272122 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -45,6 +45,7 @@ public: private: void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); + void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 5844c0e0c9af..22c5873babf2 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -91,6 +91,11 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, aColor); } + void XShapeDumper::dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, aTransparence); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -151,13 +156,18 @@ namespace { if(anotherAny >>= eFillStyle) dumpFillStyleAsAttribute(eFillStyle, xmlWriter); } - { uno::Any anotherAny = xPropSet->getPropertyValue("FillColor"); sal_Int32 aColor; if(anotherAny >>= aColor) dumpFillColorAsAttribute(aColor, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparence"); + sal_Int32 aTransparence; + if(anotherAny >>= aTransparence) + dumpFillColorAsAttribute(aTransparence, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From c353401fb81dfd5c370fd4674819ce66608e40d9 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 5 Jun 2012 02:35:35 +0200 Subject: Added dumping [property] FillTransparenceGradientName + corrected method calls Change-Id: I882d1d4ebe0bef6ac23eb25117d52e460223bb29 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 28 ++++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 744b46272122..4b77fb720be1 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -46,6 +46,7 @@ private: void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); + void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString aTranspGradName, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 22c5873babf2..55bfc6f91e34 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -67,19 +67,19 @@ namespace { switch(eFillStyle) { case drawing::FillStyle_NONE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "NONE"); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "NONE"); break; case drawing::FillStyle_SOLID: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "SOLID"); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "SOLID"); break; case drawing::FillStyle_GRADIENT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "GRADIENT"); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "GRADIENT"); break; case drawing::FillStyle_HATCH: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "HATCH"); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "HATCH"); break; case drawing::FillStyle_BITMAP: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("FillStyle"), "%s", "BITMAP"); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "BITMAP"); break; default: break; @@ -88,12 +88,18 @@ namespace { void XShapeDumper::dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, aColor); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillColor"), "%" SAL_PRIdINT32, aColor); } void XShapeDumper::dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, aTransparence); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32, aTransparence); + } + + void XShapeDumper::dumpFillTransparenceGradientNameAsAttribute(rtl::OUString aTranspGradName, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s", + rtl::OUStringToOString(aTranspGradName, RTL_TEXTENCODING_UTF8).getStr()); } void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) @@ -166,7 +172,13 @@ namespace { uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparence"); sal_Int32 aTransparence; if(anotherAny >>= aTransparence) - dumpFillColorAsAttribute(aTransparence, xmlWriter); + dumpFillTransparenceAsAttribute(aTransparence, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradientName"); + rtl::OUString aTranspGradName; + if(anotherAny >>= aTranspGradName) + dumpFillTransparenceGradientNameAsAttribute(aTranspGradName, xmlWriter); } } -- cgit From 5c10fd12a1aaa53c398a93387ee8d01374d832ca Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 6 Jun 2012 02:52:34 +0200 Subject: Added dumping [property] FillTransparenceGradient Change-Id: I548059675801ee6c85111398836d5122525532db --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 45 ++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 4b77fb720be1..c77e4842b53f 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -31,6 +31,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -47,6 +48,8 @@ private: void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString aTranspGradName, xmlTextWriterPtr xmlWriter); + void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); + void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 55bfc6f91e34..7cd08924338d 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -102,6 +102,45 @@ namespace { rtl::OUStringToOString(aTranspGradName, RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillTransparenceGradient" )); + + switch(aTranspGrad.Style) //enum GradientStyle + { + case awt::GradientStyle_LINEAR: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "LINEAR"); + break; + case awt::GradientStyle_AXIAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "AXIAL"); + break; + case awt::GradientStyle_RADIAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RADIAL"); + break; + case awt::GradientStyle_ELLIPTICAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ELLIPTICAL"); + break; + case awt::GradientStyle_SQUARE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "SQUARE"); + break; + case awt::GradientStyle_RECT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT"); + break; + default: + break; + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startColor"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.StartColor); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endColor"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.EndColor); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.Angle); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("border"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.Border); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("xOffset"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.XOffset); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("yOffset"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.YOffset); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.StartIntensity); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.EndIntensity); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.StepCount); + xmlTextWriterEndElement( xmlWriter ); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -180,6 +219,12 @@ namespace { if(anotherAny >>= aTranspGradName) dumpFillTransparenceGradientNameAsAttribute(aTranspGradName, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradient"); + awt::Gradient aTranspGrad; + if(anotherAny >>= aTranspGrad) + dumpFillTransparenceGradientAsElement(aTranspGrad, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 702a90ca34d6ad22f06aad374304eb3739fbb191 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 6 Jun 2012 16:49:05 +0200 Subject: Added separate method to dump awt::Gradient properties Change-Id: Idb5f752973a4c1359587f3d43db5fd0ef9958e8e --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 30 +++++++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index c77e4842b53f..e45c597dd9f8 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -48,6 +48,7 @@ private: void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString aTranspGradName, xmlTextWriterPtr xmlWriter); + void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 7cd08924338d..49138ed08245 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -102,11 +102,10 @@ namespace { rtl::OUStringToOString(aTranspGradName, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter) + //because there's more awt::Gradient properties to dump + void XShapeDumper::dumpGradientProperty(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillTransparenceGradient" )); - - switch(aTranspGrad.Style) //enum GradientStyle + switch(aGradient.Style) //enum GradientStyle { case awt::GradientStyle_LINEAR: xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "LINEAR"); @@ -129,15 +128,20 @@ namespace { default: break; } - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startColor"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.StartColor); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endColor"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.EndColor); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.Angle); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("border"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.Border); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("xOffset"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.XOffset); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("yOffset"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.YOffset); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.StartIntensity); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.EndIntensity); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) aTranspGrad.StepCount); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startColor"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StartColor); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endColor"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.EndColor); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.Angle); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("border"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.Border); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("xOffset"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.XOffset); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("yOffset"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.YOffset); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StartIntensity); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.EndIntensity); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StepCount); + } + void XShapeDumper::dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillTransparenceGradient" )); + dumpGradientProperty(aTranspGrad, xmlWriter); xmlTextWriterEndElement( xmlWriter ); } -- cgit From cbee1a311c3e28368d826a654bb25e07a241b89d Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 6 Jun 2012 16:56:47 +0200 Subject: Added dumping [property] FillGradientName Change-Id: I7d124c9df1f05cdca2cb89b8dffa36b3f97bd843 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index e45c597dd9f8..1ee34bcff077 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -50,6 +50,7 @@ private: void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString aTranspGradName, xmlTextWriterPtr xmlWriter); void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); + void dumpFillGradientNameAsAttribute(rtl::OUString aGradName, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 49138ed08245..77d8bef013c4 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -138,6 +138,7 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.EndIntensity); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StepCount); } + void XShapeDumper::dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillTransparenceGradient" )); @@ -145,6 +146,12 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpFillGradientNameAsAttribute(rtl::OUString aGradName, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s", + rtl::OUStringToOString(aGradName, RTL_TEXTENCODING_UTF8).getStr()); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -229,6 +236,12 @@ namespace { if(anotherAny >>= aTranspGrad) dumpFillTransparenceGradientAsElement(aTranspGrad, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillGradientName"); + rtl::OUString aGradName; + if(anotherAny >>= aGradName) + dumpFillGradientNameAsAttribute(aGradName, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From e568644c72eb54b5f8ed686311f95116c71cde89 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 6 Jun 2012 17:06:15 +0200 Subject: Added dumping [property] FillGradient Change-Id: I83efbdca3b232bc1410c3f46a702e62aa8092c6a --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 1ee34bcff077..61176d09b80f 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -51,6 +51,7 @@ private: void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); void dumpFillGradientNameAsAttribute(rtl::OUString aGradName, xmlTextWriterPtr xmlWriter); + void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 77d8bef013c4..6ae6ef1cb1ff 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -152,6 +152,13 @@ namespace { rtl::OUStringToOString(aGradName, RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpFillGradientAsElement(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillGradient" )); + dumpGradientProperty(aGradient, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -242,6 +249,12 @@ namespace { if(anotherAny >>= aGradName) dumpFillGradientNameAsAttribute(aGradName, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillGradient"); + awt::Gradient aGradient; + if(anotherAny >>= aGradient) + dumpFillGradientAsElement(aGradient, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 53f36f9de814a99e3cb4f8f60ca345b2dce91629 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 6 Jun 2012 17:12:32 +0200 Subject: Added dumping [property] FillHatchName Change-Id: I85e15ca28edaaf2d3c2ac26b7dd152291ff6966e --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 61176d09b80f..b211a72d7f1f 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -52,6 +52,7 @@ private: void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); void dumpFillGradientNameAsAttribute(rtl::OUString aGradName, xmlTextWriterPtr xmlWriter); void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); + void dumpFillHatchNameAsAttribute(rtl::OUString aHatchName, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 6ae6ef1cb1ff..508ad750805e 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -148,7 +148,7 @@ namespace { void XShapeDumper::dumpFillGradientNameAsAttribute(rtl::OUString aGradName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s", + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s", rtl::OUStringToOString(aGradName, RTL_TEXTENCODING_UTF8).getStr()); } @@ -159,6 +159,12 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpFillHatchNameAsAttribute(rtl::OUString aHatchName, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillHatchName"), "%s", + rtl::OUStringToOString(aHatchName, RTL_TEXTENCODING_UTF8).getStr()); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -255,6 +261,12 @@ namespace { if(anotherAny >>= aGradient) dumpFillGradientAsElement(aGradient, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillHatchName"); + rtl::OUString aHatchName; + if(anotherAny >>= aHatchName) + dumpFillGradientNameAsAttribute(aHatchName, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From c6400b95b1231a244e6e6b990f13a4c16bd3d1b6 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 6 Jun 2012 17:45:30 +0200 Subject: Added dumping [property] FillHatch Change-Id: I883c056bcda79bcf8e0275d2a1bb7145553de483 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 29 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index b211a72d7f1f..2644106fce96 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -32,6 +32,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -53,6 +54,7 @@ private: void dumpFillGradientNameAsAttribute(rtl::OUString aGradName, xmlTextWriterPtr xmlWriter); void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpFillHatchNameAsAttribute(rtl::OUString aHatchName, xmlTextWriterPtr xmlWriter); + void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 508ad750805e..400440ff8641 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -165,6 +165,29 @@ namespace { rtl::OUStringToOString(aHatchName, RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpFillHatchAsElement(drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillHatch" )); + switch(aHatch.Style) + { + case drawing::HatchStyle_SINGLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "SINGLE"); + break; + case drawing::HatchStyle_DOUBLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "DOUBLE"); + break; + case drawing::HatchStyle_TRIPLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "TRIPLE"); + break; + default: + break; + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("color"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Color); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Distance); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Angle); + xmlTextWriterEndElement( xmlWriter ); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -267,6 +290,12 @@ namespace { if(anotherAny >>= aHatchName) dumpFillGradientNameAsAttribute(aHatchName, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillHatch"); + drawing::Hatch aHatch; + if(anotherAny >>= aHatch) + dumpFillHatchAsElement(aHatch, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 0da91ad4b0d8660b9f4e1a83c3f50ff56086e360 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 00:35:28 +0200 Subject: Added dumping [property] FillBackground Change-Id: Iff019182e407355aa3d052083fb8cc3d184de6cd --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 2644106fce96..3fe2067d1839 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -55,6 +55,7 @@ private: void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpFillHatchNameAsAttribute(rtl::OUString aHatchName, xmlTextWriterPtr xmlWriter); void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter); + void dumpFillBackgroundAsAttribute(sal_Bool aBackground, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 400440ff8641..d9b2acaeda33 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -188,6 +188,14 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpFillBackgroundAsAttribute(sal_Bool aBackground, xmlTextWriterPtr xmlWriter) + { + if(aBackground) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "false"); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -296,6 +304,12 @@ namespace { if(anotherAny >>= aHatch) dumpFillHatchAsElement(aHatch, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBackground"); + sal_Bool bFillBackground; + if(anotherAny >>= bFillBackground) + dumpFillBackgroundAsAttribute(bFillBackground, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 59e00745b76bf4cbed13c63831e9435924b0f82f Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:12:11 +0200 Subject: Added dumping [property] FillBitmapName and [property] FillBitmap Change-Id: I86808c35463abf849f187b47dbe15c16a74d68a3 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 9 ++-- drawinglayer/source/dumper/XShapeDumper.cxx | 63 +++++++++++++++++++------- 2 files changed, 53 insertions(+), 19 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 3fe2067d1839..12b912733bd5 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -33,6 +33,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -48,14 +49,16 @@ private: void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); - void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString aTranspGradName, xmlTextWriterPtr xmlWriter); + void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter); void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); - void dumpFillGradientNameAsAttribute(rtl::OUString aGradName, xmlTextWriterPtr xmlWriter); + void dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter); void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); - void dumpFillHatchNameAsAttribute(rtl::OUString aHatchName, xmlTextWriterPtr xmlWriter); + void dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter); void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter); void dumpFillBackgroundAsAttribute(sal_Bool aBackground, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapAsElement(com::sun::star::uno::Reference xBitmap, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index d9b2acaeda33..34f059a318c8 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -96,10 +96,10 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32, aTransparence); } - void XShapeDumper::dumpFillTransparenceGradientNameAsAttribute(rtl::OUString aTranspGradName, xmlTextWriterPtr xmlWriter) + void XShapeDumper::dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s", - rtl::OUStringToOString(aTranspGradName, RTL_TEXTENCODING_UTF8).getStr()); + rtl::OUStringToOString(sTranspGradName, RTL_TEXTENCODING_UTF8).getStr()); } //because there's more awt::Gradient properties to dump @@ -146,10 +146,10 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpFillGradientNameAsAttribute(rtl::OUString aGradName, xmlTextWriterPtr xmlWriter) + void XShapeDumper::dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s", - rtl::OUStringToOString(aGradName, RTL_TEXTENCODING_UTF8).getStr()); + rtl::OUStringToOString(sGradName, RTL_TEXTENCODING_UTF8).getStr()); } void XShapeDumper::dumpFillGradientAsElement(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) @@ -159,10 +159,10 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpFillHatchNameAsAttribute(rtl::OUString aHatchName, xmlTextWriterPtr xmlWriter) + void XShapeDumper::dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillHatchName"), "%s", - rtl::OUStringToOString(aHatchName, RTL_TEXTENCODING_UTF8).getStr()); + rtl::OUStringToOString(sHatchName, RTL_TEXTENCODING_UTF8).getStr()); } void XShapeDumper::dumpFillHatchAsElement(drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter) @@ -196,6 +196,24 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "false"); } + void XShapeDumper::dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s", + rtl::OUStringToOString(sBitmapName, RTL_TEXTENCODING_UTF8).getStr()); + } + + void XShapeDumper::dumpFillBitmapAsElement(uno::Reference xBitmap, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillBitmap" )); + if (xBitmap.is()) + { + awt::Size const aSize = xBitmap->getSize(); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aSize.Width); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aSize.Height); + } + xmlTextWriterEndElement( xmlWriter ); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -210,7 +228,8 @@ namespace { void XShapeDumper::dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", + rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); } void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) @@ -270,9 +289,9 @@ namespace { } { uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradientName"); - rtl::OUString aTranspGradName; - if(anotherAny >>= aTranspGradName) - dumpFillTransparenceGradientNameAsAttribute(aTranspGradName, xmlWriter); + rtl::OUString sTranspGradName; + if(anotherAny >>= sTranspGradName) + dumpFillTransparenceGradientNameAsAttribute(sTranspGradName, xmlWriter); } { uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradient"); @@ -282,9 +301,9 @@ namespace { } { uno::Any anotherAny = xPropSet->getPropertyValue("FillGradientName"); - rtl::OUString aGradName; - if(anotherAny >>= aGradName) - dumpFillGradientNameAsAttribute(aGradName, xmlWriter); + rtl::OUString sGradName; + if(anotherAny >>= sGradName) + dumpFillGradientNameAsAttribute(sGradName, xmlWriter); } { uno::Any anotherAny = xPropSet->getPropertyValue("FillGradient"); @@ -294,9 +313,9 @@ namespace { } { uno::Any anotherAny = xPropSet->getPropertyValue("FillHatchName"); - rtl::OUString aHatchName; - if(anotherAny >>= aHatchName) - dumpFillGradientNameAsAttribute(aHatchName, xmlWriter); + rtl::OUString sHatchName; + if(anotherAny >>= sHatchName) + dumpFillGradientNameAsAttribute(sHatchName, xmlWriter); } { uno::Any anotherAny = xPropSet->getPropertyValue("FillHatch"); @@ -310,6 +329,18 @@ namespace { if(anotherAny >>= bFillBackground) dumpFillBackgroundAsAttribute(bFillBackground, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapName"); + rtl::OUString sBitmapName; + if(anotherAny >>= sBitmapName) + dumpFillGradientNameAsAttribute(sBitmapName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmap"); + uno::Reference xBitmap(xShape, uno::UNO_QUERY); + if(anotherAny >>= xBitmap) + dumpFillBitmapAsElement(xBitmap, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From d6bd91b3ab97cec37e7aa488b484f69cea216aa4 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:16:35 +0200 Subject: Added dumping [property] FillBitmapURL Change-Id: I58c721b529c996e5461ed4428bd01ecf5ba9e935 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 12b912733bd5..a48303c52efc 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -59,6 +59,7 @@ private: void dumpFillBackgroundAsAttribute(sal_Bool aBackground, xmlTextWriterPtr xmlWriter); void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter); void dumpFillBitmapAsElement(com::sun::star::uno::Reference xBitmap, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 34f059a318c8..523aa45c0f91 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -214,6 +214,12 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapURL"), "%s", + rtl::OUStringToOString(sBitmapURL, RTL_TEXTENCODING_UTF8).getStr()); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -341,6 +347,12 @@ namespace { if(anotherAny >>= xBitmap) dumpFillBitmapAsElement(xBitmap, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapURL"); + rtl::OUString sBitmapURL; + if(anotherAny >>= sBitmapURL) + dumpFillBitmapURLAsAttribute(sBitmapURL, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 3c313ee6e34da1de8bd81052ceff4a496a52c342 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:21:43 +0200 Subject: Added dumping [property] FillBitmapPositionOffsetX Change-Id: I2cff51b29b5b37f4a4cdb17d1f95b9f7f45c60f8 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index a48303c52efc..3bf7fc2b28e1 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -60,6 +60,7 @@ private: void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter); void dumpFillBitmapAsElement(com::sun::star::uno::Reference xBitmap, xmlTextWriterPtr xmlWriter); void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 523aa45c0f91..a21e9f2e3ad1 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -220,6 +220,11 @@ namespace { rtl::OUStringToOString(sBitmapURL, RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetX"), "%" SAL_PRIdINT32, aBitmapPositionOffsetX); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -353,6 +358,12 @@ namespace { if(anotherAny >>= sBitmapURL) dumpFillBitmapURLAsAttribute(sBitmapURL, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetX"); + sal_Int32 aBitmapPositionOffsetX; + if(anotherAny >>= aBitmapPositionOffsetX) + dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 5214c51c6f083756d2f7a4ed231eed48a72ac2f4 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:23:50 +0200 Subject: Added dumping [property] FillBitmapPositionOffsetY Change-Id: I1846a7bed49165e09e21efea6eaaced43dd558a4 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 3bf7fc2b28e1..2092a84609d0 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -61,6 +61,7 @@ private: void dumpFillBitmapAsElement(com::sun::star::uno::Reference xBitmap, xmlTextWriterPtr xmlWriter); void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter); void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index a21e9f2e3ad1..c612679ef890 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -225,6 +225,11 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetX"), "%" SAL_PRIdINT32, aBitmapPositionOffsetX); } + void XShapeDumper::dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetY"), "%" SAL_PRIdINT32, aBitmapPositionOffsetY); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -364,6 +369,12 @@ namespace { if(anotherAny >>= aBitmapPositionOffsetX) dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetY"); + sal_Int32 aBitmapPositionOffsetY; + if(anotherAny >>= aBitmapPositionOffsetY) + dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From b12a9c08eb9c55f367b846e23633c056864806e3 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:26:52 +0200 Subject: Added dumping [property] FillBitmapOffsetX Change-Id: Ic95bd25d5d3e6578a9143b6beee483f17236b22e --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 2092a84609d0..045e8c413cc3 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -62,6 +62,7 @@ private: void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter); void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter); void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index c612679ef890..7447c8d3c16c 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -230,6 +230,11 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetY"), "%" SAL_PRIdINT32, aBitmapPositionOffsetY); } + void XShapeDumper::dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetX"), "%" SAL_PRIdINT32, aBitmapOffsetX); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -375,6 +380,12 @@ namespace { if(anotherAny >>= aBitmapPositionOffsetY) dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetX"); + sal_Int32 aBitmapOffsetX; + if(anotherAny >>= aBitmapOffsetX) + dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 90ec5886b6e384cad23a2d2df498c079be7ec993 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:28:21 +0200 Subject: Added dumping [property] FillBitmapOffsetY Change-Id: I65d5618d9a5c00b1196bd791dc6115c60837d9e6 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 045e8c413cc3..bdf72c72ea91 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -63,6 +63,7 @@ private: void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter); void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter); void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 7447c8d3c16c..0d295b305997 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -235,6 +235,11 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetX"), "%" SAL_PRIdINT32, aBitmapOffsetX); } + void XShapeDumper::dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetY"), "%" SAL_PRIdINT32, aBitmapOffsetY); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -386,6 +391,12 @@ namespace { if(anotherAny >>= aBitmapOffsetX) dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetY"); + sal_Int32 aBitmapOffsetY; + if(anotherAny >>= aBitmapOffsetY) + dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 7e2f93155fe3acadee173029a8029e5e26b6b869 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:46:12 +0200 Subject: Added dumping [property] FillBitmapRectanglePoint Change-Id: Ib181adc12719df35808cb480296d3e3629ca592e --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 42 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index bdf72c72ea91..455d70ce1204 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -34,6 +34,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -64,6 +65,7 @@ private: void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter); void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter); void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 0d295b305997..5bffb6590ce3 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -240,6 +240,42 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetY"), "%" SAL_PRIdINT32, aBitmapOffsetY); } + void XShapeDumper::dumpFillBitmapRectanglePointAsAttribute(drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter) + { + switch(eBitmapRectanglePoint) + { + case drawing::RectanglePoint_LEFT_TOP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_TOP"); + break; + case drawing::RectanglePoint_MIDDLE_TOP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_TOP"); + break; + case drawing::RectanglePoint_RIGHT_TOP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_TOP"); + break; + case drawing::RectanglePoint_LEFT_MIDDLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_MIDDLE"); + break; + case drawing::RectanglePoint_MIDDLE_MIDDLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_MIDDLE"); + break; + case drawing::RectanglePoint_RIGHT_MIDDLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_MIDDLE"); + break; + case drawing::RectanglePoint_LEFT_BOTTOM: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_BOTTOM"); + break; + case drawing::RectanglePoint_MIDDLE_BOTTOM: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_BOTTOM"); + break; + case drawing::RectanglePoint_RIGHT_BOTTOM: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_BOTTOM"); + break; + default: + break; + } + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -397,6 +433,12 @@ namespace { if(anotherAny >>= aBitmapOffsetY) dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapRectanglePoint"); + drawing::RectanglePoint eBitmapRectanglePoint; + if(anotherAny >>= eBitmapRectanglePoint) + dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From b32272d83e00c2d205a2f2af89574befdde92daf Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:52:09 +0200 Subject: Added dumping [property] FillBitmapLogicalSize Change-Id: Ie3e225d87afab4e725e16eb28096df54b421cce5 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 455d70ce1204..050b15d77f5b 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -66,6 +66,7 @@ private: void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter); void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter); void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool aBitmapLogicalSize, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 5bffb6590ce3..f1f709898bbb 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -188,9 +188,9 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpFillBackgroundAsAttribute(sal_Bool aBackground, xmlTextWriterPtr xmlWriter) + void XShapeDumper::dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter) { - if(aBackground) + if(bBackground) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "true"); else xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "false"); @@ -276,6 +276,14 @@ namespace { } } + void XShapeDumper::dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter) + { + if(bBitmapLogicalSize) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "false"); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -439,6 +447,12 @@ namespace { if(anotherAny >>= eBitmapRectanglePoint) dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapLogicalSize"); + sal_Bool bBitmapLogicalSize; + if(anotherAny >>= bBitmapLogicalSize) + dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From a340832b9c278fc1049670986b16b8a676a84b01 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:55:26 +0200 Subject: Added dumping [property] FillBitmapSizeX Change-Id: Ib10e3b80dd67b834d1cf87168524942198b89d53 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 050b15d77f5b..f0b4ecd5e363 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -67,6 +67,7 @@ private: void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter); void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter); void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool aBitmapLogicalSize, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index f1f709898bbb..2dc0826e1f6b 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -284,6 +284,11 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "false"); } + void XShapeDumper::dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeX"), "%" SAL_PRIdINT32, aBitmapSizeX); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -453,6 +458,12 @@ namespace { if(anotherAny >>= bBitmapLogicalSize) dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeX"); + sal_Int32 aBitmapSizeX; + if(anotherAny >>= aBitmapSizeX) + dumpFillBitmapSizeXAsAttribute(aBitmapSizeX, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 370fab8a8f1bc5edc1de4ab3ee15a5dbdfcb4670 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 7 Jun 2012 23:57:17 +0200 Subject: Added dumping [property] FillBitmapSizeY Change-Id: Iea1bc97021d06a87ed90d7205de57b47c561a471 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index f0b4ecd5e363..dc86717367fa 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -68,6 +68,7 @@ private: void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter); void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool aBitmapLogicalSize, xmlTextWriterPtr xmlWriter); void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 2dc0826e1f6b..50aa2243ea1e 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -289,6 +289,11 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeX"), "%" SAL_PRIdINT32, aBitmapSizeX); } + void XShapeDumper::dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeY"), "%" SAL_PRIdINT32, aBitmapSizeY); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -464,6 +469,12 @@ namespace { if(anotherAny >>= aBitmapSizeX) dumpFillBitmapSizeXAsAttribute(aBitmapSizeX, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeY"); + sal_Int32 aBitmapSizeY; + if(anotherAny >>= aBitmapSizeY) + dumpFillBitmapSizeYAsAttribute(aBitmapSizeY, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From b5cf8d2a74da47ec2d67896e026738a0f2502525 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 00:04:55 +0200 Subject: Added dumping [property] FillBitmapMode Change-Id: I936197ff0048a258646b0403d15c9f3c39c3f250 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index dc86717367fa..4253ef98f20d 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -35,6 +35,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -69,6 +70,7 @@ private: void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool aBitmapLogicalSize, xmlTextWriterPtr xmlWriter); void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter); void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapModeAsAttribute(com::sun::star::drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 50aa2243ea1e..850a64747ed3 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -294,6 +294,24 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeY"), "%" SAL_PRIdINT32, aBitmapSizeY); } + void XShapeDumper::dumpFillBitmapModeAsAttribute(drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter) + { + switch(eBitmapMode) + { + case drawing::BitmapMode_REPEAT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "REPEAT"); + break; + case drawing::BitmapMode_STRETCH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "STRETCH"); + break; + case drawing::BitmapMode_NO_REPEAT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "NO_REPEAT"); + break; + default: + break; + } + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -475,6 +493,12 @@ namespace { if(anotherAny >>= aBitmapSizeY) dumpFillBitmapSizeYAsAttribute(aBitmapSizeY, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapMode"); + drawing::BitmapMode eBitmapMode; + if(anotherAny >>= eBitmapMode) + dumpFillBitmapModeAsAttribute(eBitmapMode, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From cafcc684e24a9d00d364c0537967b087deebdb37 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 00:08:34 +0200 Subject: Added dumping [property] FillBitmapStretch Change-Id: Iba0c6247c06690824b46754c9c84226590712336 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 5 +++-- drawinglayer/source/dumper/XShapeDumper.cxx | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 4253ef98f20d..8f2dcd82e8f9 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -58,7 +58,7 @@ private: void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter); void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter); - void dumpFillBackgroundAsAttribute(sal_Bool aBackground, xmlTextWriterPtr xmlWriter); + void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter); void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter); void dumpFillBitmapAsElement(com::sun::star::uno::Reference xBitmap, xmlTextWriterPtr xmlWriter); void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter); @@ -67,10 +67,11 @@ private: void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter); void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter); void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool aBitmapLogicalSize, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter); void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter); void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter); void dumpFillBitmapModeAsAttribute(com::sun::star::drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 850a64747ed3..4f18b166f6a3 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -312,6 +312,14 @@ namespace { } } + void XShapeDumper::dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter) + { + if(bBitmapStretch) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "false"); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -499,6 +507,12 @@ namespace { if(anotherAny >>= eBitmapMode) dumpFillBitmapModeAsAttribute(eBitmapMode, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapStretch"); + sal_Bool bBitmapStretch; + if(anotherAny >>= bBitmapStretch) + dumpFillBitmapStretchAsAttribute(bBitmapStretch, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 66715f1129f50886835fa6e2fe01b0c83f1aae6c Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 00:10:44 +0200 Subject: Added dumping [property] FillBitmapTile Change-Id: I14ccd56b98ca8054062fce43e261f50c2758f3a1 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 8f2dcd82e8f9..94f41e08755e 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -72,6 +72,7 @@ private: void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter); void dumpFillBitmapModeAsAttribute(com::sun::star::drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter); void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 4f18b166f6a3..247d5cce8fec 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -320,6 +320,14 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "false"); } + void XShapeDumper::dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter) + { + if(bBitmapTile) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "false"); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -513,6 +521,12 @@ namespace { if(anotherAny >>= bBitmapStretch) dumpFillBitmapStretchAsAttribute(bBitmapStretch, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapTile"); + sal_Bool bBitmapTile; + if(anotherAny >>= bBitmapTile) + dumpFillBitmapTileAsAttribute(bBitmapTile, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 9baac7f405e1e3ba54cb126c2d392f1d77c77e09 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 13:24:19 +0200 Subject: Start of dumping LineProperties service. Added [property] LineStyle Change-Id: I32ad88f0512388dbe0e4c657d894ea189a53a6f0 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 5 ++++ drawinglayer/source/dumper/XShapeDumper.cxx | 32 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 94f41e08755e..88c42e9382aa 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -36,6 +36,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -48,6 +49,7 @@ public: rtl::OUString dump(com::sun::star::uno::Reference xPageShapes); private: + // FillProperties.idl void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); @@ -74,6 +76,9 @@ private: void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter); void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter); + // LineProperties.idl + void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter); + void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 247d5cce8fec..d79dcfe61327 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -328,6 +328,28 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "false"); } + // ---------------------------------------- + // ---------- LineProperties.idl ---------- + // ---------------------------------------- + + void XShapeDumper::dumpLineStyleAsAttribute(drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter) + { + switch(eLineStyle) + { + case drawing::LineStyle_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "NONE"); + break; + case drawing::LineStyle_SOLID: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "SOLID"); + break; + case drawing::LineStyle_DASH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "DASH"); + break; + default: + break; + } + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -529,6 +551,16 @@ namespace { } } + else if(xServiceInfo->supportsService("com.sun.star.drawing.LineProperties")) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStyle"); + drawing::LineStyle eLineStyle; + if(anotherAny >>= eLineStyle) + dumpLineStyleAsAttribute(eLineStyle, xmlWriter); + } + } + #if DEBUG_DUMPER sal_Int32 nServices = aServiceNames.getLength(); for (sal_Int32 i = 0; i < nServices; ++i) -- cgit From 4eaadab609f0dd54df4945fc646e4a35a358df98 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 13:29:08 +0200 Subject: Added dumping [property] LineDash Change-Id: I9191ea0c30910b244d13a3b14a0822fa615baada --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 +++ drawinglayer/source/dumper/XShapeDumper.cxx | 34 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 88c42e9382aa..92dc06e6a38c 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -36,7 +36,9 @@ #include #include #include + #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -78,6 +80,7 @@ private: // LineProperties.idl void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter); + void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index d79dcfe61327..f551b556ab8a 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -350,6 +350,34 @@ namespace { } } + void XShapeDumper::dumpLineDashAsElement(drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineDash" )); + switch(aLineDash.Style) + { + case drawing::DashStyle_RECT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT"); + break; + case drawing::DashStyle_ROUND: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUND"); + break; + case drawing::DashStyle_RECTRELATIVE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECTRELATIVE"); + break; + case drawing::DashStyle_ROUNDRELATIVE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUNDRELATIVE"); + break; + default: + break; + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dots"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dots); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dotLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DotLen); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashes"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dashes); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DashLen); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Distance); + xmlTextWriterEndElement( xmlWriter ); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -559,6 +587,12 @@ namespace { if(anotherAny >>= eLineStyle) dumpLineStyleAsAttribute(eLineStyle, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineDash"); + drawing::LineDash aLineDash; + if(anotherAny >>= aLineDash) + dumpLineDashAsElement(aLineDash, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From bff23a8723eb9804abcb304a63406e03c5ce2cbc Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 13:39:48 +0200 Subject: Added dumping [property] LineDashName Change-Id: I3c267968379cb2e1626e17093d5513d6e2c23d84 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 92dc06e6a38c..ce44cd4413e9 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -81,6 +81,7 @@ private: // LineProperties.idl void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter); void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter); + void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index f551b556ab8a..b8cfbe66d475 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -378,6 +378,12 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineDashName"), "%s", + rtl::OUStringToOString(sLineDashName, RTL_TEXTENCODING_UTF8).getStr()); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -593,6 +599,12 @@ namespace { if(anotherAny >>= aLineDash) dumpLineDashAsElement(aLineDash, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineDashName"); + rtl::OUString sLineDashName; + if(anotherAny >>= sLineDashName) + dumpLineDashNameAsAttribute(sLineDashName, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 86c7c24ceaf0667576f14ba67cc48bd7b452da13 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 13:47:49 +0200 Subject: Added dumping [property] LineColor Change-Id: I5683c722eba00e98543e765fd97dc9426685f459 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index ce44cd4413e9..44f739e4b387 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -82,6 +82,7 @@ private: void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter); void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter); void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter); + void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index b8cfbe66d475..4fe41334258d 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -384,6 +384,11 @@ namespace { rtl::OUStringToOString(sLineDashName, RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineColor"), "%" SAL_PRIdINT32, aLineColor); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -605,6 +610,12 @@ namespace { if(anotherAny >>= sLineDashName) dumpLineDashNameAsAttribute(sLineDashName, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineColor"); + sal_Int32 aLineColor; + if(anotherAny >>= aLineColor) + dumpLineColorAsAttribute(aLineColor, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 78799102cc61b8973d35874500bbd6c057667aca Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 21:43:43 +0200 Subject: Added dumping [property] LineTransparence Change-Id: I491715b3838f85201cc349134abe9368b890fa83 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 44f739e4b387..73cfb94bef96 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -83,6 +83,7 @@ private: void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter); void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter); void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter); + void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 4fe41334258d..6c84c4df5cb5 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -389,6 +389,11 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineColor"), "%" SAL_PRIdINT32, aLineColor); } + void XShapeDumper::dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32, aLineTransparence); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -616,6 +621,12 @@ namespace { if(anotherAny >>= aLineColor) dumpLineColorAsAttribute(aLineColor, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineTransparence"); + sal_Int32 aLineTransparence; + if(anotherAny >>= aLineTransparence) + dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 6591fede60c209f170da2a1848f74f1261e9a5d8 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 21:45:47 +0200 Subject: Added dumping [property] LineWidth Change-Id: I7d0b027af0b8d2367038747aea3f204252bae22e --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 73cfb94bef96..72a9168988bb 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -84,6 +84,7 @@ private: void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter); void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter); void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter); + void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 6c84c4df5cb5..e254418321b5 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -394,6 +394,11 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32, aLineTransparence); } + void XShapeDumper::dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32, aLineWidth); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -627,6 +632,12 @@ namespace { if(anotherAny >>= aLineTransparence) dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineWidth"); + sal_Int32 aLineWidth; + if(anotherAny >>= aLineWidth) + dumpLineWidthAsAttribute(aLineWidth, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From ecc15838ab9986c538b3c491b6086a48ac3512ae Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 22:26:35 +0200 Subject: Added dumping [property] LineJoint Change-Id: I4d724d5ba9ed0ccd6b0b10d82efef5e6eb6ebd73 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 30 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 72a9168988bb..d912ec1e47c8 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -39,6 +39,7 @@ #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -85,6 +86,7 @@ private: void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter); void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter); void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter); + void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index e254418321b5..3965b1a69730 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -399,6 +399,30 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32, aLineWidth); } + void XShapeDumper::dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter) + { + switch(eLineJoint) + { + case drawing::LineJoint_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "NONE"); + break; + case drawing::LineJoint_MIDDLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MIDDLE"); + break; + case drawing::LineJoint_BEVEL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "BEVEL"); + break; + case drawing::LineJoint_MITER: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MITER"); + break; + case drawing::LineJoint_ROUND: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "ROUND"); + break; + default: + break; + } + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -638,6 +662,12 @@ namespace { if(anotherAny >>= aLineWidth) dumpLineWidthAsAttribute(aLineWidth, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineJoint"); + drawing::LineJoint eLineJoint; + if(anotherAny >>= eLineJoint) + dumpLineJointAsAttribute(eLineJoint, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 82b63ce99628f75d0da0766da82bbda8ff64c7ac Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 8 Jun 2012 22:34:01 +0200 Subject: Added dumping [property] LineStartName Change-Id: I2ad328ab32d88ddb53c69d5caa3ce801b7200002 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index d912ec1e47c8..9b7ba6694fce 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -87,6 +87,7 @@ private: void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter); void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter); void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter); + void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 3965b1a69730..7a58592ff92c 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -423,6 +423,12 @@ namespace { } } + void XShapeDumper::dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s", + rtl::OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr()); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -668,6 +674,12 @@ namespace { if(anotherAny >>= eLineJoint) dumpLineJointAsAttribute(eLineJoint, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartName"); + rtl::OUString sLineStartName; + if(anotherAny >>= sLineStartName) + dumpLineStartNameAsAttribute(sLineStartName, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 0e7cbdf1f3627142c9666308137cc42d1a4245ad Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 02:15:23 +0200 Subject: Added separate method to dump drawing::PolyPolygonBezierCoords properties Change-Id: Ia45d5dbad3fb575d39c4e9ddc6c7f65aa1d74a55 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 + drawinglayer/source/dumper/XShapeDumper.cxx | 180 +++++++++++++++++-------- 2 files changed, 128 insertions(+), 55 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 9b7ba6694fce..3eae1af8c1fe 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -40,6 +40,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -88,6 +89,8 @@ private: void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter); void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter); void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter); + void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 7a58592ff92c..1134eac4986d 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -390,44 +390,107 @@ namespace { } void XShapeDumper::dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32, aLineTransparence); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32, aLineTransparence); + } void XShapeDumper::dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32, aLineWidth); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32, aLineWidth); + } void XShapeDumper::dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter) - { - switch(eLineJoint) - { - case drawing::LineJoint_NONE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "NONE"); - break; - case drawing::LineJoint_MIDDLE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MIDDLE"); - break; - case drawing::LineJoint_BEVEL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "BEVEL"); - break; - case drawing::LineJoint_MITER: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MITER"); - break; - case drawing::LineJoint_ROUND: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "ROUND"); - break; - default: - break; - } - } + { + switch(eLineJoint) + { + case drawing::LineJoint_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "NONE"); + break; + case drawing::LineJoint_MIDDLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MIDDLE"); + break; + case drawing::LineJoint_BEVEL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "BEVEL"); + break; + case drawing::LineJoint_MITER: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MITER"); + break; + case drawing::LineJoint_ROUND: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "ROUND"); + break; + default: + break; + } + } void XShapeDumper::dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s", - rtl::OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr()); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s", + rtl::OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr()); + } + + void XShapeDumper::dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndName"), "%s", + rtl::OUStringToOString(sLineEndName, RTL_TEXTENCODING_UTF8).getStr()); + } + + void XShapeDumper::dumpPolyPolygonBezierCoords(drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter) + { + uno::Sequence > pointSequenceSequence = aPolyPolygonBezierCoords.Coordinates; + sal_Int32 nPointsSequence = pointSequenceSequence.getLength(); + for (sal_Int32 i = 0; i < nPointsSequence; ++i) + { + uno::Sequence< awt::Point > pointSequence = pointSequenceSequence[i]; + sal_Int32 nPoints = pointSequence.getLength(); + + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "pointSequence" )); + + for(sal_Int32 j = 0; j < nPoints; ++j) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "point" )); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, pointSequence[j].X); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, pointSequence[j].Y); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); + } + + uno::Sequence > polygonFlagsSequenceSequence = aPolyPolygonBezierCoords.Flags; + sal_Int32 nFlagsSequence = polygonFlagsSequenceSequence.getLength(); + for (sal_Int32 i = 0; i < nFlagsSequence; ++i) + { + uno::Sequence< drawing::PolygonFlags > polygonFlagsSequence = polygonFlagsSequenceSequence[i]; + sal_Int32 nFlags = polygonFlagsSequence.getLength(); + + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "flagsSequence" )); + + for (sal_Int32 j = 0; j < nFlags; ++j) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "polygonFlags" )); + switch(polygonFlagsSequence[j]) + { + case drawing::PolygonFlags_NORMAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "NORMAL"); + break; + case drawing::PolygonFlags_SMOOTH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SMOOTH"); + break; + case drawing::PolygonFlags_CONTROL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "CONTROL"); + break; + case drawing::PolygonFlags_SYMMETRIC: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SYMMETRIC"); + break; + default: + break; + } + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); + } + + } void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { @@ -657,29 +720,36 @@ namespace { dumpLineColorAsAttribute(aLineColor, xmlWriter); } { - uno::Any anotherAny = xPropSet->getPropertyValue("LineTransparence"); - sal_Int32 aLineTransparence; - if(anotherAny >>= aLineTransparence) - dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineWidth"); - sal_Int32 aLineWidth; - if(anotherAny >>= aLineWidth) - dumpLineWidthAsAttribute(aLineWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineJoint"); - drawing::LineJoint eLineJoint; - if(anotherAny >>= eLineJoint) - dumpLineJointAsAttribute(eLineJoint, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStartName"); - rtl::OUString sLineStartName; - if(anotherAny >>= sLineStartName) - dumpLineStartNameAsAttribute(sLineStartName, xmlWriter); - } + uno::Any anotherAny = xPropSet->getPropertyValue("LineTransparence"); + sal_Int32 aLineTransparence; + if(anotherAny >>= aLineTransparence) + dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineWidth"); + sal_Int32 aLineWidth; + if(anotherAny >>= aLineWidth) + dumpLineWidthAsAttribute(aLineWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineJoint"); + drawing::LineJoint eLineJoint; + if(anotherAny >>= eLineJoint) + dumpLineJointAsAttribute(eLineJoint, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartName"); + rtl::OUString sLineStartName; + if(anotherAny >>= sLineStartName) + dumpLineStartNameAsAttribute(sLineStartName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndName"); + rtl::OUString sLineEndName; + if(anotherAny >>= sLineEndName) + dumpLineEndNameAsAttribute(sLineEndName, xmlWriter); + } + } #if DEBUG_DUMPER -- cgit From 294619d8900a7ee9f693d6fe5f80115d81a5d2af Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 02:18:09 +0200 Subject: Added dumping [property] LineStart Change-Id: I99e792692a2d92e67240925c255d8038345ea6d0 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 3eae1af8c1fe..f233bbac0888 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -91,6 +91,7 @@ private: void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter); void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter); void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); + void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 1134eac4986d..d1bb6a6395d4 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -492,6 +492,13 @@ namespace { } + void XShapeDumper::dumpLineStartAsElement(drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineStart" )); + dumpPolyPolygonBezierCoords(aLineStart, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -749,6 +756,12 @@ namespace { if(anotherAny >>= sLineEndName) dumpLineEndNameAsAttribute(sLineEndName, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStart"); + drawing::PolyPolygonBezierCoords aLineStart; + if(anotherAny >>= aLineStart) + dumpLineStartAsElement(aLineStart, xmlWriter); + } } -- cgit From 0dc25080711112b8f5e7f2bd8ab84af27d16b94b Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 02:20:54 +0200 Subject: Added dumping [property] LineEnd Change-Id: I591107b78463a60f6b0d9cbd842d94ac4a58b74a --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index f233bbac0888..71183ff7faa7 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -92,6 +92,7 @@ private: void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter); void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter); + void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index d1bb6a6395d4..0223dbba6750 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -499,6 +499,13 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpLineEndAsElement(drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineEnd" )); + dumpPolyPolygonBezierCoords(aLineEnd, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -762,6 +769,12 @@ namespace { if(anotherAny >>= aLineStart) dumpLineStartAsElement(aLineStart, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEnd"); + drawing::PolyPolygonBezierCoords aLineEnd; + if(anotherAny >>= aLineEnd) + dumpLineEndAsElement(aLineEnd, xmlWriter); + } } -- cgit From be0d9df02742cc5e43617677025ba8072a9ddc72 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 13:35:01 +0200 Subject: Added dumping [property] LineStartCenter Change-Id: Ie8c14d145911525ccea5b8a74eb75bc38d7e1ab0 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 71183ff7faa7..6d166822a08c 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -93,6 +93,7 @@ private: void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter); void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter); + void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 0223dbba6750..098d7022aa97 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -506,6 +506,14 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter) + { + if(bLineStartCenter) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "false"); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -775,6 +783,12 @@ namespace { if(anotherAny >>= aLineEnd) dumpLineEndAsElement(aLineEnd, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartCenter"); + sal_Bool bLineStartCenter; + if(anotherAny >>= bLineStartCenter) + dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter); + } } -- cgit From 92a2fd34ad1fd75372ff7b820a062126ac4611ba Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 13:36:43 +0200 Subject: Added dumping [property] LineStartWidth Change-Id: Iaaad9056c7cf1fe1ae244fb1839814d7f18d402a --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 6d166822a08c..b923d9a42ef0 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -94,6 +94,7 @@ private: void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter); void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter); void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter); + void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 098d7022aa97..f6bf42bfe316 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -514,6 +514,11 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "false"); } + void XShapeDumper::dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32, aLineStartWidth); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -789,6 +794,12 @@ namespace { if(anotherAny >>= bLineStartCenter) dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartWidth"); + sal_Int32 aLineStartWidth; + if(anotherAny >>= aLineStartWidth) + dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter); + } } -- cgit From d2fafac878d904485fa236fb19136dd157216add Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 13:38:45 +0200 Subject: Added dumping [property] LineEndCenter Change-Id: I7cae9e3a22bf63076a8ceacbc80ab1d26bf177fe --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index b923d9a42ef0..501088289437 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -95,6 +95,7 @@ private: void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter); void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter); void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter); + void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index f6bf42bfe316..7c51fb3f9c06 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -519,6 +519,14 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32, aLineStartWidth); } + void XShapeDumper::dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter) + { + if(bLineEndCenter) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "false"); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -800,6 +808,12 @@ namespace { if(anotherAny >>= aLineStartWidth) dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndCenter"); + sal_Bool bLineEndCenter; + if(anotherAny >>= bLineEndCenter) + dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter); + } } -- cgit From e0bd75264fa76cbe139d16086740a88b5d58803c Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 13:40:29 +0200 Subject: Added dumping [property] LineEndWidth Change-Id: Id5628d90cd3d451b8b7ae7a2a4b56813c8192cdd --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 501088289437..82446671fbdc 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -96,6 +96,7 @@ private: void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter); void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter); void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter); + void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 7c51fb3f9c06..32b2f8d94ca1 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -527,6 +527,11 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "false"); } + void XShapeDumper::dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32, aLineEndWidth); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -814,7 +819,12 @@ namespace { if(anotherAny >>= bLineEndCenter) dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter); } - + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndWidth"); + sal_Int32 aLineEndWidth; + if(anotherAny >>= aLineEndWidth) + dumpLineEndWidthAsAttribute(aLineEndWidth, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From d8f66acd40be2632084ea7cffb8993d354052679 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 14:12:29 +0200 Subject: Start of dumping PolyPolygonDescriptor service. Added [property] PolygonKind Change-Id: Icf814a06c85bff2f8da1fc7b0181d71ac4e4602a --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 5 +++ drawinglayer/source/dumper/XShapeDumper.cxx | 50 ++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 82446671fbdc..4cebbccd9602 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -42,6 +42,8 @@ #include #include +#include + #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -98,6 +100,9 @@ private: void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter); void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter); + // PolyPolygonDescriptor.idl + void dumpPolygonKindAsAttribute(com::sun::star::drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter); + void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 32b2f8d94ca1..594f7ea2473c 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -532,6 +532,46 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32, aLineEndWidth); } + // ----------------------------------------------- + // ---------- PolyPolygonDescriptor.idl ---------- + // ----------------------------------------------- + + void XShapeDumper::dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter) + { + switch(ePolygonKind) + { + case drawing::PolygonKind_LINE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "LINE"); + break; + case drawing::PolygonKind_POLY: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "POLY"); + break; + case drawing::PolygonKind_PLIN: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PLIN"); + break; + case drawing::PolygonKind_PATHLINE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHLINE"); + break; + case drawing::PolygonKind_PATHFILL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHFILL"); + break; + case drawing::PolygonKind_FREELINE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREELINE"); + break; + case drawing::PolygonKind_FREEFILL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREEFILL"); + break; + case drawing::PolygonKind_PATHPOLY: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPOLY"); + break; + case drawing::PolygonKind_PATHPLIN: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPLIN"); + break; + default: + break; + } + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -827,6 +867,16 @@ namespace { } } + else if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonDescriptor")) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); + drawing::PolygonKind ePolygonKind; + if(anotherAny >>= ePolygonKind) + dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); + } + } + #if DEBUG_DUMPER sal_Int32 nServices = aServiceNames.getLength(); for (sal_Int32 i = 0; i < nServices; ++i) -- cgit From c000eeed997cbf37f1a5f92741a891aa8756404c Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 14:32:02 +0200 Subject: Added separate method to dump drawing::PointSequenceSequence properties Change-Id: Ieb630a4ae2d8e1dcf178d20dca443a022255146f --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 7 +++++-- drawinglayer/source/dumper/XShapeDumper.cxx | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 4cebbccd9602..250795dd1700 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -55,12 +55,16 @@ public: rtl::OUString dump(com::sun::star::uno::Reference xPageShapes); private: + // auxiliary functions + void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); + void dumpPointSequenceSequence(com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence, xmlTextWriterPtr xmlWriter); + // FillProperties.idl void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter); - void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); void dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter); void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); @@ -92,7 +96,6 @@ private: void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter); void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter); void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter); - void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter); void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter); void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 594f7ea2473c..78b8da85bdb1 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -572,6 +572,29 @@ namespace { } } + void XShapeDumper::dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence, xmlTextWriterPtr xmlWriter) + { + // LibreOffice proudly presents - The Sequenception + uno::Sequence > pointSequenceSequence = aPointSequenceSequence; + sal_Int32 nPointsSequence = pointSequenceSequence.getLength(); + for (sal_Int32 i = 0; i < nPointsSequence; ++i) + { + uno::Sequence< awt::Point > pointSequence = pointSequenceSequence[i]; + sal_Int32 nPoints = pointSequence.getLength(); + + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "pointSequence" )); + + for(sal_Int32 j = 0; j < nPoints; ++j) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "point" )); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, pointSequence[j].X); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, pointSequence[j].Y); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); + } + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); -- cgit From eb364a23a6579a2b8740071784858a873b4d48db Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 14:39:11 +0200 Subject: Restructurization of a dumpPolyPolygonBezierCoords() method, more elegant now Change-Id: I3cda1a3554837e4e667a42ac292db24d6a8edf37 --- drawinglayer/source/dumper/XShapeDumper.cxx | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 78b8da85bdb1..182cb6298cc4 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -437,25 +437,10 @@ namespace { void XShapeDumper::dumpPolyPolygonBezierCoords(drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter) { - uno::Sequence > pointSequenceSequence = aPolyPolygonBezierCoords.Coordinates; - sal_Int32 nPointsSequence = pointSequenceSequence.getLength(); - for (sal_Int32 i = 0; i < nPointsSequence; ++i) - { - uno::Sequence< awt::Point > pointSequence = pointSequenceSequence[i]; - sal_Int32 nPoints = pointSequence.getLength(); - - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "pointSequence" )); - - for(sal_Int32 j = 0; j < nPoints; ++j) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "point" )); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, pointSequence[j].X); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, pointSequence[j].Y); - xmlTextWriterEndElement( xmlWriter ); - } - xmlTextWriterEndElement( xmlWriter ); - } + // dumps first field - Coordinates + dumpPointSequenceSequence(aPolyPolygonBezierCoords.Coordinates, xmlWriter); + // dumps second field - Flags uno::Sequence > polygonFlagsSequenceSequence = aPolyPolygonBezierCoords.Flags; sal_Int32 nFlagsSequence = polygonFlagsSequenceSequence.getLength(); for (sal_Int32 i = 0; i < nFlagsSequence; ++i) -- cgit From 6c8c00d231bfeb9c42a5cfdea97fcad9fa2b7598 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 14:44:45 +0200 Subject: Added dumping [property] PolyPolygon Change-Id: Id2ccf39cc38200ac693c6949390c248a9df0620b --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 250795dd1700..6d423ad0ad21 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -105,6 +105,7 @@ private: // PolyPolygonDescriptor.idl void dumpPolygonKindAsAttribute(com::sun::star::drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonAsElement(com::sun::star::drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 182cb6298cc4..c3d739f9b2f5 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -580,6 +580,13 @@ namespace { } } + void XShapeDumper::dumpPolyPolygonAsElement(drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygon" )); + dumpPointSequenceSequence(aPolyPolygon, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -883,6 +890,12 @@ namespace { if(anotherAny >>= ePolygonKind) dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygon"); + drawing::PointSequenceSequence aPolyPolygon; + if(anotherAny >>= aPolyPolygon) + dumpPolyPolygonAsElement(aPolyPolygon, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 5286627907d3fbf59b518ee1e9cf9924729b0f2c Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 9 Jun 2012 14:47:01 +0200 Subject: Added dumping [property] Geometry Change-Id: Ib95aaf19f266358bdc21dd76450b3d88483f92eb --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 6d423ad0ad21..88298d8629fd 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -106,6 +106,7 @@ private: // PolyPolygonDescriptor.idl void dumpPolygonKindAsAttribute(com::sun::star::drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter); void dumpPolyPolygonAsElement(com::sun::star::drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter); + void dumpGeometryAsElement(com::sun::star::drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter); void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index c3d739f9b2f5..4682c2e22c58 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -587,6 +587,13 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpGeometryAsElement(drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" )); + dumpPointSequenceSequence(aGeometry, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + } + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -896,6 +903,12 @@ namespace { if(anotherAny >>= aPolyPolygon) dumpPolyPolygonAsElement(aPolyPolygon, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); + drawing::PointSequenceSequence aGeometry; + if(anotherAny >>= aGeometry) + dumpGeometryAsElement(aGeometry, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From cace122087fb700560173dc61d8c36941b5fab3a Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 01:33:17 +0200 Subject: Start of dumping TextProperties service. Added dumping IsNumbering property Change-Id: I4db7d0df6562b2e0bc01f0626191c5ca3d02eecb --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 4 ++++ drawinglayer/source/dumper/XShapeDumper.cxx | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 88298d8629fd..d734d15f486b 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -108,6 +108,10 @@ private: void dumpPolyPolygonAsElement(com::sun::star::drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter); void dumpGeometryAsElement(com::sun::star::drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter); + // TextProperties.idl + void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter); + + // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 4682c2e22c58..7c80fa4564a7 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -594,6 +594,22 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + // ---------------------------------------- + // ---------- TextProperties.idl ---------- + // ---------------------------------------- + + void XShapeDumper::dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter) + { + if(bIsNumbering) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "false"); + } + + // -------------------------------- + // ---------- XShape.idl ---------- + // -------------------------------- + void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); @@ -642,6 +658,15 @@ namespace { if(!aText.isEmpty()) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); } + else if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties")) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering"); + sal_Bool bIsNumbering; + if(anotherAny >>= bIsNumbering) + dumpIsNumberingAsAttribute(bIsNumbering, xmlWriter); + } + } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW); -- cgit From 5022553e09387428e80abbcb0f18ceb376e25f87 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 01:37:25 +0200 Subject: Added dumping TextAutoGrowHeight & TextAutoGrowWidth properties Change-Id: I03c8786d1cfce2f05ead5fabd58f5f24cd567aff --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 28 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index d734d15f486b..c9cfd89ccc16 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -110,6 +110,8 @@ private: // TextProperties.idl void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter); + void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter); + void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 7c80fa4564a7..83d496b75b08 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -606,6 +606,22 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "false"); } + void XShapeDumper::dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter) + { + if(bTextAutoGrowHeight) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "false"); + } + + void XShapeDumper::dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter) + { + if(bTextAutoGrowWidth) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "false"); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -666,6 +682,18 @@ namespace { if(anotherAny >>= bIsNumbering) dumpIsNumberingAsAttribute(bIsNumbering, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowHeight"); + sal_Bool bTextAutoGrowHeight; + if(anotherAny >>= bTextAutoGrowHeight) + dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowWidth"); + sal_Bool bTextAutoGrowWidth; + if(anotherAny >>= bTextAutoGrowWidth) + dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From a3af2e51d968b21ecd8df3bf28aa35984a795303 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 01:50:38 +0200 Subject: Added dumping TextContourFrame & TextFitToSize properties Change-Id: I8ff16b5901cb813318ed96b9377e09325af46532 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 4 +++ drawinglayer/source/dumper/XShapeDumper.cxx | 41 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index c9cfd89ccc16..ed00e9667c4e 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -44,6 +44,8 @@ #include +#include + #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -112,6 +114,8 @@ private: void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter); void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter); void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter); + void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter); + void dumpTextFitToSizeAsAttribute(com::sun::star::drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 83d496b75b08..14c243f06ab2 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -622,6 +622,35 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "false"); } + void XShapeDumper::dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter) + { + if(bTextContourFrame) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "false"); + } + + void XShapeDumper::dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter) + { + switch(eTextFitToSize) + { + case drawing::TextFitToSizeType_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "NONE"); + break; + case drawing::TextFitToSizeType_PROPORTIONAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "PROPORTIONAL"); + break; + case drawing::TextFitToSizeType_ALLLINES: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "ALLLINES"); + break; + case drawing::TextFitToSizeType_AUTOFIT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "AUTOFIT"); + break; + default: + break; + } + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -694,6 +723,18 @@ namespace { if(anotherAny >>= bTextAutoGrowWidth) dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextContourFrame"); + sal_Bool bTextContourFrame; + if(anotherAny >>= bTextContourFrame) + dumpTextContourFrameAsAttribute(bTextContourFrame, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextFitToSize"); + drawing::TextFitToSizeType eTextFitToSize; + if(anotherAny >>= eTextFitToSize) + dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From f55df02baec7d07dfb5af432a903ecea5f857827 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 01:56:59 +0200 Subject: Added dumping TextHorizontalAdjust & TextVerticalAdjust properties Change-Id: I452b79ef13ff481a939463339d8461777a88b820 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 4 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 54 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index ed00e9667c4e..8f968d1e8de1 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -45,6 +45,8 @@ #include #include +#include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -116,6 +118,8 @@ private: void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter); void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter); void dumpTextFitToSizeAsAttribute(com::sun::star::drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter); + void dumpTextHorizontalAdjustAsAttribute(com::sun::star::drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter); + void dumpTextVerticalAdjustAsAttribute(com::sun::star::drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 14c243f06ab2..fc1a57d05298 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -651,6 +651,48 @@ namespace { } } + void XShapeDumper::dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter) + { + switch(eTextHorizontalAdjust) + { + case drawing::TextHorizontalAdjust_LEFT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "LEFT"); + break; + case drawing::TextHorizontalAdjust_CENTER: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "CENTER"); + break; + case drawing::TextHorizontalAdjust_RIGHT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "RIGHT"); + break; + case drawing::TextHorizontalAdjust_BLOCK: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK"); + break; + default: + break; + } + } + + void XShapeDumper::dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter) + { + switch(eTextVerticalAdjust) + { + case drawing::TextVerticalAdjust_TOP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "TOP"); + break; + case drawing::TextVerticalAdjust_CENTER: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "CENTER"); + break; + case drawing::TextVerticalAdjust_BOTTOM: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BOTTOM"); + break; + case drawing::TextVerticalAdjust_BLOCK: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BLOCK"); + break; + default: + break; + } + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -735,6 +777,18 @@ namespace { if(anotherAny >>= eTextFitToSize) dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust"); + drawing::TextHorizontalAdjust eTextHorizontalAdjust; + if(anotherAny >>= eTextHorizontalAdjust) + dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust"); + drawing::TextVerticalAdjust eTextVerticalAdjust; + if(anotherAny >>= eTextVerticalAdjust) + dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From 7caf3b83aaf951ad430dc0a9e27e2daa1acf64b3 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:00:38 +0200 Subject: Added dumping TextLeftDistance & TextRightDistance properties Change-Id: Idec437f399de9f61cac74146de3239e3805dd78c --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 8f968d1e8de1..3494455bbda6 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -120,6 +120,8 @@ private: void dumpTextFitToSizeAsAttribute(com::sun::star::drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter); void dumpTextHorizontalAdjustAsAttribute(com::sun::star::drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter); void dumpTextVerticalAdjustAsAttribute(com::sun::star::drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter); + void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter); + void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index fc1a57d05298..7e15975d88c5 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -693,6 +693,16 @@ namespace { } } + void XShapeDumper::dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32, aTextLeftDistance); + } + + void XShapeDumper::dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32, aTextRightDistance); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -789,6 +799,18 @@ namespace { if(anotherAny >>= eTextVerticalAdjust) dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextLeftDistance"); + sal_Int32 aTextLeftDistance; + if(anotherAny >>= aTextLeftDistance) + dumpTextLeftDistanceAsAttribute(aTextLeftDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextRightDistance"); + sal_Int32 aTextRightDistance; + if(anotherAny >>= aTextRightDistance) + dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From f7731c65e7fa05a4671df1990ed54a35481c5544 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:03:17 +0200 Subject: Added dumping TextUpperDistance & TextLowerDistance properties Change-Id: Icf659538179b56e441f147a2a0a3367d3123dcf3 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 3494455bbda6..21ece8b87f38 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -122,6 +122,8 @@ private: void dumpTextVerticalAdjustAsAttribute(com::sun::star::drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter); void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter); void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter); + void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter); + void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 7e15975d88c5..bad5746019c4 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -703,6 +703,16 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32, aTextRightDistance); } + void XShapeDumper::dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32, aTextUpperDistance); + } + + void XShapeDumper::dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32, aTextLowerDistance); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -811,6 +821,18 @@ namespace { if(anotherAny >>= aTextRightDistance) dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextUpperDistance"); + sal_Int32 aTextUpperDistance; + if(anotherAny >>= aTextUpperDistance) + dumpTextUpperDistanceAsAttribute(aTextUpperDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextLowerDistance"); + sal_Int32 aTextLowerDistance; + if(anotherAny >>= aTextLowerDistance) + dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From 0a8c2bb40120cd4729883986ae6c9b07282d1d30 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:06:03 +0200 Subject: Added dumping TextMaximumFrameHeight & TextMaximumFrameWidth properties Change-Id: I87fe9583e9db988a552bd21efe5c3e1c606871dd --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 21ece8b87f38..796579fcae50 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -124,6 +124,8 @@ private: void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter); void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter); void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter); + void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter); + void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index bad5746019c4..982348121a99 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -713,6 +713,16 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32, aTextLowerDistance); } + void XShapeDumper::dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32, aTextMaximumFrameHeight); + } + + void XShapeDumper::dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32, aTextMaximumFrameWidth); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -833,6 +843,18 @@ namespace { if(anotherAny >>= aTextLowerDistance) dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameHeight"); + sal_Int32 aTextMaximumFrameHeight; + if(anotherAny >>= aTextMaximumFrameHeight) + dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameWidth"); + sal_Int32 aTextMaximumFrameWidth; + if(anotherAny >>= aTextMaximumFrameWidth) + dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From 3f42e3722cf8b7aa87a2ed82742415aa42f5ea6e Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:11:29 +0200 Subject: Added dumping TextMinimumFrameHeight & TextMinimumFrameWidth properties Change-Id: I6b6ab712c1852f3f77620b55dd82077fe0b6d1f7 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 796579fcae50..f3bc0be1be6e 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -126,6 +126,8 @@ private: void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter); void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter); void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter); + void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter); + void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 982348121a99..6484f121e067 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -723,6 +723,16 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32, aTextMaximumFrameWidth); } + void XShapeDumper::dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32, aTextMinimumFrameHeight); + } + + void XShapeDumper::dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32, aTextMinimumFrameWidth); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -855,6 +865,18 @@ namespace { if(anotherAny >>= aTextMaximumFrameWidth) dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameHeight"); + sal_Int32 aTextMinimumFrameHeight; + if(anotherAny >>= aTextMinimumFrameHeight) + dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameWidth"); + sal_Int32 aTextMinimumFrameWidth; + if(anotherAny >>= aTextMinimumFrameWidth) + dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From 7ec009c40fe5cadac2604d7ea1dc1164cf6c1021 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:14:05 +0200 Subject: Added dumping TextAnimationAmount & TextAnimationCount properties Change-Id: I3293b0faf5ddcb9be4d363ac8c34cb70331a0360 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index f3bc0be1be6e..e64a3cffb46f 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -128,6 +128,8 @@ private: void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter); void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter); void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 6484f121e067..92993d088b09 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -733,6 +733,16 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32, aTextMinimumFrameWidth); } + void XShapeDumper::dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32, aTextAnimationAmount); + } + + void XShapeDumper::dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32, aTextAnimationCount); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -877,6 +887,18 @@ namespace { if(anotherAny >>= aTextMinimumFrameWidth) dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationAmount"); + sal_Int32 aTextAnimationAmount; + if(anotherAny >>= aTextAnimationAmount) + dumpTextAnimationAmountAsAttribute(aTextAnimationAmount, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationCount"); + sal_Int32 aTextAnimationCount; + if(anotherAny >>= aTextAnimationCount) + dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From fd09060f57c20e7a0ee3e87ced3c0461d90382e6 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:17:45 +0200 Subject: Added dumping TextAnimationDelay & TextAnimationDirection properties Change-Id: I9ac0fa6c727890bf4274b2341db07f7a8a93f204 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 38 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index e64a3cffb46f..74f14e45e8ae 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -47,6 +47,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -130,6 +131,8 @@ private: void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter); void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter); void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationDirectionAsAttribute(com::sun::star::drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 92993d088b09..f77f0377aa19 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -743,6 +743,32 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32, aTextAnimationCount); } + void XShapeDumper::dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32, aTextAnimationDelay); + } + + void XShapeDumper::dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter) + { + switch(eTextAnimationDirection) + { + case drawing::TextAnimationDirection_LEFT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "LEFT"); + break; + case drawing::TextAnimationDirection_RIGHT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "RIGHT"); + break; + case drawing::TextAnimationDirection_UP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "UP"); + break; + case drawing::TextAnimationDirection_DOWN: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "DOWN"); + break; + default: + break; + } + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -899,6 +925,18 @@ namespace { if(anotherAny >>= aTextAnimationCount) dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDelay"); + sal_Int32 aTextAnimationDelay; + if(anotherAny >>= aTextAnimationDelay) + dumpTextAnimationDelayAsAttribute(aTextAnimationDelay, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDirection"); + drawing::TextAnimationDirection eTextAnimationDirection; + if(anotherAny >>= eTextAnimationDirection) + dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From b100e5a98e17104b957e21fd5183528fff8ad951 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:25:50 +0200 Subject: Added dumping TextAnimationKind & TextAnimationStartInside properties Change-Id: I2ea8b51499fca9107c5e60a33b76e3bfb15833ba --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 44 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 74f14e45e8ae..77d33b15307d 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -48,6 +48,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -133,6 +134,8 @@ private: void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter); void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter); void dumpTextAnimationDirectionAsAttribute(com::sun::star::drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationKindAsAttribute(com::sun::star::drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index f77f0377aa19..71ee2184753c 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -769,6 +769,38 @@ namespace { } } + void XShapeDumper::dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter) + { + switch(eTextAnimationKind) + { + case drawing::TextAnimationKind_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "NONE"); + break; + case drawing::TextAnimationKind_BLINK: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "BLINK"); + break; + case drawing::TextAnimationKind_SCROLL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SCROLL"); + break; + case drawing::TextAnimationKind_ALTERNATE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "ALTERNATE"); + break; + case drawing::TextAnimationKind_SLIDE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SLIDE"); + break; + default: + break; + } + } + + void XShapeDumper::dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter) + { + if(bTextAnimationStartInside) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "false"); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -937,6 +969,18 @@ namespace { if(anotherAny >>= eTextAnimationDirection) dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationKind"); + drawing::TextAnimationKind eTextAnimationKind; + if(anotherAny >>= eTextAnimationKind) + dumpTextAnimationKindAsAttribute(eTextAnimationKind, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStartInside"); + sal_Bool bTextAnimationStartInside; + if(anotherAny >>= bTextAnimationStartInside) + dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From 63c004fc3f0bc53ce888ef012f7993b9203a7503 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:35:24 +0200 Subject: Added dumping TextAnimationStopInside & TextWritingMode properties Change-Id: I6fad605243003826d5df89f9f1d9040cff4ee6b2 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 38 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 77d33b15307d..3d37bd73ea09 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -49,6 +49,7 @@ #include #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -136,6 +137,8 @@ private: void dumpTextAnimationDirectionAsAttribute(com::sun::star::drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter); void dumpTextAnimationKindAsAttribute(com::sun::star::drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter); void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter); + void dumpTextWritingModeAsAttribute(com::sun::star::text::WritingMode eWritingMode, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 71ee2184753c..8f86d5a3193b 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -801,6 +801,32 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "false"); } + void XShapeDumper::dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter) + { + if(bTextAnimationStopInside) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "false"); + } + + void XShapeDumper::dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode, xmlTextWriterPtr xmlWriter) + { + switch(eTextWritingMode) + { + case text::WritingMode_LR_TB: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "LR_TB"); + break; + case text::WritingMode_RL_TB: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "RL_TB"); + break; + case text::WritingMode_TB_RL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "TB_RL"); + break; + default: + break; + } + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -981,6 +1007,18 @@ namespace { if(anotherAny >>= bTextAnimationStartInside) dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStopInside"); + sal_Bool bTextAnimationStopInside; + if(anotherAny >>= bTextAnimationStopInside) + dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextWritingMode"); + text::WritingMode eTextWritingMode; + if(anotherAny >>= eTextWritingMode) + dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter); + } } else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { -- cgit From fd84cc49edaa99777712cdf02dd84221cbfd5526 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:52:04 +0200 Subject: Start of dumping ShadowProperties service. Added dumping Shadow property Change-Id: I78f484881dcd846d23d68f7651ac1069f5477a91 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 +++ drawinglayer/source/dumper/XShapeDumper.cxx | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 3d37bd73ea09..9596eaf766be 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -140,6 +140,9 @@ private: void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter); void dumpTextWritingModeAsAttribute(com::sun::star::text::WritingMode eWritingMode, xmlTextWriterPtr xmlWriter); + // ShadowProperties.idl + void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter); + // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 8f86d5a3193b..0b1888e916dd 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -827,6 +827,18 @@ namespace { } } + // ---------------------------------------- + // ---------- TextProperties.idl ---------- + // ---------------------------------------- + + void XShapeDumper::dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter) + { + if(bShadow) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "false"); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -1289,6 +1301,16 @@ namespace { } } + else if(xServiceInfo->supportsService("com.sun.star.drawing.ShadowProperties")) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("Shadow"); + sal_Bool bShadow; + if(anotherAny >>= bShadow) + dumpShadowAsAttribute(bShadow, xmlWriter); + } + } + #if DEBUG_DUMPER sal_Int32 nServices = aServiceNames.getLength(); for (sal_Int32 i = 0; i < nServices; ++i) -- cgit From a4274ea7ae837ab63b93f3fa04a5b83608234840 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:57:04 +0200 Subject: Added dumping ShadowColor & ShadowTransparence properties Change-Id: I8bffe821d00644f83ab15f4100031bbd4af38e8e --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 28 +++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 9596eaf766be..9c5537cdf428 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -142,6 +142,8 @@ private: // ShadowProperties.idl void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter); + void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter); + void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 0b1888e916dd..a47d9d14a704 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -827,9 +827,9 @@ namespace { } } - // ---------------------------------------- - // ---------- TextProperties.idl ---------- - // ---------------------------------------- + // ------------------------------------------ + // ---------- ShadowProperties.idl ---------- + // ------------------------------------------ void XShapeDumper::dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter) { @@ -839,6 +839,16 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "false"); } + void XShapeDumper::dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowColor"), "%" SAL_PRIdINT32, aShadowColor); + } + + void XShapeDumper::dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32, aShadowTransparence); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -1309,6 +1319,18 @@ namespace { if(anotherAny >>= bShadow) dumpShadowAsAttribute(bShadow, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowColor"); + sal_Int32 aShadowColor; + if(anotherAny >>= aShadowColor) + dumpShadowColorAsAttribute(aShadowColor, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowTransparence"); + sal_Int32 aShadowTransparence; + if(anotherAny >>= aShadowTransparence) + dumpShadowTransparenceAsAttribute(aShadowTransparence, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From c3f4c6c24732d8b788ceb4f385795659e475bea0 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 02:59:23 +0200 Subject: Added dumping ShadowXDistance & ShadowYDistance properties Change-Id: Ic9be7c648c9cc0fb7cc2c7869e7efab9f6d782cd --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 9c5537cdf428..54f0364fb6af 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -144,6 +144,8 @@ private: void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter); void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter); void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter); + void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter); + void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index a47d9d14a704..f6626e19ace3 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -849,6 +849,16 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32, aShadowTransparence); } + void XShapeDumper::dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowXDistance"), "%" SAL_PRIdINT32, aShadowXDistance); + } + + void XShapeDumper::dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32, aShadowYDistance); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -1331,6 +1341,18 @@ namespace { if(anotherAny >>= aShadowTransparence) dumpShadowTransparenceAsAttribute(aShadowTransparence, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowXDistance"); + sal_Int32 aShadowXDistance; + if(anotherAny >>= aShadowXDistance) + dumpShadowXDistanceAsAttribute(aShadowXDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowYDistance"); + sal_Int32 aShadowYDistance; + if(anotherAny >>= aShadowYDistance) + dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From e5dd6396d8dba845f787664926219bd6a106c312 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 22:16:36 +0200 Subject: Start of dumping Shape service. Added ZOrder property Change-Id: I0d9ec609988d1df577fe4e9dd656fc6579dec701 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 +++ drawinglayer/source/dumper/XShapeDumper.cxx | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 54f0364fb6af..d36cf966ae94 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -147,6 +147,9 @@ private: void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter); void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter); + //Shape.idl + void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter); + // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index f6626e19ace3..667fca235f4c 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -859,6 +859,15 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32, aShadowYDistance); } + // ------------------------------- + // ---------- Shape.idl ---------- + // ------------------------------- + + void XShapeDumper::dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("zOrder"), "%" SAL_PRIdINT32, aZOrder); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -1354,6 +1363,15 @@ namespace { dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter); } } + else if(xServiceInfo->supportsService("com.sun.star.drawing.Shape")) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder"); + sal_Int32 aZOrder; + if(anotherAny >>= aZOrder) + dumpZOrderAsAttribute(aZOrder, xmlWriter); + } + } #if DEBUG_DUMPER sal_Int32 nServices = aServiceNames.getLength(); -- cgit From 58ece5025790b6835d2bcb766da499bcc0ee17b3 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 22:21:41 +0200 Subject: Added dumping LayerID & LayerName properties Change-Id: Icadcea9251a2f33a2d37b70b438282238f5b29ee --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index d36cf966ae94..b9461aba8ee8 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -149,6 +149,8 @@ private: //Shape.idl void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter); + void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter); + void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 667fca235f4c..4b6552395b06 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -868,6 +868,17 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("zOrder"), "%" SAL_PRIdINT32, aZOrder); } + void XShapeDumper::dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID); + } + + void XShapeDumper::dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s", + rtl::OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr()); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -1371,6 +1382,18 @@ namespace { if(anotherAny >>= aZOrder) dumpZOrderAsAttribute(aZOrder, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LayerID"); + sal_Int32 aLayerID; + if(anotherAny >>= aLayerID) + dumpLayerIDAsAttribute(aLayerID, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LayerName"); + rtl::OUString sLayerName; + if(anotherAny >>= sLayerName) + dumpLayerNameAsAttribute(sLayerName, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From de167e39f84226f122a9bec3b7a8b82e2f73fa16 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 22:24:59 +0200 Subject: Added dumping Visible & Printable properties Change-Id: If6abb577f9ae752f2467976e388a13964eaa3417 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 28 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index b9461aba8ee8..b8a437d132b8 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -151,6 +151,8 @@ private: void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter); void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter); void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter); + void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter); + void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 4b6552395b06..d1211ba44aa0 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -879,6 +879,22 @@ namespace { rtl::OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter) + { + if(bVisible) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "false"); + } + + void XShapeDumper::dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter) + { + if(bPrintable) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "false"); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -1394,6 +1410,18 @@ namespace { if(anotherAny >>= sLayerName) dumpLayerNameAsAttribute(sLayerName, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Visible"); + sal_Bool bVisible; + if(anotherAny >>= bVisible) + dumpVisibleAsAttribute(bVisible, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Printable"); + sal_Bool bPrintable; + if(anotherAny >>= bPrintable) + dumpPrintableAsAttribute(bPrintable, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From e2b053854b291c9efd6f82408eebea34c172997a Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sun, 10 Jun 2012 22:29:52 +0200 Subject: Added dumping MoveProtect & Name properties Change-Id: I5faf77a955fe9e6134e6e5ae15c2367f1ee81d7b --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 28 +++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index b8a437d132b8..fd0a8ab00b15 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -153,6 +153,8 @@ private: void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter); void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter); void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter); + void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter); + void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index d1211ba44aa0..2e047793c80a 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -876,7 +876,7 @@ namespace { void XShapeDumper::dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s", - rtl::OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr()); + rtl::OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr()); } void XShapeDumper::dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter) @@ -895,6 +895,20 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "false"); } + void XShapeDumper::dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter) + { + if(bMoveProtect) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false"); + } + + void XShapeDumper::dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", + rtl::OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr()); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -1422,6 +1436,18 @@ namespace { if(anotherAny >>= bPrintable) dumpPrintableAsAttribute(bPrintable, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("MoveProtect"); + sal_Bool bMoveProtect; + if(anotherAny >>= bMoveProtect) + dumpMoveProtectAsAttribute(bMoveProtect, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Name"); + rtl::OUString sName; + if(anotherAny >>= sName) + dumpNameAsAttribute(sName, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 360a938abdecb1db7a07e65a0bc8acbc99e6bd33 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Mon, 11 Jun 2012 00:53:24 +0200 Subject: Added dumping SizeProtect property Change-Id: Ie0fc0e92522184caa3380443ea601a77101ac813 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index fd0a8ab00b15..4244cc10b3aa 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -155,6 +155,7 @@ private: void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter); void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter); void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter); + void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 2e047793c80a..2ba635a9f215 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -909,6 +909,14 @@ namespace { rtl::OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter) + { + if(bSizeProtect) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false"); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -1448,6 +1456,12 @@ namespace { if(anotherAny >>= sName) dumpNameAsAttribute(sName, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SizeProtect"); + sal_Bool bSizeProtect; + if(anotherAny >>= bSizeProtect) + dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From b1e0f23fbb950bfe1e7e5cbeea18f0cc68be8f7e Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Mon, 11 Jun 2012 01:03:06 +0200 Subject: Added separate method to dump HomogenMatrixLine3 properties/fields Change-Id: Id0c66cf82ce224364f4e15fe5a21fcf52b8cde3b --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 +++ drawinglayer/source/dumper/XShapeDumper.cxx | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 4244cc10b3aa..5c540ad46150 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -51,6 +51,8 @@ #include #include +#include + #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -156,6 +158,7 @@ private: void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter); void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter); void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter); + void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 2ba635a9f215..4ef45690d5c2 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -917,6 +917,13 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false"); } + void XShapeDumper::dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column1"), "%f", aLine.Column1); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column2"), "%f", aLine.Column2); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", aLine.Column3); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- -- cgit From 922fcb352686f71e01696d28425fdd08504efedd Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Mon, 11 Jun 2012 14:00:26 +0200 Subject: Added dumping Transformation property Change-Id: Id7ded83cee7798a1ddc3fc3ce7344d64b8f0f795 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 31 ++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 5c540ad46150..2e27505f2392 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -52,6 +52,7 @@ #include #include +#include #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -159,6 +160,7 @@ private: void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter); void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter); void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter); + void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 4ef45690d5c2..470d8973c19d 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -917,11 +917,28 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false"); } - void XShapeDumper::dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter) + void XShapeDumper::dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aHomogenMatrixLine3, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column1"), "%f", aLine.Column1); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column2"), "%f", aLine.Column2); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", aLine.Column3); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column1"), "%f", aHomogenMatrixLine3.Column1); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column2"), "%f", aHomogenMatrixLine3.Column2); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", aHomogenMatrixLine3.Column3); + } + + void XShapeDumper::dumpTransformationAsElement(drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Transformation" )); + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line1" )); + dumpHomogenMatrixLine3(aTransformation.Line1, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line2" )); + dumpHomogenMatrixLine3(aTransformation.Line2, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line3" )); + dumpHomogenMatrixLine3(aTransformation.Line3, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); } // -------------------------------- @@ -1469,6 +1486,12 @@ namespace { if(anotherAny >>= bSizeProtect) dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Transformation"); + drawing::HomogenMatrix3 aTransformation; + if(anotherAny >>= aTransformation) + dumpTransformationAsElement(aTransformation, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 5f13c74b808667c32d0c40416acbb3377ff0e3ce Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Mon, 11 Jun 2012 14:03:39 +0200 Subject: Added dumping NavigationOrder & Hyperlink properties Change-Id: I15bd739657f04afd647f22a28a3b04ac066ce114 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 2e27505f2392..347499562b36 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -161,6 +161,8 @@ private: void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter); void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter); void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter); + void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter); + void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 470d8973c19d..4775a2465a1c 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -941,6 +941,17 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder); + } + + void XShapeDumper::dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("hyperlink"), "%s", + rtl::OUStringToOString(sHyperlink, RTL_TEXTENCODING_UTF8).getStr()); + } + // -------------------------------- // ---------- XShape.idl ---------- // -------------------------------- @@ -1492,6 +1503,18 @@ namespace { if(anotherAny >>= aTransformation) dumpTransformationAsElement(aTransformation, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("NavigationOrder"); + sal_Int32 aNavigationOrder; + if(anotherAny >>= aNavigationOrder) + dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Hyperlink"); + rtl::OUString sHyperlink; + if(anotherAny >>= sHyperlink) + dumpHyperlinkAsAttribute(sHyperlink, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 90d4ead80375cc0da112f72c5f7c6d0c0cf09385 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 13 Jun 2012 05:48:54 +0200 Subject: an object may support several services, so dump all supported ones Change-Id: Id5d8a9591fc4448f3ea3390fa728e37b2753aea4 --- drawinglayer/source/dumper/XShapeDumper.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 4775a2465a1c..73b36e3f84f1 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -35,7 +35,7 @@ #include -#define DEBUG_DUMPER 0 +#define DEBUG_DUMPER 1 using namespace com::sun::star; //class XShapeDumper @@ -1004,7 +1004,7 @@ namespace { if(!aText.isEmpty()) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); } - else if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties")) + if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties")) { { uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering"); @@ -1145,12 +1145,12 @@ namespace { dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter); } } - else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) + if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW); dumpXShapes(xShapes, xmlWriter); } - else if(xServiceInfo->supportsService("com.sun.star.drawing.FillProperties")) + if(xServiceInfo->supportsService("com.sun.star.drawing.FillProperties")) { { uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); @@ -1298,7 +1298,7 @@ namespace { } } - else if(xServiceInfo->supportsService("com.sun.star.drawing.LineProperties")) + if(xServiceInfo->supportsService("com.sun.star.drawing.LineProperties")) { { uno::Any anotherAny = xPropSet->getPropertyValue("LineStyle"); @@ -1392,7 +1392,7 @@ namespace { } } - else if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonDescriptor")) + if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonDescriptor")) { { uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); @@ -1414,7 +1414,7 @@ namespace { } } - else if(xServiceInfo->supportsService("com.sun.star.drawing.ShadowProperties")) + if(xServiceInfo->supportsService("com.sun.star.drawing.ShadowProperties")) { { uno::Any anotherAny = xPropSet->getPropertyValue("Shadow"); @@ -1447,7 +1447,8 @@ namespace { dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter); } } - else if(xServiceInfo->supportsService("com.sun.star.drawing.Shape")) + + if(xServiceInfo->supportsService("com.sun.star.drawing.Shape")) { { uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder"); -- cgit From be0559116f94bda6b404d255d004b729c59425d5 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 13 Jun 2012 05:49:32 +0200 Subject: replace tabs with spaces Change-Id: I6fb51e2897c85c50cd55afc2c067c166fddbf06a --- drawinglayer/source/dumper/XShapeDumper.cxx | 1162 +++++++++++++-------------- 1 file changed, 581 insertions(+), 581 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 73b36e3f84f1..20454dc84b62 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -492,70 +492,70 @@ namespace { } void XShapeDumper::dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter) - { - if(bLineStartCenter) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "false"); - } + { + if(bLineStartCenter) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "false"); + } void XShapeDumper::dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32, aLineStartWidth); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32, aLineStartWidth); + } void XShapeDumper::dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter) - { - if(bLineEndCenter) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "false"); - } + { + if(bLineEndCenter) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "false"); + } void XShapeDumper::dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32, aLineEndWidth); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32, aLineEndWidth); + } // ----------------------------------------------- // ---------- PolyPolygonDescriptor.idl ---------- // ----------------------------------------------- void XShapeDumper::dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter) - { - switch(ePolygonKind) - { - case drawing::PolygonKind_LINE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "LINE"); - break; - case drawing::PolygonKind_POLY: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "POLY"); - break; - case drawing::PolygonKind_PLIN: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PLIN"); - break; - case drawing::PolygonKind_PATHLINE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHLINE"); - break; - case drawing::PolygonKind_PATHFILL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHFILL"); - break; - case drawing::PolygonKind_FREELINE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREELINE"); - break; - case drawing::PolygonKind_FREEFILL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREEFILL"); - break; - case drawing::PolygonKind_PATHPOLY: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPOLY"); - break; - case drawing::PolygonKind_PATHPLIN: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPLIN"); - break; - default: - break; - } - } + { + switch(ePolygonKind) + { + case drawing::PolygonKind_LINE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "LINE"); + break; + case drawing::PolygonKind_POLY: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "POLY"); + break; + case drawing::PolygonKind_PLIN: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PLIN"); + break; + case drawing::PolygonKind_PATHLINE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHLINE"); + break; + case drawing::PolygonKind_PATHFILL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHFILL"); + break; + case drawing::PolygonKind_FREELINE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREELINE"); + break; + case drawing::PolygonKind_FREEFILL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREEFILL"); + break; + case drawing::PolygonKind_PATHPOLY: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPOLY"); + break; + case drawing::PolygonKind_PATHPLIN: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPLIN"); + break; + default: + break; + } + } void XShapeDumper::dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence, xmlTextWriterPtr xmlWriter) { @@ -599,323 +599,323 @@ namespace { // ---------------------------------------- void XShapeDumper::dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter) - { - if(bIsNumbering) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "false"); - } + { + if(bIsNumbering) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "false"); + } void XShapeDumper::dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter) - { - if(bTextAutoGrowHeight) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "false"); - } + { + if(bTextAutoGrowHeight) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "false"); + } void XShapeDumper::dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter) - { - if(bTextAutoGrowWidth) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "false"); - } + { + if(bTextAutoGrowWidth) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "false"); + } void XShapeDumper::dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter) - { - if(bTextContourFrame) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "false"); - } + { + if(bTextContourFrame) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "false"); + } void XShapeDumper::dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter) - { - switch(eTextFitToSize) - { - case drawing::TextFitToSizeType_NONE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "NONE"); - break; - case drawing::TextFitToSizeType_PROPORTIONAL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "PROPORTIONAL"); - break; - case drawing::TextFitToSizeType_ALLLINES: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "ALLLINES"); - break; - case drawing::TextFitToSizeType_AUTOFIT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "AUTOFIT"); - break; - default: - break; - } - } + { + switch(eTextFitToSize) + { + case drawing::TextFitToSizeType_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "NONE"); + break; + case drawing::TextFitToSizeType_PROPORTIONAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "PROPORTIONAL"); + break; + case drawing::TextFitToSizeType_ALLLINES: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "ALLLINES"); + break; + case drawing::TextFitToSizeType_AUTOFIT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "AUTOFIT"); + break; + default: + break; + } + } void XShapeDumper::dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter) - { - switch(eTextHorizontalAdjust) - { - case drawing::TextHorizontalAdjust_LEFT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "LEFT"); - break; - case drawing::TextHorizontalAdjust_CENTER: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "CENTER"); - break; - case drawing::TextHorizontalAdjust_RIGHT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "RIGHT"); - break; - case drawing::TextHorizontalAdjust_BLOCK: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK"); - break; - default: - break; - } - } + { + switch(eTextHorizontalAdjust) + { + case drawing::TextHorizontalAdjust_LEFT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "LEFT"); + break; + case drawing::TextHorizontalAdjust_CENTER: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "CENTER"); + break; + case drawing::TextHorizontalAdjust_RIGHT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "RIGHT"); + break; + case drawing::TextHorizontalAdjust_BLOCK: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK"); + break; + default: + break; + } + } void XShapeDumper::dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter) - { - switch(eTextVerticalAdjust) - { - case drawing::TextVerticalAdjust_TOP: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "TOP"); - break; - case drawing::TextVerticalAdjust_CENTER: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "CENTER"); - break; - case drawing::TextVerticalAdjust_BOTTOM: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BOTTOM"); - break; - case drawing::TextVerticalAdjust_BLOCK: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BLOCK"); - break; - default: - break; - } - } + { + switch(eTextVerticalAdjust) + { + case drawing::TextVerticalAdjust_TOP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "TOP"); + break; + case drawing::TextVerticalAdjust_CENTER: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "CENTER"); + break; + case drawing::TextVerticalAdjust_BOTTOM: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BOTTOM"); + break; + case drawing::TextVerticalAdjust_BLOCK: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BLOCK"); + break; + default: + break; + } + } void XShapeDumper::dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32, aTextLeftDistance); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32, aTextLeftDistance); + } void XShapeDumper::dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32, aTextRightDistance); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32, aTextRightDistance); + } void XShapeDumper::dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32, aTextUpperDistance); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32, aTextUpperDistance); + } void XShapeDumper::dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32, aTextLowerDistance); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32, aTextLowerDistance); + } void XShapeDumper::dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32, aTextMaximumFrameHeight); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32, aTextMaximumFrameHeight); + } void XShapeDumper::dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32, aTextMaximumFrameWidth); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32, aTextMaximumFrameWidth); + } void XShapeDumper::dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32, aTextMinimumFrameHeight); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32, aTextMinimumFrameHeight); + } void XShapeDumper::dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32, aTextMinimumFrameWidth); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32, aTextMinimumFrameWidth); + } void XShapeDumper::dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32, aTextAnimationAmount); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32, aTextAnimationAmount); + } void XShapeDumper::dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32, aTextAnimationCount); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32, aTextAnimationCount); + } void XShapeDumper::dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32, aTextAnimationDelay); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32, aTextAnimationDelay); + } void XShapeDumper::dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter) - { - switch(eTextAnimationDirection) - { - case drawing::TextAnimationDirection_LEFT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "LEFT"); - break; - case drawing::TextAnimationDirection_RIGHT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "RIGHT"); - break; - case drawing::TextAnimationDirection_UP: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "UP"); - break; - case drawing::TextAnimationDirection_DOWN: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "DOWN"); - break; - default: - break; - } - } + { + switch(eTextAnimationDirection) + { + case drawing::TextAnimationDirection_LEFT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "LEFT"); + break; + case drawing::TextAnimationDirection_RIGHT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "RIGHT"); + break; + case drawing::TextAnimationDirection_UP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "UP"); + break; + case drawing::TextAnimationDirection_DOWN: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "DOWN"); + break; + default: + break; + } + } void XShapeDumper::dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter) - { - switch(eTextAnimationKind) - { - case drawing::TextAnimationKind_NONE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "NONE"); - break; - case drawing::TextAnimationKind_BLINK: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "BLINK"); - break; - case drawing::TextAnimationKind_SCROLL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SCROLL"); - break; - case drawing::TextAnimationKind_ALTERNATE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "ALTERNATE"); - break; - case drawing::TextAnimationKind_SLIDE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SLIDE"); - break; - default: - break; - } - } + { + switch(eTextAnimationKind) + { + case drawing::TextAnimationKind_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "NONE"); + break; + case drawing::TextAnimationKind_BLINK: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "BLINK"); + break; + case drawing::TextAnimationKind_SCROLL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SCROLL"); + break; + case drawing::TextAnimationKind_ALTERNATE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "ALTERNATE"); + break; + case drawing::TextAnimationKind_SLIDE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SLIDE"); + break; + default: + break; + } + } void XShapeDumper::dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter) - { - if(bTextAnimationStartInside) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "false"); - } + { + if(bTextAnimationStartInside) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "false"); + } void XShapeDumper::dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter) - { - if(bTextAnimationStopInside) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "false"); - } + { + if(bTextAnimationStopInside) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "false"); + } void XShapeDumper::dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode, xmlTextWriterPtr xmlWriter) - { - switch(eTextWritingMode) - { - case text::WritingMode_LR_TB: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "LR_TB"); - break; - case text::WritingMode_RL_TB: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "RL_TB"); - break; - case text::WritingMode_TB_RL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "TB_RL"); - break; - default: - break; - } - } + { + switch(eTextWritingMode) + { + case text::WritingMode_LR_TB: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "LR_TB"); + break; + case text::WritingMode_RL_TB: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "RL_TB"); + break; + case text::WritingMode_TB_RL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "TB_RL"); + break; + default: + break; + } + } // ------------------------------------------ // ---------- ShadowProperties.idl ---------- // ------------------------------------------ void XShapeDumper::dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter) - { - if(bShadow) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "false"); - } + { + if(bShadow) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "false"); + } void XShapeDumper::dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowColor"), "%" SAL_PRIdINT32, aShadowColor); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowColor"), "%" SAL_PRIdINT32, aShadowColor); + } void XShapeDumper::dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32, aShadowTransparence); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32, aShadowTransparence); + } void XShapeDumper::dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowXDistance"), "%" SAL_PRIdINT32, aShadowXDistance); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowXDistance"), "%" SAL_PRIdINT32, aShadowXDistance); + } void XShapeDumper::dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32, aShadowYDistance); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32, aShadowYDistance); + } // ------------------------------- // ---------- Shape.idl ---------- // ------------------------------- void XShapeDumper::dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("zOrder"), "%" SAL_PRIdINT32, aZOrder); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("zOrder"), "%" SAL_PRIdINT32, aZOrder); + } void XShapeDumper::dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID); + } void XShapeDumper::dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s", - rtl::OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr()); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s", + rtl::OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr()); + } void XShapeDumper::dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter) - { - if(bVisible) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "false"); - } + { + if(bVisible) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "false"); + } void XShapeDumper::dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter) - { - if(bPrintable) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "false"); - } + { + if(bPrintable) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "false"); + } void XShapeDumper::dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter) - { - if(bMoveProtect) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false"); - } + { + if(bMoveProtect) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false"); + } void XShapeDumper::dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", - rtl::OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr()); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", + rtl::OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr()); + } void XShapeDumper::dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter) - { - if(bSizeProtect) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false"); - } + { + if(bSizeProtect) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false"); + } void XShapeDumper::dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aHomogenMatrixLine3, xmlTextWriterPtr xmlWriter) { @@ -942,15 +942,15 @@ namespace { } void XShapeDumper::dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder); + } void XShapeDumper::dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("hyperlink"), "%s", - rtl::OUStringToOString(sHyperlink, RTL_TEXTENCODING_UTF8).getStr()); - } + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("hyperlink"), "%s", + rtl::OUStringToOString(sHyperlink, RTL_TEXTENCODING_UTF8).getStr()); + } // -------------------------------- // ---------- XShape.idl ---------- @@ -1007,143 +1007,143 @@ namespace { if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties")) { { - uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering"); - sal_Bool bIsNumbering; - if(anotherAny >>= bIsNumbering) - dumpIsNumberingAsAttribute(bIsNumbering, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowHeight"); - sal_Bool bTextAutoGrowHeight; - if(anotherAny >>= bTextAutoGrowHeight) - dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowWidth"); - sal_Bool bTextAutoGrowWidth; - if(anotherAny >>= bTextAutoGrowWidth) - dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextContourFrame"); - sal_Bool bTextContourFrame; - if(anotherAny >>= bTextContourFrame) - dumpTextContourFrameAsAttribute(bTextContourFrame, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextFitToSize"); - drawing::TextFitToSizeType eTextFitToSize; - if(anotherAny >>= eTextFitToSize) - dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust"); - drawing::TextHorizontalAdjust eTextHorizontalAdjust; - if(anotherAny >>= eTextHorizontalAdjust) - dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust"); - drawing::TextVerticalAdjust eTextVerticalAdjust; - if(anotherAny >>= eTextVerticalAdjust) - dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextLeftDistance"); - sal_Int32 aTextLeftDistance; - if(anotherAny >>= aTextLeftDistance) - dumpTextLeftDistanceAsAttribute(aTextLeftDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextRightDistance"); - sal_Int32 aTextRightDistance; - if(anotherAny >>= aTextRightDistance) - dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextUpperDistance"); - sal_Int32 aTextUpperDistance; - if(anotherAny >>= aTextUpperDistance) - dumpTextUpperDistanceAsAttribute(aTextUpperDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextLowerDistance"); - sal_Int32 aTextLowerDistance; - if(anotherAny >>= aTextLowerDistance) - dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameHeight"); - sal_Int32 aTextMaximumFrameHeight; - if(anotherAny >>= aTextMaximumFrameHeight) - dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameWidth"); - sal_Int32 aTextMaximumFrameWidth; - if(anotherAny >>= aTextMaximumFrameWidth) - dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameHeight"); - sal_Int32 aTextMinimumFrameHeight; - if(anotherAny >>= aTextMinimumFrameHeight) - dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameWidth"); - sal_Int32 aTextMinimumFrameWidth; - if(anotherAny >>= aTextMinimumFrameWidth) - dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationAmount"); - sal_Int32 aTextAnimationAmount; - if(anotherAny >>= aTextAnimationAmount) - dumpTextAnimationAmountAsAttribute(aTextAnimationAmount, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationCount"); - sal_Int32 aTextAnimationCount; - if(anotherAny >>= aTextAnimationCount) - dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDelay"); - sal_Int32 aTextAnimationDelay; - if(anotherAny >>= aTextAnimationDelay) - dumpTextAnimationDelayAsAttribute(aTextAnimationDelay, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDirection"); - drawing::TextAnimationDirection eTextAnimationDirection; - if(anotherAny >>= eTextAnimationDirection) - dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationKind"); - drawing::TextAnimationKind eTextAnimationKind; - if(anotherAny >>= eTextAnimationKind) - dumpTextAnimationKindAsAttribute(eTextAnimationKind, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStartInside"); - sal_Bool bTextAnimationStartInside; - if(anotherAny >>= bTextAnimationStartInside) - dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStopInside"); - sal_Bool bTextAnimationStopInside; - if(anotherAny >>= bTextAnimationStopInside) - dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextWritingMode"); - text::WritingMode eTextWritingMode; - if(anotherAny >>= eTextWritingMode) - dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter); - } + uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering"); + sal_Bool bIsNumbering; + if(anotherAny >>= bIsNumbering) + dumpIsNumberingAsAttribute(bIsNumbering, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowHeight"); + sal_Bool bTextAutoGrowHeight; + if(anotherAny >>= bTextAutoGrowHeight) + dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowWidth"); + sal_Bool bTextAutoGrowWidth; + if(anotherAny >>= bTextAutoGrowWidth) + dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextContourFrame"); + sal_Bool bTextContourFrame; + if(anotherAny >>= bTextContourFrame) + dumpTextContourFrameAsAttribute(bTextContourFrame, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextFitToSize"); + drawing::TextFitToSizeType eTextFitToSize; + if(anotherAny >>= eTextFitToSize) + dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust"); + drawing::TextHorizontalAdjust eTextHorizontalAdjust; + if(anotherAny >>= eTextHorizontalAdjust) + dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust"); + drawing::TextVerticalAdjust eTextVerticalAdjust; + if(anotherAny >>= eTextVerticalAdjust) + dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextLeftDistance"); + sal_Int32 aTextLeftDistance; + if(anotherAny >>= aTextLeftDistance) + dumpTextLeftDistanceAsAttribute(aTextLeftDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextRightDistance"); + sal_Int32 aTextRightDistance; + if(anotherAny >>= aTextRightDistance) + dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextUpperDistance"); + sal_Int32 aTextUpperDistance; + if(anotherAny >>= aTextUpperDistance) + dumpTextUpperDistanceAsAttribute(aTextUpperDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextLowerDistance"); + sal_Int32 aTextLowerDistance; + if(anotherAny >>= aTextLowerDistance) + dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameHeight"); + sal_Int32 aTextMaximumFrameHeight; + if(anotherAny >>= aTextMaximumFrameHeight) + dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameWidth"); + sal_Int32 aTextMaximumFrameWidth; + if(anotherAny >>= aTextMaximumFrameWidth) + dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameHeight"); + sal_Int32 aTextMinimumFrameHeight; + if(anotherAny >>= aTextMinimumFrameHeight) + dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameWidth"); + sal_Int32 aTextMinimumFrameWidth; + if(anotherAny >>= aTextMinimumFrameWidth) + dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationAmount"); + sal_Int32 aTextAnimationAmount; + if(anotherAny >>= aTextAnimationAmount) + dumpTextAnimationAmountAsAttribute(aTextAnimationAmount, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationCount"); + sal_Int32 aTextAnimationCount; + if(anotherAny >>= aTextAnimationCount) + dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDelay"); + sal_Int32 aTextAnimationDelay; + if(anotherAny >>= aTextAnimationDelay) + dumpTextAnimationDelayAsAttribute(aTextAnimationDelay, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDirection"); + drawing::TextAnimationDirection eTextAnimationDirection; + if(anotherAny >>= eTextAnimationDirection) + dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationKind"); + drawing::TextAnimationKind eTextAnimationKind; + if(anotherAny >>= eTextAnimationKind) + dumpTextAnimationKindAsAttribute(eTextAnimationKind, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStartInside"); + sal_Bool bTextAnimationStartInside; + if(anotherAny >>= bTextAnimationStartInside) + dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStopInside"); + sal_Bool bTextAnimationStopInside; + if(anotherAny >>= bTextAnimationStopInside) + dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextWritingMode"); + text::WritingMode eTextWritingMode; + if(anotherAny >>= eTextWritingMode) + dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter); + } } if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { @@ -1355,167 +1355,167 @@ namespace { dumpLineEndNameAsAttribute(sLineEndName, xmlWriter); } { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStart"); - drawing::PolyPolygonBezierCoords aLineStart; - if(anotherAny >>= aLineStart) - dumpLineStartAsElement(aLineStart, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEnd"); - drawing::PolyPolygonBezierCoords aLineEnd; - if(anotherAny >>= aLineEnd) - dumpLineEndAsElement(aLineEnd, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStartCenter"); - sal_Bool bLineStartCenter; - if(anotherAny >>= bLineStartCenter) - dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStartWidth"); - sal_Int32 aLineStartWidth; - if(anotherAny >>= aLineStartWidth) - dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEndCenter"); - sal_Bool bLineEndCenter; - if(anotherAny >>= bLineEndCenter) - dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEndWidth"); - sal_Int32 aLineEndWidth; - if(anotherAny >>= aLineEndWidth) - dumpLineEndWidthAsAttribute(aLineEndWidth, xmlWriter); - } + uno::Any anotherAny = xPropSet->getPropertyValue("LineStart"); + drawing::PolyPolygonBezierCoords aLineStart; + if(anotherAny >>= aLineStart) + dumpLineStartAsElement(aLineStart, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEnd"); + drawing::PolyPolygonBezierCoords aLineEnd; + if(anotherAny >>= aLineEnd) + dumpLineEndAsElement(aLineEnd, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartCenter"); + sal_Bool bLineStartCenter; + if(anotherAny >>= bLineStartCenter) + dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartWidth"); + sal_Int32 aLineStartWidth; + if(anotherAny >>= aLineStartWidth) + dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndCenter"); + sal_Bool bLineEndCenter; + if(anotherAny >>= bLineEndCenter) + dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndWidth"); + sal_Int32 aLineEndWidth; + if(anotherAny >>= aLineEndWidth) + dumpLineEndWidthAsAttribute(aLineEndWidth, xmlWriter); + } } if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonDescriptor")) { { - uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); - drawing::PolygonKind ePolygonKind; - if(anotherAny >>= ePolygonKind) - dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygon"); - drawing::PointSequenceSequence aPolyPolygon; - if(anotherAny >>= aPolyPolygon) - dumpPolyPolygonAsElement(aPolyPolygon, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); - drawing::PointSequenceSequence aGeometry; - if(anotherAny >>= aGeometry) - dumpGeometryAsElement(aGeometry, xmlWriter); - } + uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); + drawing::PolygonKind ePolygonKind; + if(anotherAny >>= ePolygonKind) + dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygon"); + drawing::PointSequenceSequence aPolyPolygon; + if(anotherAny >>= aPolyPolygon) + dumpPolyPolygonAsElement(aPolyPolygon, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); + drawing::PointSequenceSequence aGeometry; + if(anotherAny >>= aGeometry) + dumpGeometryAsElement(aGeometry, xmlWriter); + } } if(xServiceInfo->supportsService("com.sun.star.drawing.ShadowProperties")) { { - uno::Any anotherAny = xPropSet->getPropertyValue("Shadow"); - sal_Bool bShadow; - if(anotherAny >>= bShadow) - dumpShadowAsAttribute(bShadow, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowColor"); - sal_Int32 aShadowColor; - if(anotherAny >>= aShadowColor) - dumpShadowColorAsAttribute(aShadowColor, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowTransparence"); - sal_Int32 aShadowTransparence; - if(anotherAny >>= aShadowTransparence) - dumpShadowTransparenceAsAttribute(aShadowTransparence, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowXDistance"); - sal_Int32 aShadowXDistance; - if(anotherAny >>= aShadowXDistance) - dumpShadowXDistanceAsAttribute(aShadowXDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowYDistance"); - sal_Int32 aShadowYDistance; - if(anotherAny >>= aShadowYDistance) - dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter); - } + uno::Any anotherAny = xPropSet->getPropertyValue("Shadow"); + sal_Bool bShadow; + if(anotherAny >>= bShadow) + dumpShadowAsAttribute(bShadow, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowColor"); + sal_Int32 aShadowColor; + if(anotherAny >>= aShadowColor) + dumpShadowColorAsAttribute(aShadowColor, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowTransparence"); + sal_Int32 aShadowTransparence; + if(anotherAny >>= aShadowTransparence) + dumpShadowTransparenceAsAttribute(aShadowTransparence, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowXDistance"); + sal_Int32 aShadowXDistance; + if(anotherAny >>= aShadowXDistance) + dumpShadowXDistanceAsAttribute(aShadowXDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowYDistance"); + sal_Int32 aShadowYDistance; + if(anotherAny >>= aShadowYDistance) + dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter); + } } if(xServiceInfo->supportsService("com.sun.star.drawing.Shape")) { { - uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder"); - sal_Int32 aZOrder; - if(anotherAny >>= aZOrder) - dumpZOrderAsAttribute(aZOrder, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LayerID"); - sal_Int32 aLayerID; - if(anotherAny >>= aLayerID) - dumpLayerIDAsAttribute(aLayerID, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LayerName"); - rtl::OUString sLayerName; - if(anotherAny >>= sLayerName) - dumpLayerNameAsAttribute(sLayerName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Visible"); - sal_Bool bVisible; - if(anotherAny >>= bVisible) - dumpVisibleAsAttribute(bVisible, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Printable"); - sal_Bool bPrintable; - if(anotherAny >>= bPrintable) - dumpPrintableAsAttribute(bPrintable, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("MoveProtect"); - sal_Bool bMoveProtect; - if(anotherAny >>= bMoveProtect) - dumpMoveProtectAsAttribute(bMoveProtect, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Name"); - rtl::OUString sName; - if(anotherAny >>= sName) - dumpNameAsAttribute(sName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("SizeProtect"); - sal_Bool bSizeProtect; - if(anotherAny >>= bSizeProtect) - dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Transformation"); - drawing::HomogenMatrix3 aTransformation; - if(anotherAny >>= aTransformation) - dumpTransformationAsElement(aTransformation, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("NavigationOrder"); - sal_Int32 aNavigationOrder; - if(anotherAny >>= aNavigationOrder) - dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Hyperlink"); - rtl::OUString sHyperlink; - if(anotherAny >>= sHyperlink) - dumpHyperlinkAsAttribute(sHyperlink, xmlWriter); - } + uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder"); + sal_Int32 aZOrder; + if(anotherAny >>= aZOrder) + dumpZOrderAsAttribute(aZOrder, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LayerID"); + sal_Int32 aLayerID; + if(anotherAny >>= aLayerID) + dumpLayerIDAsAttribute(aLayerID, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LayerName"); + rtl::OUString sLayerName; + if(anotherAny >>= sLayerName) + dumpLayerNameAsAttribute(sLayerName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Visible"); + sal_Bool bVisible; + if(anotherAny >>= bVisible) + dumpVisibleAsAttribute(bVisible, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Printable"); + sal_Bool bPrintable; + if(anotherAny >>= bPrintable) + dumpPrintableAsAttribute(bPrintable, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("MoveProtect"); + sal_Bool bMoveProtect; + if(anotherAny >>= bMoveProtect) + dumpMoveProtectAsAttribute(bMoveProtect, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Name"); + rtl::OUString sName; + if(anotherAny >>= sName) + dumpNameAsAttribute(sName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SizeProtect"); + sal_Bool bSizeProtect; + if(anotherAny >>= bSizeProtect) + dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Transformation"); + drawing::HomogenMatrix3 aTransformation; + if(anotherAny >>= aTransformation) + dumpTransformationAsElement(aTransformation, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("NavigationOrder"); + sal_Int32 aNavigationOrder; + if(anotherAny >>= aNavigationOrder) + dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Hyperlink"); + rtl::OUString sHyperlink; + if(anotherAny >>= sHyperlink) + dumpHyperlinkAsAttribute(sHyperlink, xmlWriter); + } } #if DEBUG_DUMPER -- cgit From 0ce3c289ca3be20fffd55a3829b8c6d60c71ecc1 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 13 Jun 2012 07:03:26 +0200 Subject: only dump existing properties Change-Id: Ia7e3c7766ef8d9d86bd65945a6e6daae05c93b75 --- drawinglayer/source/dumper/XShapeDumper.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 20454dc84b62..daf78c23631a 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -35,7 +35,7 @@ #include -#define DEBUG_DUMPER 1 +#define DEBUG_DUMPER 0 using namespace com::sun::star; //class XShapeDumper @@ -1006,6 +1006,8 @@ namespace { } if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties")) { + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); + if(xInfo->hasPropertyByName("IsNumbering")) { uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering"); sal_Bool bIsNumbering; @@ -1450,6 +1452,7 @@ namespace { if(xServiceInfo->supportsService("com.sun.star.drawing.Shape")) { + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); { uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder"); sal_Int32 aZOrder; @@ -1510,6 +1513,7 @@ namespace { if(anotherAny >>= aNavigationOrder) dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter); } + if(xInfo->hasPropertyByName("Hyperlink")) { uno::Any anotherAny = xPropSet->getPropertyValue("Hyperlink"); rtl::OUString sHyperlink; -- cgit From 3524c1a4dcdb07e8cb808ebb2311df164ab7a04b Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Thu, 14 Jun 2012 03:07:15 +0200 Subject: Refactoring dumping - separate methods for the main services Change-Id: Icbe8ba80e10669ccb5162ba2f2723cfc95393775 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 9 + drawinglayer/source/dumper/XShapeDumper.cxx | 1023 ++++++++++++------------ 2 files changed, 530 insertions(+), 502 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 347499562b36..b4294b0572d4 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -167,9 +168,17 @@ private: // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); + + // the rest void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); void dumpXShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, xmlTextWriterPtr xmlWriter); void dumpXShapes( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); + void dumpTextPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpFillPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpLinePropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpShadowPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); }; #endif diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index daf78c23631a..58633f6f8153 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -974,6 +974,520 @@ namespace { rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + { + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); + if(xInfo->hasPropertyByName("IsNumbering")) + { + uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering"); + sal_Bool bIsNumbering; + if(anotherAny >>= bIsNumbering) + dumpIsNumberingAsAttribute(bIsNumbering, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowHeight"); + sal_Bool bTextAutoGrowHeight; + if(anotherAny >>= bTextAutoGrowHeight) + dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowWidth"); + sal_Bool bTextAutoGrowWidth; + if(anotherAny >>= bTextAutoGrowWidth) + dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextContourFrame"); + sal_Bool bTextContourFrame; + if(anotherAny >>= bTextContourFrame) + dumpTextContourFrameAsAttribute(bTextContourFrame, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextFitToSize"); + drawing::TextFitToSizeType eTextFitToSize; + if(anotherAny >>= eTextFitToSize) + dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust"); + drawing::TextHorizontalAdjust eTextHorizontalAdjust; + if(anotherAny >>= eTextHorizontalAdjust) + dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust"); + drawing::TextVerticalAdjust eTextVerticalAdjust; + if(anotherAny >>= eTextVerticalAdjust) + dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextLeftDistance"); + sal_Int32 aTextLeftDistance; + if(anotherAny >>= aTextLeftDistance) + dumpTextLeftDistanceAsAttribute(aTextLeftDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextRightDistance"); + sal_Int32 aTextRightDistance; + if(anotherAny >>= aTextRightDistance) + dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextUpperDistance"); + sal_Int32 aTextUpperDistance; + if(anotherAny >>= aTextUpperDistance) + dumpTextUpperDistanceAsAttribute(aTextUpperDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextLowerDistance"); + sal_Int32 aTextLowerDistance; + if(anotherAny >>= aTextLowerDistance) + dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameHeight"); + sal_Int32 aTextMaximumFrameHeight; + if(anotherAny >>= aTextMaximumFrameHeight) + dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameWidth"); + sal_Int32 aTextMaximumFrameWidth; + if(anotherAny >>= aTextMaximumFrameWidth) + dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameHeight"); + sal_Int32 aTextMinimumFrameHeight; + if(anotherAny >>= aTextMinimumFrameHeight) + dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameWidth"); + sal_Int32 aTextMinimumFrameWidth; + if(anotherAny >>= aTextMinimumFrameWidth) + dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationAmount"); + sal_Int32 aTextAnimationAmount; + if(anotherAny >>= aTextAnimationAmount) + dumpTextAnimationAmountAsAttribute(aTextAnimationAmount, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationCount"); + sal_Int32 aTextAnimationCount; + if(anotherAny >>= aTextAnimationCount) + dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDelay"); + sal_Int32 aTextAnimationDelay; + if(anotherAny >>= aTextAnimationDelay) + dumpTextAnimationDelayAsAttribute(aTextAnimationDelay, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDirection"); + drawing::TextAnimationDirection eTextAnimationDirection; + if(anotherAny >>= eTextAnimationDirection) + dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationKind"); + drawing::TextAnimationKind eTextAnimationKind; + if(anotherAny >>= eTextAnimationKind) + dumpTextAnimationKindAsAttribute(eTextAnimationKind, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStartInside"); + sal_Bool bTextAnimationStartInside; + if(anotherAny >>= bTextAnimationStartInside) + dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStopInside"); + sal_Bool bTextAnimationStopInside; + if(anotherAny >>= bTextAnimationStopInside) + dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextWritingMode"); + text::WritingMode eTextWritingMode; + if(anotherAny >>= eTextWritingMode) + dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter); + } + } + + void XShapeDumper::dumpFillPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); + drawing::FillStyle eFillStyle; + if(anotherAny >>= eFillStyle) + dumpFillStyleAsAttribute(eFillStyle, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillColor"); + sal_Int32 aColor; + if(anotherAny >>= aColor) + dumpFillColorAsAttribute(aColor, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparence"); + sal_Int32 aTransparence; + if(anotherAny >>= aTransparence) + dumpFillTransparenceAsAttribute(aTransparence, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradientName"); + rtl::OUString sTranspGradName; + if(anotherAny >>= sTranspGradName) + dumpFillTransparenceGradientNameAsAttribute(sTranspGradName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradient"); + awt::Gradient aTranspGrad; + if(anotherAny >>= aTranspGrad) + dumpFillTransparenceGradientAsElement(aTranspGrad, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillGradientName"); + rtl::OUString sGradName; + if(anotherAny >>= sGradName) + dumpFillGradientNameAsAttribute(sGradName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillGradient"); + awt::Gradient aGradient; + if(anotherAny >>= aGradient) + dumpFillGradientAsElement(aGradient, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillHatchName"); + rtl::OUString sHatchName; + if(anotherAny >>= sHatchName) + dumpFillGradientNameAsAttribute(sHatchName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillHatch"); + drawing::Hatch aHatch; + if(anotherAny >>= aHatch) + dumpFillHatchAsElement(aHatch, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBackground"); + sal_Bool bFillBackground; + if(anotherAny >>= bFillBackground) + dumpFillBackgroundAsAttribute(bFillBackground, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapName"); + rtl::OUString sBitmapName; + if(anotherAny >>= sBitmapName) + dumpFillGradientNameAsAttribute(sBitmapName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmap"); + uno::Reference xBitmap; + if(anotherAny >>= xBitmap) + dumpFillBitmapAsElement(xBitmap, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapURL"); + rtl::OUString sBitmapURL; + if(anotherAny >>= sBitmapURL) + dumpFillBitmapURLAsAttribute(sBitmapURL, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetX"); + sal_Int32 aBitmapPositionOffsetX; + if(anotherAny >>= aBitmapPositionOffsetX) + dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetY"); + sal_Int32 aBitmapPositionOffsetY; + if(anotherAny >>= aBitmapPositionOffsetY) + dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetX"); + sal_Int32 aBitmapOffsetX; + if(anotherAny >>= aBitmapOffsetX) + dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetY"); + sal_Int32 aBitmapOffsetY; + if(anotherAny >>= aBitmapOffsetY) + dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapRectanglePoint"); + drawing::RectanglePoint eBitmapRectanglePoint; + if(anotherAny >>= eBitmapRectanglePoint) + dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapLogicalSize"); + sal_Bool bBitmapLogicalSize; + if(anotherAny >>= bBitmapLogicalSize) + dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeX"); + sal_Int32 aBitmapSizeX; + if(anotherAny >>= aBitmapSizeX) + dumpFillBitmapSizeXAsAttribute(aBitmapSizeX, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeY"); + sal_Int32 aBitmapSizeY; + if(anotherAny >>= aBitmapSizeY) + dumpFillBitmapSizeYAsAttribute(aBitmapSizeY, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapMode"); + drawing::BitmapMode eBitmapMode; + if(anotherAny >>= eBitmapMode) + dumpFillBitmapModeAsAttribute(eBitmapMode, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapStretch"); + sal_Bool bBitmapStretch; + if(anotherAny >>= bBitmapStretch) + dumpFillBitmapStretchAsAttribute(bBitmapStretch, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapTile"); + sal_Bool bBitmapTile; + if(anotherAny >>= bBitmapTile) + dumpFillBitmapTileAsAttribute(bBitmapTile, xmlWriter); + } + } + + void XShapeDumper::dumpLinePropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStyle"); + drawing::LineStyle eLineStyle; + if(anotherAny >>= eLineStyle) + dumpLineStyleAsAttribute(eLineStyle, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineDash"); + drawing::LineDash aLineDash; + if(anotherAny >>= aLineDash) + dumpLineDashAsElement(aLineDash, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineDashName"); + rtl::OUString sLineDashName; + if(anotherAny >>= sLineDashName) + dumpLineDashNameAsAttribute(sLineDashName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineColor"); + sal_Int32 aLineColor; + if(anotherAny >>= aLineColor) + dumpLineColorAsAttribute(aLineColor, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineTransparence"); + sal_Int32 aLineTransparence; + if(anotherAny >>= aLineTransparence) + dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineWidth"); + sal_Int32 aLineWidth; + if(anotherAny >>= aLineWidth) + dumpLineWidthAsAttribute(aLineWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineJoint"); + drawing::LineJoint eLineJoint; + if(anotherAny >>= eLineJoint) + dumpLineJointAsAttribute(eLineJoint, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartName"); + rtl::OUString sLineStartName; + if(anotherAny >>= sLineStartName) + dumpLineStartNameAsAttribute(sLineStartName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndName"); + rtl::OUString sLineEndName; + if(anotherAny >>= sLineEndName) + dumpLineEndNameAsAttribute(sLineEndName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStart"); + drawing::PolyPolygonBezierCoords aLineStart; + if(anotherAny >>= aLineStart) + dumpLineStartAsElement(aLineStart, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEnd"); + drawing::PolyPolygonBezierCoords aLineEnd; + if(anotherAny >>= aLineEnd) + dumpLineEndAsElement(aLineEnd, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartCenter"); + sal_Bool bLineStartCenter; + if(anotherAny >>= bLineStartCenter) + dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartWidth"); + sal_Int32 aLineStartWidth; + if(anotherAny >>= aLineStartWidth) + dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndCenter"); + sal_Bool bLineEndCenter; + if(anotherAny >>= bLineEndCenter) + dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndWidth"); + sal_Int32 aLineEndWidth; + if(anotherAny >>= aLineEndWidth) + dumpLineEndWidthAsAttribute(aLineEndWidth, xmlWriter); + } + } + + void XShapeDumper::dumpShadowPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("Shadow"); + sal_Bool bShadow; + if(anotherAny >>= bShadow) + dumpShadowAsAttribute(bShadow, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowColor"); + sal_Int32 aShadowColor; + if(anotherAny >>= aShadowColor) + dumpShadowColorAsAttribute(aShadowColor, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowTransparence"); + sal_Int32 aShadowTransparence; + if(anotherAny >>= aShadowTransparence) + dumpShadowTransparenceAsAttribute(aShadowTransparence, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowXDistance"); + sal_Int32 aShadowXDistance; + if(anotherAny >>= aShadowXDistance) + dumpShadowXDistanceAsAttribute(aShadowXDistance, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowYDistance"); + sal_Int32 aShadowYDistance; + if(anotherAny >>= aShadowYDistance) + dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter); + } + } + + void XShapeDumper::dumpPolyPolygonDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); + drawing::PolygonKind ePolygonKind; + if(anotherAny >>= ePolygonKind) + dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygon"); + drawing::PointSequenceSequence aPolyPolygon; + if(anotherAny >>= aPolyPolygon) + dumpPolyPolygonAsElement(aPolyPolygon, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); + drawing::PointSequenceSequence aGeometry; + if(anotherAny >>= aGeometry) + dumpGeometryAsElement(aGeometry, xmlWriter); + } + } + + void XShapeDumper::dumpShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + { + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); + { + uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder"); + sal_Int32 aZOrder; + if(anotherAny >>= aZOrder) + dumpZOrderAsAttribute(aZOrder, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LayerID"); + sal_Int32 aLayerID; + if(anotherAny >>= aLayerID) + dumpLayerIDAsAttribute(aLayerID, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LayerName"); + rtl::OUString sLayerName; + if(anotherAny >>= sLayerName) + dumpLayerNameAsAttribute(sLayerName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Visible"); + sal_Bool bVisible; + if(anotherAny >>= bVisible) + dumpVisibleAsAttribute(bVisible, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Printable"); + sal_Bool bPrintable; + if(anotherAny >>= bPrintable) + dumpPrintableAsAttribute(bPrintable, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("MoveProtect"); + sal_Bool bMoveProtect; + if(anotherAny >>= bMoveProtect) + dumpMoveProtectAsAttribute(bMoveProtect, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Name"); + rtl::OUString sName; + if(anotherAny >>= sName) + dumpNameAsAttribute(sName, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SizeProtect"); + sal_Bool bSizeProtect; + if(anotherAny >>= bSizeProtect) + dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Transformation"); + drawing::HomogenMatrix3 aTransformation; + if(anotherAny >>= aTransformation) + dumpTransformationAsElement(aTransformation, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("NavigationOrder"); + sal_Int32 aNavigationOrder; + if(anotherAny >>= aNavigationOrder) + dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter); + } + if(xInfo->hasPropertyByName("Hyperlink")) + { + uno::Any anotherAny = xPropSet->getPropertyValue("Hyperlink"); + rtl::OUString sHyperlink; + if(anotherAny >>= sHyperlink) + dumpHyperlinkAsAttribute(sHyperlink, xmlWriter); + } + } + void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); @@ -1005,522 +1519,27 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); } if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties")) - { - uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); - if(xInfo->hasPropertyByName("IsNumbering")) - { - uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering"); - sal_Bool bIsNumbering; - if(anotherAny >>= bIsNumbering) - dumpIsNumberingAsAttribute(bIsNumbering, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowHeight"); - sal_Bool bTextAutoGrowHeight; - if(anotherAny >>= bTextAutoGrowHeight) - dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowWidth"); - sal_Bool bTextAutoGrowWidth; - if(anotherAny >>= bTextAutoGrowWidth) - dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextContourFrame"); - sal_Bool bTextContourFrame; - if(anotherAny >>= bTextContourFrame) - dumpTextContourFrameAsAttribute(bTextContourFrame, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextFitToSize"); - drawing::TextFitToSizeType eTextFitToSize; - if(anotherAny >>= eTextFitToSize) - dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust"); - drawing::TextHorizontalAdjust eTextHorizontalAdjust; - if(anotherAny >>= eTextHorizontalAdjust) - dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust"); - drawing::TextVerticalAdjust eTextVerticalAdjust; - if(anotherAny >>= eTextVerticalAdjust) - dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextLeftDistance"); - sal_Int32 aTextLeftDistance; - if(anotherAny >>= aTextLeftDistance) - dumpTextLeftDistanceAsAttribute(aTextLeftDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextRightDistance"); - sal_Int32 aTextRightDistance; - if(anotherAny >>= aTextRightDistance) - dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextUpperDistance"); - sal_Int32 aTextUpperDistance; - if(anotherAny >>= aTextUpperDistance) - dumpTextUpperDistanceAsAttribute(aTextUpperDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextLowerDistance"); - sal_Int32 aTextLowerDistance; - if(anotherAny >>= aTextLowerDistance) - dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameHeight"); - sal_Int32 aTextMaximumFrameHeight; - if(anotherAny >>= aTextMaximumFrameHeight) - dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameWidth"); - sal_Int32 aTextMaximumFrameWidth; - if(anotherAny >>= aTextMaximumFrameWidth) - dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameHeight"); - sal_Int32 aTextMinimumFrameHeight; - if(anotherAny >>= aTextMinimumFrameHeight) - dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameWidth"); - sal_Int32 aTextMinimumFrameWidth; - if(anotherAny >>= aTextMinimumFrameWidth) - dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationAmount"); - sal_Int32 aTextAnimationAmount; - if(anotherAny >>= aTextAnimationAmount) - dumpTextAnimationAmountAsAttribute(aTextAnimationAmount, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationCount"); - sal_Int32 aTextAnimationCount; - if(anotherAny >>= aTextAnimationCount) - dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDelay"); - sal_Int32 aTextAnimationDelay; - if(anotherAny >>= aTextAnimationDelay) - dumpTextAnimationDelayAsAttribute(aTextAnimationDelay, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDirection"); - drawing::TextAnimationDirection eTextAnimationDirection; - if(anotherAny >>= eTextAnimationDirection) - dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationKind"); - drawing::TextAnimationKind eTextAnimationKind; - if(anotherAny >>= eTextAnimationKind) - dumpTextAnimationKindAsAttribute(eTextAnimationKind, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStartInside"); - sal_Bool bTextAnimationStartInside; - if(anotherAny >>= bTextAnimationStartInside) - dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStopInside"); - sal_Bool bTextAnimationStopInside; - if(anotherAny >>= bTextAnimationStopInside) - dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextWritingMode"); - text::WritingMode eTextWritingMode; - if(anotherAny >>= eTextWritingMode) - dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter); - } - } + dumpTextPropertiesService(xPropSet, xmlWriter); + if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW); dumpXShapes(xShapes, xmlWriter); } if(xServiceInfo->supportsService("com.sun.star.drawing.FillProperties")) - { - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); - drawing::FillStyle eFillStyle; - if(anotherAny >>= eFillStyle) - dumpFillStyleAsAttribute(eFillStyle, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillColor"); - sal_Int32 aColor; - if(anotherAny >>= aColor) - dumpFillColorAsAttribute(aColor, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparence"); - sal_Int32 aTransparence; - if(anotherAny >>= aTransparence) - dumpFillTransparenceAsAttribute(aTransparence, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradientName"); - rtl::OUString sTranspGradName; - if(anotherAny >>= sTranspGradName) - dumpFillTransparenceGradientNameAsAttribute(sTranspGradName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradient"); - awt::Gradient aTranspGrad; - if(anotherAny >>= aTranspGrad) - dumpFillTransparenceGradientAsElement(aTranspGrad, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillGradientName"); - rtl::OUString sGradName; - if(anotherAny >>= sGradName) - dumpFillGradientNameAsAttribute(sGradName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillGradient"); - awt::Gradient aGradient; - if(anotherAny >>= aGradient) - dumpFillGradientAsElement(aGradient, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillHatchName"); - rtl::OUString sHatchName; - if(anotherAny >>= sHatchName) - dumpFillGradientNameAsAttribute(sHatchName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillHatch"); - drawing::Hatch aHatch; - if(anotherAny >>= aHatch) - dumpFillHatchAsElement(aHatch, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBackground"); - sal_Bool bFillBackground; - if(anotherAny >>= bFillBackground) - dumpFillBackgroundAsAttribute(bFillBackground, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapName"); - rtl::OUString sBitmapName; - if(anotherAny >>= sBitmapName) - dumpFillGradientNameAsAttribute(sBitmapName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmap"); - uno::Reference xBitmap(xShape, uno::UNO_QUERY); - if(anotherAny >>= xBitmap) - dumpFillBitmapAsElement(xBitmap, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapURL"); - rtl::OUString sBitmapURL; - if(anotherAny >>= sBitmapURL) - dumpFillBitmapURLAsAttribute(sBitmapURL, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetX"); - sal_Int32 aBitmapPositionOffsetX; - if(anotherAny >>= aBitmapPositionOffsetX) - dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetY"); - sal_Int32 aBitmapPositionOffsetY; - if(anotherAny >>= aBitmapPositionOffsetY) - dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetX"); - sal_Int32 aBitmapOffsetX; - if(anotherAny >>= aBitmapOffsetX) - dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetY"); - sal_Int32 aBitmapOffsetY; - if(anotherAny >>= aBitmapOffsetY) - dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapRectanglePoint"); - drawing::RectanglePoint eBitmapRectanglePoint; - if(anotherAny >>= eBitmapRectanglePoint) - dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapLogicalSize"); - sal_Bool bBitmapLogicalSize; - if(anotherAny >>= bBitmapLogicalSize) - dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeX"); - sal_Int32 aBitmapSizeX; - if(anotherAny >>= aBitmapSizeX) - dumpFillBitmapSizeXAsAttribute(aBitmapSizeX, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeY"); - sal_Int32 aBitmapSizeY; - if(anotherAny >>= aBitmapSizeY) - dumpFillBitmapSizeYAsAttribute(aBitmapSizeY, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapMode"); - drawing::BitmapMode eBitmapMode; - if(anotherAny >>= eBitmapMode) - dumpFillBitmapModeAsAttribute(eBitmapMode, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapStretch"); - sal_Bool bBitmapStretch; - if(anotherAny >>= bBitmapStretch) - dumpFillBitmapStretchAsAttribute(bBitmapStretch, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapTile"); - sal_Bool bBitmapTile; - if(anotherAny >>= bBitmapTile) - dumpFillBitmapTileAsAttribute(bBitmapTile, xmlWriter); - } - } + dumpFillPropertiesService(xPropSet, xmlWriter); if(xServiceInfo->supportsService("com.sun.star.drawing.LineProperties")) - { - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStyle"); - drawing::LineStyle eLineStyle; - if(anotherAny >>= eLineStyle) - dumpLineStyleAsAttribute(eLineStyle, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineDash"); - drawing::LineDash aLineDash; - if(anotherAny >>= aLineDash) - dumpLineDashAsElement(aLineDash, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineDashName"); - rtl::OUString sLineDashName; - if(anotherAny >>= sLineDashName) - dumpLineDashNameAsAttribute(sLineDashName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineColor"); - sal_Int32 aLineColor; - if(anotherAny >>= aLineColor) - dumpLineColorAsAttribute(aLineColor, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineTransparence"); - sal_Int32 aLineTransparence; - if(anotherAny >>= aLineTransparence) - dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineWidth"); - sal_Int32 aLineWidth; - if(anotherAny >>= aLineWidth) - dumpLineWidthAsAttribute(aLineWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineJoint"); - drawing::LineJoint eLineJoint; - if(anotherAny >>= eLineJoint) - dumpLineJointAsAttribute(eLineJoint, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStartName"); - rtl::OUString sLineStartName; - if(anotherAny >>= sLineStartName) - dumpLineStartNameAsAttribute(sLineStartName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEndName"); - rtl::OUString sLineEndName; - if(anotherAny >>= sLineEndName) - dumpLineEndNameAsAttribute(sLineEndName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStart"); - drawing::PolyPolygonBezierCoords aLineStart; - if(anotherAny >>= aLineStart) - dumpLineStartAsElement(aLineStart, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEnd"); - drawing::PolyPolygonBezierCoords aLineEnd; - if(anotherAny >>= aLineEnd) - dumpLineEndAsElement(aLineEnd, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStartCenter"); - sal_Bool bLineStartCenter; - if(anotherAny >>= bLineStartCenter) - dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStartWidth"); - sal_Int32 aLineStartWidth; - if(anotherAny >>= aLineStartWidth) - dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEndCenter"); - sal_Bool bLineEndCenter; - if(anotherAny >>= bLineEndCenter) - dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEndWidth"); - sal_Int32 aLineEndWidth; - if(anotherAny >>= aLineEndWidth) - dumpLineEndWidthAsAttribute(aLineEndWidth, xmlWriter); - } - } + dumpLinePropertiesService(xPropSet, xmlWriter); if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonDescriptor")) - { - { - uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); - drawing::PolygonKind ePolygonKind; - if(anotherAny >>= ePolygonKind) - dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygon"); - drawing::PointSequenceSequence aPolyPolygon; - if(anotherAny >>= aPolyPolygon) - dumpPolyPolygonAsElement(aPolyPolygon, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); - drawing::PointSequenceSequence aGeometry; - if(anotherAny >>= aGeometry) - dumpGeometryAsElement(aGeometry, xmlWriter); - } - } + dumpPolyPolygonDescriptorService(xPropSet, xmlWriter); if(xServiceInfo->supportsService("com.sun.star.drawing.ShadowProperties")) - { - { - uno::Any anotherAny = xPropSet->getPropertyValue("Shadow"); - sal_Bool bShadow; - if(anotherAny >>= bShadow) - dumpShadowAsAttribute(bShadow, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowColor"); - sal_Int32 aShadowColor; - if(anotherAny >>= aShadowColor) - dumpShadowColorAsAttribute(aShadowColor, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowTransparence"); - sal_Int32 aShadowTransparence; - if(anotherAny >>= aShadowTransparence) - dumpShadowTransparenceAsAttribute(aShadowTransparence, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowXDistance"); - sal_Int32 aShadowXDistance; - if(anotherAny >>= aShadowXDistance) - dumpShadowXDistanceAsAttribute(aShadowXDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowYDistance"); - sal_Int32 aShadowYDistance; - if(anotherAny >>= aShadowYDistance) - dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter); - } - } + dumpShadowPropertiesService(xPropSet, xmlWriter); if(xServiceInfo->supportsService("com.sun.star.drawing.Shape")) - { - uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); - { - uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder"); - sal_Int32 aZOrder; - if(anotherAny >>= aZOrder) - dumpZOrderAsAttribute(aZOrder, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LayerID"); - sal_Int32 aLayerID; - if(anotherAny >>= aLayerID) - dumpLayerIDAsAttribute(aLayerID, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LayerName"); - rtl::OUString sLayerName; - if(anotherAny >>= sLayerName) - dumpLayerNameAsAttribute(sLayerName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Visible"); - sal_Bool bVisible; - if(anotherAny >>= bVisible) - dumpVisibleAsAttribute(bVisible, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Printable"); - sal_Bool bPrintable; - if(anotherAny >>= bPrintable) - dumpPrintableAsAttribute(bPrintable, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("MoveProtect"); - sal_Bool bMoveProtect; - if(anotherAny >>= bMoveProtect) - dumpMoveProtectAsAttribute(bMoveProtect, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Name"); - rtl::OUString sName; - if(anotherAny >>= sName) - dumpNameAsAttribute(sName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("SizeProtect"); - sal_Bool bSizeProtect; - if(anotherAny >>= bSizeProtect) - dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Transformation"); - drawing::HomogenMatrix3 aTransformation; - if(anotherAny >>= aTransformation) - dumpTransformationAsElement(aTransformation, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("NavigationOrder"); - sal_Int32 aNavigationOrder; - if(anotherAny >>= aNavigationOrder) - dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter); - } - if(xInfo->hasPropertyByName("Hyperlink")) - { - uno::Any anotherAny = xPropSet->getPropertyValue("Hyperlink"); - rtl::OUString sHyperlink; - if(anotherAny >>= sHyperlink) - dumpHyperlinkAsAttribute(sHyperlink, xmlWriter); - } - } + dumpShapeService(xPropSet, xmlWriter); #if DEBUG_DUMPER sal_Int32 nServices = aServiceNames.getLength(); -- cgit From 3639f80edcb6ca6b53afadcdf6d7d72fce441a22 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 15 Jun 2012 22:59:09 +0200 Subject: Started dumping PolyPolygonBezierDescriptor service.Added PolygonKind property Change-Id: I17461a86120f0d05137c8b8410c47f9fc3097e8f --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 +++ drawinglayer/source/dumper/XShapeDumper.cxx | 13 +++++++++++++ 2 files changed, 16 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index b4294b0572d4..8ce450e06271 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -165,6 +165,9 @@ private: void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter); void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter); + // PolyPolygonBezierDescriptor.idl + void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 58633f6f8153..c0cc783bba96 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1488,6 +1488,16 @@ namespace { } } + void XShapeDumper::dumpPolyPolygonBezierDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); + drawing::PolygonKind ePolygonKind; + if(anotherAny >>= ePolygonKind) + dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); + } + } + void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); @@ -1541,6 +1551,9 @@ namespace { if(xServiceInfo->supportsService("com.sun.star.drawing.Shape")) dumpShapeService(xPropSet, xmlWriter); + if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonBezierDescriptor")) + dumpPolyPolygonBezierDescriptorService(xPropSet, xmlWriter); + #if DEBUG_DUMPER sal_Int32 nServices = aServiceNames.getLength(); for (sal_Int32 i = 0; i < nServices; ++i) -- cgit From 6556f5b2f0c0e083b339c9d5dc672a8bfd3553b3 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 15 Jun 2012 23:24:53 +0200 Subject: Added PolyPolygonBezier & Geometry properties Change-Id: I8c7bad77c5904cc63ab1ff2e2cc1adeb7afbdc62 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 4 +++- drawinglayer/source/dumper/XShapeDumper.cxx | 32 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 8ce450e06271..ccf613f30bbd 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -166,7 +166,8 @@ private: void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter); // PolyPolygonBezierDescriptor.idl - void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonBezierAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter); + void dumpGeometryAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); @@ -182,6 +183,7 @@ private: void dumpShadowPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); void dumpPolyPolygonDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); void dumpShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); }; #endif diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index c0cc783bba96..e7e6f0086aca 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -974,6 +974,26 @@ namespace { rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); } + // ----------------------------------------------------- + // ---------- PolyPolygonBezierDescriptor.idl ---------- + // ----------------------------------------------------- + + void XShapeDumper::dumpPolyPolygonBezierAsElement(drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygonBezier" )); + dumpPolyPolygonBezierCoords(aPolyPolygonBezier, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + } + + void XShapeDumper::dumpGeometryAsElement(drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" )); + dumpPolyPolygonBezierCoords(aGeometry, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + } + + // dumping services + void XShapeDumper::dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); @@ -1496,6 +1516,18 @@ namespace { if(anotherAny >>= ePolygonKind) dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygonBezier"); + drawing::PolyPolygonBezierCoords aPolyPolygonBezier; + if(anotherAny >>= aPolyPolygonBezier) + dumpPolyPolygonBezierCoords(aPolyPolygonBezier, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); + drawing::PolyPolygonBezierCoords aGeometry; + if(anotherAny >>= aGeometry) + dumpPolyPolygonBezierCoords(aGeometry, xmlWriter); + } } void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) -- cgit From 3d766ba84cad3227d0ce62eaf44e8328479907e9 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 15 Jun 2012 23:48:58 +0200 Subject: Started dumping CustomShape service. Added CustomShapeEngine property Change-Id: If1d11d5dfcf101a3599bc828f6ac515624b087a1 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 4 ++++ drawinglayer/source/dumper/XShapeDumper.cxx | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index ccf613f30bbd..9caec462c738 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -169,6 +169,9 @@ private: void dumpPolyPolygonBezierAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter); void dumpGeometryAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter); + // CustomShape.idl + void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter); + // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); @@ -184,6 +187,7 @@ private: void dumpPolyPolygonDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); void dumpShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpCustomShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); }; #endif diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index e7e6f0086aca..63b8a793fdef 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -992,7 +992,17 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - // dumping services + // ------------------------------------- + // ---------- CustomShape.idl ---------- + // ------------------------------------- + + void XShapeDumper::dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeEngine"), "%s", + rtl::OUStringToOString(sCustomShapeEngine, RTL_TEXTENCODING_UTF8).getStr()); + } + + // methods dumping whole services void XShapeDumper::dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { @@ -1530,6 +1540,16 @@ namespace { } } + void XShapeDumper::dumpCustomShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + { + { + uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeEngine"); + rtl::OUString sCustomShapeEngine; + if(anotherAny >>= sCustomShapeEngine) + dumpCustomShapeEngineAsAttribute(sCustomShapeEngine, xmlWriter); + } + } + void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); -- cgit From 89683e605855995450320c9751b4a6832a1baa58 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 16 Jun 2012 01:52:24 +0200 Subject: Added CustomShapeData property Change-Id: I9b41a8b427098126224bff268bf0b9be9ec3e2ef --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 9caec462c738..135b15701e47 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -171,6 +171,7 @@ private: // CustomShape.idl void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter); + void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 63b8a793fdef..9eb524b9fa16 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1002,6 +1002,12 @@ namespace { rtl::OUStringToOString(sCustomShapeEngine, RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeData"), "%s", + rtl::OUStringToOString(sCustomShapeData, RTL_TEXTENCODING_UTF8).getStr()); + } + // methods dumping whole services void XShapeDumper::dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) @@ -1548,6 +1554,12 @@ namespace { if(anotherAny >>= sCustomShapeEngine) dumpCustomShapeEngineAsAttribute(sCustomShapeEngine, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeData"); + rtl::OUString sCustomShapeData; + if(anotherAny >>= sCustomShapeData) + dumpCustomShapeDataAsAttribute(sCustomShapeData, xmlWriter); + } } void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) -- cgit From 111cc7b912e48da5f0f94151388233f4e7383105 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 16 Jun 2012 02:40:37 +0200 Subject: Added CustomShapeGeometry property Change-Id: I2a4a22cef0c31a8535d33f920a74f61d712e9080 --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/XShapeDumper.cxx | 47 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 135b15701e47..6cce5d278462 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -55,6 +55,8 @@ #include #include +#include + #ifndef ChartViewDumper_hxx #define ChartViewDumper_hxx @@ -172,6 +174,7 @@ private: // CustomShape.idl void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter); void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter); + void dumpCustomShapeGeometryAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 9eb524b9fa16..5f76e1c42d82 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1008,6 +1008,44 @@ namespace { rtl::OUStringToOString(sCustomShapeData, RTL_TEXTENCODING_UTF8).getStr()); } + void XShapeDumper::dumpCustomShapeGeometryAsElement(uno::Sequence< beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "CustomShapeGeometry" )); + sal_Int32 nLength = aCustomShapeGeometry.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" )); + + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", + rtl::OUStringToOString(aCustomShapeGeometry[i].Name, RTL_TEXTENCODING_UTF8).getStr()); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("handle"), "%" SAL_PRIdINT32, aCustomShapeGeometry[i].Handle); + + uno::Any aAny = aCustomShapeGeometry[i].Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(aCustomShapeGeometry[i].Name, RTL_TEXTENCODING_UTF8).getStr()); + } + switch(aCustomShapeGeometry[i].State) + { + case beans::PropertyState_DIRECT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE"); + break; + case beans::PropertyState_DEFAULT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE"); + break; + case beans::PropertyState_AMBIGUOUS_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE"); + break; + default: + break; + } + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); + } + // methods dumping whole services void XShapeDumper::dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) @@ -1560,6 +1598,12 @@ namespace { if(anotherAny >>= sCustomShapeData) dumpCustomShapeDataAsAttribute(sCustomShapeData, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeGeometry"); + uno::Sequence< beans::PropertyValue> aCustomShapeGeometry; + if(anotherAny >>= aCustomShapeGeometry) + dumpCustomShapeGeometryAsElement(aCustomShapeGeometry, xmlWriter); + } } void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) @@ -1618,6 +1662,9 @@ namespace { if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonBezierDescriptor")) dumpPolyPolygonBezierDescriptorService(xPropSet, xmlWriter); + if(xServiceInfo->supportsService("com.sun.star.drawing.CustomShape")) + dumpCustomShapeService(xPropSet, xmlWriter); + #if DEBUG_DUMPER sal_Int32 nServices = aServiceNames.getLength(); for (sal_Int32 i = 0; i < nServices; ++i) -- cgit From e3f2bcb85d815f5c7592b7006b82862fa01b1ffb Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Sat, 16 Jun 2012 02:43:21 +0200 Subject: Added CustomShapeReplacementURL property Change-Id: Ie0f2b1993392a8ba6974d891ca5147c69bf9a59d --- drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 1 + drawinglayer/source/dumper/XShapeDumper.cxx | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 6cce5d278462..f497e0a6b8de 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -175,6 +175,7 @@ private: void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter); void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter); void dumpCustomShapeGeometryAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter); + void dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter); // XShape.idl void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 5f76e1c42d82..dcf39212d6a5 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1046,6 +1046,12 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } + void XShapeDumper::dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeReplacementURL"), "%s", + rtl::OUStringToOString(sCustomShapeReplacementURL, RTL_TEXTENCODING_UTF8).getStr()); + } + // methods dumping whole services void XShapeDumper::dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) @@ -1604,6 +1610,12 @@ namespace { if(anotherAny >>= aCustomShapeGeometry) dumpCustomShapeGeometryAsElement(aCustomShapeGeometry, xmlWriter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeReplacementURL"); + rtl::OUString sCustomShapeReplacementURL; + if(anotherAny >>= sCustomShapeReplacementURL) + dumpCustomShapeReplacementURLAsAttribute(sCustomShapeReplacementURL, xmlWriter); + } } void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) -- cgit From d96a9a2b6c5e1681422262e7392fb57152af0b9a Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 22 Jun 2012 12:40:47 +0200 Subject: fixed taking wrong string as a parameter Change-Id: I30a68a17b14b9867dc2d2ade8b12e7484d68fe9e --- drawinglayer/source/dumper/XShapeDumper.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index dcf39212d6a5..7ed19c045b0a 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1025,7 +1025,7 @@ namespace { if(aAny >>= sValue) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", - rtl::OUStringToOString(aCustomShapeGeometry[i].Name, RTL_TEXTENCODING_UTF8).getStr()); + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); } switch(aCustomShapeGeometry[i].State) { -- cgit From e0881b2f8916530a18c637bb16d5cdf993f7b5d4 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 26 Jun 2012 19:07:12 +0200 Subject: Added new class EnhancedShapeDumper handled in XShapeDumper Change-Id: Ie719eba2579998917cea030fad51f07b0bcacec4 --- drawinglayer/Library_drawinglayer.mk | 1 + drawinglayer/Package_inc.mk | 1 + .../inc/drawinglayer/EnhancedShapeDumper.hxx | 49 ++++++++++++++++++++++ drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 7 +++- drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 33 +++++++++++++++ drawinglayer/source/dumper/XShapeDumper.cxx | 13 ++++++ 6 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx create mode 100644 drawinglayer/source/dumper/EnhancedShapeDumper.cxx (limited to 'drawinglayer') diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk index 202211858278..146c38b98348 100644 --- a/drawinglayer/Library_drawinglayer.mk +++ b/drawinglayer/Library_drawinglayer.mk @@ -177,6 +177,7 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\ drawinglayer/source/texture/texture3d \ drawinglayer/source/texture/texture \ drawinglayer/source/dumper/XShapeDumper \ + drawinglayer/source/dumper/EnhancedShapeDumper \ )) # vim: set noet sw=4 ts=4: diff --git a/drawinglayer/Package_inc.mk b/drawinglayer/Package_inc.mk index 7d41e6c2b5d8..585a027735f5 100644 --- a/drawinglayer/Package_inc.mk +++ b/drawinglayer/Package_inc.mk @@ -138,5 +138,6 @@ $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/ $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/texture/texture3d.hxx,drawinglayer/texture/texture3d.hxx)) $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/texture/texture.hxx,drawinglayer/texture/texture.hxx)) $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/XShapeDumper.hxx,drawinglayer/XShapeDumper.hxx)) +$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/XShapeDumper.hxx,drawinglayer/EnhancedShapeDumper.hxx)) # vim: set noet sw=4 ts=4: diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx new file mode 100644 index 000000000000..71b0fde3600f --- /dev/null +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Artur Dorda (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include +#include + +#ifndef EnhancedShapeDumper_hxx +#define EnhancedShapeDumper_hxx + +class DRAWINGLAYER_DLLPUBLIC EnhancedShapeDumper +{ +public: + EnhancedShapeDumper(xmlTextWriterPtr writer) + : + xmlWriter(writer) + { + + } + + +private: + xmlTextWriterPtr xmlWriter; +}; +#endif diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index f497e0a6b8de..544636e69d32 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include @@ -57,8 +59,8 @@ #include -#ifndef ChartViewDumper_hxx -#define ChartViewDumper_hxx +#ifndef XShapeDumper_hxx +#define XShapeDumper_hxx class DRAWINGLAYER_DLLPUBLIC XShapeDumper { @@ -193,6 +195,7 @@ private: void dumpShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); void dumpCustomShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, EnhancedShapeDumper enhancedDumper); }; #endif diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx new file mode 100644 index 000000000000..f68d3206dd62 --- /dev/null +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Artur Dorda (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include +#include + + + diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 7ed19c045b0a..990e033b85a6 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1618,6 +1618,11 @@ namespace { } } + void XShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference< beans::XPropertySet > xPropSet, EnhancedShapeDumper enhancedDumper) + { + + } + void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); @@ -1677,6 +1682,14 @@ namespace { if(xServiceInfo->supportsService("com.sun.star.drawing.CustomShape")) dumpCustomShapeService(xPropSet, xmlWriter); + // EnhancedShapeDumper used + + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeExtrusion")) + { + EnhancedShapeDumper enhancedDumper(xmlWriter); + dumpEnhancedCustomShapeExtrusionService(xPropSet, enhancedDumper); + } + #if DEBUG_DUMPER sal_Int32 nServices = aServiceNames.getLength(); for (sal_Int32 i = 0; i < nServices; ++i) -- cgit From 1ebccdaf3df65a5f4b50844e0111ca364c0d133f Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 26 Jun 2012 19:13:22 +0200 Subject: Added service EnhancedCustomShapeExtrusion, properties Extrusion & Brightness Change-Id: Ie787fb90f2c8192632e0ad8a86c7affbb3315791 --- drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 3 +++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 15 +++++++++++++++ drawinglayer/source/dumper/XShapeDumper.cxx | 13 ++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 71b0fde3600f..777a00be2314 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -42,6 +42,9 @@ public: } + // EnhancedCustomShapeExtrusion.idl + void dumpExtrusionAsAttribute(sal_Bool bExtrusion); + void dumpBrightnessAsAttribute(double aBrightness); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index f68d3206dd62..19c60d4e236c 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -29,5 +29,20 @@ #include #include +// ------------------------------------------------------ +// ---------- EnhancedCustomShapeExtrusion.idl ---------- +// ------------------------------------------------------ +void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) +{ + if(bExtrusion) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("extrusion"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("extrusion"), "%s", "false"); +} + +void EnhancedShapeDumper::dumpBrightnessAsAttribute(double aBrightness) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("brightness"), "%f", aBrightness); +} diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 990e033b85a6..f17c4261a278 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1620,7 +1620,18 @@ namespace { void XShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference< beans::XPropertySet > xPropSet, EnhancedShapeDumper enhancedDumper) { - + { + uno::Any anotherAny = xPropSet->getPropertyValue("Extrusion"); + sal_Bool bExtrusion; + if(anotherAny >>= bExtrusion) + enhancedDumper.dumpExtrusionAsAttribute(bExtrusion); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Brightness"); + double aBrightness; + if(anotherAny >>= aBrightness) + enhancedDumper.dumpBrightnessAsAttribute(aBrightness); + } } void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) -- cgit From 4024d146109b86131a10a78627aa149321df9065 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Mon, 2 Jul 2012 22:47:41 +0200 Subject: Restructurization of XShape- and EnhancedShape- dumpers, builds fine now Change-Id: I57e230f5b2aff8cd6818b38776ae0b0b0d614d61 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 + drawinglayer/inc/drawinglayer/XShapeDumper.hxx | 130 ------- drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 18 + drawinglayer/source/dumper/XShapeDumper.cxx | 378 ++++++++++++++------- 4 files changed, 271 insertions(+), 257 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 777a00be2314..6c30dda2df99 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -28,6 +28,7 @@ #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -43,6 +44,7 @@ public: } // EnhancedCustomShapeExtrusion.idl + void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpExtrusionAsAttribute(sal_Bool bExtrusion); void dumpBrightnessAsAttribute(double aBrightness); diff --git a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx index 544636e69d32..a7d1d8d61b16 100644 --- a/drawinglayer/inc/drawinglayer/XShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/XShapeDumper.hxx @@ -26,9 +26,7 @@ * instead of those above. */ -#include #include -#include #include #include @@ -69,133 +67,5 @@ public: XShapeDumper(); rtl::OUString dump(com::sun::star::uno::Reference xPageShapes); -private: - // auxiliary functions - void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); - void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); - void dumpPointSequenceSequence(com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence, xmlTextWriterPtr xmlWriter); - - // FillProperties.idl - void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); - void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); - void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); - void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter); - void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); - void dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter); - void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); - void dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter); - void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter); - void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapAsElement(com::sun::star::uno::Reference xBitmap, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapModeAsAttribute(com::sun::star::drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter); - - // LineProperties.idl - void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter); - void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter); - void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter); - void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter); - void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter); - void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter); - void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter); - void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter); - void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter); - void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter); - void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter); - void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter); - void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter); - void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter); - void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter); - - // PolyPolygonDescriptor.idl - void dumpPolygonKindAsAttribute(com::sun::star::drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter); - void dumpPolyPolygonAsElement(com::sun::star::drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter); - void dumpGeometryAsElement(com::sun::star::drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter); - - // TextProperties.idl - void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter); - void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter); - void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter); - void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter); - void dumpTextFitToSizeAsAttribute(com::sun::star::drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter); - void dumpTextHorizontalAdjustAsAttribute(com::sun::star::drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter); - void dumpTextVerticalAdjustAsAttribute(com::sun::star::drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter); - void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter); - void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter); - void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter); - void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter); - void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter); - void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter); - void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter); - void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationDirectionAsAttribute(com::sun::star::drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationKindAsAttribute(com::sun::star::drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter); - void dumpTextWritingModeAsAttribute(com::sun::star::text::WritingMode eWritingMode, xmlTextWriterPtr xmlWriter); - - // ShadowProperties.idl - void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter); - void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter); - void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter); - void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter); - void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter); - - //Shape.idl - void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter); - void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter); - void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter); - void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter); - void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter); - void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter); - void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter); - void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter); - void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter); - void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter); - void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter); - void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter); - - // PolyPolygonBezierDescriptor.idl - void dumpPolyPolygonBezierAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter); - void dumpGeometryAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter); - - // CustomShape.idl - void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter); - void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter); - void dumpCustomShapeGeometryAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter); - void dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter); - - // XShape.idl - void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); - void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); - - // the rest - void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); - void dumpXShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, xmlTextWriterPtr xmlWriter); - void dumpXShapes( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); - void dumpTextPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpFillPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpLinePropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpShadowPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpPolyPolygonDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpCustomShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, EnhancedShapeDumper enhancedDumper); - }; #endif diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 19c60d4e236c..542a687b6c6c 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -28,11 +28,29 @@ #include #include +#include + +using namespace com::sun::star; // ------------------------------------------------------ // ---------- EnhancedCustomShapeExtrusion.idl ---------- // ------------------------------------------------------ +void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference< beans::XPropertySet > xPropSet) +{ + { + uno::Any anotherAny = xPropSet->getPropertyValue("Extrusion"); + sal_Bool bExtrusion; + if(anotherAny >>= bExtrusion) + dumpExtrusionAsAttribute(bExtrusion); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Brightness"); + double aBrightness; + if(anotherAny >>= aBrightness) + dumpBrightnessAsAttribute(aBrightness); + } +} void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { if(bExtrusion) diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index f17c4261a278..7a3a18ac7e1d 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -27,21 +27,156 @@ */ #include +#include #include #include #include #include #include #include - +#include #define DEBUG_DUMPER 0 using namespace com::sun::star; //class XShapeDumper + XShapeDumper::XShapeDumper() + { + + } + namespace { +// FUNCTION DECLARATIONS + + // auxiliary functions + void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); + void dumpPointSequenceSequence(com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence, xmlTextWriterPtr xmlWriter); + + // FillProperties.idl + void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); + void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); + void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); + void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter); + void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); + void dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter); + void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); + void dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter); + void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter); + void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapAsElement(com::sun::star::uno::Reference xBitmap, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapModeAsAttribute(com::sun::star::drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter); + void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter); + + // LineProperties.idl + void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter); + void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter); + void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter); + void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter); + void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter); + void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter); + void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter); + void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter); + void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter); + void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter); + void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter); + void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter); + void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter); + void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter); + void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter); + + // PolyPolygonDescriptor.idl + void dumpPolygonKindAsAttribute(com::sun::star::drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonAsElement(com::sun::star::drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter); + void dumpGeometryAsElement(com::sun::star::drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter); + + // TextProperties.idl + void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter); + void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter); + void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter); + void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter); + void dumpTextFitToSizeAsAttribute(com::sun::star::drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter); + void dumpTextHorizontalAdjustAsAttribute(com::sun::star::drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter); + void dumpTextVerticalAdjustAsAttribute(com::sun::star::drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter); + void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter); + void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter); + void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter); + void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter); + void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter); + void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter); + void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter); + void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationDirectionAsAttribute(com::sun::star::drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationKindAsAttribute(com::sun::star::drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter); + void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter); + void dumpTextWritingModeAsAttribute(com::sun::star::text::WritingMode eWritingMode, xmlTextWriterPtr xmlWriter); + + // ShadowProperties.idl + void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter); + void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter); + void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter); + void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter); + void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter); + + //Shape.idl + void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter); + void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter); + void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter); + void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter); + void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter); + void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter); + void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter); + void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter); + void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter); + void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter); + void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter); + void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter); + + // PolyPolygonBezierDescriptor.idl + void dumpPolyPolygonBezierAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter); + void dumpGeometryAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter); + + // CustomShape.idl + void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter); + void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter); + void dumpCustomShapeGeometryAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter); + void dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter); + + // XShape.idl + void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); + void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); + + // the rest + void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); + void dumpXShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, xmlTextWriterPtr xmlWriter); + void dumpXShapes( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); + void dumpTextPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpFillPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpLinePropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpShadowPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + void dumpCustomShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + + int writeCallback(void* pContext, const char* sBuffer, int nLen) { rtl::OStringBuffer* pBuffer = static_cast(pContext); @@ -53,16 +188,11 @@ namespace { { return 0; } -} //end of namespace - - XShapeDumper::XShapeDumper() - { - } // ---------------------------------------- // ---------- FillProperties.idl ---------- // ---------------------------------------- - void XShapeDumper::dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter) + void dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter) { switch(eFillStyle) { @@ -86,24 +216,24 @@ namespace { } } - void XShapeDumper::dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter) + void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillColor"), "%" SAL_PRIdINT32, aColor); } - void XShapeDumper::dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter) + void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32, aTransparence); } - void XShapeDumper::dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter) + void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s", rtl::OUStringToOString(sTranspGradName, RTL_TEXTENCODING_UTF8).getStr()); } //because there's more awt::Gradient properties to dump - void XShapeDumper::dumpGradientProperty(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) + void dumpGradientProperty(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) { switch(aGradient.Style) //enum GradientStyle { @@ -139,33 +269,33 @@ namespace { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StepCount); } - void XShapeDumper::dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter) + void dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillTransparenceGradient" )); dumpGradientProperty(aTranspGrad, xmlWriter); xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter) + void dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s", rtl::OUStringToOString(sGradName, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpFillGradientAsElement(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) + void dumpFillGradientAsElement(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillGradient" )); dumpGradientProperty(aGradient, xmlWriter); xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter) + void dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillHatchName"), "%s", rtl::OUStringToOString(sHatchName, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpFillHatchAsElement(drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter) + void dumpFillHatchAsElement(drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillHatch" )); switch(aHatch.Style) @@ -188,7 +318,7 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter) + void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter) { if(bBackground) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "true"); @@ -196,13 +326,13 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "false"); } - void XShapeDumper::dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s", rtl::OUStringToOString(sBitmapName, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpFillBitmapAsElement(uno::Reference xBitmap, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapAsElement(uno::Reference xBitmap, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillBitmap" )); if (xBitmap.is()) @@ -214,33 +344,33 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapURL"), "%s", rtl::OUStringToOString(sBitmapURL, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetX"), "%" SAL_PRIdINT32, aBitmapPositionOffsetX); } - void XShapeDumper::dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetY"), "%" SAL_PRIdINT32, aBitmapPositionOffsetY); } - void XShapeDumper::dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetX"), "%" SAL_PRIdINT32, aBitmapOffsetX); } - void XShapeDumper::dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetY"), "%" SAL_PRIdINT32, aBitmapOffsetY); } - void XShapeDumper::dumpFillBitmapRectanglePointAsAttribute(drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapRectanglePointAsAttribute(drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter) { switch(eBitmapRectanglePoint) { @@ -276,7 +406,7 @@ namespace { } } - void XShapeDumper::dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter) { if(bBitmapLogicalSize) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "true"); @@ -284,17 +414,17 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "false"); } - void XShapeDumper::dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeX"), "%" SAL_PRIdINT32, aBitmapSizeX); } - void XShapeDumper::dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeY"), "%" SAL_PRIdINT32, aBitmapSizeY); } - void XShapeDumper::dumpFillBitmapModeAsAttribute(drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapModeAsAttribute(drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter) { switch(eBitmapMode) { @@ -312,7 +442,7 @@ namespace { } } - void XShapeDumper::dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter) { if(bBitmapStretch) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "true"); @@ -320,7 +450,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "false"); } - void XShapeDumper::dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter) + void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter) { if(bBitmapTile) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "true"); @@ -332,7 +462,7 @@ namespace { // ---------- LineProperties.idl ---------- // ---------------------------------------- - void XShapeDumper::dumpLineStyleAsAttribute(drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter) + void dumpLineStyleAsAttribute(drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter) { switch(eLineStyle) { @@ -350,7 +480,7 @@ namespace { } } - void XShapeDumper::dumpLineDashAsElement(drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter) + void dumpLineDashAsElement(drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineDash" )); switch(aLineDash.Style) @@ -378,28 +508,28 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter) + void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineDashName"), "%s", rtl::OUStringToOString(sLineDashName, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter) + void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineColor"), "%" SAL_PRIdINT32, aLineColor); } - void XShapeDumper::dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter) + void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32, aLineTransparence); } - void XShapeDumper::dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter) + void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32, aLineWidth); } - void XShapeDumper::dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter) + void dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter) { switch(eLineJoint) { @@ -423,19 +553,19 @@ namespace { } } - void XShapeDumper::dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter) + void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s", rtl::OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter) + void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndName"), "%s", rtl::OUStringToOString(sLineEndName, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpPolyPolygonBezierCoords(drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter) + void dumpPolyPolygonBezierCoords(drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter) { // dumps first field - Coordinates dumpPointSequenceSequence(aPolyPolygonBezierCoords.Coordinates, xmlWriter); @@ -477,21 +607,21 @@ namespace { } - void XShapeDumper::dumpLineStartAsElement(drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter) + void dumpLineStartAsElement(drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineStart" )); dumpPolyPolygonBezierCoords(aLineStart, xmlWriter); xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpLineEndAsElement(drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter) + void dumpLineEndAsElement(drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineEnd" )); dumpPolyPolygonBezierCoords(aLineEnd, xmlWriter); xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter) + void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter) { if(bLineStartCenter) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "true"); @@ -499,12 +629,12 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "false"); } - void XShapeDumper::dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter) + void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32, aLineStartWidth); } - void XShapeDumper::dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter) + void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter) { if(bLineEndCenter) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "true"); @@ -512,7 +642,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "false"); } - void XShapeDumper::dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter) + void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32, aLineEndWidth); } @@ -521,7 +651,7 @@ namespace { // ---------- PolyPolygonDescriptor.idl ---------- // ----------------------------------------------- - void XShapeDumper::dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter) + void dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter) { switch(ePolygonKind) { @@ -557,7 +687,7 @@ namespace { } } - void XShapeDumper::dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence, xmlTextWriterPtr xmlWriter) + void dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence, xmlTextWriterPtr xmlWriter) { // LibreOffice proudly presents - The Sequenception uno::Sequence > pointSequenceSequence = aPointSequenceSequence; @@ -580,14 +710,14 @@ namespace { } } - void XShapeDumper::dumpPolyPolygonAsElement(drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter) + void dumpPolyPolygonAsElement(drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygon" )); dumpPointSequenceSequence(aPolyPolygon, xmlWriter); xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpGeometryAsElement(drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter) + void dumpGeometryAsElement(drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" )); dumpPointSequenceSequence(aGeometry, xmlWriter); @@ -598,7 +728,7 @@ namespace { // ---------- TextProperties.idl ---------- // ---------------------------------------- - void XShapeDumper::dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter) + void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter) { if(bIsNumbering) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "true"); @@ -606,7 +736,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "false"); } - void XShapeDumper::dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter) + void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter) { if(bTextAutoGrowHeight) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "true"); @@ -614,7 +744,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "false"); } - void XShapeDumper::dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter) + void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter) { if(bTextAutoGrowWidth) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "true"); @@ -622,7 +752,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "false"); } - void XShapeDumper::dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter) + void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter) { if(bTextContourFrame) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "true"); @@ -630,7 +760,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "false"); } - void XShapeDumper::dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter) + void dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter) { switch(eTextFitToSize) { @@ -651,7 +781,7 @@ namespace { } } - void XShapeDumper::dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter) + void dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter) { switch(eTextHorizontalAdjust) { @@ -672,7 +802,7 @@ namespace { } } - void XShapeDumper::dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter) + void dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter) { switch(eTextVerticalAdjust) { @@ -693,62 +823,62 @@ namespace { } } - void XShapeDumper::dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter) + void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32, aTextLeftDistance); } - void XShapeDumper::dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter) + void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32, aTextRightDistance); } - void XShapeDumper::dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter) + void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32, aTextUpperDistance); } - void XShapeDumper::dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter) + void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32, aTextLowerDistance); } - void XShapeDumper::dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter) + void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32, aTextMaximumFrameHeight); } - void XShapeDumper::dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter) + void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32, aTextMaximumFrameWidth); } - void XShapeDumper::dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter) + void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32, aTextMinimumFrameHeight); } - void XShapeDumper::dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter) + void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32, aTextMinimumFrameWidth); } - void XShapeDumper::dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter) + void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32, aTextAnimationAmount); } - void XShapeDumper::dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter) + void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32, aTextAnimationCount); } - void XShapeDumper::dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter) + void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32, aTextAnimationDelay); } - void XShapeDumper::dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter) + void dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter) { switch(eTextAnimationDirection) { @@ -769,7 +899,7 @@ namespace { } } - void XShapeDumper::dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter) + void dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter) { switch(eTextAnimationKind) { @@ -793,7 +923,7 @@ namespace { } } - void XShapeDumper::dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter) + void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter) { if(bTextAnimationStartInside) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "true"); @@ -801,7 +931,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "false"); } - void XShapeDumper::dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter) + void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter) { if(bTextAnimationStopInside) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "true"); @@ -809,7 +939,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "false"); } - void XShapeDumper::dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode, xmlTextWriterPtr xmlWriter) + void dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode, xmlTextWriterPtr xmlWriter) { switch(eTextWritingMode) { @@ -831,7 +961,7 @@ namespace { // ---------- ShadowProperties.idl ---------- // ------------------------------------------ - void XShapeDumper::dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter) + void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter) { if(bShadow) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "true"); @@ -839,22 +969,22 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "false"); } - void XShapeDumper::dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter) + void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowColor"), "%" SAL_PRIdINT32, aShadowColor); } - void XShapeDumper::dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter) + void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32, aShadowTransparence); } - void XShapeDumper::dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter) + void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowXDistance"), "%" SAL_PRIdINT32, aShadowXDistance); } - void XShapeDumper::dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter) + void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32, aShadowYDistance); } @@ -863,23 +993,23 @@ namespace { // ---------- Shape.idl ---------- // ------------------------------- - void XShapeDumper::dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter) + void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("zOrder"), "%" SAL_PRIdINT32, aZOrder); } - void XShapeDumper::dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter) + void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID); } - void XShapeDumper::dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter) + void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s", rtl::OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter) + void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter) { if(bVisible) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "true"); @@ -887,7 +1017,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "false"); } - void XShapeDumper::dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter) + void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter) { if(bPrintable) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "true"); @@ -895,7 +1025,7 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "false"); } - void XShapeDumper::dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter) + void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter) { if(bMoveProtect) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "true"); @@ -903,13 +1033,13 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false"); } - void XShapeDumper::dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter) + void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter) + void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter) { if(bSizeProtect) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "true"); @@ -917,14 +1047,14 @@ namespace { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false"); } - void XShapeDumper::dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aHomogenMatrixLine3, xmlTextWriterPtr xmlWriter) + void dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aHomogenMatrixLine3, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column1"), "%f", aHomogenMatrixLine3.Column1); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column2"), "%f", aHomogenMatrixLine3.Column2); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", aHomogenMatrixLine3.Column3); } - void XShapeDumper::dumpTransformationAsElement(drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter) + void dumpTransformationAsElement(drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Transformation" )); { @@ -941,12 +1071,12 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter) + void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder); } - void XShapeDumper::dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter) + void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("hyperlink"), "%s", rtl::OUStringToOString(sHyperlink, RTL_TEXTENCODING_UTF8).getStr()); @@ -956,19 +1086,19 @@ namespace { // ---------- XShape.idl ---------- // -------------------------------- - void XShapeDumper::dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) + void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y); } - void XShapeDumper::dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter) + void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height); } - void XShapeDumper::dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ) + void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); @@ -978,14 +1108,14 @@ namespace { // ---------- PolyPolygonBezierDescriptor.idl ---------- // ----------------------------------------------------- - void XShapeDumper::dumpPolyPolygonBezierAsElement(drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter) + void dumpPolyPolygonBezierAsElement(drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygonBezier" )); dumpPolyPolygonBezierCoords(aPolyPolygonBezier, xmlWriter); xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpGeometryAsElement(drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter) + void dumpGeometryAsElement(drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" )); dumpPolyPolygonBezierCoords(aGeometry, xmlWriter); @@ -996,19 +1126,19 @@ namespace { // ---------- CustomShape.idl ---------- // ------------------------------------- - void XShapeDumper::dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter) + void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeEngine"), "%s", rtl::OUStringToOString(sCustomShapeEngine, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter) + void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeData"), "%s", rtl::OUStringToOString(sCustomShapeData, RTL_TEXTENCODING_UTF8).getStr()); } - void XShapeDumper::dumpCustomShapeGeometryAsElement(uno::Sequence< beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter) + void dumpCustomShapeGeometryAsElement(uno::Sequence< beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "CustomShapeGeometry" )); sal_Int32 nLength = aCustomShapeGeometry.getLength(); @@ -1046,7 +1176,7 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter) + void dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeReplacementURL"), "%s", rtl::OUStringToOString(sCustomShapeReplacementURL, RTL_TEXTENCODING_UTF8).getStr()); @@ -1054,7 +1184,7 @@ namespace { // methods dumping whole services - void XShapeDumper::dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + void dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); if(xInfo->hasPropertyByName("IsNumbering")) @@ -1198,7 +1328,7 @@ namespace { } } - void XShapeDumper::dumpFillPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + void dumpFillPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { { uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); @@ -1346,7 +1476,7 @@ namespace { } } - void XShapeDumper::dumpLinePropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + void dumpLinePropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { { uno::Any anotherAny = xPropSet->getPropertyValue("LineStyle"); @@ -1440,7 +1570,7 @@ namespace { } } - void XShapeDumper::dumpShadowPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + void dumpShadowPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { { uno::Any anotherAny = xPropSet->getPropertyValue("Shadow"); @@ -1474,7 +1604,7 @@ namespace { } } - void XShapeDumper::dumpPolyPolygonDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + void dumpPolyPolygonDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { { uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); @@ -1496,7 +1626,7 @@ namespace { } } - void XShapeDumper::dumpShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + void dumpShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); { @@ -1568,7 +1698,7 @@ namespace { } } - void XShapeDumper::dumpPolyPolygonBezierDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + void dumpPolyPolygonBezierDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { { uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); @@ -1590,8 +1720,9 @@ namespace { } } - void XShapeDumper::dumpCustomShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + void dumpCustomShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) { + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); { uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeEngine"); rtl::OUString sCustomShapeEngine; @@ -1610,6 +1741,7 @@ namespace { if(anotherAny >>= aCustomShapeGeometry) dumpCustomShapeGeometryAsElement(aCustomShapeGeometry, xmlWriter); } + if(xInfo->hasPropertyByName("CustomShapeReplacementURL")) { uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeReplacementURL"); rtl::OUString sCustomShapeReplacementURL; @@ -1618,23 +1750,7 @@ namespace { } } - void XShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference< beans::XPropertySet > xPropSet, EnhancedShapeDumper enhancedDumper) - { - { - uno::Any anotherAny = xPropSet->getPropertyValue("Extrusion"); - sal_Bool bExtrusion; - if(anotherAny >>= bExtrusion) - enhancedDumper.dumpExtrusionAsAttribute(bExtrusion); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Brightness"); - double aBrightness; - if(anotherAny >>= aBrightness) - enhancedDumper.dumpBrightnessAsAttribute(aBrightness); - } - } - - void XShapeDumper::dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) + void dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW); @@ -1657,6 +1773,8 @@ namespace { if (!aName.isEmpty()) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr()); } + try + { if (xServiceInfo->supportsService("com.sun.star.drawing.Text")) { uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW); @@ -1698,7 +1816,12 @@ namespace { if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeExtrusion")) { EnhancedShapeDumper enhancedDumper(xmlWriter); - dumpEnhancedCustomShapeExtrusionService(xPropSet, enhancedDumper); + enhancedDumper.dumpEnhancedCustomShapeExtrusionService(xPropSet); + } + } + catch (com::sun::star::beans::UnknownPropertyException &e) + { + printf("Problem in the XShapeDumper"); } #if DEBUG_DUMPER @@ -1714,7 +1837,7 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } - void XShapeDumper::dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ) + void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ) { xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) ); uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW); @@ -1727,6 +1850,7 @@ namespace { xmlTextWriterEndElement( xmlWriter ); } +} //end of namespace rtl::OUString XShapeDumper::dump(uno::Reference xPageShapes) { -- cgit From 3b97877219087a0d47f55bf5b7a080e3ed0df8f6 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 15:36:35 +0200 Subject: Added auxiliary method for dumping EnhancedCustomShapeParameterPair Change-Id: I3e0eca4f042565e8b64ab3e7286f66033c0e75a3 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 4 ++++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 28 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 6c30dda2df99..aecb856b42d6 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -29,6 +29,7 @@ #include #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -43,6 +44,9 @@ public: } + // auxiliary functions + void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); + // EnhancedCustomShapeExtrusion.idl void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpExtrusionAsAttribute(sal_Bool bExtrusion); diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 542a687b6c6c..85bfd276f9e1 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -64,3 +64,31 @@ void EnhancedShapeDumper::dumpBrightnessAsAttribute(double aBrightness) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("brightness"), "%f", aBrightness); } +void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(drawing::EnhancedCustomShapeParameterPair aParameterPair) +{ + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "First" )); + uno::Any aAny = aParameterPair.First.Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aParameterPair.First.Type); + xmlTextWriterEndElement( xmlWriter ); + } + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Second" )); + uno::Any aAny = aParameterPair.Second.Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aParameterPair.Second.Type); + xmlTextWriterEndElement( xmlWriter ); + } +} + -- cgit From 3b18024e5447a5bcce291aa9442d53cc79eeda1d Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 16:04:32 +0200 Subject: Added properties Depth & Diffusion Change-Id: If9aaf021bcdd0a43bbc32e08236f8bc39c7cda82 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 23 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index aecb856b42d6..f328a94fd747 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -51,6 +51,8 @@ public: void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpExtrusionAsAttribute(sal_Bool bExtrusion); void dumpBrightnessAsAttribute(double aBrightness); + void dumpDepthAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepth); + void dumpDiffusionAsAttribute(double aDiffusion); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 85bfd276f9e1..aee479e04706 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -50,6 +50,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aBrightness) dumpBrightnessAsAttribute(aBrightness); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Depth"); + drawing::EnhancedCustomShapeParameterPair aDepth; + if(anotherAny >>= aDepth) + dumpDepthAsElement(aDepth); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Diffusion"); + double aDiffusion; + if(anotherAny >>= aDiffusion) + dumpDiffusionAsAttribute(aDiffusion); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -92,3 +104,14 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(drawing::Enhanced } } +void EnhancedShapeDumper::dumpDepthAsElement(drawing::EnhancedCustomShapeParameterPair aDepth) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Depth" )); + dumpEnhancedCustomShapeParameterPair(aDepth); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpDiffusionAsAttribute(double aDiffusion) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("diffusion"), "%f", aDiffusion); +} -- cgit From 0857b88d97d2de5041218a072044438f32f31fc3 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 16:10:31 +0200 Subject: Added properties NumberOfLineSegments & { Change-Id: I04e6db01c14344b1f7a71b587b7437fd87e72d99 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 27 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index f328a94fd747..99b4f34dd645 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -53,6 +53,8 @@ public: void dumpBrightnessAsAttribute(double aBrightness); void dumpDepthAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepth); void dumpDiffusionAsAttribute(double aDiffusion); + void dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments); + void dumpLightFaceAsAttribute(sal_Bool bLightFace); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index aee479e04706..8bf533faa25d 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -62,6 +62,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aDiffusion) dumpDiffusionAsAttribute(aDiffusion); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("NumberOfLineSegments"); + sal_Int32 aNumberOfLineSegments; + if(anotherAny >>= aNumberOfLineSegments) + dumpNumberOfLineSegmentsAsAttribute(aNumberOfLineSegments); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LightFace"); + sal_Bool bLightFace; + if(anotherAny >>= bLightFace) + dumpLightFaceAsAttribute(bLightFace); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -115,3 +127,18 @@ void EnhancedShapeDumper::dumpDiffusionAsAttribute(double aDiffusion) { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("diffusion"), "%f", aDiffusion); } + +void EnhancedShapeDumper::dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("numberOfLineSegments"), "%" SAL_PRIdINT32, aNumberOfLineSegments); +} + +void EnhancedShapeDumper::dumpLightFaceAsAttribute(sal_Bool bLightFace) +{ + if(bLightFace) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lightFace"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lightFace"), "%s", "false"); +} + + -- cgit From a5a422d20dc2c75b9e249a7685994171eda82804 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 20:20:13 +0200 Subject: Added properties FirstLightHarsh & SecondLightHarsh Change-Id: I628b5f390c9eb99542254f814b6b34a0b30dab57 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 28 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 99b4f34dd645..b11666fdf0cd 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -55,6 +55,8 @@ public: void dumpDiffusionAsAttribute(double aDiffusion); void dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments); void dumpLightFaceAsAttribute(sal_Bool bLightFace); + void dumpFirstLightHarshAsAttribute(sal_Bool bFirstLightHarsh); + void dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 8bf533faa25d..b12a34b5db68 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -74,6 +74,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= bLightFace) dumpLightFaceAsAttribute(bLightFace); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FirstLightHarsh"); + sal_Bool bFirstLightHarsh; + if(anotherAny >>= bFirstLightHarsh) + dumpFirstLightHarshAsAttribute(bFirstLightHarsh); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SecondLightHarsh"); + sal_Bool bSecondLightHarsh; + if(anotherAny >>= bSecondLightHarsh) + dumpSecondLightHarshAsAttribute(bSecondLightHarsh); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -141,4 +153,20 @@ void EnhancedShapeDumper::dumpLightFaceAsAttribute(sal_Bool bLightFace) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lightFace"), "%s", "false"); } +void EnhancedShapeDumper::dumpFirstLightHarshAsAttribute(sal_Bool bFirstLightHarsh) +{ + if(bFirstLightHarsh) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("firstLightHarsh"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("firstLightHarsh"), "%s", "false"); +} + +void EnhancedShapeDumper::dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh) +{ + if(bSecondLightHarsh) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightHarsh"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightHarsh"), "%s", "false"); +} + -- cgit From 549db19b4d85e2379028d06e089c1c5ffee2526e Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 20:25:52 +0200 Subject: Added properties FirstLightLevel & SecondLightLevel Change-Id: Ia7ff7cd84c5b26d1a2f7898a271a800d9731b65f --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index b11666fdf0cd..412c33764b9e 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -57,6 +57,8 @@ public: void dumpLightFaceAsAttribute(sal_Bool bLightFace); void dumpFirstLightHarshAsAttribute(sal_Bool bFirstLightHarsh); void dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh); + void dumpFirstLightLevelAsAttribute(double aFirstLightLevel); + void dumpSecondLightLevelAsAttribute(double aSecondLightLevel); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index b12a34b5db68..15f65b986b54 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -86,6 +86,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= bSecondLightHarsh) dumpSecondLightHarshAsAttribute(bSecondLightHarsh); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FirstLightLevel"); + double aFirstLightLevel; + if(anotherAny >>= aFirstLightLevel) + dumpFirstLightLevelAsAttribute(aFirstLightLevel); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SecondLightLevel"); + double aSecondLightLevel; + if(anotherAny >>= aSecondLightLevel) + dumpSecondLightLevelAsAttribute(aSecondLightLevel); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -169,4 +181,14 @@ void EnhancedShapeDumper::dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightH xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightHarsh"), "%s", "false"); } +void EnhancedShapeDumper::dumpFirstLightLevelAsAttribute(double aFirstLightLevel) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("firstLightLevel"), "%f", aFirstLightLevel); +} + +void EnhancedShapeDumper::dumpSecondLightLevelAsAttribute(double aSecondLightLevel) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightLevel"), "%f", aSecondLightLevel); +} + -- cgit From 5324d0d3086f1d528c69164b74dc6a7672fe0c97 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 20:29:38 +0200 Subject: Added auxiliary method for dumping Direction3D Change-Id: Id237d6c233857f83400c1aac0965f59ebc8daf4b --- drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 412c33764b9e..2265a523ff76 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -30,6 +30,7 @@ #include #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -46,6 +47,7 @@ public: // auxiliary functions void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); + void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D); // EnhancedCustomShapeExtrusion.idl void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 15f65b986b54..5cfb0358b16d 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -191,4 +191,11 @@ void EnhancedShapeDumper::dumpSecondLightLevelAsAttribute(double aSecondLightLev xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightLevel"), "%f", aSecondLightLevel); } +void EnhancedShapeDumper::dumpDirection3D(drawing::Direction3D aDirection3D) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("directionX"), "%f", aDirection3D.DirectionX); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("directionY"), "%f", aDirection3D.DirectionY); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("directionZ"), "%f", aDirection3D.DirectionZ); +} + -- cgit From 6c245e0687c4ff9f7b4e6240282a11ca600d2e32 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 20:52:32 +0200 Subject: Added properties FirstLightDirection & SecondLightDirection Change-Id: I7236ac0df42765e351b75a75fa2fa66422a72277 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 26 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 2265a523ff76..bc2e713f2c5d 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -61,6 +61,8 @@ public: void dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh); void dumpFirstLightLevelAsAttribute(double aFirstLightLevel); void dumpSecondLightLevelAsAttribute(double aSecondLightLevel); + void dumpFirstLightDirectionAsElement(com::sun::star::drawing::Direction3D aFirstLightDirection); + void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 5cfb0358b16d..a4eafb6f1447 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -98,6 +98,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aSecondLightLevel) dumpSecondLightLevelAsAttribute(aSecondLightLevel); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FirstLightDirection"); + drawing::Direction3D aFirstLightDirection; + if(anotherAny >>= aFirstLightDirection) + dumpFirstLightDirectionAsElement(aFirstLightDirection); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SecondLightDirection"); + drawing::Direction3D aSecondLightDirection; + if(anotherAny >>= aSecondLightDirection) + dumpSecondLightDirectionAsElement(aSecondLightDirection); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -198,4 +210,18 @@ void EnhancedShapeDumper::dumpDirection3D(drawing::Direction3D aDirection3D) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("directionZ"), "%f", aDirection3D.DirectionZ); } +void EnhancedShapeDumper::dumpFirstLightDirectionAsElement(drawing::Direction3D aFirstLightDirection) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FirstLightDirection" )); + dumpDirection3D(aFirstLightDirection); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpSecondLightDirectionAsElement(drawing::Direction3D aSecondLightDirection) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "SecondLightDirection" )); + dumpDirection3D(aSecondLightDirection); + xmlTextWriterEndElement( xmlWriter ); +} + -- cgit From f104a3649608959b3b845dd3694aaf897e8808e6 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 20:57:08 +0200 Subject: Added properties Metal & ShadeMode Change-Id: I254a9089d78b97dde331812f77ad7977631b0d12 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 41 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index bc2e713f2c5d..aca302b5356a 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -31,6 +31,7 @@ #include #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -63,6 +64,8 @@ public: void dumpSecondLightLevelAsAttribute(double aSecondLightLevel); void dumpFirstLightDirectionAsElement(com::sun::star::drawing::Direction3D aFirstLightDirection); void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection); + void dumpMetalAsAttribute(sal_Bool bMetal); + void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index a4eafb6f1447..527115fed3d2 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -110,6 +110,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aSecondLightDirection) dumpSecondLightDirectionAsElement(aSecondLightDirection); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Metal"); + sal_Bool bMetal; + if(anotherAny >>= bMetal) + dumpMetalAsAttribute(bMetal); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadeMode"); + drawing::ShadeMode eShadeMode; + if(anotherAny >>= eShadeMode) + dumpShadeModeAsAttribute(eShadeMode); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -224,4 +236,33 @@ void EnhancedShapeDumper::dumpSecondLightDirectionAsElement(drawing::Direction3D xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpMetalAsAttribute(sal_Bool bMetal) +{ + if(bMetal) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("metal"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("metal"), "%s", "false"); +} + +void EnhancedShapeDumper::dumpShadeModeAsAttribute(drawing::ShadeMode eShadeMode) +{ + switch(eShadeMode) + { + case drawing::ShadeMode_FLAT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "FLAT"); + break; + case drawing::ShadeMode_PHONG: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "PHONG"); + break; + case drawing::ShadeMode_SMOOTH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "SMOOTH"); + break; + case drawing::ShadeMode_DRAFT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "DRAFT"); + break; + default: + break; + } +} + -- cgit From b83881ac5a8053cbbef98db6980f80d134ba792c Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 21:01:40 +0200 Subject: Added properties RotateAngle & RotationCenter Change-Id: I97d52be4904657eacb7cea4ebec789e6dd9a4722 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 26 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index aca302b5356a..6e25dc92bd7f 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -66,6 +66,8 @@ public: void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection); void dumpMetalAsAttribute(sal_Bool bMetal); void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode); + void dumpRotateAngleAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aRotateAngle); + void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 527115fed3d2..dc92e425a43a 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -122,6 +122,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= eShadeMode) dumpShadeModeAsAttribute(eShadeMode); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RotateAngle"); + drawing::EnhancedCustomShapeParameterPair aRotateAngle; + if(anotherAny >>= aRotateAngle) + dumpRotateAngleAsElement(aRotateAngle); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RotationCenter"); + drawing::Direction3D aRotationCenter; + if(anotherAny >>= aRotationCenter) + dumpRotationCenterAsElement(aRotationCenter); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -265,4 +277,18 @@ void EnhancedShapeDumper::dumpShadeModeAsAttribute(drawing::ShadeMode eShadeMode } } +void EnhancedShapeDumper::dumpRotateAngleAsElement(drawing::EnhancedCustomShapeParameterPair aRotateAngle) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RotateAngle" )); + dumpEnhancedCustomShapeParameterPair(aRotateAngle); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpRotationCenterAsElement(drawing::Direction3D aRotationCenter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RotationCenter" )); + dumpDirection3D(aRotationCenter); + xmlTextWriterEndElement( xmlWriter ); +} + -- cgit From 39becd1a50de51785de3428dc2a36aa257758081 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 21:04:52 +0200 Subject: Added properties Shininess & Skew Change-Id: I8a78b918c94d769b71cc336f461318099db7b877 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 24 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 6e25dc92bd7f..51ab82180c38 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -68,6 +68,8 @@ public: void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode); void dumpRotateAngleAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aRotateAngle); void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter); + void dumpShininessAsAttribute(double aShininess); + void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index dc92e425a43a..85c57876c857 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -134,6 +134,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aRotationCenter) dumpRotationCenterAsElement(aRotationCenter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Shininess"); + double aShininess; + if(anotherAny >>= aShininess) + dumpShininessAsAttribute(aShininess); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Skew"); + drawing::EnhancedCustomShapeParameterPair aSkew; + if(anotherAny >>= aSkew) + dumpSkewAsElement(aSkew); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -291,4 +303,16 @@ void EnhancedShapeDumper::dumpRotationCenterAsElement(drawing::Direction3D aRota xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpShininessAsAttribute(double aShininess) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shininess"), "%f", aShininess); +} + +void EnhancedShapeDumper::dumpSkewAsElement(drawing::EnhancedCustomShapeParameterPair aSkew) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Skew" )); + dumpEnhancedCustomShapeParameterPair(aSkew); + xmlTextWriterEndElement( xmlWriter ); +} + -- cgit From 3501827a4fecd0ca174715a5688ddaf10ad33cdf Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 21:10:05 +0200 Subject: Added properties Specularity & ProjectionMode Change-Id: I9e614c571f8d8db1cf00d3251cc4b09ff1dde278 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 32 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 51ab82180c38..5a5fbf8eeedd 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -32,6 +32,7 @@ #include #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -70,6 +71,8 @@ public: void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter); void dumpShininessAsAttribute(double aShininess); void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew); + void dumpSpecularityAsAttribute(double aSpecularity); + void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 85c57876c857..5b9b5acd3da6 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -146,6 +146,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aSkew) dumpSkewAsElement(aSkew); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Specularity"); + double aSpecularity; + if(anotherAny >>= aSpecularity) + dumpSpecularityAsAttribute(aSpecularity); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ProjectionMode"); + drawing::ProjectionMode eProjectionMode; + if(anotherAny >>= eProjectionMode) + dumpProjectionModeAsAttribute(eProjectionMode); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -315,4 +327,24 @@ void EnhancedShapeDumper::dumpSkewAsElement(drawing::EnhancedCustomShapeParamete xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpSpecularityAsAttribute(double aSpecularity) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("specularity"), "%f", aSpecularity); +} + +void EnhancedShapeDumper::dumpProjectionModeAsAttribute(drawing::ProjectionMode eProjectionMode) +{ + switch(eProjectionMode) + { + case drawing::ProjectionMode_PARALLEL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("projectionMode"), "%s", "PARALLEL"); + break; + case drawing::ProjectionMode_PERSPECTIVE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("projectionMode"), "%s", "PERSPECTIVE"); + break; + default: + break; + } +} + -- cgit From 39e516aaedd8261949d7c866c550dd3e00274a17 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 21:23:31 +0200 Subject: Added properties ViewPoint & Origin Change-Id: I87deba7504eff3feb6671835b33768045f502ba5 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 3 +++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 28 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 5a5fbf8eeedd..ed35546bd042 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -33,6 +33,7 @@ #include #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -73,6 +74,8 @@ public: void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew); void dumpSpecularityAsAttribute(double aSpecularity); void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode); + void dumpViewPointAsElement(com::sun::star::drawing::Position3D aViewPoint); + void dumpOriginAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aOrigin); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 5b9b5acd3da6..152e1faabe8f 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -158,6 +158,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= eProjectionMode) dumpProjectionModeAsAttribute(eProjectionMode); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ViewPoint"); + drawing::Position3D aViewPoint; + if(anotherAny >>= aViewPoint) + dumpViewPointAsElement(aViewPoint); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Origin"); + drawing::EnhancedCustomShapeParameterPair aOrigin; + if(anotherAny >>= aOrigin) + dumpOriginAsElement(aOrigin); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -347,4 +359,20 @@ void EnhancedShapeDumper::dumpProjectionModeAsAttribute(drawing::ProjectionMode } } +void EnhancedShapeDumper::dumpViewPointAsElement(drawing::Position3D aViewPoint) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ViewPoint" )); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("positionX"), "%f", aViewPoint.PositionX); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("positionY"), "%f", aViewPoint.PositionY); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("positionZ"), "%f", aViewPoint.PositionZ); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpOriginAsElement(drawing::EnhancedCustomShapeParameterPair aOrigin) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Origin" )); + dumpEnhancedCustomShapeParameterPair(aOrigin); + xmlTextWriterEndElement( xmlWriter ); +} + -- cgit From e307ee7cff96146fff43e2b9beb4282fb09b9227 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 21:26:01 +0200 Subject: Added dumping ExtrusionColor property Change-Id: I5df2f997494c399921a6657aecbb0d9a40977e93 --- drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 1 + drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index ed35546bd042..eaf7e9e01cd7 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -76,6 +76,7 @@ public: void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode); void dumpViewPointAsElement(com::sun::star::drawing::Position3D aViewPoint); void dumpOriginAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aOrigin); + void dumpExtrusionColorAsAttribute(sal_Bool bExtrusionColor); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 152e1faabe8f..51cacccf4fef 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -170,6 +170,12 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aOrigin) dumpOriginAsElement(aOrigin); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ExtrusionColor"); + sal_Bool bExtrusionColor; + if(anotherAny >>= bExtrusionColor) + dumpExtrusionColorAsAttribute(bExtrusionColor); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -375,4 +381,11 @@ void EnhancedShapeDumper::dumpOriginAsElement(drawing::EnhancedCustomShapeParame xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpExtrusionColorAsAttribute(sal_Bool bExtrusionColor) +{ + if(bExtrusionColor) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("extrusionColor"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("extrusionColor"), "%s", "false"); +} -- cgit From 62b1ad1d484786015be443145cf02b4943338275 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Tue, 3 Jul 2012 21:54:47 +0200 Subject: Fixed warning with incompatible arguments Change-Id: Id39143163a570a06020eecc5ddc5ec82c8d12f2c --- drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 51cacccf4fef..3006e370fbe8 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -201,7 +201,8 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(drawing::Enhanced xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); } - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aParameterPair.First.Type); + sal_Int32 aType = aParameterPair.First.Type; + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aType); xmlTextWriterEndElement( xmlWriter ); } { @@ -213,7 +214,8 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(drawing::Enhanced xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); } - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aParameterPair.Second.Type); + sal_Int32 aType = aParameterPair.First.Type; + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aType); xmlTextWriterEndElement( xmlWriter ); } } -- cgit From a2f212927728a4c0d8f2497b6d9335fc0cd37680 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 03:20:19 +0200 Subject: Added EnhancedCustomShapeGeometry service & Type property Change-Id: I38c60a10fc378a840f4bd267a9d6bec529906ca8 --- drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 4 ++++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 18 ++++++++++++++++++ drawinglayer/source/dumper/XShapeDumper.cxx | 5 +++++ 3 files changed, 27 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index eaf7e9e01cd7..a461a88e1634 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -78,6 +78,10 @@ public: void dumpOriginAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aOrigin); void dumpExtrusionColorAsAttribute(sal_Bool bExtrusionColor); + // EnhancedCustomShapeGeometry.idl + void dumpEnhancedCustomShapeGeometryService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); + void dumpTypeAsAttribute(rtl::OUString sType); + private: xmlTextWriterPtr xmlWriter; }; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 3006e370fbe8..10f7572d3adc 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -391,3 +391,21 @@ void EnhancedShapeDumper::dumpExtrusionColorAsAttribute(sal_Bool bExtrusionColor xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("extrusionColor"), "%s", "false"); } +// ------------------------------------------------------ +// ---------- EnhancedCustomShapeGeometry.idl ----------- +// ------------------------------------------------------ + +void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference< beans::XPropertySet > xPropSet) +{ + { + uno::Any anotherAny = xPropSet->getPropertyValue("Type"); + rtl::OUString sType; + if(anotherAny >>= sType) + dumpTypeAsAttribute(sType); + } +} +void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", + rtl::OUStringToOString(sType, RTL_TEXTENCODING_UTF8).getStr()); + } diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 7a3a18ac7e1d..24b9d12c75ea 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1818,7 +1818,12 @@ namespace { EnhancedShapeDumper enhancedDumper(xmlWriter); enhancedDumper.dumpEnhancedCustomShapeExtrusionService(xPropSet); } + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeGeometry")) + { + EnhancedShapeDumper enhancedDumper(xmlWriter); + enhancedDumper.dumpEnhancedCustomShapeGeometryService(xPropSet); } + } // end of the 'try' block catch (com::sun::star::beans::UnknownPropertyException &e) { printf("Problem in the XShapeDumper"); -- cgit 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 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 4 +++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 32 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) (limited to 'drawinglayer') 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 #include +#include + #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"); + } + + -- cgit From 0e135909696ba48df8ab7d132279526d9209f4d7 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 03:34:19 +0200 Subject: Added properties MirroredY & TextRotateAngle Change-Id: I46a6d47b7eeab91522c63364684532bc731f271e --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 25 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 74f434fa01ba..42cdd21ba2bd 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -85,6 +85,8 @@ public: void dumpTypeAsAttribute(rtl::OUString sType); void dumpViewBoxAsElement(com::sun::star::awt::Rectangle aViewBox); void dumpMirroredXAsAttribute(sal_Bool bMirroredX); + void dumpMirroredYAsAttribute(sal_Bool bMirroredY); + void dumpTextRotateAngleAsAttribute(double aTextRotateAngle); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 94970998582f..a79c8f4f7601 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -415,6 +415,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference< if(anotherAny >>= bMirroredX) dumpMirroredXAsAttribute(bMirroredX); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("MirroredY"); + sal_Bool bMirroredY; + if(anotherAny >>= bMirroredY) + dumpMirroredYAsAttribute(bMirroredY); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextRotateAngle"); + double aTextRotateAngle; + if(anotherAny >>= aTextRotateAngle) + dumpTextRotateAngleAsAttribute(aTextRotateAngle); + } } void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType) { @@ -440,4 +452,17 @@ void EnhancedShapeDumper::dumpMirroredXAsAttribute(sal_Bool bMirroredX) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredX"), "%s", "false"); } +void EnhancedShapeDumper::dumpMirroredYAsAttribute(sal_Bool bMirroredY) + { + if(bMirroredY) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "false"); + } + +void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle) + { + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle); + } + -- cgit From 2704fe3973e2e2d72183d2ca148b29aceab746d1 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 03:39:53 +0200 Subject: Added dumping property AdjustmentValues Change-Id: Iac59e89f3d7dd5e75ca43b43c19639880fc2b3d5 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 38 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 42cdd21ba2bd..375864a76f63 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -36,6 +36,7 @@ #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -87,6 +88,7 @@ public: void dumpMirroredXAsAttribute(sal_Bool bMirroredX); void dumpMirroredYAsAttribute(sal_Bool bMirroredY); void dumpTextRotateAngleAsAttribute(double aTextRotateAngle); + void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index a79c8f4f7601..7336db7c76e4 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -427,6 +427,12 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference< if(anotherAny >>= aTextRotateAngle) dumpTextRotateAngleAsAttribute(aTextRotateAngle); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("AdjustmentValues"); + uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues; + if(anotherAny >>= aAdjustmentValues) + dumpAdjustmentValuesAsElement(aAdjustmentValues); + } } void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType) { @@ -465,4 +471,36 @@ void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle); } +void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "AdjustmentValues" )); + sal_Int32 nLength = aAdjustmentValues.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeAdjustmentValue" )); + uno::Any aAny = aAdjustmentValues[i].Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + switch(aAdjustmentValues[i].State) + { + case beans::PropertyState_DIRECT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE"); + break; + case beans::PropertyState_DEFAULT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE"); + break; + case beans::PropertyState_AMBIGUOUS_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE"); + break; + default: + break; + } + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); + } -- cgit From 59fba39c076c90918d99aabf272f87385030f400 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 03:42:50 +0200 Subject: Added auxiliary method for dumping PropertyValue Change-Id: Ie060ea82bda32bd62ea0fa82da037a47a78f3bf9 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 32 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 375864a76f63..afa0d109b496 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -37,6 +37,7 @@ #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -54,6 +55,7 @@ public: // auxiliary functions void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D); + void dumpPropertyValueAsElement(com::sun::star::beans::PropertyValue aPropertyValue); // EnhancedCustomShapeExtrusion.idl void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 7336db7c76e4..8c6df680d865 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -504,3 +504,35 @@ void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing:: xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPropertyValue) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" )); + + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", + rtl::OUStringToOString(aPropertyValue.Name, RTL_TEXTENCODING_UTF8).getStr()); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("handle"), "%" SAL_PRIdINT32, aPropertyValue.Handle); + + uno::Any aAny = aPropertyValue.Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + switch(aPropertyValue.State) + { + case beans::PropertyState_DIRECT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE"); + break; + case beans::PropertyState_DEFAULT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE"); + break; + case beans::PropertyState_AMBIGUOUS_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE"); + break; + default: + break; + } + xmlTextWriterEndElement( xmlWriter ); + } + -- cgit From 1579148e83835b519c82add6b3a2e162b2875c73 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 03:50:09 +0200 Subject: Added Extrusion, Path & TextPath properties Change-Id: I46e7d6e0c83d8f988f2e5a5b9e7a10cbaef83958 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 3 + drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 187 +++++++++++++-------- 2 files changed, 122 insertions(+), 68 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index afa0d109b496..a7d26f649124 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -91,6 +91,9 @@ public: void dumpMirroredYAsAttribute(sal_Bool bMirroredY); void dumpTextRotateAngleAsAttribute(double aTextRotateAngle); void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues); + void dumpExtrusionAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aExtrusion); + void dumpPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aPath); + void dumpTextPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aTextPath); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 8c6df680d865..63fea5fcb1c6 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -433,93 +433,77 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference< if(anotherAny >>= aAdjustmentValues) dumpAdjustmentValuesAsElement(aAdjustmentValues); } -} -void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", - rtl::OUStringToOString(sType, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("Extrusion"); + uno::Sequence< beans::PropertyValue > aExtrusion; + if(anotherAny >>= aExtrusion) + dumpExtrusionAsElement(aExtrusion); } - -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 ); + uno::Any anotherAny = xPropSet->getPropertyValue("Path"); + uno::Sequence< beans::PropertyValue > aPath; + if(anotherAny >>= aPath) + dumpPathAsElement(aPath); } - -void EnhancedShapeDumper::dumpMirroredXAsAttribute(sal_Bool bMirroredX) { - if(bMirroredX) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredX"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredX"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("TextPath"); + uno::Sequence< beans::PropertyValue > aTextPath; + if(anotherAny >>= aTextPath) + dumpTextPathAsElement(aTextPath); } +} +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"); +} void EnhancedShapeDumper::dumpMirroredYAsAttribute(sal_Bool bMirroredY) - { - if(bMirroredY) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "false"); - } +{ + if(bMirroredY) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("mirroredY"), "%s", "false"); +} void EnhancedShapeDumper::dumpTextRotateAngleAsAttribute(double aTextRotateAngle) - { - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle); - } +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textRotateAngle"), "%f", aTextRotateAngle); +} void EnhancedShapeDumper::dumpAdjustmentValuesAsElement(uno::Sequence< drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "AdjustmentValues" )); + sal_Int32 nLength = aAdjustmentValues.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "AdjustmentValues" )); - sal_Int32 nLength = aAdjustmentValues.getLength(); - for (sal_Int32 i = 0; i < nLength; ++i) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeAdjustmentValue" )); - uno::Any aAny = aAdjustmentValues[i].Value; - rtl::OUString sValue; - if(aAny >>= sValue) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", - rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); - } - switch(aAdjustmentValues[i].State) - { - case beans::PropertyState_DIRECT_VALUE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE"); - break; - case beans::PropertyState_DEFAULT_VALUE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE"); - break; - case beans::PropertyState_AMBIGUOUS_VALUE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE"); - break; - default: - break; - } - xmlTextWriterEndElement( xmlWriter ); - } - xmlTextWriterEndElement( xmlWriter ); - } - -void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPropertyValue) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" )); - - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", - rtl::OUStringToOString(aPropertyValue.Name, RTL_TEXTENCODING_UTF8).getStr()); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("handle"), "%" SAL_PRIdINT32, aPropertyValue.Handle); - - uno::Any aAny = aPropertyValue.Value; + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeAdjustmentValue" )); + uno::Any aAny = aAdjustmentValues[i].Value; rtl::OUString sValue; if(aAny >>= sValue) { xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); } - switch(aPropertyValue.State) + switch(aAdjustmentValues[i].State) { case beans::PropertyState_DIRECT_VALUE: xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE"); @@ -535,4 +519,71 @@ void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPrope } xmlTextWriterEndElement( xmlWriter ); } + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpPropertyValueAsElement(beans::PropertyValue aPropertyValue) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" )); + + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", + rtl::OUStringToOString(aPropertyValue.Name, RTL_TEXTENCODING_UTF8).getStr()); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("handle"), "%" SAL_PRIdINT32, aPropertyValue.Handle); + + uno::Any aAny = aPropertyValue.Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + switch(aPropertyValue.State) + { + case beans::PropertyState_DIRECT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE"); + break; + case beans::PropertyState_DEFAULT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE"); + break; + case beans::PropertyState_AMBIGUOUS_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE"); + break; + default: + break; + } + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpExtrusionAsElement(uno::Sequence< beans::PropertyValue > aExtrusion) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Extrusion" )); + sal_Int32 nLength = aExtrusion.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + dumpPropertyValueAsElement(aExtrusion[i]); + } + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpPathAsElement(uno::Sequence< beans::PropertyValue > aPath) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Path" )); + sal_Int32 nLength = aPath.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + dumpPropertyValueAsElement(aPath[i]); + } + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpTextPathAsElement(uno::Sequence< beans::PropertyValue > aTextPath) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "TextPath" )); + sal_Int32 nLength = aTextPath.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + dumpPropertyValueAsElement(aTextPath[i]); + } + xmlTextWriterEndElement( xmlWriter ); +} -- cgit From 30b646a4cf8fc9a455b52f9b83ec08c68928adfc Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 04:07:27 +0200 Subject: Added Equations & Handles properties Change-Id: I7912399d2864c964483bbbbc0a6afac3bfa64f66 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 4 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 45 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index a7d26f649124..d58299a076ad 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -27,6 +27,7 @@ */ #include + #include #include #include @@ -38,6 +39,7 @@ #include #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -94,6 +96,8 @@ public: void dumpExtrusionAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aExtrusion); void dumpPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aPath); void dumpTextPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aTextPath); + void dumpEquationsAsElement(com::sun::star::uno::Sequence< rtl::OUString > aEquations); + void dumpHandlesAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValues > aHandles); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 63fea5fcb1c6..8556b3a61866 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -451,6 +451,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference< if(anotherAny >>= aTextPath) dumpTextPathAsElement(aTextPath); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Equations"); + uno::Sequence< rtl::OUString > aEquations; + if(anotherAny >>= aEquations) + dumpEquationsAsElement(aEquations); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Handles"); + uno::Sequence< beans::PropertyValues > aHandles; + if(anotherAny >>= aHandles) + dumpHandlesAsElement(aHandles); + } } void EnhancedShapeDumper::dumpTypeAsAttribute(rtl::OUString sType) { @@ -587,3 +599,36 @@ void EnhancedShapeDumper::dumpTextPathAsElement(uno::Sequence< beans::PropertyVa xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpEquationsAsElement(uno::Sequence< rtl::OUString > aEquations) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Equations" )); + sal_Int32 nLength = aEquations.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", + rtl::OUStringToOString(aEquations[i], RTL_TEXTENCODING_UTF8).getStr()); + } + xmlTextWriterEndElement( xmlWriter ); +} + +// PropertyValues specifies a sequence of PropertyValue instances. +// so in this case it's a Sequence of a Sequence of a PropertyValue instances. +// Welcome to Sequenception again. +void EnhancedShapeDumper::dumpHandlesAsElement(uno::Sequence< beans::PropertyValues > aHandles) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Handles" )); + sal_Int32 nSequenceLength = aHandles.getLength(); + for (sal_Int32 i = 0; i < nSequenceLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValues" )); + uno::Sequence< beans::PropertyValue > propertyValueSequence = aHandles[i]; + sal_Int32 nLength = propertyValueSequence.getLength(); + for (sal_Int32 j = 0; j < nLength; ++j) + { + dumpPropertyValueAsElement(propertyValueSequence[j]); + } + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} + -- cgit From e6238a9cd793c7d86b1290b1a09448a1547e37fc Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 14:14:38 +0200 Subject: Added dumping of EnhancedCustomShapeHandle service Change-Id: I0b9d2b7abd966bf4d8e1cf579fdc0cf319978a6e --- drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 7 +++++-- drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 8 ++++++++ drawinglayer/source/dumper/XShapeDumper.cxx | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index d58299a076ad..c4786ac0a856 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -89,8 +89,8 @@ public: 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); - void dumpMirroredYAsAttribute(sal_Bool bMirroredY); + void dumpMirroredXAsAttribute(sal_Bool bMirroredX); // also used in EnhancedCustomShapeHandle + void dumpMirroredYAsAttribute(sal_Bool bMirroredY); // also used in EnhancedCustomShapeHandle void dumpTextRotateAngleAsAttribute(double aTextRotateAngle); void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues); void dumpExtrusionAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aExtrusion); @@ -99,6 +99,9 @@ public: void dumpEquationsAsElement(com::sun::star::uno::Sequence< rtl::OUString > aEquations); void dumpHandlesAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValues > aHandles); + // EnhancedCustomShapeHandle.idl + void dumpEnhancedCustomShapeHandleService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); + private: xmlTextWriterPtr xmlWriter; }; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 8556b3a61866..698dcd1e89cd 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -632,3 +632,11 @@ void EnhancedShapeDumper::dumpHandlesAsElement(uno::Sequence< beans::PropertyVal xmlTextWriterEndElement( xmlWriter ); } +// ------------------------------------------------------ +// ---------- EnhancedCustomShapeHandle.idl ----------- +// ------------------------------------------------------ + +void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(uno::Reference< beans::XPropertySet > xPropSet) +{ + +} diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 24b9d12c75ea..c0dc89e6cd00 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1823,6 +1823,11 @@ namespace { EnhancedShapeDumper enhancedDumper(xmlWriter); enhancedDumper.dumpEnhancedCustomShapeGeometryService(xPropSet); } + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeHandle")) + { + EnhancedShapeDumper enhancedDumper(xmlWriter); + enhancedDumper.dumpEnhancedCustomShapeHandleService(xPropSet); + } } // end of the 'try' block catch (com::sun::star::beans::UnknownPropertyException &e) { -- cgit From a7cb63e3e772259ff86f8207651808a66fd4167f Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 14:16:15 +0200 Subject: Added dumping of MirroredX & MirroredY properties Change-Id: Ic580cf7c7c7d75c8f1fa0fbba13f53318b285932 --- drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 698dcd1e89cd..57546011b6a8 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -638,5 +638,16 @@ void EnhancedShapeDumper::dumpHandlesAsElement(uno::Sequence< beans::PropertyVal void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(uno::Reference< beans::XPropertySet > xPropSet) { - + { + uno::Any anotherAny = xPropSet->getPropertyValue("MirroredX"); + sal_Bool bMirroredX; + if(anotherAny >>= bMirroredX) + dumpMirroredXAsAttribute(bMirroredX); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("MirroredY"); + sal_Bool bMirroredY; + if(anotherAny >>= bMirroredY) + dumpMirroredYAsAttribute(bMirroredY); + } } -- cgit From bd6f8d3f9e21b149a42527e5d4f6e3252c6e2242 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 15:01:16 +0200 Subject: Added dumping of Switched & Position properties Change-Id: Ice30218ba8ec66807089174058951c7607f9b6cb --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 29 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index c4786ac0a856..9922f309086e 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -101,6 +101,8 @@ public: // EnhancedCustomShapeHandle.idl void dumpEnhancedCustomShapeHandleService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); + void dumpSwitchedAsAttribute(sal_Bool bSwitched); + void dumpPositionAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 57546011b6a8..4306b22fb487 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -650,4 +650,33 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(uno::Reference< b if(anotherAny >>= bMirroredY) dumpMirroredYAsAttribute(bMirroredY); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Switched"); + sal_Bool bSwitched; + if(anotherAny >>= bSwitched) + dumpSwitchedAsAttribute(bSwitched); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Position"); + drawing::EnhancedCustomShapeParameterPair aPosition; + if(anotherAny >>= aPosition) + dumpPositionAsElement(aPosition); + } +} + +void EnhancedShapeDumper::dumpSwitchedAsAttribute(sal_Bool bSwitched) +{ + if(bSwitched) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("switched"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("switched"), "%s", "false"); } + +void EnhancedShapeDumper::dumpPositionAsElement(drawing::EnhancedCustomShapeParameterPair aPosition) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Position" )); + dumpEnhancedCustomShapeParameterPair(aPosition); + xmlTextWriterEndElement( xmlWriter ); +} + + -- cgit From 13eb277734174c8bf07d603fef717004eafa79a0 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 15:07:36 +0200 Subject: Added dumping of Polar, RefX & RefY properties Change-Id: I43e690fef87091bdb47a36d3365df35b7e1fcdcb --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 35 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 9922f309086e..d0bca44d739f 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -103,6 +103,9 @@ public: void dumpEnhancedCustomShapeHandleService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpSwitchedAsAttribute(sal_Bool bSwitched); void dumpPositionAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition); + void dumpPolarAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPolar); + void dumpRefXAsAttribute(sal_Int32 aRefX); + void dumpRefYAsAttribute(sal_Int32 aRefY); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 4306b22fb487..5dc4f3e3d9d0 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -662,6 +662,24 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(uno::Reference< b if(anotherAny >>= aPosition) dumpPositionAsElement(aPosition); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Polar"); + drawing::EnhancedCustomShapeParameterPair aPolar; + if(anotherAny >>= aPolar) + dumpPolarAsElement(aPolar); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RefX"); + sal_Int32 aRefX; + if(anotherAny >>= aRefX) + dumpRefXAsAttribute(aRefX); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RefY"); + sal_Int32 aRefY; + if(anotherAny >>= aRefY) + dumpRefYAsAttribute(aRefY); + } } void EnhancedShapeDumper::dumpSwitchedAsAttribute(sal_Bool bSwitched) @@ -679,4 +697,21 @@ void EnhancedShapeDumper::dumpPositionAsElement(drawing::EnhancedCustomShapePara xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpPolarAsElement(drawing::EnhancedCustomShapeParameterPair aPolar) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Polar" )); + dumpEnhancedCustomShapeParameterPair(aPolar); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpRefXAsAttribute(sal_Int32 aRefX) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("refX"), "%" SAL_PRIdINT32, aRefX); +} + +void EnhancedShapeDumper::dumpRefYAsAttribute(sal_Int32 aRefY) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("refY"), "%" SAL_PRIdINT32, aRefY); +} + -- cgit From 3d15d7060c3490fbbee0c34ed54634ba7a34d456 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 15:10:02 +0200 Subject: Added dumping of RefAngle & RefR properties Change-Id: Iabd1c00a33477ca92d7525f46ad5a9c732a35eee --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 23 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index d0bca44d739f..72c39486b7d2 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -106,6 +106,8 @@ public: void dumpPolarAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPolar); void dumpRefXAsAttribute(sal_Int32 aRefX); void dumpRefYAsAttribute(sal_Int32 aRefY); + void dumpRefAngleAsAttribute(sal_Int32 aRefAngle); + void dumpRefRAsAttribute(sal_Int32 aRefR); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 5dc4f3e3d9d0..e3efe68c5ecd 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -680,6 +680,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(uno::Reference< b if(anotherAny >>= aRefY) dumpRefYAsAttribute(aRefY); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RefAngle"); + sal_Int32 aRefAngle; + if(anotherAny >>= aRefAngle) + dumpRefAngleAsAttribute(aRefAngle); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RefR"); + sal_Int32 aRefR; + if(anotherAny >>= aRefR) + dumpRefRAsAttribute(aRefR); + } } void EnhancedShapeDumper::dumpSwitchedAsAttribute(sal_Bool bSwitched) @@ -714,4 +726,15 @@ void EnhancedShapeDumper::dumpRefYAsAttribute(sal_Int32 aRefY) xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("refY"), "%" SAL_PRIdINT32, aRefY); } +void EnhancedShapeDumper::dumpRefAngleAsAttribute(sal_Int32 aRefAngle) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("refAngle"), "%" SAL_PRIdINT32, aRefAngle); +} + +void EnhancedShapeDumper::dumpRefRAsAttribute(sal_Int32 aRefR) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("refR"), "%" SAL_PRIdINT32, aRefR); +} + + -- cgit From 585c5e09b94d4b559383e8ffd105c4c5850b19db Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 15:12:57 +0200 Subject: Added auxiliary method for dumping EnhancedCustomShapeParameter Change-Id: Icef3d19c36224f4afd1b1a08c08630e5d6522bf6 --- drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 12 ++++++++++++ 2 files changed, 14 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 72c39486b7d2..322c61325775 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -40,6 +40,7 @@ #include #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -58,6 +59,7 @@ public: void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D); void dumpPropertyValueAsElement(com::sun::star::beans::PropertyValue aPropertyValue); + void dumpEnhancedCustomShapeParameter(com::sun::star::drawing::EnhancedCustomShapeParameter aParameter); // EnhancedCustomShapeExtrusion.idl void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index e3efe68c5ecd..3d2074714ed3 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -736,5 +736,17 @@ void EnhancedShapeDumper::dumpRefRAsAttribute(sal_Int32 aRefR) xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("refR"), "%" SAL_PRIdINT32, aRefR); } +void EnhancedShapeDumper::dumpEnhancedCustomShapeParameter(drawing::EnhancedCustomShapeParameter aParameter) +{ + uno::Any aAny = aParameter.Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + sal_Int32 aType = aParameter.Type; + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aType); +} -- cgit From 5c99514f4a47e81ff1de76711315471ec4794fd9 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 15:19:57 +0200 Subject: improval - Enhanced...ParameterPair() now use Enhanced...Parameter() Change-Id: Ib19d92241c6fcd0edc00680bd876f43dac8bd5c3 --- drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 3d2074714ed3..622b26e8ffa7 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -194,28 +194,12 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(drawing::Enhanced { { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "First" )); - uno::Any aAny = aParameterPair.First.Value; - rtl::OUString sValue; - if(aAny >>= sValue) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", - rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); - } - sal_Int32 aType = aParameterPair.First.Type; - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aType); + dumpEnhancedCustomShapeParameter(aParameterPair.First); xmlTextWriterEndElement( xmlWriter ); } { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Second" )); - uno::Any aAny = aParameterPair.Second.Value; - rtl::OUString sValue; - if(aAny >>= sValue) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", - rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); - } - sal_Int32 aType = aParameterPair.First.Type; - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aType); + dumpEnhancedCustomShapeParameter(aParameterPair.Second); xmlTextWriterEndElement( xmlWriter ); } } -- cgit From 3b5c45c72318e6ed614d2361a93acf43534dd122 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 15:26:33 +0200 Subject: Added dumping of RangeXMinimum & RangeXMaximum properties Change-Id: I5e5648a8aa4f8dd8942b87e36e5a85879d3ff0e8 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 26 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 322c61325775..a98e68597a36 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -110,6 +110,8 @@ public: void dumpRefYAsAttribute(sal_Int32 aRefY); void dumpRefAngleAsAttribute(sal_Int32 aRefAngle); void dumpRefRAsAttribute(sal_Int32 aRefR); + void dumpRangeXMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMinimum); + void dumpRangeXMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 622b26e8ffa7..e2e6d6417873 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -676,6 +676,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(uno::Reference< b if(anotherAny >>= aRefR) dumpRefRAsAttribute(aRefR); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RangeXMinimum"); + drawing::EnhancedCustomShapeParameter aRangeXMinimum; + if(anotherAny >>= aRangeXMinimum) + dumpRangeXMinimumAsElement(aRangeXMinimum); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RangeXMaximum"); + drawing::EnhancedCustomShapeParameter aRangeXMaximum; + if(anotherAny >>= aRangeXMaximum) + dumpRangeXMaximumAsElement(aRangeXMaximum); + } } void EnhancedShapeDumper::dumpSwitchedAsAttribute(sal_Bool bSwitched) @@ -733,4 +745,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeParameter(drawing::EnhancedCust xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aType); } +void EnhancedShapeDumper::dumpRangeXMinimumAsElement(drawing::EnhancedCustomShapeParameter aRangeXMinimum) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RangeXMinimum" )); + dumpEnhancedCustomShapeParameter(aRangeXMinimum); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpRangeXMaximumAsElement(drawing::EnhancedCustomShapeParameter aRangeXMaximum) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RangeXMaximum" )); + dumpEnhancedCustomShapeParameter(aRangeXMaximum); + xmlTextWriterEndElement( xmlWriter ); +} + -- cgit From d88f5256e791a53169a8dbc399ec3a141e45f606 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 15:29:38 +0200 Subject: Added dumping of RangeYMinimum & RangeYMaximum properties Change-Id: I9ce489487676bd3182c6bdd4ce3969544d40c2ae --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 25 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index a98e68597a36..e2f43dab2ed6 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -112,6 +112,8 @@ public: void dumpRefRAsAttribute(sal_Int32 aRefR); void dumpRangeXMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMinimum); void dumpRangeXMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum); + void dumpRangeYMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeYMinimum); + void dumpRangeYMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index e2e6d6417873..cf8ecedaf1da 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -688,6 +688,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(uno::Reference< b if(anotherAny >>= aRangeXMaximum) dumpRangeXMaximumAsElement(aRangeXMaximum); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RangeYMinimum"); + drawing::EnhancedCustomShapeParameter aRangeYMinimum; + if(anotherAny >>= aRangeYMinimum) + dumpRangeYMinimumAsElement(aRangeYMinimum); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RangeYMaximum"); + drawing::EnhancedCustomShapeParameter aRangeYMaximum; + if(anotherAny >>= aRangeYMaximum) + dumpRangeYMaximumAsElement(aRangeYMaximum); + } } void EnhancedShapeDumper::dumpSwitchedAsAttribute(sal_Bool bSwitched) @@ -759,4 +771,17 @@ void EnhancedShapeDumper::dumpRangeXMaximumAsElement(drawing::EnhancedCustomShap xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpRangeYMinimumAsElement(drawing::EnhancedCustomShapeParameter aRangeYMinimum) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RangeYMinimum" )); + dumpEnhancedCustomShapeParameter(aRangeYMinimum); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpRangeYMaximumAsElement(drawing::EnhancedCustomShapeParameter aRangeYMaximum) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RangeYMaximum" )); + dumpEnhancedCustomShapeParameter(aRangeYMaximum); + xmlTextWriterEndElement( xmlWriter ); +} -- cgit From 3ab020c12995305b613bdc2f75bde33c761e3244 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 15:32:32 +0200 Subject: Added dumping of RadiusRangeMinimum & RadiusRangeMaximum properties Change-Id: I8ba86df74939d1267c8be622d29c8fdcea9cdb19 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 26 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index e2f43dab2ed6..a93a5248b59b 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -114,6 +114,8 @@ public: void dumpRangeXMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum); void dumpRangeYMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeYMinimum); void dumpRangeYMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum); + void dumpRadiusRangeMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum); + void dumpRadiusRangeMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index cf8ecedaf1da..5f5591321487 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -700,6 +700,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeHandleService(uno::Reference< b if(anotherAny >>= aRangeYMaximum) dumpRangeYMaximumAsElement(aRangeYMaximum); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RadiusRangeMinimum"); + drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum; + if(anotherAny >>= aRadiusRangeMinimum) + dumpRadiusRangeMinimumAsElement(aRadiusRangeMinimum); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RadiusRangeMaximum"); + drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum; + if(anotherAny >>= aRadiusRangeMaximum) + dumpRadiusRangeMaximumAsElement(aRadiusRangeMaximum); + } } void EnhancedShapeDumper::dumpSwitchedAsAttribute(sal_Bool bSwitched) @@ -785,3 +797,17 @@ void EnhancedShapeDumper::dumpRangeYMaximumAsElement(drawing::EnhancedCustomShap xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpRadiusRangeMinimumAsElement(drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RadiusRangeMinimum" )); + dumpEnhancedCustomShapeParameter(aRadiusRangeMinimum); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpRadiusRangeMaximumAsElement(drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RadiusRangeMaximum" )); + dumpEnhancedCustomShapeParameter(aRadiusRangeMaximum); + xmlTextWriterEndElement( xmlWriter ); +} + -- cgit From be89451450580eb5f79e97d33bb5885e764c7c79 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 17:45:11 +0200 Subject: Started dumping of EnhancedCustomShapePath service Change-Id: I11ded0e19f4a9f619546af2ff838ad7aeadd7429 --- drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 3 +++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 8 ++++++++ drawinglayer/source/dumper/XShapeDumper.cxx | 5 +++++ 3 files changed, 16 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index a93a5248b59b..74947ca11e5e 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -117,6 +117,9 @@ public: void dumpRadiusRangeMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum); void dumpRadiusRangeMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum); + // EnhancedCustomShapePath.idl + void dumpEnhancedCustomShapePathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); + private: xmlTextWriterPtr xmlWriter; }; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 5f5591321487..e7940a28e65d 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -811,3 +811,11 @@ void EnhancedShapeDumper::dumpRadiusRangeMaximumAsElement(drawing::EnhancedCusto xmlTextWriterEndElement( xmlWriter ); } +// ------------------------------------------------------ +// ---------- EnhancedCustomShapePath.idl --------------- +// ------------------------------------------------------ + +void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< beans::XPropertySet > xPropSet) +{ + +} diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index c0dc89e6cd00..c1c89418a2ca 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1828,6 +1828,11 @@ namespace { EnhancedShapeDumper enhancedDumper(xmlWriter); enhancedDumper.dumpEnhancedCustomShapeHandleService(xPropSet); } + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapePath")) + { + EnhancedShapeDumper enhancedDumper(xmlWriter); + enhancedDumper.dumpEnhancedCustomShapePathService(xPropSet); + } } // end of the 'try' block catch (com::sun::star::beans::UnknownPropertyException &e) { -- cgit From 7cb81fc2ebccbf607bf0d08d65f74bb43a83d1ea Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 17:57:42 +0200 Subject: Added dumping of Coordinates & Segments properties Change-Id: I4acfe9f1d1ca9bb4f434376bd6fd23804b66a25f --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 4 +++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 42 ++++++++++++++++++++++ 2 files changed, 46 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 74947ca11e5e..6742021ef064 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -42,6 +42,8 @@ #include #include +#include + #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -119,6 +121,8 @@ public: // EnhancedCustomShapePath.idl void dumpEnhancedCustomShapePathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); + void dumpCoordinatesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates); + void dumpSegmentsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index e7940a28e65d..dbb7f5653264 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -817,5 +817,47 @@ void EnhancedShapeDumper::dumpRadiusRangeMaximumAsElement(drawing::EnhancedCusto void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< beans::XPropertySet > xPropSet) { + { + uno::Any anotherAny = xPropSet->getPropertyValue("Coordinates"); + uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates; + if(anotherAny >>= aCoordinates) + dumpCoordinatesAsElement(aCoordinates); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Segments"); + uno::Sequence< drawing::EnhancedCustomShapeSegment > aSegments; + if(anotherAny >>= aSegments) + dumpSegmentsAsElement(aSegments); + } +} +void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Coordinates" )); + sal_Int32 nLength = aCoordinates.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeParameterPair" )); + dumpEnhancedCustomShapeParameterPair(aCoordinates[i]); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); } + +void EnhancedShapeDumper::dumpSegmentsAsElement(uno::Sequence< drawing::EnhancedCustomShapeSegment > aSegments) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Segments" )); + sal_Int32 nLength = aSegments.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeSegment" )); + sal_Int32 aCommand = aSegments[i].Command; + sal_Int32 aCount = aSegments[i].Count; + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("command"), "%" SAL_PRIdINT32, aCommand); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("count"), "%" SAL_PRIdINT32, aCount); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} + + -- cgit From 4b4ca8030285bd66526ff5bb2b6ea5a75a6c6bc7 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 18:30:48 +0200 Subject: Added dumping of StretchX & StretchY properties Change-Id: Iddd10cb3baffbb3f40bd6af15e48bcfb7ea8317e --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 6742021ef064..982348357432 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -123,6 +123,8 @@ public: void dumpEnhancedCustomShapePathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpCoordinatesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates); void dumpSegmentsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments); + void dumpStretchXAsAttribute(sal_Int32 aStretchX); + void dumpStretchYAsAttribute(sal_Int32 aStretchY); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index dbb7f5653264..a461c47190e7 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -829,6 +829,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< bea if(anotherAny >>= aSegments) dumpSegmentsAsElement(aSegments); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("StretchX"); + sal_Int32 aStretchX; + if(anotherAny >>= aStretchX) + dumpStretchXAsAttribute(aStretchX); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("StretchY"); + sal_Int32 aStretchY; + if(anotherAny >>= aStretchY) + dumpStretchYAsAttribute(aStretchY); + } } void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) @@ -860,4 +872,14 @@ void EnhancedShapeDumper::dumpSegmentsAsElement(uno::Sequence< drawing::Enhanced xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpStretchXAsAttribute(sal_Int32 aStretchX) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stretchX"), "%" SAL_PRIdINT32, aStretchX); +} + +void EnhancedShapeDumper::dumpStretchYAsAttribute(sal_Int32 aStretchY) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stretchY"), "%" SAL_PRIdINT32, aStretchY); +} + -- cgit From 85ff400da59a8bb0ab64d2676696fddcd5714858 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 18:52:04 +0200 Subject: Added dumping of TextFrames & GluePoints properties Change-Id: Ibaa5f782d511d406575bfec6267f95d6ae50b87c --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 46 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 982348357432..894e530bbc08 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -43,6 +43,7 @@ #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -125,6 +126,8 @@ public: void dumpSegmentsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments); void dumpStretchXAsAttribute(sal_Int32 aStretchX); void dumpStretchYAsAttribute(sal_Int32 aStretchY); + void dumpTextFramesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames); + void dumpGluePointsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index a461c47190e7..ca532d15cac9 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -841,6 +841,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< bea if(anotherAny >>= aStretchY) dumpStretchYAsAttribute(aStretchY); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextFrames"); + uno::Sequence< drawing::EnhancedCustomShapeTextFrame > aTextFrames; + if(anotherAny >>= aTextFrames) + dumpTextFramesAsElement(aTextFrames); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("GluePoints"); + uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aGluePoints; + if(anotherAny >>= aGluePoints) + dumpGluePointsAsElement(aGluePoints); + } } void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) @@ -882,4 +894,38 @@ void EnhancedShapeDumper::dumpStretchYAsAttribute(sal_Int32 aStretchY) xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stretchY"), "%" SAL_PRIdINT32, aStretchY); } +void EnhancedShapeDumper::dumpTextFramesAsElement(uno::Sequence< drawing::EnhancedCustomShapeTextFrame > aTextFrames) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "TextFrames" )); + sal_Int32 nLength = aTextFrames.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeTextFrame" )); + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "TopLeft" )); + dumpEnhancedCustomShapeParameterPair(aTextFrames[i].TopLeft); + xmlTextWriterEndElement( xmlWriter ); + + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "BottomRight" )); + dumpEnhancedCustomShapeParameterPair(aTextFrames[i].BottomRight); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpGluePointsAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aGluePoints) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "GluePoints" )); + sal_Int32 nLength = aGluePoints.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "EnhancedCustomShapeParameterPair" )); + dumpEnhancedCustomShapeParameterPair(aGluePoints[i]); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} + -- cgit From 8b79eeb8181e459c6fa82847f9d5ec36cc06f998 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 18:56:28 +0200 Subject: Added dumping of GluePointLeavingDirections & GluePointType properties Change-Id: Ie83dfd31196cc9777e4d582f45f27ff74482d2b4 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 28 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 894e530bbc08..4beef8fd858f 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -128,6 +128,8 @@ public: void dumpStretchYAsAttribute(sal_Int32 aStretchY); void dumpTextFramesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames); void dumpGluePointsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints); + void dumpGluePointLeavingDirectionsAsElement(com::sun::star::uno::Sequence< double > aGluePointLeavingDirections); + void dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index ca532d15cac9..a3a34791439a 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -853,6 +853,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< bea if(anotherAny >>= aGluePoints) dumpGluePointsAsElement(aGluePoints); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("GluePointLeavingDirections"); + uno::Sequence< double > aGluePointLeavingDirections; + if(anotherAny >>= aGluePointLeavingDirections) + dumpGluePointLeavingDirectionsAsElement(aGluePointLeavingDirections); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("GluePointType"); + sal_Int32 aGluePointType; + if(anotherAny >>= aGluePointType) + dumpGluePointTypeAsAttribute(aGluePointType); + } } void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) @@ -928,4 +940,20 @@ void EnhancedShapeDumper::dumpGluePointsAsElement(uno::Sequence< drawing::Enhanc xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpGluePointLeavingDirectionsAsElement(uno::Sequence< double > aGluePointLeavingDirections) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "GluePointLeavingDirections" )); + sal_Int32 nLength = aGluePointLeavingDirections.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("value"), "%f", aGluePointLeavingDirections[i]); + } + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("gluePointType"), "%" SAL_PRIdINT32, aGluePointType); +} + -- cgit From 72fc403a6f90a7b4db5956acf2a572856aee9f7b Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 18:58:29 +0200 Subject: Added dumping of ExtrusionAllowed & ConcentricGradientFillAllowed properties Change-Id: I696c7bfc6f0f7e50d0f0ae84a9e96c6b2f1bd554 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 2 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 28 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 4beef8fd858f..11cb4295aee8 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -130,6 +130,8 @@ public: void dumpGluePointsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints); void dumpGluePointLeavingDirectionsAsElement(com::sun::star::uno::Sequence< double > aGluePointLeavingDirections); void dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType); + void dumpExtrusionAllowedAsAttribute(sal_Bool bExtrusionAllowed); + void dumpConcentricGradientFillAllowedAsAttribute(sal_Bool bConcentricGradientFillAllowed); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index a3a34791439a..40203097b680 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -865,6 +865,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< bea if(anotherAny >>= aGluePointType) dumpGluePointTypeAsAttribute(aGluePointType); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ExtrusionAllowed"); + sal_Bool bExtrusionAllowed; + if(anotherAny >>= bExtrusionAllowed) + dumpExtrusionAllowedAsAttribute(bExtrusionAllowed); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ConcentricGradientFillAllowed"); + sal_Bool bConcentricGradientFillAllowed; + if(anotherAny >>= bConcentricGradientFillAllowed) + dumpConcentricGradientFillAllowedAsAttribute(bConcentricGradientFillAllowed); + } } void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) @@ -956,4 +968,20 @@ void EnhancedShapeDumper::dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType) xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("gluePointType"), "%" SAL_PRIdINT32, aGluePointType); } +void EnhancedShapeDumper::dumpExtrusionAllowedAsAttribute(sal_Bool bExtrusionAllowed) +{ + if(bExtrusionAllowed) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("extrusionAllowed"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("extrusionAllowed"), "%s", "false"); +} + +void EnhancedShapeDumper::dumpConcentricGradientFillAllowedAsAttribute(sal_Bool bConcentricGradientFillAllowed) +{ + if(bConcentricGradientFillAllowed) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("concentricGradientFillAllowed"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("concentricGradientFillAllowed"), "%s", "false"); +} + -- cgit From cf7e4d3cedaee86da6887ff068565185fee4874a Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 19:01:54 +0200 Subject: Added dumping of TextPathAllowed & SubViewSize properties Change-Id: I4088e15cf010f2c0c4493b9a7781c9720d375480 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 3 ++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 32 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 11cb4295aee8..74c231cfb484 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -44,6 +44,7 @@ #include #include +#include #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -132,6 +133,8 @@ public: void dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType); void dumpExtrusionAllowedAsAttribute(sal_Bool bExtrusionAllowed); void dumpConcentricGradientFillAllowedAsAttribute(sal_Bool bConcentricGradientFillAllowed); + void dumpTextPathAllowedAsAttribute(sal_Bool bTextPathAllowed); + void dumpSubViewSizeAsElement(com::sun::star::uno::Sequence< com::sun::star::awt::Size > aSubViewSize); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 40203097b680..735919b16cbc 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -877,6 +877,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapePathService(uno::Reference< bea if(anotherAny >>= bConcentricGradientFillAllowed) dumpConcentricGradientFillAllowedAsAttribute(bConcentricGradientFillAllowed); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("TextPathAllowed"); + sal_Bool bTextPathAllowed; + if(anotherAny >>= bTextPathAllowed) + dumpTextPathAllowedAsAttribute(bTextPathAllowed); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SubViewSize"); + uno::Sequence< awt::Size > aSubViewSize; + if(anotherAny >>= aSubViewSize) + dumpSubViewSizeAsElement(aSubViewSize); + } } void EnhancedShapeDumper::dumpCoordinatesAsElement(uno::Sequence< drawing::EnhancedCustomShapeParameterPair > aCoordinates) @@ -984,4 +996,24 @@ void EnhancedShapeDumper::dumpConcentricGradientFillAllowedAsAttribute(sal_Bool xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("concentricGradientFillAllowed"), "%s", "false"); } +void EnhancedShapeDumper::dumpTextPathAllowedAsAttribute(sal_Bool bTextPathAllowed) +{ + if(bTextPathAllowed) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPathAllowed"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textPathAllowed"), "%s", "false"); +} +void EnhancedShapeDumper::dumpSubViewSizeAsElement(uno::Sequence< awt::Size > aSubViewSize) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "SubViewSize" )); + sal_Int32 nLength = aSubViewSize.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Size" )); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aSubViewSize[i].Width); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aSubViewSize[i].Height); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} -- cgit 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 From f48bd974cb652d28d7a80a9084f75c1daaadac50 Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Wed, 4 Jul 2012 19:10:45 +0200 Subject: Added dumping TextPathMode & ScaleX properties Change-Id: Ib31fc84424d4a57e8f3bcca2054016c5809b6f10 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 4 +++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 37 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 7fc85597dc9e..7bad73c7e497 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -46,6 +46,8 @@ #include #include +#include + #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 a880d6b3972c..7ecbb3c5f1ab 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"); +} -- cgit From c19a6dfa7bd0bce580c91d4073686a631c12b255 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 12 Jul 2012 00:59:24 +0200 Subject: some small improvements for the dumper Change-Id: I0a24a0e9c4a3b818c9144bc38857b67e49483915 --- drawinglayer/source/dumper/XShapeDumper.cxx | 87 ++++++++++++++--------------- 1 file changed, 41 insertions(+), 46 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 1503bbe28230..d42e9441da09 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -53,7 +53,7 @@ namespace { // auxiliary functions void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); - void dumpPointSequenceSequence(com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence, xmlTextWriterPtr xmlWriter); + void dumpPointSequenceSequence(com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence, uno::Sequence >*, xmlTextWriterPtr xmlWriter); // FillProperties.idl void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); @@ -567,44 +567,7 @@ namespace { void dumpPolyPolygonBezierCoords(drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter) { - // dumps first field - Coordinates - dumpPointSequenceSequence(aPolyPolygonBezierCoords.Coordinates, xmlWriter); - - // dumps second field - Flags - uno::Sequence > polygonFlagsSequenceSequence = aPolyPolygonBezierCoords.Flags; - sal_Int32 nFlagsSequence = polygonFlagsSequenceSequence.getLength(); - for (sal_Int32 i = 0; i < nFlagsSequence; ++i) - { - uno::Sequence< drawing::PolygonFlags > polygonFlagsSequence = polygonFlagsSequenceSequence[i]; - sal_Int32 nFlags = polygonFlagsSequence.getLength(); - - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "flagsSequence" )); - - for (sal_Int32 j = 0; j < nFlags; ++j) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "polygonFlags" )); - switch(polygonFlagsSequence[j]) - { - case drawing::PolygonFlags_NORMAL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "NORMAL"); - break; - case drawing::PolygonFlags_SMOOTH: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SMOOTH"); - break; - case drawing::PolygonFlags_CONTROL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "CONTROL"); - break; - case drawing::PolygonFlags_SYMMETRIC: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SYMMETRIC"); - break; - default: - break; - } - xmlTextWriterEndElement( xmlWriter ); - } - xmlTextWriterEndElement( xmlWriter ); - } - + dumpPointSequenceSequence(aPolyPolygonBezierCoords.Coordinates, &aPolyPolygonBezierCoords.Flags, xmlWriter); } void dumpLineStartAsElement(drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter) @@ -687,16 +650,21 @@ namespace { } } - void dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence, xmlTextWriterPtr xmlWriter) + void dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence, uno::Sequence >* pFlags, xmlTextWriterPtr xmlWriter) { // LibreOffice proudly presents - The Sequenception uno::Sequence > pointSequenceSequence = aPointSequenceSequence; sal_Int32 nPointsSequence = pointSequenceSequence.getLength(); + for (sal_Int32 i = 0; i < nPointsSequence; ++i) { uno::Sequence< awt::Point > pointSequence = pointSequenceSequence[i]; sal_Int32 nPoints = pointSequence.getLength(); + uno::Sequence< drawing::PolygonFlags> flagsSequence; + if(pFlags) + flagsSequence = (*pFlags)[i]; + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "pointSequence" )); for(sal_Int32 j = 0; j < nPoints; ++j) @@ -704,6 +672,28 @@ namespace { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "point" )); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, pointSequence[j].X); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, pointSequence[j].Y); + + if(pFlags) + { + switch(flagsSequence[j]) + { + case drawing::PolygonFlags_NORMAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "NORMAL"); + break; + case drawing::PolygonFlags_SMOOTH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SMOOTH"); + break; + case drawing::PolygonFlags_CONTROL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "CONTROL"); + break; + case drawing::PolygonFlags_SYMMETRIC: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SYMMETRIC"); + break; + default: + break; + } + } + xmlTextWriterEndElement( xmlWriter ); } xmlTextWriterEndElement( xmlWriter ); @@ -713,14 +703,14 @@ namespace { void dumpPolyPolygonAsElement(drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygon" )); - dumpPointSequenceSequence(aPolyPolygon, xmlWriter); + dumpPointSequenceSequence(aPolyPolygon, NULL, xmlWriter); xmlTextWriterEndElement( xmlWriter ); } void dumpGeometryAsElement(drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter) { xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" )); - dumpPointSequenceSequence(aGeometry, xmlWriter); + dumpPointSequenceSequence(aGeometry, NULL, xmlWriter); xmlTextWriterEndElement( xmlWriter ); } @@ -1767,12 +1757,17 @@ namespace { uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW ); uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames(); - uno::Any aAny = xPropSet->getPropertyValue("Name"); - if (aAny >>= aName) + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); + if(xInfo->hasPropertyByName("Name")) { - if (!aName.isEmpty()) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any aAny = xPropSet->getPropertyValue("Name"); + if (aAny >>= aName) + { + if (!aName.isEmpty()) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr()); + } } + try { if (xServiceInfo->supportsService("com.sun.star.drawing.Text")) -- cgit From ea7cce1dd0a077322fa152e6bb1300b0ca129d61 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 12 Jul 2012 01:28:01 +0200 Subject: fix indentation don't indent after namespace declaration Change-Id: I3773521abd2463269c58162eae6a608085b1bf9f --- drawinglayer/source/dumper/XShapeDumper.cxx | 3208 +++++++++++++-------------- 1 file changed, 1604 insertions(+), 1604 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index d42e9441da09..7c31bb9281f2 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -41,1847 +41,1847 @@ using namespace com::sun::star; //class XShapeDumper - XShapeDumper::XShapeDumper() - { +XShapeDumper::XShapeDumper() +{ - } +} namespace { // FUNCTION DECLARATIONS - // auxiliary functions - void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); - void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); - void dumpPointSequenceSequence(com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence, uno::Sequence >*, xmlTextWriterPtr xmlWriter); - - // FillProperties.idl - void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); - void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); - void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); - void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter); - void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); - void dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter); - void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); - void dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter); - void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter); - void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapAsElement(com::sun::star::uno::Reference xBitmap, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapModeAsAttribute(com::sun::star::drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter); - void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter); - - // LineProperties.idl - void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter); - void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter); - void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter); - void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter); - void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter); - void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter); - void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter); - void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter); - void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter); - void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter); - void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter); - void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter); - void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter); - void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter); - void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter); - - // PolyPolygonDescriptor.idl - void dumpPolygonKindAsAttribute(com::sun::star::drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter); - void dumpPolyPolygonAsElement(com::sun::star::drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter); - void dumpGeometryAsElement(com::sun::star::drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter); - - // TextProperties.idl - void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter); - void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter); - void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter); - void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter); - void dumpTextFitToSizeAsAttribute(com::sun::star::drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter); - void dumpTextHorizontalAdjustAsAttribute(com::sun::star::drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter); - void dumpTextVerticalAdjustAsAttribute(com::sun::star::drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter); - void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter); - void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter); - void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter); - void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter); - void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter); - void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter); - void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter); - void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationDirectionAsAttribute(com::sun::star::drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationKindAsAttribute(com::sun::star::drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter); - void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter); - void dumpTextWritingModeAsAttribute(com::sun::star::text::WritingMode eWritingMode, xmlTextWriterPtr xmlWriter); - - // ShadowProperties.idl - void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter); - void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter); - void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter); - void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter); - void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter); - - //Shape.idl - void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter); - void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter); - void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter); - void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter); - void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter); - void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter); - void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter); - void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter); - void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter); - void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter); - void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter); - void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter); - - // PolyPolygonBezierDescriptor.idl - void dumpPolyPolygonBezierAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter); - void dumpGeometryAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter); - - // CustomShape.idl - void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter); - void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter); - void dumpCustomShapeGeometryAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter); - void dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter); - - // XShape.idl - void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); - void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); - - // the rest - void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); - void dumpXShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, xmlTextWriterPtr xmlWriter); - void dumpXShapes( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); - void dumpTextPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpFillPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpLinePropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpShadowPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpPolyPolygonDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - void dumpCustomShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); - - - int writeCallback(void* pContext, const char* sBuffer, int nLen) - { - rtl::OStringBuffer* pBuffer = static_cast(pContext); - pBuffer->append(sBuffer); - return nLen; - } - - int closeCallback(void* ) - { - return 0; - } - - // ---------------------------------------- - // ---------- FillProperties.idl ---------- - // ---------------------------------------- - void dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter) - { - switch(eFillStyle) +// auxiliary functions +void dumpGradientProperty(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); +void dumpPolyPolygonBezierCoords(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter); +void dumpPointSequenceSequence(com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence, uno::Sequence >*, xmlTextWriterPtr xmlWriter); + +// FillProperties.idl +void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter); +void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter); +void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter); +void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter); +void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter); +void dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter); +void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter); +void dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter); +void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter); +void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapAsElement(com::sun::star::uno::Reference xBitmap, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapRectanglePointAsAttribute(com::sun::star::drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapModeAsAttribute(com::sun::star::drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter); +void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter); + +// LineProperties.idl +void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter); +void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter); +void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter); +void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter); +void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter); +void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter); +void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter); +void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter); +void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter); +void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter); +void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter); +void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter); +void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter); +void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter); +void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter); + +// PolyPolygonDescriptor.idl +void dumpPolygonKindAsAttribute(com::sun::star::drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter); +void dumpPolyPolygonAsElement(com::sun::star::drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter); +void dumpGeometryAsElement(com::sun::star::drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter); + +// TextProperties.idl +void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter); +void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter); +void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter); +void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter); +void dumpTextFitToSizeAsAttribute(com::sun::star::drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter); +void dumpTextHorizontalAdjustAsAttribute(com::sun::star::drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter); +void dumpTextVerticalAdjustAsAttribute(com::sun::star::drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter); +void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter); +void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter); +void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter); +void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter); +void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter); +void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter); +void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter); +void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter); +void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter); +void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter); +void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter); +void dumpTextAnimationDirectionAsAttribute(com::sun::star::drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter); +void dumpTextAnimationKindAsAttribute(com::sun::star::drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter); +void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter); +void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter); +void dumpTextWritingModeAsAttribute(com::sun::star::text::WritingMode eWritingMode, xmlTextWriterPtr xmlWriter); + +// ShadowProperties.idl +void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter); +void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter); +void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter); +void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter); +void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter); + +//Shape.idl +void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter); +void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter); +void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter); +void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter); +void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter); +void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter); +void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter); +void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter); +void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter); +void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter); +void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter); +void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter); + +// PolyPolygonBezierDescriptor.idl +void dumpPolyPolygonBezierAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter); +void dumpGeometryAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter); + +// CustomShape.idl +void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter); +void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter); +void dumpCustomShapeGeometryAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter); +void dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter); + +// XShape.idl +void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter); +void dumpSizeAsAttribute(const com::sun::star::awt::Size& rSize, xmlTextWriterPtr xmlWriter); + +// the rest +void dumpShapeDescriptorAsAttribute( com::sun::star::uno::Reference< com::sun::star::drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ); +void dumpXShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, xmlTextWriterPtr xmlWriter); +void dumpXShapes( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ); +void dumpTextPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); +void dumpFillPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); +void dumpLinePropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); +void dumpShadowPropertiesService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); +void dumpPolyPolygonDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); +void dumpShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); +void dumpPolyPolygonBezierDescriptorService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); +void dumpCustomShapeService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter); + + +int writeCallback(void* pContext, const char* sBuffer, int nLen) +{ + rtl::OStringBuffer* pBuffer = static_cast(pContext); + pBuffer->append(sBuffer); + return nLen; +} + +int closeCallback(void* ) +{ + return 0; +} + +// ---------------------------------------- +// ---------- FillProperties.idl ---------- +// ---------------------------------------- +void dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter) +{ + switch(eFillStyle) + { + case drawing::FillStyle_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "NONE"); + break; + case drawing::FillStyle_SOLID: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "SOLID"); + break; + case drawing::FillStyle_GRADIENT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "GRADIENT"); + break; + case drawing::FillStyle_HATCH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "HATCH"); + break; + case drawing::FillStyle_BITMAP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "BITMAP"); + break; + default: + break; + } +} + +void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillColor"), "%" SAL_PRIdINT32, aColor); +} + +void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32, aTransparence); +} + +void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s", + rtl::OUStringToOString(sTranspGradName, RTL_TEXTENCODING_UTF8).getStr()); +} + +//because there's more awt::Gradient properties to dump +void dumpGradientProperty(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) +{ + switch(aGradient.Style) //enum GradientStyle + { + case awt::GradientStyle_LINEAR: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "LINEAR"); + break; + case awt::GradientStyle_AXIAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "AXIAL"); + break; + case awt::GradientStyle_RADIAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RADIAL"); + break; + case awt::GradientStyle_ELLIPTICAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ELLIPTICAL"); + break; + case awt::GradientStyle_SQUARE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "SQUARE"); + break; + case awt::GradientStyle_RECT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT"); + break; + default: + break; + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startColor"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StartColor); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endColor"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.EndColor); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.Angle); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("border"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.Border); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("xOffset"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.XOffset); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("yOffset"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.YOffset); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StartIntensity); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.EndIntensity); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StepCount); +} + +void dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillTransparenceGradient" )); + dumpGradientProperty(aTranspGrad, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s", + rtl::OUStringToOString(sGradName, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpFillGradientAsElement(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillGradient" )); + dumpGradientProperty(aGradient, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillHatchName"), "%s", + rtl::OUStringToOString(sHatchName, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpFillHatchAsElement(drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillHatch" )); + switch(aHatch.Style) + { + case drawing::HatchStyle_SINGLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "SINGLE"); + break; + case drawing::HatchStyle_DOUBLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "DOUBLE"); + break; + case drawing::HatchStyle_TRIPLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "TRIPLE"); + break; + default: + break; + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("color"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Color); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Distance); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Angle); + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter) +{ + if(bBackground) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "false"); +} + +void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s", + rtl::OUStringToOString(sBitmapName, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpFillBitmapAsElement(uno::Reference xBitmap, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillBitmap" )); + if (xBitmap.is()) + { + awt::Size const aSize = xBitmap->getSize(); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aSize.Width); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aSize.Height); + } + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapURL"), "%s", + rtl::OUStringToOString(sBitmapURL, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetX"), "%" SAL_PRIdINT32, aBitmapPositionOffsetX); +} + +void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetY"), "%" SAL_PRIdINT32, aBitmapPositionOffsetY); +} + +void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetX"), "%" SAL_PRIdINT32, aBitmapOffsetX); +} + +void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetY"), "%" SAL_PRIdINT32, aBitmapOffsetY); +} + +void dumpFillBitmapRectanglePointAsAttribute(drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter) +{ + switch(eBitmapRectanglePoint) + { + case drawing::RectanglePoint_LEFT_TOP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_TOP"); + break; + case drawing::RectanglePoint_MIDDLE_TOP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_TOP"); + break; + case drawing::RectanglePoint_RIGHT_TOP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_TOP"); + break; + case drawing::RectanglePoint_LEFT_MIDDLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_MIDDLE"); + break; + case drawing::RectanglePoint_MIDDLE_MIDDLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_MIDDLE"); + break; + case drawing::RectanglePoint_RIGHT_MIDDLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_MIDDLE"); + break; + case drawing::RectanglePoint_LEFT_BOTTOM: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_BOTTOM"); + break; + case drawing::RectanglePoint_MIDDLE_BOTTOM: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_BOTTOM"); + break; + case drawing::RectanglePoint_RIGHT_BOTTOM: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_BOTTOM"); + break; + default: + break; + } +} + +void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter) +{ + if(bBitmapLogicalSize) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "false"); +} + +void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeX"), "%" SAL_PRIdINT32, aBitmapSizeX); +} + +void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeY"), "%" SAL_PRIdINT32, aBitmapSizeY); +} + +void dumpFillBitmapModeAsAttribute(drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter) +{ + switch(eBitmapMode) + { + case drawing::BitmapMode_REPEAT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "REPEAT"); + break; + case drawing::BitmapMode_STRETCH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "STRETCH"); + break; + case drawing::BitmapMode_NO_REPEAT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "NO_REPEAT"); + break; + default: + break; + } +} + +void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter) +{ + if(bBitmapStretch) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "false"); +} + +void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter) +{ + if(bBitmapTile) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "false"); +} + +// ---------------------------------------- +// ---------- LineProperties.idl ---------- +// ---------------------------------------- + +void dumpLineStyleAsAttribute(drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter) +{ + switch(eLineStyle) + { + case drawing::LineStyle_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "NONE"); + break; + case drawing::LineStyle_SOLID: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "SOLID"); + break; + case drawing::LineStyle_DASH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "DASH"); + break; + default: + break; + } +} + +void dumpLineDashAsElement(drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineDash" )); + switch(aLineDash.Style) + { + case drawing::DashStyle_RECT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT"); + break; + case drawing::DashStyle_ROUND: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUND"); + break; + case drawing::DashStyle_RECTRELATIVE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECTRELATIVE"); + break; + case drawing::DashStyle_ROUNDRELATIVE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUNDRELATIVE"); + break; + default: + break; + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dots"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dots); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dotLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DotLen); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashes"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dashes); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DashLen); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Distance); + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineDashName"), "%s", + rtl::OUStringToOString(sLineDashName, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineColor"), "%" SAL_PRIdINT32, aLineColor); +} + +void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32, aLineTransparence); +} + +void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32, aLineWidth); +} + +void dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter) +{ + switch(eLineJoint) + { + case drawing::LineJoint_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "NONE"); + break; + case drawing::LineJoint_MIDDLE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MIDDLE"); + break; + case drawing::LineJoint_BEVEL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "BEVEL"); + break; + case drawing::LineJoint_MITER: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MITER"); + break; + case drawing::LineJoint_ROUND: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "ROUND"); + break; + default: + break; + } +} + +void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s", + rtl::OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndName"), "%s", + rtl::OUStringToOString(sLineEndName, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpPolyPolygonBezierCoords(drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter) +{ + dumpPointSequenceSequence(aPolyPolygonBezierCoords.Coordinates, &aPolyPolygonBezierCoords.Flags, xmlWriter); +} + +void dumpLineStartAsElement(drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineStart" )); + dumpPolyPolygonBezierCoords(aLineStart, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpLineEndAsElement(drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineEnd" )); + dumpPolyPolygonBezierCoords(aLineEnd, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter) +{ + if(bLineStartCenter) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "false"); +} + +void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32, aLineStartWidth); +} + +void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter) +{ + if(bLineEndCenter) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "false"); +} + +void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32, aLineEndWidth); +} + +// ----------------------------------------------- +// ---------- PolyPolygonDescriptor.idl ---------- +// ----------------------------------------------- + +void dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter) +{ + switch(ePolygonKind) + { + case drawing::PolygonKind_LINE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "LINE"); + break; + case drawing::PolygonKind_POLY: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "POLY"); + break; + case drawing::PolygonKind_PLIN: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PLIN"); + break; + case drawing::PolygonKind_PATHLINE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHLINE"); + break; + case drawing::PolygonKind_PATHFILL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHFILL"); + break; + case drawing::PolygonKind_FREELINE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREELINE"); + break; + case drawing::PolygonKind_FREEFILL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREEFILL"); + break; + case drawing::PolygonKind_PATHPOLY: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPOLY"); + break; + case drawing::PolygonKind_PATHPLIN: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPLIN"); + break; + default: + break; + } +} + +void dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence, uno::Sequence >* pFlags, xmlTextWriterPtr xmlWriter) +{ + // LibreOffice proudly presents - The Sequenception + uno::Sequence > pointSequenceSequence = aPointSequenceSequence; + sal_Int32 nPointsSequence = pointSequenceSequence.getLength(); + + for (sal_Int32 i = 0; i < nPointsSequence; ++i) + { + uno::Sequence< awt::Point > pointSequence = pointSequenceSequence[i]; + sal_Int32 nPoints = pointSequence.getLength(); + + uno::Sequence< drawing::PolygonFlags> flagsSequence; + if(pFlags) + flagsSequence = (*pFlags)[i]; + + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "pointSequence" )); + + for(sal_Int32 j = 0; j < nPoints; ++j) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "point" )); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, pointSequence[j].X); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, pointSequence[j].Y); + + if(pFlags) + { + switch(flagsSequence[j]) + { + case drawing::PolygonFlags_NORMAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "NORMAL"); + break; + case drawing::PolygonFlags_SMOOTH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SMOOTH"); + break; + case drawing::PolygonFlags_CONTROL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "CONTROL"); + break; + case drawing::PolygonFlags_SYMMETRIC: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SYMMETRIC"); + break; + default: + break; + } + } + + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); + } +} + +void dumpPolyPolygonAsElement(drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygon" )); + dumpPointSequenceSequence(aPolyPolygon, NULL, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpGeometryAsElement(drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" )); + dumpPointSequenceSequence(aGeometry, NULL, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); +} + +// ---------------------------------------- +// ---------- TextProperties.idl ---------- +// ---------------------------------------- + +void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter) +{ + if(bIsNumbering) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "false"); +} + +void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter) +{ + if(bTextAutoGrowHeight) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "false"); +} + +void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter) +{ + if(bTextAutoGrowWidth) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "false"); +} + +void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter) +{ + if(bTextContourFrame) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "false"); +} + +void dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter) +{ + switch(eTextFitToSize) + { + case drawing::TextFitToSizeType_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "NONE"); + break; + case drawing::TextFitToSizeType_PROPORTIONAL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "PROPORTIONAL"); + break; + case drawing::TextFitToSizeType_ALLLINES: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "ALLLINES"); + break; + case drawing::TextFitToSizeType_AUTOFIT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "AUTOFIT"); + break; + default: + break; + } +} + +void dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter) +{ + switch(eTextHorizontalAdjust) + { + case drawing::TextHorizontalAdjust_LEFT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "LEFT"); + break; + case drawing::TextHorizontalAdjust_CENTER: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "CENTER"); + break; + case drawing::TextHorizontalAdjust_RIGHT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "RIGHT"); + break; + case drawing::TextHorizontalAdjust_BLOCK: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK"); + break; + default: + break; + } +} + +void dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter) +{ + switch(eTextVerticalAdjust) + { + case drawing::TextVerticalAdjust_TOP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "TOP"); + break; + case drawing::TextVerticalAdjust_CENTER: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "CENTER"); + break; + case drawing::TextVerticalAdjust_BOTTOM: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BOTTOM"); + break; + case drawing::TextVerticalAdjust_BLOCK: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BLOCK"); + break; + default: + break; + } +} + +void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32, aTextLeftDistance); +} + +void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32, aTextRightDistance); +} + +void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32, aTextUpperDistance); +} + +void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32, aTextLowerDistance); +} + +void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32, aTextMaximumFrameHeight); +} + +void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32, aTextMaximumFrameWidth); +} + +void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32, aTextMinimumFrameHeight); +} + +void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32, aTextMinimumFrameWidth); +} + +void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32, aTextAnimationAmount); +} + +void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32, aTextAnimationCount); +} + +void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32, aTextAnimationDelay); +} + +void dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter) +{ + switch(eTextAnimationDirection) + { + case drawing::TextAnimationDirection_LEFT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "LEFT"); + break; + case drawing::TextAnimationDirection_RIGHT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "RIGHT"); + break; + case drawing::TextAnimationDirection_UP: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "UP"); + break; + case drawing::TextAnimationDirection_DOWN: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "DOWN"); + break; + default: + break; + } +} + +void dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter) +{ + switch(eTextAnimationKind) + { + case drawing::TextAnimationKind_NONE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "NONE"); + break; + case drawing::TextAnimationKind_BLINK: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "BLINK"); + break; + case drawing::TextAnimationKind_SCROLL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SCROLL"); + break; + case drawing::TextAnimationKind_ALTERNATE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "ALTERNATE"); + break; + case drawing::TextAnimationKind_SLIDE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SLIDE"); + break; + default: + break; + } +} + +void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter) +{ + if(bTextAnimationStartInside) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "false"); +} + +void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter) +{ + if(bTextAnimationStopInside) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "false"); +} + +void dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode, xmlTextWriterPtr xmlWriter) +{ + switch(eTextWritingMode) + { + case text::WritingMode_LR_TB: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "LR_TB"); + break; + case text::WritingMode_RL_TB: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "RL_TB"); + break; + case text::WritingMode_TB_RL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "TB_RL"); + break; + default: + break; + } +} + +// ------------------------------------------ +// ---------- ShadowProperties.idl ---------- +// ------------------------------------------ + +void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter) +{ + if(bShadow) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "false"); +} + +void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowColor"), "%" SAL_PRIdINT32, aShadowColor); +} + +void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32, aShadowTransparence); +} + +void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowXDistance"), "%" SAL_PRIdINT32, aShadowXDistance); +} + +void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32, aShadowYDistance); +} + +// ------------------------------- +// ---------- Shape.idl ---------- +// ------------------------------- + +void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("zOrder"), "%" SAL_PRIdINT32, aZOrder); +} + +void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID); +} + +void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s", + rtl::OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter) +{ + if(bVisible) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "false"); +} + +void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter) +{ + if(bPrintable) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "false"); +} + +void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter) +{ + if(bMoveProtect) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false"); +} + +void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", + rtl::OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter) +{ + if(bSizeProtect) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false"); +} + +void dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aHomogenMatrixLine3, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column1"), "%f", aHomogenMatrixLine3.Column1); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column2"), "%f", aHomogenMatrixLine3.Column2); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", aHomogenMatrixLine3.Column3); +} + +void dumpTransformationAsElement(drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Transformation" )); + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line1" )); + dumpHomogenMatrixLine3(aTransformation.Line1, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line2" )); + dumpHomogenMatrixLine3(aTransformation.Line2, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line3" )); + dumpHomogenMatrixLine3(aTransformation.Line3, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); + } + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder); +} + +void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("hyperlink"), "%s", + rtl::OUStringToOString(sHyperlink, RTL_TEXTENCODING_UTF8).getStr()); +} + +// -------------------------------- +// ---------- XShape.idl ---------- +// -------------------------------- + +void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y); +} + +void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height); +} + +void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", + rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); +} + +// ----------------------------------------------------- +// ---------- PolyPolygonBezierDescriptor.idl ---------- +// ----------------------------------------------------- + +void dumpPolyPolygonBezierAsElement(drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygonBezier" )); + dumpPolyPolygonBezierCoords(aPolyPolygonBezier, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpGeometryAsElement(drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" )); + dumpPolyPolygonBezierCoords(aGeometry, xmlWriter); + xmlTextWriterEndElement( xmlWriter ); +} + +// ------------------------------------- +// ---------- CustomShape.idl ---------- +// ------------------------------------- + +void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeEngine"), "%s", + rtl::OUStringToOString(sCustomShapeEngine, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeData"), "%s", + rtl::OUStringToOString(sCustomShapeData, RTL_TEXTENCODING_UTF8).getStr()); +} + +void dumpCustomShapeGeometryAsElement(uno::Sequence< beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "CustomShapeGeometry" )); + sal_Int32 nLength = aCustomShapeGeometry.getLength(); + for (sal_Int32 i = 0; i < nLength; ++i) + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" )); + + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", + rtl::OUStringToOString(aCustomShapeGeometry[i].Name, RTL_TEXTENCODING_UTF8).getStr()); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("handle"), "%" SAL_PRIdINT32, aCustomShapeGeometry[i].Handle); + + uno::Any aAny = aCustomShapeGeometry[i].Value; + rtl::OUString sValue; + if(aAny >>= sValue) { - case drawing::FillStyle_NONE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "NONE"); - break; - case drawing::FillStyle_SOLID: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "SOLID"); - break; - case drawing::FillStyle_GRADIENT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "GRADIENT"); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + switch(aCustomShapeGeometry[i].State) + { + case beans::PropertyState_DIRECT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE"); break; - case drawing::FillStyle_HATCH: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "HATCH"); + case beans::PropertyState_DEFAULT_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE"); break; - case drawing::FillStyle_BITMAP: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillStyle"), "%s", "BITMAP"); + case beans::PropertyState_AMBIGUOUS_VALUE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE"); break; default: break; } + xmlTextWriterEndElement( xmlWriter ); } + xmlTextWriterEndElement( xmlWriter ); +} + +void dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeReplacementURL"), "%s", + rtl::OUStringToOString(sCustomShapeReplacementURL, RTL_TEXTENCODING_UTF8).getStr()); +} - void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter) +// methods dumping whole services + +void dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) +{ + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); + if(xInfo->hasPropertyByName("IsNumbering")) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillColor"), "%" SAL_PRIdINT32, aColor); + uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering"); + sal_Bool bIsNumbering; + if(anotherAny >>= bIsNumbering) + dumpIsNumberingAsAttribute(bIsNumbering, xmlWriter); } - - void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32, aTransparence); + uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowHeight"); + sal_Bool bTextAutoGrowHeight; + if(anotherAny >>= bTextAutoGrowHeight) + dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight, xmlWriter); } - - void dumpFillTransparenceGradientNameAsAttribute(rtl::OUString sTranspGradName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s", - rtl::OUStringToOString(sTranspGradName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowWidth"); + sal_Bool bTextAutoGrowWidth; + if(anotherAny >>= bTextAutoGrowWidth) + dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter); } - - //because there's more awt::Gradient properties to dump - void dumpGradientProperty(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) { - switch(aGradient.Style) //enum GradientStyle - { - case awt::GradientStyle_LINEAR: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "LINEAR"); - break; - case awt::GradientStyle_AXIAL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "AXIAL"); - break; - case awt::GradientStyle_RADIAL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RADIAL"); - break; - case awt::GradientStyle_ELLIPTICAL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ELLIPTICAL"); - break; - case awt::GradientStyle_SQUARE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "SQUARE"); - break; - case awt::GradientStyle_RECT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT"); - break; - default: - break; - } - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startColor"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StartColor); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endColor"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.EndColor); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.Angle); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("border"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.Border); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("xOffset"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.XOffset); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("yOffset"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.YOffset); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StartIntensity); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.EndIntensity); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) aGradient.StepCount); + uno::Any anotherAny = xPropSet->getPropertyValue("TextContourFrame"); + sal_Bool bTextContourFrame; + if(anotherAny >>= bTextContourFrame) + dumpTextContourFrameAsAttribute(bTextContourFrame, xmlWriter); } - - void dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillTransparenceGradient" )); - dumpGradientProperty(aTranspGrad, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("TextFitToSize"); + drawing::TextFitToSizeType eTextFitToSize; + if(anotherAny >>= eTextFitToSize) + dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter); } - - void dumpFillGradientNameAsAttribute(rtl::OUString sGradName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s", - rtl::OUStringToOString(sGradName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust"); + drawing::TextHorizontalAdjust eTextHorizontalAdjust; + if(anotherAny >>= eTextHorizontalAdjust) + dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter); } - - void dumpFillGradientAsElement(awt::Gradient aGradient, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillGradient" )); - dumpGradientProperty(aGradient, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust"); + drawing::TextVerticalAdjust eTextVerticalAdjust; + if(anotherAny >>= eTextVerticalAdjust) + dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter); } - - void dumpFillHatchNameAsAttribute(rtl::OUString sHatchName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillHatchName"), "%s", - rtl::OUStringToOString(sHatchName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("TextLeftDistance"); + sal_Int32 aTextLeftDistance; + if(anotherAny >>= aTextLeftDistance) + dumpTextLeftDistanceAsAttribute(aTextLeftDistance, xmlWriter); } - - void dumpFillHatchAsElement(drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillHatch" )); - switch(aHatch.Style) - { - case drawing::HatchStyle_SINGLE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "SINGLE"); - break; - case drawing::HatchStyle_DOUBLE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "DOUBLE"); - break; - case drawing::HatchStyle_TRIPLE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "TRIPLE"); - break; - default: - break; - } - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("color"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Color); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Distance); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) aHatch.Angle); - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("TextRightDistance"); + sal_Int32 aTextRightDistance; + if(anotherAny >>= aTextRightDistance) + dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter); } - - void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter) { - if(bBackground) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBackground"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("TextUpperDistance"); + sal_Int32 aTextUpperDistance; + if(anotherAny >>= aTextUpperDistance) + dumpTextUpperDistanceAsAttribute(aTextUpperDistance, xmlWriter); } - - void dumpFillBitmapNameAsAttribute(rtl::OUString sBitmapName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s", - rtl::OUStringToOString(sBitmapName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("TextLowerDistance"); + sal_Int32 aTextLowerDistance; + if(anotherAny >>= aTextLowerDistance) + dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter); } - - void dumpFillBitmapAsElement(uno::Reference xBitmap, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FillBitmap" )); - if (xBitmap.is()) - { - awt::Size const aSize = xBitmap->getSize(); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("width"), "%" SAL_PRIdINT32, aSize.Width); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("height"), "%" SAL_PRIdINT32, aSize.Height); - } - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameHeight"); + sal_Int32 aTextMaximumFrameHeight; + if(anotherAny >>= aTextMaximumFrameHeight) + dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight, xmlWriter); } - - void dumpFillBitmapURLAsAttribute(rtl::OUString sBitmapURL, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapURL"), "%s", - rtl::OUStringToOString(sBitmapURL, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameWidth"); + sal_Int32 aTextMaximumFrameWidth; + if(anotherAny >>= aTextMaximumFrameWidth) + dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter); } - - void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetX"), "%" SAL_PRIdINT32, aBitmapPositionOffsetX); + uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameHeight"); + sal_Int32 aTextMinimumFrameHeight; + if(anotherAny >>= aTextMinimumFrameHeight) + dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight, xmlWriter); } - - void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapPositionOffsetY"), "%" SAL_PRIdINT32, aBitmapPositionOffsetY); + uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameWidth"); + sal_Int32 aTextMinimumFrameWidth; + if(anotherAny >>= aTextMinimumFrameWidth) + dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter); } - - void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetX"), "%" SAL_PRIdINT32, aBitmapOffsetX); + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationAmount"); + sal_Int32 aTextAnimationAmount; + if(anotherAny >>= aTextAnimationAmount) + dumpTextAnimationAmountAsAttribute(aTextAnimationAmount, xmlWriter); } - - void dumpFillBitmapOffsetYAsAttribute(sal_Int32 aBitmapOffsetY, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapOffsetY"), "%" SAL_PRIdINT32, aBitmapOffsetY); + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationCount"); + sal_Int32 aTextAnimationCount; + if(anotherAny >>= aTextAnimationCount) + dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter); } - - void dumpFillBitmapRectanglePointAsAttribute(drawing::RectanglePoint eBitmapRectanglePoint, xmlTextWriterPtr xmlWriter) { - switch(eBitmapRectanglePoint) - { - case drawing::RectanglePoint_LEFT_TOP: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_TOP"); - break; - case drawing::RectanglePoint_MIDDLE_TOP: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_TOP"); - break; - case drawing::RectanglePoint_RIGHT_TOP: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_TOP"); - break; - case drawing::RectanglePoint_LEFT_MIDDLE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_MIDDLE"); - break; - case drawing::RectanglePoint_MIDDLE_MIDDLE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_MIDDLE"); - break; - case drawing::RectanglePoint_RIGHT_MIDDLE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_MIDDLE"); - break; - case drawing::RectanglePoint_LEFT_BOTTOM: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "LEFT_BOTTOM"); - break; - case drawing::RectanglePoint_MIDDLE_BOTTOM: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "MIDDLE_BOTTOM"); - break; - case drawing::RectanglePoint_RIGHT_BOTTOM: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapRectanglePoint"), "%s", "RIGHT_BOTTOM"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDelay"); + sal_Int32 aTextAnimationDelay; + if(anotherAny >>= aTextAnimationDelay) + dumpTextAnimationDelayAsAttribute(aTextAnimationDelay, xmlWriter); } - - void dumpFillBitmapLogicalSizeAsAttribute(sal_Bool bBitmapLogicalSize, xmlTextWriterPtr xmlWriter) { - if(bBitmapLogicalSize) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapLogicalSize"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDirection"); + drawing::TextAnimationDirection eTextAnimationDirection; + if(anotherAny >>= eTextAnimationDirection) + dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter); } - - void dumpFillBitmapSizeXAsAttribute(sal_Int32 aBitmapSizeX, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeX"), "%" SAL_PRIdINT32, aBitmapSizeX); + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationKind"); + drawing::TextAnimationKind eTextAnimationKind; + if(anotherAny >>= eTextAnimationKind) + dumpTextAnimationKindAsAttribute(eTextAnimationKind, xmlWriter); } - - void dumpFillBitmapSizeYAsAttribute(sal_Int32 aBitmapSizeY, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapSizeY"), "%" SAL_PRIdINT32, aBitmapSizeY); + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStartInside"); + sal_Bool bTextAnimationStartInside; + if(anotherAny >>= bTextAnimationStartInside) + dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter); } - - void dumpFillBitmapModeAsAttribute(drawing::BitmapMode eBitmapMode, xmlTextWriterPtr xmlWriter) { - switch(eBitmapMode) - { - case drawing::BitmapMode_REPEAT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "REPEAT"); - break; - case drawing::BitmapMode_STRETCH: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "STRETCH"); - break; - case drawing::BitmapMode_NO_REPEAT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapMode"), "%s", "NO_REPEAT"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStopInside"); + sal_Bool bTextAnimationStopInside; + if(anotherAny >>= bTextAnimationStopInside) + dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside, xmlWriter); } - - void dumpFillBitmapStretchAsAttribute(sal_Bool bBitmapStretch, xmlTextWriterPtr xmlWriter) { - if(bBitmapStretch) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapStretch"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("TextWritingMode"); + text::WritingMode eTextWritingMode; + if(anotherAny >>= eTextWritingMode) + dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter); } +} - void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWriter) +void dumpFillPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) +{ { - if(bBitmapTile) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("fillBitmapTile"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); + drawing::FillStyle eFillStyle; + if(anotherAny >>= eFillStyle) + dumpFillStyleAsAttribute(eFillStyle, xmlWriter); } - - // ---------------------------------------- - // ---------- LineProperties.idl ---------- - // ---------------------------------------- - - void dumpLineStyleAsAttribute(drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter) { - switch(eLineStyle) - { - case drawing::LineStyle_NONE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "NONE"); - break; - case drawing::LineStyle_SOLID: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "SOLID"); - break; - case drawing::LineStyle_DASH: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStyle"), "%s", "DASH"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("FillColor"); + sal_Int32 aColor; + if(anotherAny >>= aColor) + dumpFillColorAsAttribute(aColor, xmlWriter); } - - void dumpLineDashAsElement(drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineDash" )); - switch(aLineDash.Style) - { - case drawing::DashStyle_RECT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECT"); - break; - case drawing::DashStyle_ROUND: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUND"); - break; - case drawing::DashStyle_RECTRELATIVE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "RECTRELATIVE"); - break; - case drawing::DashStyle_ROUNDRELATIVE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("style"), "%s", "ROUNDRELATIVE"); - break; - default: - break; - } - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dots"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dots); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dotLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DotLen); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashes"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Dashes); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashLen"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.DashLen); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) aLineDash.Distance); - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparence"); + sal_Int32 aTransparence; + if(anotherAny >>= aTransparence) + dumpFillTransparenceAsAttribute(aTransparence, xmlWriter); } - - void dumpLineDashNameAsAttribute(rtl::OUString sLineDashName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineDashName"), "%s", - rtl::OUStringToOString(sLineDashName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradientName"); + rtl::OUString sTranspGradName; + if(anotherAny >>= sTranspGradName) + dumpFillTransparenceGradientNameAsAttribute(sTranspGradName, xmlWriter); } - - void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineColor"), "%" SAL_PRIdINT32, aLineColor); + uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradient"); + awt::Gradient aTranspGrad; + if(anotherAny >>= aTranspGrad) + dumpFillTransparenceGradientAsElement(aTranspGrad, xmlWriter); } - - void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineTransparence"), "%" SAL_PRIdINT32, aLineTransparence); + uno::Any anotherAny = xPropSet->getPropertyValue("FillGradientName"); + rtl::OUString sGradName; + if(anotherAny >>= sGradName) + dumpFillGradientNameAsAttribute(sGradName, xmlWriter); } - - void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineWidth"), "%" SAL_PRIdINT32, aLineWidth); + uno::Any anotherAny = xPropSet->getPropertyValue("FillGradient"); + awt::Gradient aGradient; + if(anotherAny >>= aGradient) + dumpFillGradientAsElement(aGradient, xmlWriter); } - - void dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter) { - switch(eLineJoint) - { - case drawing::LineJoint_NONE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "NONE"); - break; - case drawing::LineJoint_MIDDLE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MIDDLE"); - break; - case drawing::LineJoint_BEVEL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "BEVEL"); - break; - case drawing::LineJoint_MITER: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "MITER"); - break; - case drawing::LineJoint_ROUND: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineJoint"), "%s", "ROUND"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("FillHatchName"); + rtl::OUString sHatchName; + if(anotherAny >>= sHatchName) + dumpFillGradientNameAsAttribute(sHatchName, xmlWriter); } - - void dumpLineStartNameAsAttribute(rtl::OUString sLineStartName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s", - rtl::OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("FillHatch"); + drawing::Hatch aHatch; + if(anotherAny >>= aHatch) + dumpFillHatchAsElement(aHatch, xmlWriter); } - - void dumpLineEndNameAsAttribute(rtl::OUString sLineEndName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndName"), "%s", - rtl::OUStringToOString(sLineEndName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBackground"); + sal_Bool bFillBackground; + if(anotherAny >>= bFillBackground) + dumpFillBackgroundAsAttribute(bFillBackground, xmlWriter); } - - void dumpPolyPolygonBezierCoords(drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords, xmlTextWriterPtr xmlWriter) { - dumpPointSequenceSequence(aPolyPolygonBezierCoords.Coordinates, &aPolyPolygonBezierCoords.Flags, xmlWriter); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapName"); + rtl::OUString sBitmapName; + if(anotherAny >>= sBitmapName) + dumpFillGradientNameAsAttribute(sBitmapName, xmlWriter); } - - void dumpLineStartAsElement(drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineStart" )); - dumpPolyPolygonBezierCoords(aLineStart, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmap"); + uno::Reference xBitmap; + if(anotherAny >>= xBitmap) + dumpFillBitmapAsElement(xBitmap, xmlWriter); } - - void dumpLineEndAsElement(drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "LineEnd" )); - dumpPolyPolygonBezierCoords(aLineEnd, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapURL"); + rtl::OUString sBitmapURL; + if(anotherAny >>= sBitmapURL) + dumpFillBitmapURLAsAttribute(sBitmapURL, xmlWriter); } - - void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter) { - if(bLineStartCenter) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineStartCenter"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetX"); + sal_Int32 aBitmapPositionOffsetX; + if(anotherAny >>= aBitmapPositionOffsetX) + dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX, xmlWriter); } - - void dumpLineStartWidthAsAttribute(sal_Int32 aLineStartWidth, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartWidth"), "%" SAL_PRIdINT32, aLineStartWidth); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetY"); + sal_Int32 aBitmapPositionOffsetY; + if(anotherAny >>= aBitmapPositionOffsetY) + dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY, xmlWriter); } - - void dumpLineEndCenterAsAttribute(sal_Bool bLineEndCenter, xmlTextWriterPtr xmlWriter) { - if(bLineEndCenter) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lineEndCenter"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetX"); + sal_Int32 aBitmapOffsetX; + if(anotherAny >>= aBitmapOffsetX) + dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX, xmlWriter); } - - void dumpLineEndWidthAsAttribute(sal_Int32 aLineEndWidth, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndWidth"), "%" SAL_PRIdINT32, aLineEndWidth); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetY"); + sal_Int32 aBitmapOffsetY; + if(anotherAny >>= aBitmapOffsetY) + dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY, xmlWriter); } - - // ----------------------------------------------- - // ---------- PolyPolygonDescriptor.idl ---------- - // ----------------------------------------------- - - void dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind, xmlTextWriterPtr xmlWriter) { - switch(ePolygonKind) - { - case drawing::PolygonKind_LINE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "LINE"); - break; - case drawing::PolygonKind_POLY: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "POLY"); - break; - case drawing::PolygonKind_PLIN: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PLIN"); - break; - case drawing::PolygonKind_PATHLINE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHLINE"); - break; - case drawing::PolygonKind_PATHFILL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHFILL"); - break; - case drawing::PolygonKind_FREELINE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREELINE"); - break; - case drawing::PolygonKind_FREEFILL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "FREEFILL"); - break; - case drawing::PolygonKind_PATHPOLY: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPOLY"); - break; - case drawing::PolygonKind_PATHPLIN: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonKind"), "%s", "PATHPLIN"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapRectanglePoint"); + drawing::RectanglePoint eBitmapRectanglePoint; + if(anotherAny >>= eBitmapRectanglePoint) + dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint, xmlWriter); } - - void dumpPointSequenceSequence(drawing::PointSequenceSequence aPointSequenceSequence, uno::Sequence >* pFlags, xmlTextWriterPtr xmlWriter) { - // LibreOffice proudly presents - The Sequenception - uno::Sequence > pointSequenceSequence = aPointSequenceSequence; - sal_Int32 nPointsSequence = pointSequenceSequence.getLength(); - - for (sal_Int32 i = 0; i < nPointsSequence; ++i) - { - uno::Sequence< awt::Point > pointSequence = pointSequenceSequence[i]; - sal_Int32 nPoints = pointSequence.getLength(); - - uno::Sequence< drawing::PolygonFlags> flagsSequence; - if(pFlags) - flagsSequence = (*pFlags)[i]; - - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "pointSequence" )); - - for(sal_Int32 j = 0; j < nPoints; ++j) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "point" )); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, pointSequence[j].X); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, pointSequence[j].Y); - - if(pFlags) - { - switch(flagsSequence[j]) - { - case drawing::PolygonFlags_NORMAL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "NORMAL"); - break; - case drawing::PolygonFlags_SMOOTH: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SMOOTH"); - break; - case drawing::PolygonFlags_CONTROL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "CONTROL"); - break; - case drawing::PolygonFlags_SYMMETRIC: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("polygonFlags"), "%s", "SYMMETRIC"); - break; - default: - break; - } - } - - xmlTextWriterEndElement( xmlWriter ); - } - xmlTextWriterEndElement( xmlWriter ); - } + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapLogicalSize"); + sal_Bool bBitmapLogicalSize; + if(anotherAny >>= bBitmapLogicalSize) + dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize, xmlWriter); } - - void dumpPolyPolygonAsElement(drawing::PointSequenceSequence aPolyPolygon, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygon" )); - dumpPointSequenceSequence(aPolyPolygon, NULL, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeX"); + sal_Int32 aBitmapSizeX; + if(anotherAny >>= aBitmapSizeX) + dumpFillBitmapSizeXAsAttribute(aBitmapSizeX, xmlWriter); } - - void dumpGeometryAsElement(drawing::PointSequenceSequence aGeometry, xmlTextWriterPtr xmlWriter) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" )); - dumpPointSequenceSequence(aGeometry, NULL, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeY"); + sal_Int32 aBitmapSizeY; + if(anotherAny >>= aBitmapSizeY) + dumpFillBitmapSizeYAsAttribute(aBitmapSizeY, xmlWriter); } - - // ---------------------------------------- - // ---------- TextProperties.idl ---------- - // ---------------------------------------- - - void dumpIsNumberingAsAttribute(sal_Bool bIsNumbering, xmlTextWriterPtr xmlWriter) { - if(bIsNumbering) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("isNumbering"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapMode"); + drawing::BitmapMode eBitmapMode; + if(anotherAny >>= eBitmapMode) + dumpFillBitmapModeAsAttribute(eBitmapMode, xmlWriter); } - - void dumpTextAutoGrowHeightAsAttribute(sal_Bool bTextAutoGrowHeight, xmlTextWriterPtr xmlWriter) { - if(bTextAutoGrowHeight) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowHeight"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapStretch"); + sal_Bool bBitmapStretch; + if(anotherAny >>= bBitmapStretch) + dumpFillBitmapStretchAsAttribute(bBitmapStretch, xmlWriter); } - - void dumpTextAutoGrowWidthAsAttribute(sal_Bool bTextAutoGrowWidth, xmlTextWriterPtr xmlWriter) { - if(bTextAutoGrowWidth) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAutoGrowWidth"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapTile"); + sal_Bool bBitmapTile; + if(anotherAny >>= bBitmapTile) + dumpFillBitmapTileAsAttribute(bBitmapTile, xmlWriter); } +} - void dumpTextContourFrameAsAttribute(sal_Bool bTextContourFrame, xmlTextWriterPtr xmlWriter) +void dumpLinePropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) +{ { - if(bTextContourFrame) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textContourFrame"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("LineStyle"); + drawing::LineStyle eLineStyle; + if(anotherAny >>= eLineStyle) + dumpLineStyleAsAttribute(eLineStyle, xmlWriter); } - - void dumpTextFitToSizeAsAttribute(drawing::TextFitToSizeType eTextFitToSize, xmlTextWriterPtr xmlWriter) { - switch(eTextFitToSize) - { - case drawing::TextFitToSizeType_NONE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "NONE"); - break; - case drawing::TextFitToSizeType_PROPORTIONAL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "PROPORTIONAL"); - break; - case drawing::TextFitToSizeType_ALLLINES: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "ALLLINES"); - break; - case drawing::TextFitToSizeType_AUTOFIT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textFitToSize"), "%s", "AUTOFIT"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("LineDash"); + drawing::LineDash aLineDash; + if(anotherAny >>= aLineDash) + dumpLineDashAsElement(aLineDash, xmlWriter); } - - void dumpTextHorizontalAdjustAsAttribute(drawing::TextHorizontalAdjust eTextHorizontalAdjust, xmlTextWriterPtr xmlWriter) { - switch(eTextHorizontalAdjust) - { - case drawing::TextHorizontalAdjust_LEFT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "LEFT"); - break; - case drawing::TextHorizontalAdjust_CENTER: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "CENTER"); - break; - case drawing::TextHorizontalAdjust_RIGHT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "RIGHT"); - break; - case drawing::TextHorizontalAdjust_BLOCK: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textHorizontalAdjust"), "%s", "BLOCK"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("LineDashName"); + rtl::OUString sLineDashName; + if(anotherAny >>= sLineDashName) + dumpLineDashNameAsAttribute(sLineDashName, xmlWriter); } - - void dumpTextVerticalAdjustAsAttribute(drawing::TextVerticalAdjust eTextVerticalAdjust, xmlTextWriterPtr xmlWriter) { - switch(eTextVerticalAdjust) - { - case drawing::TextVerticalAdjust_TOP: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "TOP"); - break; - case drawing::TextVerticalAdjust_CENTER: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "CENTER"); - break; - case drawing::TextVerticalAdjust_BOTTOM: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BOTTOM"); - break; - case drawing::TextVerticalAdjust_BLOCK: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textVerticalAdjust"), "%s", "BLOCK"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("LineColor"); + sal_Int32 aLineColor; + if(anotherAny >>= aLineColor) + dumpLineColorAsAttribute(aLineColor, xmlWriter); } - - void dumpTextLeftDistanceAsAttribute(sal_Int32 aTextLeftDistance, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLeftDistance"), "%" SAL_PRIdINT32, aTextLeftDistance); + uno::Any anotherAny = xPropSet->getPropertyValue("LineTransparence"); + sal_Int32 aLineTransparence; + if(anotherAny >>= aLineTransparence) + dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter); } - - void dumpTextRightDistanceAsAttribute(sal_Int32 aTextRightDistance, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textRightDistance"), "%" SAL_PRIdINT32, aTextRightDistance); + uno::Any anotherAny = xPropSet->getPropertyValue("LineWidth"); + sal_Int32 aLineWidth; + if(anotherAny >>= aLineWidth) + dumpLineWidthAsAttribute(aLineWidth, xmlWriter); } - - void dumpTextUpperDistanceAsAttribute(sal_Int32 aTextUpperDistance, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textUpperDistance"), "%" SAL_PRIdINT32, aTextUpperDistance); + uno::Any anotherAny = xPropSet->getPropertyValue("LineJoint"); + drawing::LineJoint eLineJoint; + if(anotherAny >>= eLineJoint) + dumpLineJointAsAttribute(eLineJoint, xmlWriter); } - - void dumpTextLowerDistanceAsAttribute(sal_Int32 aTextLowerDistance, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textLowerDistance"), "%" SAL_PRIdINT32, aTextLowerDistance); + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartName"); + rtl::OUString sLineStartName; + if(anotherAny >>= sLineStartName) + dumpLineStartNameAsAttribute(sLineStartName, xmlWriter); } - - void dumpTextMaximumFrameHeightAsAttribute(sal_Int32 aTextMaximumFrameHeight, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameHeight"), "%" SAL_PRIdINT32, aTextMaximumFrameHeight); + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndName"); + rtl::OUString sLineEndName; + if(anotherAny >>= sLineEndName) + dumpLineEndNameAsAttribute(sLineEndName, xmlWriter); } - - void dumpTextMaximumFrameWidthAsAttribute(sal_Int32 aTextMaximumFrameWidth, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMaximumFrameWidth"), "%" SAL_PRIdINT32, aTextMaximumFrameWidth); + uno::Any anotherAny = xPropSet->getPropertyValue("LineStart"); + drawing::PolyPolygonBezierCoords aLineStart; + if(anotherAny >>= aLineStart) + dumpLineStartAsElement(aLineStart, xmlWriter); } - - void dumpTextMinimumFrameHeightAsAttribute(sal_Int32 aTextMinimumFrameHeight, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameHeight"), "%" SAL_PRIdINT32, aTextMinimumFrameHeight); + uno::Any anotherAny = xPropSet->getPropertyValue("LineEnd"); + drawing::PolyPolygonBezierCoords aLineEnd; + if(anotherAny >>= aLineEnd) + dumpLineEndAsElement(aLineEnd, xmlWriter); } - - void dumpTextMinimumFrameWidthAsAttribute(sal_Int32 aTextMinimumFrameWidth, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textMinimumFrameWidth"), "%" SAL_PRIdINT32, aTextMinimumFrameWidth); + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartCenter"); + sal_Bool bLineStartCenter; + if(anotherAny >>= bLineStartCenter) + dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter); } - - void dumpTextAnimationAmountAsAttribute(sal_Int32 aTextAnimationAmount, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationAmount"), "%" SAL_PRIdINT32, aTextAnimationAmount); + uno::Any anotherAny = xPropSet->getPropertyValue("LineStartWidth"); + sal_Int32 aLineStartWidth; + if(anotherAny >>= aLineStartWidth) + dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter); } - - void dumpTextAnimationCountAsAttribute(sal_Int32 aTextAnimationCount, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationCount"), "%" SAL_PRIdINT32, aTextAnimationCount); + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndCenter"); + sal_Bool bLineEndCenter; + if(anotherAny >>= bLineEndCenter) + dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter); } - - void dumpTextAnimationDelayAsAttribute(sal_Int32 aTextAnimationDelay, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("textAnimationDelay"), "%" SAL_PRIdINT32, aTextAnimationDelay); + uno::Any anotherAny = xPropSet->getPropertyValue("LineEndWidth"); + sal_Int32 aLineEndWidth; + if(anotherAny >>= aLineEndWidth) + dumpLineEndWidthAsAttribute(aLineEndWidth, xmlWriter); } +} - void dumpTextAnimationDirectionAsAttribute(drawing::TextAnimationDirection eTextAnimationDirection, xmlTextWriterPtr xmlWriter) +void dumpShadowPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) +{ { - switch(eTextAnimationDirection) - { - case drawing::TextAnimationDirection_LEFT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "LEFT"); - break; - case drawing::TextAnimationDirection_RIGHT: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "RIGHT"); - break; - case drawing::TextAnimationDirection_UP: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "UP"); - break; - case drawing::TextAnimationDirection_DOWN: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationDirection"), "%s", "DOWN"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("Shadow"); + sal_Bool bShadow; + if(anotherAny >>= bShadow) + dumpShadowAsAttribute(bShadow, xmlWriter); } - - void dumpTextAnimationKindAsAttribute(drawing::TextAnimationKind eTextAnimationKind, xmlTextWriterPtr xmlWriter) { - switch(eTextAnimationKind) - { - case drawing::TextAnimationKind_NONE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "NONE"); - break; - case drawing::TextAnimationKind_BLINK: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "BLINK"); - break; - case drawing::TextAnimationKind_SCROLL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SCROLL"); - break; - case drawing::TextAnimationKind_ALTERNATE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "ALTERNATE"); - break; - case drawing::TextAnimationKind_SLIDE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationKind"), "%s", "SLIDE"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowColor"); + sal_Int32 aShadowColor; + if(anotherAny >>= aShadowColor) + dumpShadowColorAsAttribute(aShadowColor, xmlWriter); } - - void dumpTextAnimationStartInsideAsAttribute(sal_Bool bTextAnimationStartInside, xmlTextWriterPtr xmlWriter) { - if(bTextAnimationStartInside) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStartInside"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowTransparence"); + sal_Int32 aShadowTransparence; + if(anotherAny >>= aShadowTransparence) + dumpShadowTransparenceAsAttribute(aShadowTransparence, xmlWriter); } - - void dumpTextAnimationStopInsideAsAttribute(sal_Bool bTextAnimationStopInside, xmlTextWriterPtr xmlWriter) { - if(bTextAnimationStopInside) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textAnimationStopInside"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowXDistance"); + sal_Int32 aShadowXDistance; + if(anotherAny >>= aShadowXDistance) + dumpShadowXDistanceAsAttribute(aShadowXDistance, xmlWriter); } - - void dumpTextWritingModeAsAttribute(text::WritingMode eTextWritingMode, xmlTextWriterPtr xmlWriter) { - switch(eTextWritingMode) - { - case text::WritingMode_LR_TB: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "LR_TB"); - break; - case text::WritingMode_RL_TB: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "RL_TB"); - break; - case text::WritingMode_TB_RL: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("textWritingMode"), "%s", "TB_RL"); - break; - default: - break; - } + uno::Any anotherAny = xPropSet->getPropertyValue("ShadowYDistance"); + sal_Int32 aShadowYDistance; + if(anotherAny >>= aShadowYDistance) + dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter); } +} - // ------------------------------------------ - // ---------- ShadowProperties.idl ---------- - // ------------------------------------------ - - void dumpShadowAsAttribute(sal_Bool bShadow, xmlTextWriterPtr xmlWriter) +void dumpPolyPolygonDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) +{ { - if(bShadow) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadow"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); + drawing::PolygonKind ePolygonKind; + if(anotherAny >>= ePolygonKind) + dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); } - - void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowColor"), "%" SAL_PRIdINT32, aShadowColor); + uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygon"); + drawing::PointSequenceSequence aPolyPolygon; + if(anotherAny >>= aPolyPolygon) + dumpPolyPolygonAsElement(aPolyPolygon, xmlWriter); } - - void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowTransparence"), "%" SAL_PRIdINT32, aShadowTransparence); + uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); + drawing::PointSequenceSequence aGeometry; + if(anotherAny >>= aGeometry) + dumpGeometryAsElement(aGeometry, xmlWriter); } +} - void dumpShadowXDistanceAsAttribute(sal_Int32 aShadowXDistance, xmlTextWriterPtr xmlWriter) +void dumpShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) +{ + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowXDistance"), "%" SAL_PRIdINT32, aShadowXDistance); + uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder"); + sal_Int32 aZOrder; + if(anotherAny >>= aZOrder) + dumpZOrderAsAttribute(aZOrder, xmlWriter); } - - void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowYDistance"), "%" SAL_PRIdINT32, aShadowYDistance); + uno::Any anotherAny = xPropSet->getPropertyValue("LayerID"); + sal_Int32 aLayerID; + if(anotherAny >>= aLayerID) + dumpLayerIDAsAttribute(aLayerID, xmlWriter); } - - // ------------------------------- - // ---------- Shape.idl ---------- - // ------------------------------- - - void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("zOrder"), "%" SAL_PRIdINT32, aZOrder); + uno::Any anotherAny = xPropSet->getPropertyValue("LayerName"); + rtl::OUString sLayerName; + if(anotherAny >>= sLayerName) + dumpLayerNameAsAttribute(sLayerName, xmlWriter); } - - void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID); + uno::Any anotherAny = xPropSet->getPropertyValue("Visible"); + sal_Bool bVisible; + if(anotherAny >>= bVisible) + dumpVisibleAsAttribute(bVisible, xmlWriter); } - - void dumpLayerNameAsAttribute(rtl::OUString sLayerName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s", - rtl::OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("Printable"); + sal_Bool bPrintable; + if(anotherAny >>= bPrintable) + dumpPrintableAsAttribute(bPrintable, xmlWriter); } - - void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter) { - if(bVisible) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("visible"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("MoveProtect"); + sal_Bool bMoveProtect; + if(anotherAny >>= bMoveProtect) + dumpMoveProtectAsAttribute(bMoveProtect, xmlWriter); } - - void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter) { - if(bPrintable) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("printable"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("Name"); + rtl::OUString sName; + if(anotherAny >>= sName) + dumpNameAsAttribute(sName, xmlWriter); } - - void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter) { - if(bMoveProtect) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("SizeProtect"); + sal_Bool bSizeProtect; + if(anotherAny >>= bSizeProtect) + dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter); } - - void dumpNameAsAttribute(rtl::OUString sName, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", - rtl::OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("Transformation"); + drawing::HomogenMatrix3 aTransformation; + if(anotherAny >>= aTransformation) + dumpTransformationAsElement(aTransformation, xmlWriter); } - - void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter) { - if(bSizeProtect) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "true"); - else - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("sizeProtect"), "%s", "false"); + uno::Any anotherAny = xPropSet->getPropertyValue("NavigationOrder"); + sal_Int32 aNavigationOrder; + if(anotherAny >>= aNavigationOrder) + dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter); + } + if(xInfo->hasPropertyByName("Hyperlink")) + { + uno::Any anotherAny = xPropSet->getPropertyValue("Hyperlink"); + rtl::OUString sHyperlink; + if(anotherAny >>= sHyperlink) + dumpHyperlinkAsAttribute(sHyperlink, xmlWriter); } +} - void dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aHomogenMatrixLine3, xmlTextWriterPtr xmlWriter) +void dumpPolyPolygonBezierDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) +{ + { + uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); + drawing::PolygonKind ePolygonKind; + if(anotherAny >>= ePolygonKind) + dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygonBezier"); + drawing::PolyPolygonBezierCoords aPolyPolygonBezier; + if(anotherAny >>= aPolyPolygonBezier) + dumpPolyPolygonBezierCoords(aPolyPolygonBezier, xmlWriter); + } { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column1"), "%f", aHomogenMatrixLine3.Column1); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column2"), "%f", aHomogenMatrixLine3.Column2); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", aHomogenMatrixLine3.Column3); + uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); + drawing::PolyPolygonBezierCoords aGeometry; + if(anotherAny >>= aGeometry) + dumpPolyPolygonBezierCoords(aGeometry, xmlWriter); } +} - void dumpTransformationAsElement(drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter) +void dumpCustomShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) +{ + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Transformation" )); - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line1" )); - dumpHomogenMatrixLine3(aTransformation.Line1, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line2" )); - dumpHomogenMatrixLine3(aTransformation.Line2, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Line3" )); - dumpHomogenMatrixLine3(aTransformation.Line3, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); - } - xmlTextWriterEndElement( xmlWriter ); + uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeEngine"); + rtl::OUString sCustomShapeEngine; + if(anotherAny >>= sCustomShapeEngine) + dumpCustomShapeEngineAsAttribute(sCustomShapeEngine, xmlWriter); } - - void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder); + uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeData"); + rtl::OUString sCustomShapeData; + if(anotherAny >>= sCustomShapeData) + dumpCustomShapeDataAsAttribute(sCustomShapeData, xmlWriter); } - - void dumpHyperlinkAsAttribute(rtl::OUString sHyperlink, xmlTextWriterPtr xmlWriter) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("hyperlink"), "%s", - rtl::OUStringToOString(sHyperlink, RTL_TEXTENCODING_UTF8).getStr()); + uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeGeometry"); + uno::Sequence< beans::PropertyValue> aCustomShapeGeometry; + if(anotherAny >>= aCustomShapeGeometry) + dumpCustomShapeGeometryAsElement(aCustomShapeGeometry, xmlWriter); } - - // -------------------------------- - // ---------- XShape.idl ---------- - // -------------------------------- - - void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter) + if(xInfo->hasPropertyByName("CustomShapeReplacementURL")) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y); + uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeReplacementURL"); + rtl::OUString sCustomShapeReplacementURL; + if(anotherAny >>= sCustomShapeReplacementURL) + dumpCustomShapeReplacementURLAsAttribute(sCustomShapeReplacementURL, xmlWriter); } +} - void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height); - } +void dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) +{ + xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); + uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW); + uno::Reference xPropSetInfo = xPropSet->getPropertySetInfo(); + rtl::OUString aName; - void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter ) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", - rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr()); - } + dumpPositionAsAttribute(xShape->getPosition(), xmlWriter); + dumpSizeAsAttribute(xShape->getSize(), xmlWriter); + uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW); + dumpShapeDescriptorAsAttribute(xDescr, xmlWriter); - // ----------------------------------------------------- - // ---------- PolyPolygonBezierDescriptor.idl ---------- - // ----------------------------------------------------- + // uno::Sequence aProperties = xPropSetInfo->getProperties(); - void dumpPolyPolygonBezierAsElement(drawing::PolyPolygonBezierCoords aPolyPolygonBezier, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PolyPolygonBezier" )); - dumpPolyPolygonBezierCoords(aPolyPolygonBezier, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); - } + uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW ); + uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames(); - void dumpGeometryAsElement(drawing::PolyPolygonBezierCoords aGeometry, xmlTextWriterPtr xmlWriter) + uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); + if(xInfo->hasPropertyByName("Name")) { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Geometry" )); - dumpPolyPolygonBezierCoords(aGeometry, xmlWriter); - xmlTextWriterEndElement( xmlWriter ); + uno::Any aAny = xPropSet->getPropertyValue("Name"); + if (aAny >>= aName) + { + if (!aName.isEmpty()) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr()); + } } - // ------------------------------------- - // ---------- CustomShape.idl ---------- - // ------------------------------------- - - void dumpCustomShapeEngineAsAttribute(rtl::OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter) + try + { + if (xServiceInfo->supportsService("com.sun.star.drawing.Text")) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeEngine"), "%s", - rtl::OUStringToOString(sCustomShapeEngine, RTL_TEXTENCODING_UTF8).getStr()); + uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW); + rtl::OUString aText = xText->getString(); + if(!aText.isEmpty()) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); } + if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties")) + dumpTextPropertiesService(xPropSet, xmlWriter); - void dumpCustomShapeDataAsAttribute(rtl::OUString sCustomShapeData, xmlTextWriterPtr xmlWriter) + if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeData"), "%s", - rtl::OUStringToOString(sCustomShapeData, RTL_TEXTENCODING_UTF8).getStr()); + uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW); + dumpXShapes(xShapes, xmlWriter); } + if(xServiceInfo->supportsService("com.sun.star.drawing.FillProperties")) + dumpFillPropertiesService(xPropSet, xmlWriter); - void dumpCustomShapeGeometryAsElement(uno::Sequence< beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "CustomShapeGeometry" )); - sal_Int32 nLength = aCustomShapeGeometry.getLength(); - for (sal_Int32 i = 0; i < nLength; ++i) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "PropertyValue" )); + if(xServiceInfo->supportsService("com.sun.star.drawing.LineProperties")) + dumpLinePropertiesService(xPropSet, xmlWriter); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", - rtl::OUStringToOString(aCustomShapeGeometry[i].Name, RTL_TEXTENCODING_UTF8).getStr()); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("handle"), "%" SAL_PRIdINT32, aCustomShapeGeometry[i].Handle); + if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonDescriptor")) + dumpPolyPolygonDescriptorService(xPropSet, xmlWriter); - uno::Any aAny = aCustomShapeGeometry[i].Value; - rtl::OUString sValue; - if(aAny >>= sValue) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", - rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); - } - switch(aCustomShapeGeometry[i].State) - { - case beans::PropertyState_DIRECT_VALUE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DIRECT_VALUE"); - break; - case beans::PropertyState_DEFAULT_VALUE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "DEFAULT_VALUE"); - break; - case beans::PropertyState_AMBIGUOUS_VALUE: - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("propertyState"), "%s", "AMBIGUOUS_VALUE"); - break; - default: - break; - } - xmlTextWriterEndElement( xmlWriter ); - } - xmlTextWriterEndElement( xmlWriter ); - } + if(xServiceInfo->supportsService("com.sun.star.drawing.ShadowProperties")) + dumpShadowPropertiesService(xPropSet, xmlWriter); - void dumpCustomShapeReplacementURLAsAttribute(rtl::OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeReplacementURL"), "%s", - rtl::OUStringToOString(sCustomShapeReplacementURL, RTL_TEXTENCODING_UTF8).getStr()); - } + if(xServiceInfo->supportsService("com.sun.star.drawing.Shape")) + dumpShapeService(xPropSet, xmlWriter); - // methods dumping whole services + if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonBezierDescriptor")) + dumpPolyPolygonBezierDescriptorService(xPropSet, xmlWriter); - void dumpTextPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) - { - uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); - if(xInfo->hasPropertyByName("IsNumbering")) - { - uno::Any anotherAny = xPropSet->getPropertyValue("IsNumbering"); - sal_Bool bIsNumbering; - if(anotherAny >>= bIsNumbering) - dumpIsNumberingAsAttribute(bIsNumbering, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowHeight"); - sal_Bool bTextAutoGrowHeight; - if(anotherAny >>= bTextAutoGrowHeight) - dumpTextAutoGrowHeightAsAttribute(bTextAutoGrowHeight, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAutoGrowWidth"); - sal_Bool bTextAutoGrowWidth; - if(anotherAny >>= bTextAutoGrowWidth) - dumpTextAutoGrowWidthAsAttribute(bTextAutoGrowWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextContourFrame"); - sal_Bool bTextContourFrame; - if(anotherAny >>= bTextContourFrame) - dumpTextContourFrameAsAttribute(bTextContourFrame, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextFitToSize"); - drawing::TextFitToSizeType eTextFitToSize; - if(anotherAny >>= eTextFitToSize) - dumpTextFitToSizeAsAttribute(eTextFitToSize, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextHorizontalAdjust"); - drawing::TextHorizontalAdjust eTextHorizontalAdjust; - if(anotherAny >>= eTextHorizontalAdjust) - dumpTextHorizontalAdjustAsAttribute(eTextHorizontalAdjust, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextVerticalAdjust"); - drawing::TextVerticalAdjust eTextVerticalAdjust; - if(anotherAny >>= eTextVerticalAdjust) - dumpTextVerticalAdjustAsAttribute(eTextVerticalAdjust, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextLeftDistance"); - sal_Int32 aTextLeftDistance; - if(anotherAny >>= aTextLeftDistance) - dumpTextLeftDistanceAsAttribute(aTextLeftDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextRightDistance"); - sal_Int32 aTextRightDistance; - if(anotherAny >>= aTextRightDistance) - dumpTextRightDistanceAsAttribute(aTextRightDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextUpperDistance"); - sal_Int32 aTextUpperDistance; - if(anotherAny >>= aTextUpperDistance) - dumpTextUpperDistanceAsAttribute(aTextUpperDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextLowerDistance"); - sal_Int32 aTextLowerDistance; - if(anotherAny >>= aTextLowerDistance) - dumpTextLowerDistanceAsAttribute(aTextLowerDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameHeight"); - sal_Int32 aTextMaximumFrameHeight; - if(anotherAny >>= aTextMaximumFrameHeight) - dumpTextMaximumFrameHeightAsAttribute(aTextMaximumFrameHeight, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMaximumFrameWidth"); - sal_Int32 aTextMaximumFrameWidth; - if(anotherAny >>= aTextMaximumFrameWidth) - dumpTextMaximumFrameWidthAsAttribute(aTextMaximumFrameWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameHeight"); - sal_Int32 aTextMinimumFrameHeight; - if(anotherAny >>= aTextMinimumFrameHeight) - dumpTextMinimumFrameHeightAsAttribute(aTextMinimumFrameHeight, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextMinimumFrameWidth"); - sal_Int32 aTextMinimumFrameWidth; - if(anotherAny >>= aTextMinimumFrameWidth) - dumpTextMinimumFrameWidthAsAttribute(aTextMinimumFrameWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationAmount"); - sal_Int32 aTextAnimationAmount; - if(anotherAny >>= aTextAnimationAmount) - dumpTextAnimationAmountAsAttribute(aTextAnimationAmount, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationCount"); - sal_Int32 aTextAnimationCount; - if(anotherAny >>= aTextAnimationCount) - dumpTextAnimationCountAsAttribute(aTextAnimationCount, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDelay"); - sal_Int32 aTextAnimationDelay; - if(anotherAny >>= aTextAnimationDelay) - dumpTextAnimationDelayAsAttribute(aTextAnimationDelay, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationDirection"); - drawing::TextAnimationDirection eTextAnimationDirection; - if(anotherAny >>= eTextAnimationDirection) - dumpTextAnimationDirectionAsAttribute(eTextAnimationDirection, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationKind"); - drawing::TextAnimationKind eTextAnimationKind; - if(anotherAny >>= eTextAnimationKind) - dumpTextAnimationKindAsAttribute(eTextAnimationKind, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStartInside"); - sal_Bool bTextAnimationStartInside; - if(anotherAny >>= bTextAnimationStartInside) - dumpTextAnimationStartInsideAsAttribute(bTextAnimationStartInside, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextAnimationStopInside"); - sal_Bool bTextAnimationStopInside; - if(anotherAny >>= bTextAnimationStopInside) - dumpTextAnimationStopInsideAsAttribute(bTextAnimationStopInside, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("TextWritingMode"); - text::WritingMode eTextWritingMode; - if(anotherAny >>= eTextWritingMode) - dumpTextWritingModeAsAttribute(eTextWritingMode, xmlWriter); - } - } + if(xServiceInfo->supportsService("com.sun.star.drawing.CustomShape")) + dumpCustomShapeService(xPropSet, xmlWriter); - void dumpFillPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) - { - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillStyle"); - drawing::FillStyle eFillStyle; - if(anotherAny >>= eFillStyle) - dumpFillStyleAsAttribute(eFillStyle, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillColor"); - sal_Int32 aColor; - if(anotherAny >>= aColor) - dumpFillColorAsAttribute(aColor, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparence"); - sal_Int32 aTransparence; - if(anotherAny >>= aTransparence) - dumpFillTransparenceAsAttribute(aTransparence, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradientName"); - rtl::OUString sTranspGradName; - if(anotherAny >>= sTranspGradName) - dumpFillTransparenceGradientNameAsAttribute(sTranspGradName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillTransparenceGradient"); - awt::Gradient aTranspGrad; - if(anotherAny >>= aTranspGrad) - dumpFillTransparenceGradientAsElement(aTranspGrad, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillGradientName"); - rtl::OUString sGradName; - if(anotherAny >>= sGradName) - dumpFillGradientNameAsAttribute(sGradName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillGradient"); - awt::Gradient aGradient; - if(anotherAny >>= aGradient) - dumpFillGradientAsElement(aGradient, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillHatchName"); - rtl::OUString sHatchName; - if(anotherAny >>= sHatchName) - dumpFillGradientNameAsAttribute(sHatchName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillHatch"); - drawing::Hatch aHatch; - if(anotherAny >>= aHatch) - dumpFillHatchAsElement(aHatch, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBackground"); - sal_Bool bFillBackground; - if(anotherAny >>= bFillBackground) - dumpFillBackgroundAsAttribute(bFillBackground, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapName"); - rtl::OUString sBitmapName; - if(anotherAny >>= sBitmapName) - dumpFillGradientNameAsAttribute(sBitmapName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmap"); - uno::Reference xBitmap; - if(anotherAny >>= xBitmap) - dumpFillBitmapAsElement(xBitmap, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapURL"); - rtl::OUString sBitmapURL; - if(anotherAny >>= sBitmapURL) - dumpFillBitmapURLAsAttribute(sBitmapURL, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetX"); - sal_Int32 aBitmapPositionOffsetX; - if(anotherAny >>= aBitmapPositionOffsetX) - dumpFillBitmapPositionOffsetXAsAttribute(aBitmapPositionOffsetX, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapPositionOffsetY"); - sal_Int32 aBitmapPositionOffsetY; - if(anotherAny >>= aBitmapPositionOffsetY) - dumpFillBitmapPositionOffsetYAsAttribute(aBitmapPositionOffsetY, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetX"); - sal_Int32 aBitmapOffsetX; - if(anotherAny >>= aBitmapOffsetX) - dumpFillBitmapOffsetXAsAttribute(aBitmapOffsetX, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapOffsetY"); - sal_Int32 aBitmapOffsetY; - if(anotherAny >>= aBitmapOffsetY) - dumpFillBitmapOffsetYAsAttribute(aBitmapOffsetY, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapRectanglePoint"); - drawing::RectanglePoint eBitmapRectanglePoint; - if(anotherAny >>= eBitmapRectanglePoint) - dumpFillBitmapRectanglePointAsAttribute(eBitmapRectanglePoint, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapLogicalSize"); - sal_Bool bBitmapLogicalSize; - if(anotherAny >>= bBitmapLogicalSize) - dumpFillBitmapLogicalSizeAsAttribute(bBitmapLogicalSize, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeX"); - sal_Int32 aBitmapSizeX; - if(anotherAny >>= aBitmapSizeX) - dumpFillBitmapSizeXAsAttribute(aBitmapSizeX, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapSizeY"); - sal_Int32 aBitmapSizeY; - if(anotherAny >>= aBitmapSizeY) - dumpFillBitmapSizeYAsAttribute(aBitmapSizeY, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapMode"); - drawing::BitmapMode eBitmapMode; - if(anotherAny >>= eBitmapMode) - dumpFillBitmapModeAsAttribute(eBitmapMode, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapStretch"); - sal_Bool bBitmapStretch; - if(anotherAny >>= bBitmapStretch) - dumpFillBitmapStretchAsAttribute(bBitmapStretch, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("FillBitmapTile"); - sal_Bool bBitmapTile; - if(anotherAny >>= bBitmapTile) - dumpFillBitmapTileAsAttribute(bBitmapTile, xmlWriter); - } - } + // EnhancedShapeDumper used - void dumpLinePropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeExtrusion")) { - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStyle"); - drawing::LineStyle eLineStyle; - if(anotherAny >>= eLineStyle) - dumpLineStyleAsAttribute(eLineStyle, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineDash"); - drawing::LineDash aLineDash; - if(anotherAny >>= aLineDash) - dumpLineDashAsElement(aLineDash, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineDashName"); - rtl::OUString sLineDashName; - if(anotherAny >>= sLineDashName) - dumpLineDashNameAsAttribute(sLineDashName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineColor"); - sal_Int32 aLineColor; - if(anotherAny >>= aLineColor) - dumpLineColorAsAttribute(aLineColor, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineTransparence"); - sal_Int32 aLineTransparence; - if(anotherAny >>= aLineTransparence) - dumpLineTransparenceAsAttribute(aLineTransparence, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineWidth"); - sal_Int32 aLineWidth; - if(anotherAny >>= aLineWidth) - dumpLineWidthAsAttribute(aLineWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineJoint"); - drawing::LineJoint eLineJoint; - if(anotherAny >>= eLineJoint) - dumpLineJointAsAttribute(eLineJoint, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStartName"); - rtl::OUString sLineStartName; - if(anotherAny >>= sLineStartName) - dumpLineStartNameAsAttribute(sLineStartName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEndName"); - rtl::OUString sLineEndName; - if(anotherAny >>= sLineEndName) - dumpLineEndNameAsAttribute(sLineEndName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStart"); - drawing::PolyPolygonBezierCoords aLineStart; - if(anotherAny >>= aLineStart) - dumpLineStartAsElement(aLineStart, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEnd"); - drawing::PolyPolygonBezierCoords aLineEnd; - if(anotherAny >>= aLineEnd) - dumpLineEndAsElement(aLineEnd, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStartCenter"); - sal_Bool bLineStartCenter; - if(anotherAny >>= bLineStartCenter) - dumpLineStartCenterAsAttribute(bLineStartCenter, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineStartWidth"); - sal_Int32 aLineStartWidth; - if(anotherAny >>= aLineStartWidth) - dumpLineStartWidthAsAttribute(aLineStartWidth, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEndCenter"); - sal_Bool bLineEndCenter; - if(anotherAny >>= bLineEndCenter) - dumpLineEndCenterAsAttribute(bLineEndCenter, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LineEndWidth"); - sal_Int32 aLineEndWidth; - if(anotherAny >>= aLineEndWidth) - dumpLineEndWidthAsAttribute(aLineEndWidth, xmlWriter); - } + EnhancedShapeDumper enhancedDumper(xmlWriter); + enhancedDumper.dumpEnhancedCustomShapeExtrusionService(xPropSet); } - - void dumpShadowPropertiesService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeGeometry")) { - { - uno::Any anotherAny = xPropSet->getPropertyValue("Shadow"); - sal_Bool bShadow; - if(anotherAny >>= bShadow) - dumpShadowAsAttribute(bShadow, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowColor"); - sal_Int32 aShadowColor; - if(anotherAny >>= aShadowColor) - dumpShadowColorAsAttribute(aShadowColor, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowTransparence"); - sal_Int32 aShadowTransparence; - if(anotherAny >>= aShadowTransparence) - dumpShadowTransparenceAsAttribute(aShadowTransparence, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowXDistance"); - sal_Int32 aShadowXDistance; - if(anotherAny >>= aShadowXDistance) - dumpShadowXDistanceAsAttribute(aShadowXDistance, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("ShadowYDistance"); - sal_Int32 aShadowYDistance; - if(anotherAny >>= aShadowYDistance) - dumpShadowYDistanceAsAttribute(aShadowYDistance, xmlWriter); - } + EnhancedShapeDumper enhancedDumper(xmlWriter); + enhancedDumper.dumpEnhancedCustomShapeGeometryService(xPropSet); } - - void dumpPolyPolygonDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeHandle")) { - { - uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); - drawing::PolygonKind ePolygonKind; - if(anotherAny >>= ePolygonKind) - dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygon"); - drawing::PointSequenceSequence aPolyPolygon; - if(anotherAny >>= aPolyPolygon) - dumpPolyPolygonAsElement(aPolyPolygon, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); - drawing::PointSequenceSequence aGeometry; - if(anotherAny >>= aGeometry) - dumpGeometryAsElement(aGeometry, xmlWriter); - } + EnhancedShapeDumper enhancedDumper(xmlWriter); + enhancedDumper.dumpEnhancedCustomShapeHandleService(xPropSet); } - - void dumpShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapePath")) { - uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); - { - uno::Any anotherAny = xPropSet->getPropertyValue("ZOrder"); - sal_Int32 aZOrder; - if(anotherAny >>= aZOrder) - dumpZOrderAsAttribute(aZOrder, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LayerID"); - sal_Int32 aLayerID; - if(anotherAny >>= aLayerID) - dumpLayerIDAsAttribute(aLayerID, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("LayerName"); - rtl::OUString sLayerName; - if(anotherAny >>= sLayerName) - dumpLayerNameAsAttribute(sLayerName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Visible"); - sal_Bool bVisible; - if(anotherAny >>= bVisible) - dumpVisibleAsAttribute(bVisible, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Printable"); - sal_Bool bPrintable; - if(anotherAny >>= bPrintable) - dumpPrintableAsAttribute(bPrintable, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("MoveProtect"); - sal_Bool bMoveProtect; - if(anotherAny >>= bMoveProtect) - dumpMoveProtectAsAttribute(bMoveProtect, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Name"); - rtl::OUString sName; - if(anotherAny >>= sName) - dumpNameAsAttribute(sName, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("SizeProtect"); - sal_Bool bSizeProtect; - if(anotherAny >>= bSizeProtect) - dumpSizeProtectAsAttribute(bSizeProtect, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Transformation"); - drawing::HomogenMatrix3 aTransformation; - if(anotherAny >>= aTransformation) - dumpTransformationAsElement(aTransformation, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("NavigationOrder"); - sal_Int32 aNavigationOrder; - if(anotherAny >>= aNavigationOrder) - dumpNavigationOrderAsAttribute(aNavigationOrder, xmlWriter); - } - if(xInfo->hasPropertyByName("Hyperlink")) - { - uno::Any anotherAny = xPropSet->getPropertyValue("Hyperlink"); - rtl::OUString sHyperlink; - if(anotherAny >>= sHyperlink) - dumpHyperlinkAsAttribute(sHyperlink, xmlWriter); - } + EnhancedShapeDumper enhancedDumper(xmlWriter); + enhancedDumper.dumpEnhancedCustomShapePathService(xPropSet); } - - void dumpPolyPolygonBezierDescriptorService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeTextPath")) { - { - uno::Any anotherAny = xPropSet->getPropertyValue("PolygonKind"); - drawing::PolygonKind ePolygonKind; - if(anotherAny >>= ePolygonKind) - dumpPolygonKindAsAttribute(ePolygonKind, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("PolyPolygonBezier"); - drawing::PolyPolygonBezierCoords aPolyPolygonBezier; - if(anotherAny >>= aPolyPolygonBezier) - dumpPolyPolygonBezierCoords(aPolyPolygonBezier, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("Geometry"); - drawing::PolyPolygonBezierCoords aGeometry; - if(anotherAny >>= aGeometry) - dumpPolyPolygonBezierCoords(aGeometry, xmlWriter); - } + EnhancedShapeDumper enhancedDumper(xmlWriter); + enhancedDumper.dumpEnhancedCustomShapeTextPathService(xPropSet); } - - void dumpCustomShapeService(uno::Reference< beans::XPropertySet > xPropSet, xmlTextWriterPtr xmlWriter) + } // end of the 'try' block + catch (com::sun::star::beans::UnknownPropertyException &e) { - uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); - { - uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeEngine"); - rtl::OUString sCustomShapeEngine; - if(anotherAny >>= sCustomShapeEngine) - dumpCustomShapeEngineAsAttribute(sCustomShapeEngine, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeData"); - rtl::OUString sCustomShapeData; - if(anotherAny >>= sCustomShapeData) - dumpCustomShapeDataAsAttribute(sCustomShapeData, xmlWriter); - } - { - uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeGeometry"); - uno::Sequence< beans::PropertyValue> aCustomShapeGeometry; - if(anotherAny >>= aCustomShapeGeometry) - dumpCustomShapeGeometryAsElement(aCustomShapeGeometry, xmlWriter); - } - if(xInfo->hasPropertyByName("CustomShapeReplacementURL")) - { - uno::Any anotherAny = xPropSet->getPropertyValue("CustomShapeReplacementURL"); - rtl::OUString sCustomShapeReplacementURL; - if(anotherAny >>= sCustomShapeReplacementURL) - dumpCustomShapeReplacementURLAsAttribute(sCustomShapeReplacementURL, xmlWriter); - } + printf("Problem in the XShapeDumper"); } - void dumpXShape(uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter) - { - xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) ); - uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW); - uno::Reference xPropSetInfo = xPropSet->getPropertySetInfo(); - rtl::OUString aName; - - dumpPositionAsAttribute(xShape->getPosition(), xmlWriter); - dumpSizeAsAttribute(xShape->getSize(), xmlWriter); - uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW); - dumpShapeDescriptorAsAttribute(xDescr, xmlWriter); - - // uno::Sequence aProperties = xPropSetInfo->getProperties(); - - uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW ); - uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames(); - - uno::Reference< beans::XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo(); - if(xInfo->hasPropertyByName("Name")) - { - uno::Any aAny = xPropSet->getPropertyValue("Name"); - if (aAny >>= aName) - { - if (!aName.isEmpty()) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr()); - } - } - - try - { - if (xServiceInfo->supportsService("com.sun.star.drawing.Text")) - { - uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW); - rtl::OUString aText = xText->getString(); - if(!aText.isEmpty()) - xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); - } - if(xServiceInfo->supportsService("com.sun.star.drawing.TextProperties")) - dumpTextPropertiesService(xPropSet, xmlWriter); - - if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) + #if DEBUG_DUMPER + sal_Int32 nServices = aServiceNames.getLength(); + for (sal_Int32 i = 0; i < nServices; ++i) { - uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW); - dumpXShapes(xShapes, xmlWriter); - } - if(xServiceInfo->supportsService("com.sun.star.drawing.FillProperties")) - dumpFillPropertiesService(xPropSet, xmlWriter); - - if(xServiceInfo->supportsService("com.sun.star.drawing.LineProperties")) - dumpLinePropertiesService(xPropSet, xmlWriter); - - if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonDescriptor")) - dumpPolyPolygonDescriptorService(xPropSet, xmlWriter); - - if(xServiceInfo->supportsService("com.sun.star.drawing.ShadowProperties")) - dumpShadowPropertiesService(xPropSet, xmlWriter); - - if(xServiceInfo->supportsService("com.sun.star.drawing.Shape")) - dumpShapeService(xPropSet, xmlWriter); - - if(xServiceInfo->supportsService("com.sun.star.drawing.PolyPolygonBezierDescriptor")) - dumpPolyPolygonBezierDescriptorService(xPropSet, xmlWriter); - - if(xServiceInfo->supportsService("com.sun.star.drawing.CustomShape")) - dumpCustomShapeService(xPropSet, xmlWriter); - - // EnhancedShapeDumper used - - if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeExtrusion")) - { - EnhancedShapeDumper enhancedDumper(xmlWriter); - enhancedDumper.dumpEnhancedCustomShapeExtrusionService(xPropSet); - } - if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeGeometry")) - { - EnhancedShapeDumper enhancedDumper(xmlWriter); - enhancedDumper.dumpEnhancedCustomShapeGeometryService(xPropSet); - } - if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapeHandle")) - { - EnhancedShapeDumper enhancedDumper(xmlWriter); - enhancedDumper.dumpEnhancedCustomShapeHandleService(xPropSet); - } - if(xServiceInfo->supportsService("com.sun.star.drawing.EnhancedCustomShapePath")) - { - 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) - { - printf("Problem in the XShapeDumper"); + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ServiceName" )); + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( "name" ), "%s", rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr()); + xmlTextWriterEndElement( xmlWriter ); } + #endif - #if DEBUG_DUMPER - sal_Int32 nServices = aServiceNames.getLength(); - for (sal_Int32 i = 0; i < nServices; ++i) - { - xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ServiceName" )); - xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( "name" ), "%s", rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr()); - xmlTextWriterEndElement( xmlWriter ); - } - #endif - - xmlTextWriterEndElement( xmlWriter ); - } + xmlTextWriterEndElement( xmlWriter ); +} - void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ) +void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter ) +{ + xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) ); + uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW); + sal_Int32 nLength = xIA->getCount(); + for (sal_Int32 i = 0; i < nLength; ++i) { - xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) ); - uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW); - sal_Int32 nLength = xIA->getCount(); - for (sal_Int32 i = 0; i < nLength; ++i) - { - uno::Reference< drawing::XShape > xShape( xIA->getByIndex( i ), uno::UNO_QUERY_THROW ); - dumpXShape( xShape, xmlWriter ); - } - - xmlTextWriterEndElement( xmlWriter ); + uno::Reference< drawing::XShape > xShape( xIA->getByIndex( i ), uno::UNO_QUERY_THROW ); + dumpXShape( xShape, xmlWriter ); } + + xmlTextWriterEndElement( xmlWriter ); +} } //end of namespace - rtl::OUString XShapeDumper::dump(uno::Reference xPageShapes) - { +rtl::OUString XShapeDumper::dump(uno::Reference xPageShapes) +{ - rtl::OStringBuffer aString; - xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL ); - xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer ); - xmlTextWriterSetIndent( xmlWriter, 1 ); + rtl::OStringBuffer aString; + xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO( writeCallback, closeCallback, &aString, NULL ); + xmlTextWriterPtr xmlWriter = xmlNewTextWriter( xmlOutBuffer ); + xmlTextWriterSetIndent( xmlWriter, 1 ); - xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL ); + xmlTextWriterStartDocument( xmlWriter, NULL, NULL, NULL ); - dumpXShapes( xPageShapes, xmlWriter ); + dumpXShapes( xPageShapes, xmlWriter ); - xmlTextWriterEndDocument( xmlWriter ); - xmlFreeTextWriter( xmlWriter ); + xmlTextWriterEndDocument( xmlWriter ); + xmlFreeTextWriter( xmlWriter ); - return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); - } + return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); +} -- cgit From f11bfe90f8453c74c94717b816f05ad44ba00b1e Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 13 Jul 2012 06:00:35 +0200 Subject: move EnhancedShapeDumper to a module local location Change-Id: Idb4cd44da611973c92bda6de779daf3aa8425168 --- .../inc/drawinglayer/EnhancedShapeDumper.hxx | 150 --------------------- drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 2 +- drawinglayer/source/dumper/EnhancedShapeDumper.hxx | 149 ++++++++++++++++++++ drawinglayer/source/dumper/XShapeDumper.cxx | 2 +- 4 files changed, 151 insertions(+), 152 deletions(-) delete mode 100644 drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx create mode 100644 drawinglayer/source/dumper/EnhancedShapeDumper.hxx (limited to 'drawinglayer') diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx deleted file mode 100644 index 7bad73c7e497..000000000000 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * Version: MPL 1.1 / GPLv3+ / LGPLv3+ - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License or as specified alternatively below. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * Major Contributor(s): - * Copyright (C) 2012 Artur Dorda (initial developer) - * - * All Rights Reserved. - * - * For minor contributions see the git repository. - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 3 or later (the "GPLv3+"), or - * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), - * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable - * instead of those above. - */ - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#ifndef EnhancedShapeDumper_hxx -#define EnhancedShapeDumper_hxx - -class DRAWINGLAYER_DLLPUBLIC EnhancedShapeDumper -{ -public: - EnhancedShapeDumper(xmlTextWriterPtr writer) - : - xmlWriter(writer) - { - - } - - // auxiliary functions - void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); - void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D); - void dumpPropertyValueAsElement(com::sun::star::beans::PropertyValue aPropertyValue); - void dumpEnhancedCustomShapeParameter(com::sun::star::drawing::EnhancedCustomShapeParameter aParameter); - - // EnhancedCustomShapeExtrusion.idl - void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); - void dumpExtrusionAsAttribute(sal_Bool bExtrusion); - void dumpBrightnessAsAttribute(double aBrightness); - void dumpDepthAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepth); - void dumpDiffusionAsAttribute(double aDiffusion); - void dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments); - void dumpLightFaceAsAttribute(sal_Bool bLightFace); - void dumpFirstLightHarshAsAttribute(sal_Bool bFirstLightHarsh); - void dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh); - void dumpFirstLightLevelAsAttribute(double aFirstLightLevel); - void dumpSecondLightLevelAsAttribute(double aSecondLightLevel); - void dumpFirstLightDirectionAsElement(com::sun::star::drawing::Direction3D aFirstLightDirection); - void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection); - void dumpMetalAsAttribute(sal_Bool bMetal); - void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode); - void dumpRotateAngleAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aRotateAngle); - void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter); - void dumpShininessAsAttribute(double aShininess); - void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew); - void dumpSpecularityAsAttribute(double aSpecularity); - void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode); - void dumpViewPointAsElement(com::sun::star::drawing::Position3D aViewPoint); - void dumpOriginAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aOrigin); - void dumpExtrusionColorAsAttribute(sal_Bool bExtrusionColor); - - // 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); // also used in EnhancedCustomShapeHandle - void dumpMirroredYAsAttribute(sal_Bool bMirroredY); // also used in EnhancedCustomShapeHandle - void dumpTextRotateAngleAsAttribute(double aTextRotateAngle); - void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues); - void dumpExtrusionAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aExtrusion); - void dumpPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aPath); - void dumpTextPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aTextPath); - void dumpEquationsAsElement(com::sun::star::uno::Sequence< rtl::OUString > aEquations); - void dumpHandlesAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValues > aHandles); - - // EnhancedCustomShapeHandle.idl - void dumpEnhancedCustomShapeHandleService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); - void dumpSwitchedAsAttribute(sal_Bool bSwitched); - void dumpPositionAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition); - void dumpPolarAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPolar); - void dumpRefXAsAttribute(sal_Int32 aRefX); - void dumpRefYAsAttribute(sal_Int32 aRefY); - void dumpRefAngleAsAttribute(sal_Int32 aRefAngle); - void dumpRefRAsAttribute(sal_Int32 aRefR); - void dumpRangeXMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMinimum); - void dumpRangeXMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum); - void dumpRangeYMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeYMinimum); - void dumpRangeYMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum); - void dumpRadiusRangeMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum); - void dumpRadiusRangeMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum); - - // EnhancedCustomShapePath.idl - void dumpEnhancedCustomShapePathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); - void dumpCoordinatesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates); - void dumpSegmentsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments); - void dumpStretchXAsAttribute(sal_Int32 aStretchX); - void dumpStretchYAsAttribute(sal_Int32 aStretchY); - void dumpTextFramesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames); - void dumpGluePointsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints); - void dumpGluePointLeavingDirectionsAsElement(com::sun::star::uno::Sequence< double > aGluePointLeavingDirections); - void dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType); - void dumpExtrusionAllowedAsAttribute(sal_Bool bExtrusionAllowed); - void dumpConcentricGradientFillAllowedAsAttribute(sal_Bool bConcentricGradientFillAllowed); - 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); - void dumpTextPathModeAsAttribute(com::sun::star::drawing::EnhancedCustomShapeTextPathMode eTextPathMode); - void dumpScaleXAsAttribute(sal_Bool bScaleX); - -private: - xmlTextWriterPtr xmlWriter; -}; -#endif diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 7ecbb3c5f1ab..4d7c05641db6 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -26,7 +26,7 @@ * instead of those above. */ -#include +#include #include #include diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.hxx b/drawinglayer/source/dumper/EnhancedShapeDumper.hxx new file mode 100644 index 000000000000..7ed9359535f7 --- /dev/null +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.hxx @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Artur Dorda (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#ifndef EnhancedShapeDumper_hxx +#define EnhancedShapeDumper_hxx + +class EnhancedShapeDumper +{ +public: + EnhancedShapeDumper(xmlTextWriterPtr writer) + : + xmlWriter(writer) + { + + } + + // auxiliary functions + void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); + void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D); + void dumpPropertyValueAsElement(com::sun::star::beans::PropertyValue aPropertyValue); + void dumpEnhancedCustomShapeParameter(com::sun::star::drawing::EnhancedCustomShapeParameter aParameter); + + // EnhancedCustomShapeExtrusion.idl + void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); + void dumpExtrusionAsAttribute(sal_Bool bExtrusion); + void dumpBrightnessAsAttribute(double aBrightness); + void dumpDepthAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepth); + void dumpDiffusionAsAttribute(double aDiffusion); + void dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments); + void dumpLightFaceAsAttribute(sal_Bool bLightFace); + void dumpFirstLightHarshAsAttribute(sal_Bool bFirstLightHarsh); + void dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh); + void dumpFirstLightLevelAsAttribute(double aFirstLightLevel); + void dumpSecondLightLevelAsAttribute(double aSecondLightLevel); + void dumpFirstLightDirectionAsElement(com::sun::star::drawing::Direction3D aFirstLightDirection); + void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection); + void dumpMetalAsAttribute(sal_Bool bMetal); + void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode); + void dumpRotateAngleAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aRotateAngle); + void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter); + void dumpShininessAsAttribute(double aShininess); + void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew); + void dumpSpecularityAsAttribute(double aSpecularity); + void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode); + void dumpViewPointAsElement(com::sun::star::drawing::Position3D aViewPoint); + void dumpOriginAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aOrigin); + void dumpExtrusionColorAsAttribute(sal_Bool bExtrusionColor); + + // 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); // also used in EnhancedCustomShapeHandle + void dumpMirroredYAsAttribute(sal_Bool bMirroredY); // also used in EnhancedCustomShapeHandle + void dumpTextRotateAngleAsAttribute(double aTextRotateAngle); + void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues); + void dumpExtrusionAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aExtrusion); + void dumpPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aPath); + void dumpTextPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aTextPath); + void dumpEquationsAsElement(com::sun::star::uno::Sequence< rtl::OUString > aEquations); + void dumpHandlesAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValues > aHandles); + + // EnhancedCustomShapeHandle.idl + void dumpEnhancedCustomShapeHandleService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); + void dumpSwitchedAsAttribute(sal_Bool bSwitched); + void dumpPositionAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition); + void dumpPolarAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPolar); + void dumpRefXAsAttribute(sal_Int32 aRefX); + void dumpRefYAsAttribute(sal_Int32 aRefY); + void dumpRefAngleAsAttribute(sal_Int32 aRefAngle); + void dumpRefRAsAttribute(sal_Int32 aRefR); + void dumpRangeXMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMinimum); + void dumpRangeXMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum); + void dumpRangeYMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeYMinimum); + void dumpRangeYMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum); + void dumpRadiusRangeMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum); + void dumpRadiusRangeMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum); + + // EnhancedCustomShapePath.idl + void dumpEnhancedCustomShapePathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); + void dumpCoordinatesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates); + void dumpSegmentsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments); + void dumpStretchXAsAttribute(sal_Int32 aStretchX); + void dumpStretchYAsAttribute(sal_Int32 aStretchY); + void dumpTextFramesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames); + void dumpGluePointsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints); + void dumpGluePointLeavingDirectionsAsElement(com::sun::star::uno::Sequence< double > aGluePointLeavingDirections); + void dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType); + void dumpExtrusionAllowedAsAttribute(sal_Bool bExtrusionAllowed); + void dumpConcentricGradientFillAllowedAsAttribute(sal_Bool bConcentricGradientFillAllowed); + 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); + void dumpTextPathModeAsAttribute(com::sun::star::drawing::EnhancedCustomShapeTextPathMode eTextPathMode); + void dumpScaleXAsAttribute(sal_Bool bScaleX); + +private: + xmlTextWriterPtr xmlWriter; +}; +#endif diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 7c31bb9281f2..c5055410f59b 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -27,7 +27,7 @@ */ #include -#include +#include "EnhancedShapeDumper.hxx" #include #include #include -- cgit From ee615aeb2c11ee1f288f903c2a7550299a9bc820 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 13 Jul 2012 06:07:27 +0200 Subject: forgot to remove the header file from the deliver code Change-Id: Ifd6edd22e144948a3e98b02744ebf4852f0aa3e3 --- drawinglayer/Package_inc.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/Package_inc.mk b/drawinglayer/Package_inc.mk index 585a027735f5..7d41e6c2b5d8 100644 --- a/drawinglayer/Package_inc.mk +++ b/drawinglayer/Package_inc.mk @@ -138,6 +138,5 @@ $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/ $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/texture/texture3d.hxx,drawinglayer/texture/texture3d.hxx)) $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/texture/texture.hxx,drawinglayer/texture/texture.hxx)) $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/XShapeDumper.hxx,drawinglayer/XShapeDumper.hxx)) -$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/XShapeDumper.hxx,drawinglayer/EnhancedShapeDumper.hxx)) # vim: set noet sw=4 ts=4: -- cgit