diff options
author | Christian Lippka <cl@openoffice.org> | 2001-11-27 13:14:16 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2001-11-27 13:14:16 +0000 |
commit | 17f5a2e55db527cc8ebf9d8a89f876f773552176 (patch) | |
tree | c5141dd50012d7fd23b54fddba12d3ba44807512 /xmloff/source/draw/shapeexport.cxx | |
parent | 9110083920540235a72cbb621ed2ec1efb1edd5e (diff) |
#95115# added helper for default graphic style export
Diffstat (limited to 'xmloff/source/draw/shapeexport.cxx')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 290d7a229ccc..280f1ee61275 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shapeexport.cxx,v $ * - * $Revision: 1.45 $ + * $Revision: 1.46 $ * - * last change: $Author: cl $ $Date: 2001-11-27 13:30:16 $ + * last change: $Author: cl $ $Date: 2001-11-27 14:13:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,6 +59,10 @@ * ************************************************************************/ +#ifndef _COM_SUN_STAR_LANG_SERVICENOTREGISTEREDEXCEPTION_HPP_ +#include <com/sun/star/lang/ServiceNotRegisteredException.hpp> +#endif + #ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_ #include <com/sun/star/container/XChild.hpp> #endif @@ -1025,3 +1029,34 @@ void XMLShapeExport::ImpExportGluePoints( const uno::Reference< drawing::XShape } } } + +void XMLShapeExport::ExportGraphicDefaults() +{ + XMLStyleExport aStEx(rExport, OUString(), rExport.GetAutoStylePool().get()); + + // construct PropertySetMapper + UniReference< SvXMLExportPropertyMapper > xPropertySetMapper( CreateShapePropMapper( rExport ) ); + + // chain text attributes + xPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(rExport)); + + // write graphic family default style + uno::Reference< lang::XMultiServiceFactory > xFact( rExport.GetModel(), uno::UNO_QUERY ); + if( xFact.is() ) + { + try + { + uno::Reference< beans::XPropertySet > xDefaults( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults") ) ), uno::UNO_QUERY ); + if( xDefaults.is() ) + { + aStEx.exportDefaultStyle( xDefaults, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), xPropertySetMapper ); + + // write graphic family styles + aStEx.exportStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_NAME, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), xPropertySetMapper, FALSE, XML_STYLE_FAMILY_SD_GRAPHICS_ID); + } + } + catch( lang::ServiceNotRegisteredException& ) + { + } + } +}
\ No newline at end of file |