summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2000-11-16 15:31:37 +0000
committerChristian Lippka <cl@openoffice.org>2000-11-16 15:31:37 +0000
commitcd287d5670b4cf6520df45930b3c37f8f7141980 (patch)
tree00e97ec1d559bebafd7752523ab4840cc04cf965
parente40fb85688c01983e87e0e10f69565bbb86df2af (diff)
#79620# added support for named shapes
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx17
-rw-r--r--xmloff/source/draw/shapeimport.cxx5
-rw-r--r--xmloff/source/draw/ximpshap.cxx16
-rw-r--r--xmloff/source/draw/ximpshap.hxx5
4 files changed, 35 insertions, 8 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index b88dbcd7a34a..74f6d43679c3 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdxmlexp.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: cl $ $Date: 2000-11-15 12:28:21 $
+ * last change: $Author: cl $ $Date: 2000-11-16 16:31:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -141,6 +141,10 @@
#include <com/sun/star/chart/XChartDocument.hpp>
#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
+#include <com/sun/star/container/XNamed.hpp>
+#endif
+
#ifndef _RTL_USTRBUF_HXX_
#include <rtl/ustrbuf.hxx>
#endif
@@ -2750,6 +2754,15 @@ void SdXMLExport::ImpWriteSingleShapeStyleInfo(
rExp.AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_style_name, rStyleName);
}
+ // export shape name if he has one
+ uno::Reference< container::XNamed > xNamed( xShape, uno::UNO_QUERY );
+ if( xNamed.is() )
+ {
+ const OUString aName( xNamed->getName() );
+ if( aName.getLength() )
+ rExp.AddAttribute(XML_NAMESPACE_DRAW, sXML_name, aName );
+ }
+
switch(eShapeType)
{
case XmlShapeTypeDrawRectangleShape:
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 9eba9a8397f4..5729986efb3b 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shapeimport.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: cl $ $Date: 2000-11-15 10:05:02 $
+ * last change: $Author: cl $ $Date: 2000-11-16 16:31:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -244,6 +244,7 @@ const SvXMLTokenMap& XMLShapeImportHelper::GetGroupShapeElemTokenMap()
static __FAR_DATA SvXMLTokenMapEntry aShapeAttrTokenMap[] =
{
+ { XML_NAMESPACE_DRAW, sXML_name, XML_TOK_SHAPE_NAME },
{ XML_NAMESPACE_DRAW, sXML_style_name, XML_TOK_SHAPE_DRAWSTYLE_NAME_GRAPHICS },
{ XML_NAMESPACE_PRESENTATION, sXML_class, XML_TOK_SHAPE_PRESENTATION_CLASS },
{ XML_NAMESPACE_PRESENTATION, sXML_style_name, XML_TOK_SHAPE_DRAWSTYLE_NAME_PRESENTATION },
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 13b1bc68f144..e938838a2d57 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpshap.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: cl $ $Date: 2000-11-15 11:58:54 $
+ * last change: $Author: cl $ $Date: 2000-11-16 16:31:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -142,6 +142,11 @@ SdXMLShapeContext::SdXMLShapeContext(
switch(rAttrTokenMap.Get(nPrefix, aLocalName))
{
+ case XML_TOK_SHAPE_NAME:
+ {
+ maShapeName = sValue;
+ break;
+ }
case XML_TOK_SHAPE_IS_USER_TRANSFORMED:
{
if(sValue.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(sXML_true))))
@@ -274,6 +279,13 @@ void SdXMLShapeContext::AddShape(uno::Reference< drawing::XShape >& xShape)
// set shape local
mxShape = xShape;
+ if(maShapeName.getLength())
+ {
+ uno::Reference< container::XNamed > xNamed( mxShape, uno::UNO_QUERY );
+ if( xNamed.is() )
+ xNamed->setName( maShapeName );
+ }
+
GetImport().GetShapeImport()->addShape( xShape, mxAttrList, mxShapes );
}
}
diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx
index 7cf908154df3..0243e46d5576 100644
--- a/xmloff/source/draw/ximpshap.hxx
+++ b/xmloff/source/draw/ximpshap.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpshap.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: cl $ $Date: 2000-11-15 11:58:54 $
+ * last change: $Author: cl $ $Date: 2000-11-16 16:31:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,6 +100,7 @@ protected:
com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList> mxAttrList;
rtl::OUString maDrawStyleName;
rtl::OUString maPresentationClass;
+ rtl::OUString maShapeName;
sal_Int32 mnRotate;
sal_uInt16 mnStyleFamily;
sal_uInt16 mnClass;