summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2001-11-27 13:14:16 +0000
committerChristian Lippka <cl@openoffice.org>2001-11-27 13:14:16 +0000
commit17f5a2e55db527cc8ebf9d8a89f876f773552176 (patch)
treec5141dd50012d7fd23b54fddba12d3ba44807512 /xmloff
parent9110083920540235a72cbb621ed2ec1efb1edd5e (diff)
#95115# added helper for default graphic style export
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx9
-rw-r--r--xmloff/source/draw/sdxmlexp_impl.hxx6
-rw-r--r--xmloff/source/draw/shapeexport.cxx39
3 files changed, 44 insertions, 10 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 9c9e3dd232db..0740e8169765 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdxmlexp.cxx,v $
*
- * $Revision: 1.77 $
+ * $Revision: 1.78 $
*
- * last change: $Author: dvo $ $Date: 2001-10-25 20:57:02 $
+ * last change: $Author: cl $ $Date: 2001-11-27 14:14:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -894,6 +894,7 @@ void SAL_CALL ImpDefaultMapper::removeVetoableChangeListener( const OUString& Pr
//////////////////////////////////////////////////////////////////////////////
+/* moved to shapeexport.cxx
void SdXMLExport::ImpWriteObjGraphicStyleInfos()
{
XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get());
@@ -919,7 +920,7 @@ void SdXMLExport::ImpWriteObjGraphicStyleInfos()
}
}
}
-
+*/
//////////////////////////////////////////////////////////////////////////////
void SdXMLExport::ImpPrepAutoLayoutInfos()
@@ -2025,7 +2026,7 @@ void SdXMLExport::_ExportStyles(BOOL bUsed)
SvXMLExport::_ExportStyles( bUsed );
// write draw:style-name for object graphic-styles
- ImpWriteObjGraphicStyleInfos();
+ GetShapeExport()->ExportGraphicDefaults();
// write presentation styles
ImpWritePresentationStyles();
diff --git a/xmloff/source/draw/sdxmlexp_impl.hxx b/xmloff/source/draw/sdxmlexp_impl.hxx
index 2770841f6bdf..0903f8dc3a0b 100644
--- a/xmloff/source/draw/sdxmlexp_impl.hxx
+++ b/xmloff/source/draw/sdxmlexp_impl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdxmlexp_impl.hxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: bm $ $Date: 2001-09-14 11:22:49 $
+ * last change: $Author: cl $ $Date: 2001-11-27 14:14:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -186,8 +186,6 @@ class SdXMLExport : public SvXMLExport
void ImpWriteAutoLayoutInfos();
void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect);
- void ImpWriteObjGraphicStyleInfos();
-
void exportFormsElement( com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage );
void exportPresentationSettings();
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