diff options
author | Christian Lippka <cl@openoffice.org> | 2001-01-19 15:25:18 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2001-01-19 15:25:18 +0000 |
commit | 2dc6a7e08d964dd2b0e83f0b23e51e58f5145d1b (patch) | |
tree | 4cc8b349da99aa21d889c05a44b6e1aa4877c976 /xmloff/source | |
parent | 8ff8ba03f412fa84cbce0fab8298b042886f2975 (diff) |
added layer support for impress/draw applications
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/draw/makefile.mk | 6 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 41 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 44 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.hxx | 6 | ||||
-rw-r--r-- | xmloff/source/draw/ximpstyl.cxx | 13 |
6 files changed, 103 insertions, 12 deletions
diff --git a/xmloff/source/draw/makefile.mk b/xmloff/source/draw/makefile.mk index 917dce18e7ab..830f1e847a57 100644 --- a/xmloff/source/draw/makefile.mk +++ b/xmloff/source/draw/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.6 $ +# $Revision: 1.7 $ # -# last change: $Author: mib $ $Date: 2001-01-05 16:58:04 $ +# last change: $Author: cl $ $Date: 2001-01-19 16:25:18 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -75,6 +75,8 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- SLOFILES = \ + $(SLO)$/layerexp.obj\ + $(SLO)$/layerimp.obj\ $(SLO)$/ximpshow.obj\ $(SLO)$/animimp.obj\ $(SLO)$/animexp.obj\ diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 40bdcd026b0c..45ed5e4cc3cd 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdxmlexp.cxx,v $ * - * $Revision: 1.42 $ + * $Revision: 1.43 $ * - * last change: $Author: cl $ $Date: 2001-01-18 14:49:52 $ + * last change: $Author: cl $ $Date: 2001-01-19 16:25:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -265,6 +265,10 @@ #include <com/sun/star/drawing/CameraGeometry.hpp> #endif +#ifndef _XMLOFF_LAYEREXP_HXX +#include "layerexp.hxx" +#endif + using namespace ::rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -669,6 +673,8 @@ void SAL_CALL SdXMLExport::setSourceDocument( const uno::Reference< lang::XCompo // add namespaces _GetNamespaceMap().AddAtIndex( XML_NAMESPACE_PRESENTATION, sXML_np_presentation, sXML_n_presentation, XML_NAMESPACE_PRESENTATION); + + GetShapeExport()->enableLayerExport(); } ////////////////////////////////////////////////////////////////////////////// @@ -3650,6 +3656,33 @@ void SdXMLExport::ImpWriteSingleShapeStyleInfo( rExp.AddAttribute(XML_NAMESPACE_DRAW, sXML_id, sId ); } + if( rExp.GetShapeExport()->IsLayerExportEnabled() ) + { + try + { + uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY ); + OUString aLayerName; + xProps->getPropertyValue( OUString::createFromAscii( "LayerName" ) ) >>= aLayerName; + rExp.AddAttribute(XML_NAMESPACE_DRAW, sXML_layer, aLayerName ); + +/* + sal_Int16 nLayerId; + + uno::Reference< drawing::XLayer > xLayer; + xLayerManager->getByIndex( nLayerId ) >>= xLayer; + if( xLayer.is() ) + { + + } +*/ + } + catch( uno::Exception e ) + { + DBG_ERROR( "could not export layer name for shape!" ); + } + + } + switch(eShapeType) { case XmlShapeTypeDrawRectangleShape: @@ -3779,6 +3812,7 @@ void SdXMLExport::ImpWriteSingleShapeStyleInfo( break; } } + } void SdXMLExport::ImpWriteSingleShapeStyleInfos(uno::Reference< container::XIndexAccess >& xShapes, sal_Int32 nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */ ) @@ -4188,6 +4222,9 @@ void SdXMLExport::_ExportAutoStyles() void SdXMLExport::_ExportMasterStyles() { + // export layer + SdXMLayerExporter::exportLayer( *this ); + // export MasterPages in master-styles section for(sal_Int32 nMPageId = 0L; nMPageId < mnDocMasterPageCount; nMPageId++) { diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index a8d123cfeb69..b0b7ccb76b82 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shapeexport.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: bm $ $Date: 2001-01-17 14:45:55 $ + * last change: $Author: cl $ $Date: 2001-01-19 16:25:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,6 +99,7 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp, SvXMLExportPropertyMapper *pExtMapper ) : rExport( rExp ), mnNextUniqueShapeId(1), + mbExportLayer( sal_False ), msZIndex( RTL_CONSTASCII_USTRINGPARAM("ZOrder") ), msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ), diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 30a6da45df35..60ca4081d09d 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpshap.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: cl $ $Date: 2001-01-18 14:49:52 $ + * last change: $Author: cl $ $Date: 2001-01-19 16:25:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -344,6 +344,29 @@ void SdXMLShapeContext::SetStyle() } } +void SdXMLShapeContext::SetLayer() +{ + if( maLayerName.getLength() ) + { + try + { + uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); + if(xPropSet.is() ) + { + uno::Any aAny; + aAny <<= maLayerName; + + xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("LayerName")), aAny); + return; + } + } + catch( uno::Exception e ) + { + } + DBG_ERROR( "could not attach shape to layer!" ); + } +} + // this is called from the parent group for each unparsed attribute in the attribute list void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ) { @@ -365,6 +388,10 @@ void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUStr { maDrawStyleName = rValue; } + else if( rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_layer)) ) + { + maLayerName = rValue; + } } else if( XML_NAMESPACE_PRESENTATION == nPrefix ) { @@ -466,6 +493,7 @@ void SdXMLRectShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib { // Add, set Style and properties from base shape SetStyle(); + SetLayer(); // set local parameters on shape SetSizeAndPosition(); @@ -553,6 +581,7 @@ void SdXMLLineShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib { // Add, set Style and properties from base shape SetStyle(); + SetLayer(); // set local parameters on shape uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); @@ -680,6 +709,7 @@ void SdXMLEllipseShapeContext::StartElement(const uno::Reference< xml::sax::XAtt { // Add, set Style and properties from base shape SetStyle(); + SetLayer(); // set local parameters on shape awt::Point aPoint(mnCX - mnRX, mnCY - mnRY); @@ -766,6 +796,7 @@ void SdXMLPolygonShapeContext::StartElement(const uno::Reference< xml::sax::XAtt if( mxShape.is() ) { SetStyle(); + SetLayer(); // set parameters on shape SetSizeAndPosition(); @@ -877,6 +908,7 @@ void SdXMLPathShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib if( mxShapes.is() ) { SetStyle(); + SetLayer(); // set parameters on shape SetSizeAndPosition(); @@ -980,6 +1012,7 @@ void SdXMLTextBoxShapeContext::StartElement(const uno::Reference< xml::sax::XAtt if( mxShape.is() ) { SetStyle(); + SetLayer(); if(bIsPresShape) { @@ -1058,6 +1091,7 @@ void SdXMLControlShapeContext::StartElement(const uno::Reference< xml::sax::XAtt if( mxShape.is() ) { SetStyle(); + SetLayer(); // set parameters on shape SetSizeAndPosition(); @@ -1228,6 +1262,7 @@ void SdXMLConnectorShapeContext::StartElement(const uno::Reference< xml::sax::XA xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeLine3Delta")), aAny ); } SetStyle(); + SetLayer(); SdXMLShapeContext::StartElement(xAttrList); } @@ -1299,6 +1334,7 @@ void SdXMLMeasureShapeContext::StartElement(const uno::Reference< xml::sax::XAtt if(mxShape.is()) { SetStyle(); + SetLayer(); uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY ); if( xProps.is() ) { @@ -1344,6 +1380,7 @@ void SdXMLPageShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib if(mxShape.is()) { SetStyle(); + SetLayer(); // set parameters on shape SetSizeAndPosition(); @@ -1383,6 +1420,7 @@ void SdXMLCaptionShapeContext::StartElement(const uno::Reference< xml::sax::XAtt if( mxShape.is() ) { SetStyle(); + SetLayer(); // set parameters on shape SetSizeAndPosition(); @@ -1434,6 +1472,7 @@ void SdXMLGraphicObjectShapeContext::StartElement( const ::com::sun::star::uno:: if(mxShape.is()) { SetStyle(); + SetLayer(); if( !mbIsPlaceholder ) { uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY); @@ -1522,6 +1561,7 @@ void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttri if(mxShape.is()) { SetStyle(); + SetLayer(); if( !mbIsPlaceholder ) { diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index f75b59010a24..2c379031eff6 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpshap.hxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: cl $ $Date: 2001-01-18 14:49:52 $ + * last change: $Author: cl $ $Date: 2001-01-19 16:25:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -112,6 +112,7 @@ protected: sal_Bool mbIsUserTransformed; sal_Int32 mnZOrder; sal_Int32 mnShapeId; + rtl::OUString maLayerName; com::sun::star::awt::Size maSize; com::sun::star::awt::Point maPosition; @@ -121,6 +122,7 @@ protected: sal_Int32 mnHeight; void SetStyle(); + void SetLayer(); void AddShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape); void AddShape(const char* pServiceName ); void SetSize(); diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 1536e81db851..989b7d442f05 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpstyl.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: cl $ $Date: 2001-01-18 14:49:52 $ + * last change: $Author: cl $ $Date: 2001-01-19 16:25:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,6 +121,10 @@ #include "sdpropls.hxx" #endif +#ifndef _XMLOFF_LAYERIMP_HXX +#include "layerimp.hxx" +#endif + using namespace ::rtl; using namespace ::com::sun::star; @@ -1378,6 +1382,11 @@ SvXMLImportContext* SdXMLMasterStylesContext::CreateChildContext( } } } + else if( nPrefix == XML_NAMESPACE_DRAW + && rLocalName.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(sXML_layer_set)))) + { + pContext = new SdXMLLayerSetContext( GetImport(), nPrefix, rLocalName, xAttrList ); + } // call base class if(!pContext) |