diff options
author | Michael Brauer <mib@openoffice.org> | 2001-01-03 10:07:00 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2001-01-03 10:07:00 +0000 |
commit | a91872236cc1e2f04a3f42c0074988912f49e97f (patch) | |
tree | 21b5107b9a41e2cc1b46591d5f6cc3eaf8b3efb2 | |
parent | 2a7b771e8487fabac73e638af981a5b4d25f2fa3 (diff) |
support for OLE objects in XML files
-rw-r--r-- | xmloff/inc/xmlkywd.hxx | 6 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 37 | ||||
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 6 |
6 files changed, 45 insertions, 35 deletions
diff --git a/xmloff/inc/xmlkywd.hxx b/xmloff/inc/xmlkywd.hxx index 1cec83c858be..970772e83d27 100644 --- a/xmloff/inc/xmlkywd.hxx +++ b/xmloff/inc/xmlkywd.hxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlkywd.hxx,v $ * - * $Revision: 1.81 $ + * $Revision: 1.82 $ * - * last change: $Author: dvo $ $Date: 2001-01-02 14:38:39 $ + * last change: $Author: mib $ $Date: 2001-01-03 11:03:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -325,6 +325,7 @@ XML_CONSTASCII_ACTION( sXML_circle, "circle" ); XML_CONSTASCII_ACTION( sXML_citation_body_style_name, "citation-body-style-name" ); XML_CONSTASCII_ACTION( sXML_citation_style_name, "citation-style-name" ); XML_CONSTASCII_ACTION( sXML_class, "class" ); +XML_CONSTASCII_ACTION( sXML_class_id, "class-id" ); XML_CONSTASCII_ACTION( sXML_clip, "clip" ); XML_CONSTASCII_ACTION( sXML_clockwise, "clockwise" ); XML_CONSTASCII_ACTION( sXML_close, "close" ); @@ -1030,6 +1031,7 @@ XML_CONSTASCII_ACTION( sXML_object_index, "object-index" ); XML_CONSTASCII_ACTION( sXML_object_index_entry_template, "object-index-entry-template" ); XML_CONSTASCII_ACTION( sXML_object_index_source, "object-index-source" ); XML_CONSTASCII_ACTION( sXML_object_name, "object-name"); +XML_CONSTASCII_ACTION( sXML_object_ole, "object_ole" ); XML_CONSTASCII_ACTION( sXML_objects, "objects" ); XML_CONSTASCII_ACTION( sXML_odd_page, "odd-page" ); XML_CONSTASCII_ACTION( sXML_offset, "offset" ); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 8c57b15d6344..cbd8de328dc8 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlexp.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: sab $ $Date: 2000-12-20 13:17:23 $ + * last change: $Author: mib $ $Date: 2001-01-03 11:04:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -201,6 +201,7 @@ void SvXMLExport::_InitCtor() xAttrList = (xml::sax::XAttributeList*)pAttrList; sPicturesPath = OUString( RTL_CONSTASCII_USTRINGPARAM( "#Pictures/" ) ); + sObjectsPath = OUString( RTL_CONSTASCII_USTRINGPARAM( "#./" ) ); sGraphicObjectProtocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) ); } diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 6ed2fa00059c..4ccba97a3acf 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextFrameContext.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: dvo $ $Date: 2000-12-19 18:56:46 $ + * last change: $Author: mib $ $Date: 2001-01-03 11:07:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -334,6 +334,7 @@ XMLTextFrameContext::XMLTextFrameContext( OUString sChainNextName; OUString sHRef; OUString sFilterName; + OUString sClassId; sal_Int32 nX = 0; sal_Int32 nY = 0; @@ -461,6 +462,9 @@ XMLTextFrameContext::XMLTextFrameContext( } } break; + case XML_TOK_TEXT_FRAME_CLASS_ID: + sClassId = rValue; + break; } } @@ -471,7 +475,8 @@ XMLTextFrameContext::XMLTextFrameContext( if( XML_TEXT_FRAME_OLE == nType ) { xPropSet = GetImport().GetTextImport()->createAndInsertOLEObject( - sHRef ); + GetImport(), sHRef, + sClassId ); } else { diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index c33231cb8d14..4f4691b14aab 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtimp.cxx,v $ * - * $Revision: 1.35 $ + * $Revision: 1.36 $ * - * last change: $Author: dvo $ $Date: 2001-01-02 14:05:02 $ + * last change: $Author: mib $ $Date: 2001-01-03 11:07:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -205,7 +205,7 @@ static __FAR_DATA SvXMLTokenMapEntry aTextElemTokenMap[] = { XML_NAMESPACE_DRAW, sXML_text_box, XML_TOK_TEXT_TEXTBOX_PAGE }, { XML_NAMESPACE_DRAW, sXML_image, XML_TOK_TEXT_IMAGE_PAGE }, { XML_NAMESPACE_DRAW, sXML_object, XML_TOK_TEXT_OBJECT_PAGE }, - { XML_NAMESPACE_DRAW, sXML_foreign_object, XML_TOK_TEXT_FOREIGN_OBJECT_PAGE }, + { XML_NAMESPACE_DRAW, sXML_object_ole, XML_TOK_TEXT_OBJECT_OLE_PAGE }, { XML_NAMESPACE_DRAW, sXML_a, XML_TOK_DRAW_A_PAGE }, { XML_NAMESPACE_TABLE,sXML_table, XML_TOK_TABLE_TABLE }, // { XML_NAMESPACE_TABLE,sXML_sub_table, XML_TOK_TABLE_SUBTABLE }, @@ -249,7 +249,7 @@ static __FAR_DATA SvXMLTokenMapEntry aTextPElemTokenMap[] = { XML_NAMESPACE_DRAW, sXML_text_box, XML_TOK_TEXT_TEXTBOX }, { XML_NAMESPACE_DRAW, sXML_image, XML_TOK_TEXT_IMAGE }, { XML_NAMESPACE_DRAW, sXML_object, XML_TOK_TEXT_OBJECT }, - { XML_NAMESPACE_DRAW, sXML_foreign_object, XML_TOK_TEXT_FOREIGN_OBJECT }, + { XML_NAMESPACE_DRAW, sXML_object_ole, XML_TOK_TEXT_OBJECT_OLE }, { XML_NAMESPACE_DRAW, sXML_a, XML_TOK_DRAW_A }, // index marks @@ -430,6 +430,7 @@ static __FAR_DATA SvXMLTokenMapEntry aTextFrameAttrTokenMap[] = { XML_NAMESPACE_DRAW, sXML_name, XML_TOK_TEXT_FRAME_FILTER_NAME }, { XML_NAMESPACE_DRAW, sXML_zindex, XML_TOK_TEXT_FRAME_Z_INDEX }, { XML_NAMESPACE_SVG, sXML_transform, XML_TOK_TEXT_FRAME_TRANSFORM }, + { XML_NAMESPACE_DRAW, sXML_class_id, XML_TOK_TEXT_FRAME_CLASS_ID }, XML_TOKEN_MAP_END }; @@ -1132,7 +1133,7 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext( break; case XML_TOK_TEXT_OBJECT_PAGE: - case XML_TOK_TEXT_FOREIGN_OBJECT_PAGE: + case XML_TOK_TEXT_OBJECT_OLE_PAGE: if( XML_TEXT_TYPE_BODY == eType || XML_TEXT_TYPE_TEXTBOX == eType ) { TextContentAnchorType eAnchorType = @@ -1429,7 +1430,9 @@ sal_Bool XMLTextImportHelper::IsInHeaderFooter() const } Reference< XPropertySet> XMLTextImportHelper::createAndInsertOLEObject( - const OUString& rHRef ) + SvXMLImport& rImport, + const OUString& rHRef, + const OUString& rClassId ) { Reference< XPropertySet> xPropSet; return xPropSet; diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 1d445d9c5945..289d00f48e8d 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtparae.cxx,v $ * - * $Revision: 1.41 $ + * $Revision: 1.42 $ * - * last change: $Author: dvo $ $Date: 2001-01-02 14:38:40 $ + * last change: $Author: mib $ $Date: 2001-01-03 11:07:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1866,13 +1866,6 @@ void XMLTextParagraphExport::exportTextGraphic( } } -//OUString XMLTextParagraphExport::exportTextEmbeddedGraphic( -// const Reference < XPropertySet >& rPropSet ) -//{ -// OUString sEmpty; -// return sEmpty; -//} - void XMLTextParagraphExport::exportShape( const Reference < XTextContent > & rTxtCntnt, sal_Bool bAutoStyles ) @@ -1912,14 +1905,18 @@ void XMLTextParagraphExport::_exportTextEmbedded( Reference < XModel > xEmbeddedModel; Reference < XEmbeddedObjectSupplier > xEOSupplier( rPropSet, UNO_QUERY ); - if( xEOSupplier.is() ) - xEmbeddedModel = Reference < XModel >( xEOSupplier->getEmbeddedObject(), - UNO_QUERY ); - const sal_Char *pElem = xEmbeddedModel.is() ? sXML_foreign_object - : sXML_object; +// if( xEOSupplier.is() ) +// xEmbeddedModel = Reference < XModel >( xEOSupplier->getEmbeddedObject(), +// UNO_QUERY ); + const sal_Char *pElem = xEmbeddedModel.is() ? sXML_object + : sXML_object_ole; // xlink:href - OUString sURL = exportTextEmbeddedObject( rPropSet ); + OUString sStreamName, sClassId; + getTextEmbeddedObjectProperties( rPropSet, sStreamName, sClassId ); + + OUString sURL( GetExport().GetObjectsPath() ); + sURL += sStreamName; GetExport().AddAttribute(XML_NAMESPACE_XLINK, sXML_href, sURL ); GetExport().AddAttributeASCII( XML_NAMESPACE_XLINK, sXML_type, sXML_simple ); @@ -1928,6 +1925,9 @@ void XMLTextParagraphExport::_exportTextEmbedded( GetExport().AddAttributeASCII( XML_NAMESPACE_XLINK, sXML_actuate, sXML_onRequest ); + if( !xEmbeddedModel.is() ) + GetExport().AddAttribute(XML_NAMESPACE_DRAW, sXML_class_id, sClassId ); + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW, pElem, sal_False, sal_True ); @@ -1985,11 +1985,10 @@ void XMLTextParagraphExport::exportTextEmbedded( } } -OUString XMLTextParagraphExport::exportTextEmbeddedObject( - const Reference < XPropertySet >& rPropSet ) +void XMLTextParagraphExport::getTextEmbeddedObjectProperties( + const Reference < XPropertySet >& rPropSet, + OUString& rStreamName, OUString& rClassId ) const { - OUString sEmpty; - return sEmpty; } void XMLTextParagraphExport::_exportTextRange( diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 8327802053e8..678593f32a35 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtparai.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: dvo $ $Date: 2001-01-02 14:05:02 $ + * last change: $Author: mib $ $Date: 2001-01-03 11:07:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1608,7 +1608,7 @@ SvXMLImportContext *XMLImpSpanContext_Impl::CreateChildContext( break; case XML_TOK_TEXT_OBJECT: - case XML_TOK_TEXT_FOREIGN_OBJECT: + case XML_TOK_TEXT_OBJECT_OLE: pContext = new XMLTextFrameContext( rImport, nPrefix, rLocalName, xAttrList, TextContentAnchorType_AS_CHARACTER, |