summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2001-04-30 08:02:17 +0000
committerChristian Lippka <cl@openoffice.org>2001-04-30 08:02:17 +0000
commit2a87e64018a0768b7b5618dc876a0c33c71b2e44 (patch)
treee3fcac8d81c07b85512599e4e8f0f287c882814f /xmloff
parent54d31199a0fce2a0db97d106499d5fe5c65d06ec (diff)
#86534# fixed ole2 export/import of applets,plugins and floating-frames for calc and draw
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/XMLRectangleMembersHandler.hxx100
-rw-r--r--xmloff/source/draw/sdpropls.cxx50
-rw-r--r--xmloff/source/draw/sdpropls.hxx12
-rw-r--r--xmloff/source/draw/shapeexport.cxx27
-rw-r--r--xmloff/source/draw/shapeexport2.cxx126
-rw-r--r--xmloff/source/draw/shapeimport.cxx26
-rw-r--r--xmloff/source/draw/ximpshap.cxx386
-rw-r--r--xmloff/source/draw/ximpshap.hxx89
-rw-r--r--xmloff/source/style/XMLRectangleMembersHandler.cxx172
-rw-r--r--xmloff/source/style/makefile.mk6
-rw-r--r--xmloff/source/style/prhdlfac.cxx14
11 files changed, 976 insertions, 32 deletions
diff --git a/xmloff/inc/XMLRectangleMembersHandler.hxx b/xmloff/inc/XMLRectangleMembersHandler.hxx
new file mode 100644
index 000000000000..9e78877db05b
--- /dev/null
+++ b/xmloff/inc/XMLRectangleMembersHandler.hxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLRectangleMembersHandler.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: cl $ $Date: 2001-04-30 08:57:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLRECTANGLEMEMBERSHANDLER_HXX
+#define _XMLOFF_XMLRECTANGLEMEMBERSHANDLER_HXX
+
+#ifndef _XMLOFF_PROPERTYHANDLERBASE_HXX
+#include "xmlprhdl.hxx"
+#endif
+
+struct SvXMLEnumMapEntry;
+
+///////////////////////////////////////////////////////////////////////////
+//
+/** Abstract base-class for different XML-types. Derivations of this class
+ knows how to compare, im/export a special XML-type
+*/
+class XMLRectangleMembersHdl: public XMLPropertyHandler
+{
+private:
+ sal_Int32 mnType;
+public:
+
+ XMLRectangleMembersHdl( sal_Int32 nType );
+
+ // Just needed for virtual destruction
+ virtual ~XMLRectangleMembersHdl();
+
+ /// Imports the given value in cas of the given XML-data-type
+ virtual sal_Bool importXML(
+ const ::rtl::OUString& rStrImpValue,
+ ::com::sun::star::uno::Any& rValue,
+ const SvXMLUnitConverter& rUnitConverter ) const;
+
+ /// Exports the given value in cas of the given XML-data-type
+ virtual sal_Bool exportXML(
+ ::rtl::OUString& rStrExpValue,
+ const ::com::sun::star::uno::Any& rValue,
+ const SvXMLUnitConverter& rUnitConverter ) const;
+};
+
+#endif // _XMLOFF_XMLRECTANGLEMEMBERSHANDLER_HXX
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index b68776d9ba3e..5ab3139ba95d 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdpropls.cxx,v $
*
- * $Revision: 1.32 $
+ * $Revision: 1.33 $
*
- * last change: $Author: aw $ $Date: 2001-04-25 16:26:39 $
+ * last change: $Author: cl $ $Date: 2001-04-30 09:02:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -362,10 +362,19 @@ const XMLPropertyMapEntry aXMLSDProperties[] =
{ "FontWorkHideForm", XML_NAMESPACE_DRAW, sXML_fontwork_hide_form, XML_TYPE_BOOL, CTF_FONTWORK_HIDEFORM },
{ "FontWorkShadowTransparence", XML_NAMESPACE_DRAW, sXML_fontwork_shadow_transparence, XML_TYPE_PERCENT, CTF_FONTWORK_SHADOWTRANSPARENCE },
- // control attributes (border exists one mor time for the text additions
- // of shapes)
- { "ControlBorder", XML_NAMESPACE_FO, sXML_border, XML_SD_TYPE_CONTROL_BORDER|MID_FLAG_MULTI_PROPERTY, 0 },
-
+ // control attributes (border exists one mor time for the text additions of shapes)
+ { "ControlBorder", XML_NAMESPACE_FO, sXML_border, XML_SD_TYPE_CONTROL_BORDER, 0 },
+
+ // special entries for floating frames
+ { "FrameIsAutoScroll", XML_NAMESPACE_DRAW, sXML_frame_display_scrollbar, XML_TYPE_BOOL|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_SCROLLBAR },
+ { "FrameIsBorder", XML_NAMESPACE_DRAW, sXML_frame_display_border, XML_TYPE_BOOL|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_BORDER },
+ { "FrameMarginWidth", XML_NAMESPACE_DRAW, sXML_frame_margin_horizontal, XML_TYPE_MEASURE_PX|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_HORI },
+ { "FrameMarginHeight", XML_NAMESPACE_DRAW, sXML_frame_margin_vertical, XML_TYPE_MEASURE_PX|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_VERT },
+ { "VisibleArea", XML_NAMESPACE_DRAW, sXML_visible_area_left, XML_TYPE_RECTANGLE_LEFT|MID_FLAG_MERGE_PROPERTY, CTF_SD_OLE_VIS_AREA_LEFT },
+ { "VisibleArea", XML_NAMESPACE_DRAW, sXML_visible_area_top, XML_TYPE_RECTANGLE_TOP|MID_FLAG_MERGE_PROPERTY, CTF_SD_OLE_VIS_AREA_TOP },
+ { "VisibleArea", XML_NAMESPACE_DRAW, sXML_visible_area_width, XML_TYPE_RECTANGLE_WIDTH|MID_FLAG_MERGE_PROPERTY, CTF_SD_OLE_VIS_AREA_WIDTH },
+ { "VisibleArea", XML_NAMESPACE_DRAW, sXML_visible_area_height, XML_TYPE_RECTANGLE_HEIGHT|MID_FLAG_MERGE_PROPERTY, CTF_SD_OLE_VIS_AREA_HEIGHT },
+ { "IsInternal", XML_NAMESPACE_DRAW, NULL, XML_TYPE_BUILDIN_CMP_ONLY, CTF_SD_OLE_ISINTERNAL },
{ 0L }
};
@@ -1012,6 +1021,13 @@ void XMLShapeExportPropertyMapper::ContextFilter(
XMLPropertyState* pFontWorkHideform = NULL;
XMLPropertyState* pFontWorkShadowTransparence = NULL;
+ // OLE
+ XMLPropertyState* pOLEVisAreaLeft = NULL;
+ XMLPropertyState* pOLEVisAreaTop = NULL;
+ XMLPropertyState* pOLEVisAreaWidth = NULL;
+ XMLPropertyState* pOLEVisAreaHeight = NULL;
+ XMLPropertyState* pOLEIsInternal = NULL;
+
// filter properties
for( std::vector< XMLPropertyState >::iterator property = rProperties.begin();
property != rProperties.end();
@@ -1102,9 +1118,31 @@ void XMLShapeExportPropertyMapper::ContextFilter(
case CTF_FONTWORK_FORM: pFontWorkForm = property; break;
case CTF_FONTWORK_HIDEFORM: pFontWorkHideform = property; break;
case CTF_FONTWORK_SHADOWTRANSPARENCE: pFontWorkShadowTransparence = property; break;
+
+ // OLE
+ case CTF_SD_OLE_VIS_AREA_LEFT: pOLEVisAreaLeft = property; break;
+ case CTF_SD_OLE_VIS_AREA_TOP: pOLEVisAreaTop = property; break;
+ case CTF_SD_OLE_VIS_AREA_WIDTH: pOLEVisAreaWidth = property; break;
+ case CTF_SD_OLE_VIS_AREA_HEIGHT: pOLEVisAreaHeight = property; break;
+ case CTF_SD_OLE_ISINTERNAL: pOLEIsInternal = property; break;
}
}
+ // do not export visual area for internal ole objects
+ if( pOLEIsInternal )
+ {
+ sal_Bool bInternal;
+ if( (pOLEIsInternal->maValue >>= bInternal) && bInternal )
+ {
+ if( pOLEVisAreaLeft ) pOLEVisAreaLeft->mnIndex = -1;
+ if( pOLEVisAreaTop ) pOLEVisAreaTop->mnIndex = -1;
+ if( pOLEVisAreaWidth ) pOLEVisAreaWidth->mnIndex = -1;
+ if( pOLEVisAreaHeight ) pOLEVisAreaHeight->mnIndex = -1;
+ }
+
+ pOLEIsInternal->mnIndex = -1;
+ }
+
if( pTextAnimationBlinking && pTextAnimationKind )
{
drawing::TextAnimationKind eKind;
diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx
index a3af299230bd..9dbda131ef9d 100644
--- a/xmloff/source/draw/sdpropls.hxx
+++ b/xmloff/source/draw/sdpropls.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdpropls.hxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: aw $ $Date: 2001-04-25 16:27:15 $
+ * last change: $Author: cl $ $Date: 2001-04-30 09:02:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -195,6 +195,14 @@ extern const XMLPropertyMapEntry aXMLSDPresPageProps[];
#define CTF_FONTWORK_SHADOWTRANSPARENCE 1033
//////////////////////////////////////////////////////////////////////////////
+// OLE
+#define CTF_SD_OLE_VIS_AREA_LEFT 1040
+#define CTF_SD_OLE_VIS_AREA_TOP 1041
+#define CTF_SD_OLE_VIS_AREA_WIDTH 1042
+#define CTF_SD_OLE_VIS_AREA_HEIGHT 1043
+#define CTF_SD_OLE_ISINTERNAL 1044
+
+//////////////////////////////////////////////////////////////////////////////
// #FontWork# types
#define XML_SD_TYPE_FONTWORK_STYLE (XML_SD_TYPES_START + 47 )
#define XML_SD_TYPE_FONTWORK_ADJUST (XML_SD_TYPES_START + 48 )
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 45052d843c89..979db589db80 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shapeexport.cxx,v $
*
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: cl $ $Date: 2001-04-19 12:00:46 $
+ * last change: $Author: cl $ $Date: 2001-04-30 09:02:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -553,8 +553,25 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
break;
}
- case XmlShapeTypePresOrgChartShape:
case XmlShapeTypeDrawFrameShape:
+ {
+ ImpExportFrameShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
+ break;
+ }
+
+ case XmlShapeTypeDrawAppletShape:
+ {
+ ImpExportAppletShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
+ break;
+ }
+
+ case XmlShapeTypeDrawPluginShape:
+ {
+ ImpExportPluginShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
+ break;
+ }
+
+ case XmlShapeTypePresOrgChartShape:
case XmlShapeTypeUnknown:
case XmlShapeTypeNotYetSet:
default:
@@ -774,7 +791,9 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x
}
else if(aType.EqualsAscii("Page", 21, 4)) { eShapeType = XmlShapeTypeDrawPageShape; }
else if(aType.EqualsAscii("Frame", 21, 5)) { eShapeType = XmlShapeTypeDrawFrameShape; }
- else if(aType.EqualsAscii("Caption", 21, 6)) { eShapeType = XmlShapeTypeDrawCaptionShape; }
+ else if(aType.EqualsAscii("Caption", 21, 7)) { eShapeType = XmlShapeTypeDrawCaptionShape; }
+ else if(aType.EqualsAscii("Plugin", 21, 6)) { eShapeType = XmlShapeTypeDrawPluginShape; }
+ else if(aType.EqualsAscii("Applet", 21, 6)) { eShapeType = XmlShapeTypeDrawAppletShape; }
// 3D shapes
else if(aType.EqualsAscii("Scene", 21 + 7, 5)) { eShapeType = XmlShapeTypeDraw3DSceneObject; }
diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx
index 99e09a107c45..0e6789c4f610 100644
--- a/xmloff/source/draw/shapeexport2.cxx
+++ b/xmloff/source/draw/shapeexport2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shapeexport2.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: aw $ $Date: 2001-04-24 11:34:51 $
+ * last change: $Author: cl $ $Date: 2001-04-30 09:02:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1387,3 +1387,125 @@ void XMLShapeExport::ImpExportCaptionShape(
ImpExportText( xShape );
}
+//////////////////////////////////////////////////////////////////////////////
+
+void XMLShapeExport::ImpExportFrameShape(
+ const uno::Reference< drawing::XShape >& xShape,
+ XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint)
+{
+ const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
+ if(xPropSet.is())
+ {
+ // Transformation
+ ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
+
+ // export frame url
+ OUString aStr;
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameURL" ) ) ) >>= aStr;
+ rExport.AddAttribute ( XML_NAMESPACE_XLINK, sXML_href, aStr );
+ rExport.AddAttributeASCII ( XML_NAMESPACE_XLINK, sXML_type, sXML_simple );
+ rExport.AddAttributeASCII ( XML_NAMESPACE_XLINK, sXML_show, sXML_embed );
+ rExport.AddAttributeASCII ( XML_NAMESPACE_XLINK, sXML_actuate, sXML_onLoad );
+
+ // export name
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameName" ) ) ) >>= aStr;
+ if( aStr.getLength() )
+ rExport.AddAttribute( XML_NAMESPACE_DRAW, sXML_frame_name, aStr );
+
+ // write floating frame
+ SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, sXML_floating_frame, sal_True, sal_True);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+void XMLShapeExport::ImpExportAppletShape(
+ const uno::Reference< drawing::XShape >& xShape,
+ XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint)
+{
+ const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
+ if(xPropSet.is())
+ {
+ // Transformation
+ ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
+
+ // export frame url
+ OUString aStr;
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCodeBase" ) ) ) >>= aStr;
+ rExport.AddAttribute ( XML_NAMESPACE_XLINK, sXML_href, aStr );
+ rExport.AddAttributeASCII ( XML_NAMESPACE_XLINK, sXML_type, sXML_simple );
+ rExport.AddAttributeASCII ( XML_NAMESPACE_XLINK, sXML_show, sXML_embed );
+ rExport.AddAttributeASCII ( XML_NAMESPACE_XLINK, sXML_actuate, sXML_onLoad );
+
+ // export draw:applet-name
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletName" ) ) ) >>= aStr;
+ if( aStr.getLength() )
+ rExport.AddAttribute( XML_NAMESPACE_DRAW, sXML_applet_name, aStr );
+
+ // export draw:code
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCode" ) ) ) >>= aStr;
+ rExport.AddAttribute( XML_NAMESPACE_DRAW, sXML_code, aStr );
+
+ // export draw:may-script
+ sal_Bool bIsScript;
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletIsScript" ) ) ) >>= bIsScript;
+ rExport.AddAttributeASCII( XML_NAMESPACE_DRAW, sXML_may_script, bIsScript ? sXML_true : sXML_false );
+
+ // write applet
+ SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, sXML_applet, sal_True, sal_True);
+
+ // export parameters
+ uno::Sequence< beans::PropertyValue > aCommands;
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCommands" ) ) ) >>= aCommands;
+ const sal_Int32 nCount = aCommands.getLength();
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ aCommands[nIndex].Value >>= aStr;
+ rExport.AddAttribute( XML_NAMESPACE_DRAW, sXML_name, aCommands[nIndex].Name );
+ rExport.AddAttribute( XML_NAMESPACE_DRAW, sXML_value, aStr );
+ SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, sXML_param, sal_False, sal_True );
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+void XMLShapeExport::ImpExportPluginShape(
+ const uno::Reference< drawing::XShape >& xShape,
+ XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint)
+{
+ const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
+ if(xPropSet.is())
+ {
+ // Transformation
+ ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
+
+ // export plugin url
+ OUString aStr;
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginURL" ) ) ) >>= aStr;
+ rExport.AddAttribute ( XML_NAMESPACE_XLINK, sXML_href, aStr );
+ rExport.AddAttributeASCII ( XML_NAMESPACE_XLINK, sXML_type, sXML_simple );
+ rExport.AddAttributeASCII ( XML_NAMESPACE_XLINK, sXML_show, sXML_embed );
+ rExport.AddAttributeASCII ( XML_NAMESPACE_XLINK, sXML_actuate, sXML_onLoad );
+
+ // export mime-type
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginMimeType" ) ) ) >>= aStr;
+ if(aStr.getLength())
+ rExport.AddAttribute( XML_NAMESPACE_DRAW, sXML_mime_type, aStr );
+
+ // write plugin
+ SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, sXML_plugin, sal_True, sal_True);
+
+ // export parameters
+ uno::Sequence< beans::PropertyValue > aCommands;
+ xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginCommands" ) ) ) >>= aCommands;
+ const sal_Int32 nCount = aCommands.getLength();
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ aCommands[nIndex].Value >>= aStr;
+ rExport.AddAttribute( XML_NAMESPACE_DRAW, sXML_name, aCommands[nIndex].Name );
+ rExport.AddAttribute( XML_NAMESPACE_DRAW, sXML_value, aStr );
+ SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, sXML_param, sal_False, sal_True );
+ }
+ }
+}
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 570cca810960..f192680bb2b8 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shapeimport.cxx,v $
*
- * $Revision: 1.29 $
+ * $Revision: 1.30 $
*
- * last change: $Author: cl $ $Date: 2001-02-27 16:09:08 $
+ * last change: $Author: cl $ $Date: 2001-04-30 09:02:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -273,6 +273,10 @@ static __FAR_DATA SvXMLTokenMapEntry aGroupShapeElemTokenMap[] =
{ XML_NAMESPACE_DRAW, sXML_object, XML_TOK_GROUP_OBJECT },
{ XML_NAMESPACE_DRAW, sXML_object_ole, XML_TOK_GROUP_OBJECT_OLE },
+ { XML_NAMESPACE_DRAW, sXML_plugin, XML_TOK_GROUP_PLUGIN },
+ { XML_NAMESPACE_DRAW, sXML_floating_frame,XML_TOK_GROUP_FRAME },
+ { XML_NAMESPACE_DRAW, sXML_applet, XML_TOK_GROUP_APPLET },
+
XML_TOKEN_MAP_END
};
@@ -784,6 +788,24 @@ SvXMLImportContext* XMLShapeImportHelper::CreateGroupChildContext(
pContext = new SdXMLObjectShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
break;
}
+ case XML_TOK_GROUP_PLUGIN:
+ {
+ // draw:plugin
+ pContext = new SdXMLPluginShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
+ break;
+ }
+ case XML_TOK_GROUP_FRAME:
+ {
+ // draw:frame
+ pContext = new SdXMLFrameShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
+ break;
+ }
+ case XML_TOK_GROUP_APPLET:
+ {
+ // draw:applet
+ pContext = new SdXMLAppletShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
+ break;
+ }
// add other shapes here...
default:
return new SvXMLImportContext( rImport, nPrefix, rLocalName );
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 2ce8fb9ca605..f27a4722f8fa 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpshap.cxx,v $
*
- * $Revision: 1.40 $
+ * $Revision: 1.41 $
*
- * last change: $Author: thb $ $Date: 2001-04-26 18:04:11 $
+ * last change: $Author: cl $ $Date: 2001-04-30 09:02:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1681,20 +1681,32 @@ void SdXMLGraphicObjectShapeContext::processAttribute( sal_uInt16 nPrefix, const
void SdXMLGraphicObjectShapeContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
{
// create graphic object shape
- AddShape( "com.sun.star.drawing.GraphicObjectShape" );
+ char *pService;
+
+ if(maPresentationClass.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_graphic ) ) )
+ {
+ pService = "com.sun.star.presentation.GraphicObjectShape";
+ }
+ else
+ {
+ pService = "com.sun.star.drawing.GraphicObjectShape";
+ }
+
+ AddShape( pService );
+
if(mxShape.is())
{
SetStyle();
SetLayer();
- if( !mbIsPlaceholder )
+ uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
+ if(xProps.is())
{
- uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
- if(xProps.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
- if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") )))
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), ::cppu::bool2any( sal_False ) );
+ uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
+ if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") )))
+ xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), ::cppu::bool2any( mbIsPlaceholder ) );
+ if( !mbIsPlaceholder )
+ {
if( maURL.getLength() )
{
uno::Any aAny;
@@ -1992,3 +2004,357 @@ void SdXMLObjectShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl:
SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
}
+
+//////////////////////////////////////////////////////////////////////////////
+
+TYPEINIT1( SdXMLAppletShapeContext, SdXMLShapeContext );
+
+SdXMLAppletShapeContext::SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes)
+: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
+ mbIsScript( sal_False )
+{
+}
+
+SdXMLAppletShapeContext::~SdXMLAppletShapeContext()
+{
+}
+
+void SdXMLAppletShapeContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
+{
+ char* pService = "com.sun.star.drawing.AppletShape";
+ AddShape( pService );
+
+ if( mxShape.is() )
+ {
+ SetLayer();
+
+ // set pos, size, shear and rotate
+ SetTransformation();
+ GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
+ }
+}
+
+// this is called from the parent group for each unparsed attribute in the attribute list
+void SdXMLAppletShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
+{
+ switch( nPrefix )
+ {
+ case XML_NAMESPACE_DRAW:
+ if( rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_applet_name)) )
+ {
+ maAppletName = rValue;
+ return;
+ }
+ if( rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_code)) )
+ {
+ maAppletCode = rValue;
+ return;
+ }
+ if( rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_may_script)) )
+ {
+ mbIsScript = rValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_true));
+ return;
+ }
+ break;
+ case XML_NAMESPACE_XLINK:
+ if( rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_href)) )
+ {
+ maHref = rValue;
+ return;
+ }
+ break;
+ }
+
+ SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
+}
+
+void SdXMLAppletShapeContext::EndElement()
+{
+ uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
+ if( xProps.is() )
+ {
+ uno::Any aAny;
+
+ if( maParams.getLength() )
+ {
+ aAny <<= maParams;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCommands" ) ), aAny );
+ }
+
+ if( maHref.getLength() )
+ {
+ aAny <<= maHref;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCodeBase" ) ), aAny );
+ }
+
+ if( maAppletName.getLength() )
+ {
+ aAny <<= maAppletName;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletName" ) ), aAny );
+ }
+
+ if( mbIsScript )
+ {
+ aAny <<= mbIsScript;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletIsScript" ) ), aAny );
+
+ }
+
+ if( maAppletCode.getLength() )
+ {
+ aAny <<= maAppletCode;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCode" ) ), aAny );
+ }
+ }
+}
+
+SvXMLImportContext * SdXMLAppletShapeContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList )
+{
+ SvXMLImportContext * pContext = NULL;
+
+ if( nPrefix == XML_NAMESPACE_DRAW && rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_param ) ) )
+ {
+ OUString aParamName, aParamValue;
+ const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ // now parse the attribute list and look for draw:name and draw:value
+ for(sal_Int16 a(0); a < nAttrCount; a++)
+ {
+ const OUString& rAttrName = xAttrList->getNameByIndex(a);
+ OUString aLocalName;
+ sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(rAttrName, &aLocalName);
+ const OUString aValue( xAttrList->getValueByIndex(a) );
+
+ if( nPrefix == XML_NAMESPACE_DRAW )
+ {
+ if( aLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_name ) ) )
+ {
+ aParamName = aValue;
+ }
+ else if( aLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_value ) ) )
+ {
+ aParamValue = aValue;
+ }
+ }
+
+ if( aParamName.getLength() )
+ {
+ sal_Int32 nIndex = maParams.getLength();
+ maParams.realloc( nIndex + 1 );
+ maParams[nIndex].Name = aParamName;
+ maParams[nIndex].Handle = -1;
+ maParams[nIndex].Value <<= aParamValue;
+ maParams[nIndex].State = beans::PropertyState_DIRECT_VALUE;
+ }
+ }
+
+ return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ }
+
+ return SdXMLShapeContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+TYPEINIT1( SdXMLPluginShapeContext, SdXMLShapeContext );
+
+SdXMLPluginShapeContext::SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes)
+: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
+{
+}
+
+SdXMLPluginShapeContext::~SdXMLPluginShapeContext()
+{
+}
+
+void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
+{
+ char* pService = "com.sun.star.drawing.PluginShape";
+ AddShape( pService );
+
+ if( mxShape.is() )
+ {
+ SetLayer();
+
+ // set pos, size, shear and rotate
+ SetTransformation();
+ GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
+ }
+}
+
+// this is called from the parent group for each unparsed attribute in the attribute list
+void SdXMLPluginShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
+{
+ switch( nPrefix )
+ {
+ case XML_NAMESPACE_DRAW:
+ if( rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_mime_type)) )
+ {
+ maMimeType = rValue;
+ return;
+ }
+ break;
+ case XML_NAMESPACE_XLINK:
+ if( rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_href)) )
+ {
+ maHref = rValue;
+ return;
+ }
+ break;
+ }
+
+ SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
+}
+
+void SdXMLPluginShapeContext::EndElement()
+{
+ uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
+ if( xProps.is() )
+ {
+ uno::Any aAny;
+
+ if( maParams.getLength() )
+ {
+ aAny <<= maParams;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginCommands" ) ), aAny );
+ }
+
+ if( maMimeType.getLength() )
+ {
+ aAny <<= maMimeType;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginMimeType" ) ), aAny );
+ }
+
+ if( maHref.getLength() )
+ {
+ aAny <<= maHref;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginURL" ) ), aAny );
+ }
+ }
+}
+
+SvXMLImportContext * SdXMLPluginShapeContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList )
+{
+ SvXMLImportContext * pContext = NULL;
+
+ if( nPrefix == XML_NAMESPACE_DRAW && rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_param ) ) )
+ {
+ OUString aParamName, aParamValue;
+ const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ // now parse the attribute list and look for draw:name and draw:value
+ for(sal_Int16 a(0); a < nAttrCount; a++)
+ {
+ const OUString& rAttrName = xAttrList->getNameByIndex(a);
+ OUString aLocalName;
+ sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(rAttrName, &aLocalName);
+ const OUString aValue( xAttrList->getValueByIndex(a) );
+
+ if( nPrefix == XML_NAMESPACE_DRAW )
+ {
+ if( aLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_name ) ) )
+ {
+ aParamName = aValue;
+ }
+ else if( aLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_value ) ) )
+ {
+ aParamValue = aValue;
+ }
+ }
+
+ if( aParamName.getLength() )
+ {
+ sal_Int32 nIndex = maParams.getLength();
+ maParams.realloc( nIndex + 1 );
+ maParams[nIndex].Name = aParamName;
+ maParams[nIndex].Handle = -1;
+ maParams[nIndex].Value <<= aParamValue;
+ maParams[nIndex].State = beans::PropertyState_DIRECT_VALUE;
+ }
+ }
+
+ return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ }
+
+ return SdXMLShapeContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+TYPEINIT1( SdXMLFrameShapeContext, SdXMLShapeContext );
+
+SdXMLFrameShapeContext::SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes)
+: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
+{
+}
+
+SdXMLFrameShapeContext::~SdXMLFrameShapeContext()
+{
+}
+
+void SdXMLFrameShapeContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
+{
+ char* pService = "com.sun.star.drawing.FrameShape";
+ AddShape( pService );
+
+ if( mxShape.is() )
+ {
+ SetLayer();
+
+ // set pos, size, shear and rotate
+ SetTransformation();
+
+ uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
+ if( xProps.is() )
+ {
+ uno::Any aAny;
+
+ if( maFrameName.getLength() )
+ {
+ aAny <<= maFrameName;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameName" ) ), aAny );
+ }
+
+ if( maHref.getLength() )
+ {
+ aAny <<= maHref;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameURL" ) ), aAny );
+ }
+ }
+
+ SetStyle();
+ GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
+ }
+}
+
+// this is called from the parent group for each unparsed attribute in the attribute list
+void SdXMLFrameShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
+{
+ switch( nPrefix )
+ {
+ case XML_NAMESPACE_DRAW:
+ if( rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_frame_name)) )
+ {
+ maFrameName = rValue;
+ return;
+ }
+ break;
+ case XML_NAMESPACE_XLINK:
+ if( rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_href)) )
+ {
+ maHref = rValue;
+ return;
+ }
+ break;
+ }
+
+ SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
+}
+
diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx
index f3036fdbab60..83b30785a09c 100644
--- a/xmloff/source/draw/ximpshap.hxx
+++ b/xmloff/source/draw/ximpshap.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpshap.hxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: dvo $ $Date: 2001-03-29 16:48:43 $
+ * last change: $Author: cl $ $Date: 2001-04-30 09:02:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -467,4 +467,89 @@ public:
virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
};
+//////////////////////////////////////////////////////////////////////////////
+// draw:applet
+
+class SdXMLAppletShapeContext : public SdXMLShapeContext
+{
+private:
+ rtl::OUString maAppletName;
+ rtl::OUString maAppletCode;
+ rtl::OUString maHref;
+ sal_Bool mbIsScript;
+
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maParams;
+
+public:
+ TYPEINFO();
+
+ SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
+ virtual ~SdXMLAppletShapeContext();
+
+ virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+ virtual void EndElement();
+
+ virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
+
+ // this is called from the parent group for each unparsed attribute in the attribute list
+ virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// draw:plugin
+
+class SdXMLPluginShapeContext : public SdXMLShapeContext
+{
+private:
+ rtl::OUString maMimeType;
+ rtl::OUString maHref;
+
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maParams;
+
+public:
+ TYPEINFO();
+
+ SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
+ virtual ~SdXMLPluginShapeContext();
+
+ virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+ virtual void EndElement();
+
+ virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
+
+ // this is called from the parent group for each unparsed attribute in the attribute list
+ virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// draw:frame
+
+class SdXMLFrameShapeContext : public SdXMLShapeContext
+{
+private:
+ rtl::OUString maFrameName;
+ rtl::OUString maHref;
+
+public:
+ TYPEINFO();
+
+ SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
+ virtual ~SdXMLFrameShapeContext();
+
+ virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ // this is called from the parent group for each unparsed attribute in the attribute list
+ virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
+};
#endif // _XIMPSHAPE_HXX
diff --git a/xmloff/source/style/XMLRectangleMembersHandler.cxx b/xmloff/source/style/XMLRectangleMembersHandler.cxx
new file mode 100644
index 000000000000..7af4cc68df67
--- /dev/null
+++ b/xmloff/source/style/XMLRectangleMembersHandler.cxx
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLRectangleMembersHandler.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: cl $ $Date: 2001-04-30 09:01:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "xmlkywd.hxx"
+
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include "xmluconv.hxx"
+#endif
+
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_AWT_RECTANGLE_HDL_
+#include <com/sun/star/awt/Rectangle.hdl>
+#endif
+
+#ifndef _XMLOFF_XMLRECTANGLEMEMBERSHANDLER_HXX
+#include "XMLRectangleMembersHandler.hxx"
+#endif
+
+#ifndef _XMLOFF_XMLTYPES_HXX
+#include "xmltypes.hxx"
+#endif
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::rtl;
+
+XMLRectangleMembersHdl::XMLRectangleMembersHdl( sal_Int32 nType )
+: mnType( nType )
+{
+}
+
+ sal_Int32 X;
+ sal_Int32 Y;
+ sal_Int32 Width;
+ sal_Int32 Height;
+
+XMLRectangleMembersHdl::~XMLRectangleMembersHdl()
+{
+}
+
+sal_Bool XMLRectangleMembersHdl::importXML(
+ const OUString& rStrImpValue,
+ Any& rValue,
+ const SvXMLUnitConverter& rUnitConverter ) const
+{
+ awt::Rectangle aRect( 0, 0, 0, 0 );
+ if( rValue.hasValue() )
+ rValue >>= aRect;
+
+ sal_Int32 nValue;
+
+ if( rUnitConverter.convertMeasure( nValue, rStrImpValue ) )
+ {
+ switch( mnType )
+ {
+ case XML_TYPE_RECTANGLE_LEFT :
+ aRect.X = nValue;
+ break;
+ case XML_TYPE_RECTANGLE_TOP :
+ aRect.Y = nValue;
+ break;
+ case XML_TYPE_RECTANGLE_WIDTH :
+ aRect.Width = nValue;
+ break;
+ case XML_TYPE_RECTANGLE_HEIGHT :
+ aRect.Height = nValue;
+ break;
+ }
+
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+sal_Bool XMLRectangleMembersHdl::exportXML(
+ OUString& rStrExpValue,
+ const Any& rValue,
+ const SvXMLUnitConverter& rUnitConverter ) const
+{
+ awt::Rectangle aRect( 0, 0, 0, 0 );
+ rValue >>= aRect;
+
+ sal_Int32 nValue;
+
+ switch( mnType )
+ {
+ case XML_TYPE_RECTANGLE_LEFT :
+ nValue = aRect.X;
+ break;
+ case XML_TYPE_RECTANGLE_TOP :
+ nValue = aRect.Y;
+ break;
+ case XML_TYPE_RECTANGLE_WIDTH :
+ nValue = aRect.Width;
+ break;
+ case XML_TYPE_RECTANGLE_HEIGHT :
+ nValue = aRect.Height;
+ break;
+ }
+
+ rtl::OUStringBuffer sBuffer;
+ rUnitConverter.convertMeasure( sBuffer, nValue );
+ rStrExpValue = sBuffer.makeStringAndClear();
+ return sal_True;
+}
+
diff --git a/xmloff/source/style/makefile.mk b/xmloff/source/style/makefile.mk
index 00fe5a89c96a..479e5b5737fc 100644
--- a/xmloff/source/style/makefile.mk
+++ b/xmloff/source/style/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.16 $
+# $Revision: 1.17 $
#
-# last change: $Author: pluby $ $Date: 2001-03-02 07:21:33 $
+# last change: $Author: cl $ $Date: 2001-04-30 09:01:06 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -77,6 +77,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
CXXFILES = \
+ XMLRectangleMembersHandler.cxx \
adjushdl.cxx \
backhdl.cxx \
bordrhdl.cxx \
@@ -164,6 +165,7 @@ CXXFILES = \
SLOFILES = \
+ $(SLO)$/XMLRectangleMembersHandler.obj \
$(SLO)$/adjushdl.obj \
$(SLO)$/backhdl.obj \
$(SLO)$/bordrhdl.obj \
diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx
index 7d5762d96094..e94d344c1dab 100644
--- a/xmloff/source/style/prhdlfac.cxx
+++ b/xmloff/source/style/prhdlfac.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: prhdlfac.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: mib $ $Date: 2001-03-28 09:02:20 $
+ * last change: $Author: cl $ $Date: 2001-04-30 09:01:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -152,6 +152,9 @@
#ifndef _XMLOFF_PROPERTYHANDLER_DURATIONS_HXX
#include "durationhdl.hxx"
#endif
+#ifndef _XMLOFF_XMLRECTANGLEMEMBERSHANDLER_HXX
+#include "XMLRectangleMembersHandler.hxx"
+#endif
using namespace ::com::sun::star;
@@ -293,6 +296,13 @@ const XMLPropertyHandler* XMLPropertyHandlerFactory::GetBasicHandler( sal_Int32
pPropHdl = new XMLCompareOnlyPropHdl;
break;
+ case XML_TYPE_RECTANGLE_LEFT :
+ case XML_TYPE_RECTANGLE_TOP :
+ case XML_TYPE_RECTANGLE_WIDTH :
+ case XML_TYPE_RECTANGLE_HEIGHT :
+ pPropHdl = new XMLRectangleMembersHdl( nType );
+ break;
+
case XML_TYPE_TEXT_CROSSEDOUT:
pPropHdl = new XMLCrossedOutPropHdl ;
break;