summaryrefslogtreecommitdiff
path: root/xmlscript
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-10-16 06:57:26 +0000
committerOliver Bolte <obo@openoffice.org>2008-10-16 06:57:26 +0000
commitdb4c719a825e0c5b8d13133a1c8a33d4f3b53753 (patch)
tree7c16f150485662d25afe7b89d15884ec5e6bc3dd /xmlscript
parent0a6f995f4e6739636123a9829b5e22ea04b52f72 (diff)
CWS-TOOLING: integrate CWS odbmacros3
Diffstat (limited to 'xmlscript')
-rw-r--r--xmlscript/source/xmlflat_imexp/xmlbas_export.cxx18
-rw-r--r--xmlscript/source/xmlflat_imexp/xmlbas_import.cxx17
2 files changed, 25 insertions, 10 deletions
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
index ac3f2145a4..7a8b980d4c 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xmlbas_export.cxx,v $
- * $Revision: 1.6 $
+ * $Revision: 1.6.10.1 $
*
* This file is part of OpenOffice.org.
*
@@ -35,13 +35,10 @@
#include "xmlscript/xml_helper.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
-#ifndef _COM_SUN_STAR_SCRIPT_XLIBRYARYCONTAINER2_HPP_
#include <com/sun/star/script/XLibraryContainer2.hpp>
-#endif
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
+#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <cppuhelper/implementationentry.hxx>
-#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -253,13 +250,22 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& /
m_xHandler->startElement( aLibContElementName, xLibContAttribs );
Reference< script::XLibraryContainer2 > xLibContainer;
- if ( m_xModel.is() )
+
+ // try the XEmbeddedScripts interface
+ Reference< document::XEmbeddedScripts > xDocumentScripts( m_xModel, UNO_QUERY );
+ if ( xDocumentScripts.is() )
+ xLibContainer.set( xDocumentScripts->getBasicLibraries().get() );
+
+ if ( !xLibContainer.is() )
{
+ // try the "BasicLibraries" property (old-style, for compatibility)
Reference< beans::XPropertySet > xPSet( m_xModel, UNO_QUERY );
if ( xPSet.is() )
xPSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BasicLibraries" ) ) ) >>= xLibContainer;
}
+ OSL_ENSURE( xLibContainer.is(), "XMLBasicExporterBase::filter: nowhere to export to!" );
+
if ( xLibContainer.is() )
{
Sequence< ::rtl::OUString > aLibNames = xLibContainer->getElementNames();
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
index 9436621605..c1feece98d 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xmlbas_import.cxx,v $
- * $Revision: 1.6 $
+ * $Revision: 1.6.10.1 $
*
* This file is part of OpenOffice.org.
*
@@ -36,9 +36,8 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
+#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <cppuhelper/implementationentry.hxx>
-#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -582,12 +581,22 @@ void BasicImport::setDocumentLocator( const Reference< xml::sax::XLocator >& /*x
else if ( rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "libraries" ) ) )
{
Reference< script::XLibraryContainer2 > xLibContainer;
- if ( m_xModel.is() )
+
+ // try the XEmbeddedScripts interface
+ Reference< document::XEmbeddedScripts > xDocumentScripts( m_xModel, UNO_QUERY );
+ if ( xDocumentScripts.is() )
+ xLibContainer.set( xDocumentScripts->getBasicLibraries().get() );
+
+ if ( !xLibContainer.is() )
{
+ // try the "BasicLibraries" property (old-style, for compatibility)
Reference< beans::XPropertySet > xPSet( m_xModel, UNO_QUERY );
if ( xPSet.is() )
xPSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BasicLibraries" ) ) ) >>= xLibContainer;
}
+
+ OSL_ENSURE( xLibContainer.is(), "BasicImport::startRootElement: nowhere to import to!" );
+
if ( xLibContainer.is() )
{
xElement.set( new BasicLibrariesElement( rLocalName, xAttributes, 0, this, xLibContainer ) );