summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-11-09 12:06:48 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-11-09 12:06:48 +0000
commit6590ea07a914a71366709376a137f57caf742de3 (patch)
treeacbea8e927d7568329ed661b34f2e13c07bb0d7a /xmloff
parent5fda26ff93602213cfdeb142036a7464403da7ac (diff)
INTEGRATION: CWS xmlbasic (1.106.12); FILE MERGED
2004/10/21 12:15:59 tbe 1.106.12.3: #i22747# XML filter adaptors and macros 2004/09/30 13:15:52 tbe 1.106.12.2: RESYNC: (1.106-1.108); FILE MERGED 2004/09/30 10:35:45 tbe 1.106.12.1: #i22747# XML filter adaptors and macros
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmlexp.cxx59
1 files changed, 51 insertions, 8 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 5656c4dd582a..9ea109717a41 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlexp.cxx,v $
*
- * $Revision: 1.110 $
+ * $Revision: 1.111 $
*
- * last change: $Author: hr $ $Date: 2004-11-09 12:14:51 $
+ * last change: $Author: hr $ $Date: 2004-11-09 13:06:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -198,6 +198,9 @@
#ifndef _XMLOFF_XMLEMBEDDEDOBJECTEXPORTFILTER_HXX
#include "XMLEmbeddedObjectExportFilter.hxx"
#endif
+#ifndef _XMLOFF_XMLBASICEXPORTFILTER_HXX
+#include "XMLBasicExportFilter.hxx"
+#endif
#ifndef _VOS_MUTEX_HXX_
#include <vos/mutex.hxx>
@@ -1345,16 +1348,56 @@ void SvXMLExport::_ExportConfigurationSettings(const XMLSettingsExportHelper& rS
void SvXMLExport::_ExportScripts()
{
- // <office:script>
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_SCRIPTS,
- sal_True, sal_True );
+ SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_SCRIPTS, sal_True, sal_True );
+
+ // export Basic macros (only for FlatXML)
+ if ( mnExportFlags & EXPORT_EMBEDDED )
+ {
+ ::rtl::OUString aValue( GetNamespaceMap().GetPrefixByKey( XML_NAMESPACE_OOO ) );
+ aValue += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ":Basic" ) );
+ AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, aValue );
+
+ SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_SCRIPT, sal_True, sal_True );
- // embedded scripts are not implemented, but would have to go here.
+ // initialize Basic
+ if ( xModel.is() )
+ {
+ Reference< beans::XPropertySet > xPSet( xModel, UNO_QUERY );
+ if ( xPSet.is() )
+ xPSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BasicLibraries" ) ) );
+ }
+ Reference< document::XExporter > xExporter;
+ Reference< lang::XMultiServiceFactory > xMSF( getServiceFactory() );
+ if ( xMSF.is() )
+ {
+ Reference < XDocumentHandler > xHdl( new XMLBasicExportFilter( xHandler ) );
+ Sequence < Any > aArgs( 1 );
+ aArgs[0] <<= xHdl;
+ xExporter.set( xMSF->createInstanceWithArguments(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.XMLOasisBasicExporter" ) ), aArgs ),
+ UNO_QUERY );
+ }
+
+ OSL_ENSURE( xExporter.is(),
+ "SvXMLExport::_ExportScripts: can't instantiate export filter component for Basic macros" );
+
+ if ( xExporter.is() )
+ {
+ Reference< XComponent > xComp( xModel, UNO_QUERY );
+ xExporter->setSourceDocument( xComp );
+ Reference< XFilter > xFilter( xExporter, UNO_QUERY );
+ if ( xFilter.is() )
+ {
+ Sequence < PropertyValue > aMediaDesc( 0 );
+ xFilter->filter( aMediaDesc );
+ }
+ }
+ }
// export document events
- Reference<document::XEventsSupplier> xEvents(GetModel(), UNO_QUERY);
- GetEventExport().Export(xEvents, sal_True);
+ Reference< document::XEventsSupplier > xEvents( GetModel(), UNO_QUERY );
+ GetEventExport().Export( xEvents, sal_True );
}
void SvXMLExport::_ExportFontDecls()