diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-06-06 12:31:51 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-06-06 12:31:51 +0000 |
commit | 9ec3169e05bcb98a72b39c90cbd8260c1ac0e0ae (patch) | |
tree | ef5fa10f95ee950cfc4c488471b236672b3975a6 /xmloff | |
parent | 6ec3af4200abe20f3f9c987baa78370c7e4dfb11 (diff) |
INTEGRATION: CWS dba30c (1.16.30); FILE MERGED
2008/05/13 20:21:45 fs 1.16.30.1: joining changes from CWS odbmacros3 to CWS dba30c:
2008/05/13 20:10:33 fs 1.16.28.1: #i49133# don't import scripts from the ooo:libraries element if the document actually does not support embedding scripts
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/script/xmlscripti.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/xmloff/source/script/xmlscripti.cxx b/xmloff/source/script/xmlscripti.cxx index 6b1d5416b81d..85fe076f0446 100644 --- a/xmloff/source/script/xmlscripti.cxx +++ b/xmloff/source/script/xmlscripti.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: xmlscripti.cxx,v $ - * $Revision: 1.16 $ + * $Revision: 1.17 $ * * This file is part of OpenOffice.org. * @@ -40,6 +40,7 @@ #include "xmlbasici.hxx" #include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/document/XEmbeddedScripts.hpp> using ::rtl::OUString; using namespace com::sun::star; @@ -58,7 +59,8 @@ using namespace ::xmloff::token; class XMLScriptChildContext : public SvXMLImportContext { private: - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; + ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedScripts > m_xDocumentScripts; ::rtl::OUString m_aLanguage; public: @@ -79,6 +81,7 @@ XMLScriptChildContext::XMLScriptChildContext( SvXMLImport& rImport, USHORT nPrfx const Reference< frame::XModel >& rxModel, const ::rtl::OUString& rLanguage ) :SvXMLImportContext( rImport, nPrfx, rLName ) ,m_xModel( rxModel ) + ,m_xDocumentScripts( rxModel, UNO_QUERY ) ,m_aLanguage( rLanguage ) { } @@ -97,11 +100,14 @@ SvXMLImportContext* XMLScriptChildContext::CreateChildContext( { SvXMLImportContext* pContext = NULL; - ::rtl::OUString aBasic( GetImport().GetNamespaceMap().GetPrefixByKey( XML_NAMESPACE_OOO ) ); - aBasic += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ":Basic" ) ); + if ( m_xDocumentScripts.is() ) + { // document supports embedding scripts/macros + ::rtl::OUString aBasic( GetImport().GetNamespaceMap().GetPrefixByKey( XML_NAMESPACE_OOO ) ); + aBasic += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ":Basic" ) ); - if ( m_aLanguage == aBasic && nPrefix == XML_NAMESPACE_OOO && IsXMLToken( rLocalName, XML_LIBRARIES ) ) - pContext = new XMLBasicImportContext( GetImport(), nPrefix, rLocalName, m_xModel ); + if ( m_aLanguage == aBasic && nPrefix == XML_NAMESPACE_OOO && IsXMLToken( rLocalName, XML_LIBRARIES ) ) + pContext = new XMLBasicImportContext( GetImport(), nPrefix, rLocalName, m_xModel ); + } if ( !pContext ) pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); |