diff options
author | Andreas Bregas <ab@openoffice.org> | 2001-07-02 11:02:12 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2001-07-02 11:02:12 +0000 |
commit | 17c5d5b91b354b58e941e01828b9dd001a5dae6a (patch) | |
tree | 472b67a5160c38768f4677eff930f16581f5921d /xmlscript | |
parent | 44745ea3c1e1809d2f1de344541162b1b9505492 (diff) |
#89073# New library import/export interfaces
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/inc/xmlscript/xmllib_imexp.hxx | 21 | ||||
-rw-r--r-- | xmlscript/source/xmllib_imexp/imp_share.hxx | 12 | ||||
-rw-r--r-- | xmlscript/source/xmllib_imexp/xmllib_export.cxx | 9 | ||||
-rw-r--r-- | xmlscript/source/xmllib_imexp/xmllib_import.cxx | 31 |
4 files changed, 49 insertions, 24 deletions
diff --git a/xmlscript/inc/xmlscript/xmllib_imexp.hxx b/xmlscript/inc/xmlscript/xmllib_imexp.hxx index e3d19bf5e39f..f5f0bb8306b5 100644 --- a/xmlscript/inc/xmlscript/xmllib_imexp.hxx +++ b/xmlscript/inc/xmlscript/xmllib_imexp.hxx @@ -2,9 +2,9 @@ * * $RCSfile: xmllib_imexp.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dbo $ $Date: 2001-04-04 14:35:07 $ + * last change: $Author: ab $ $Date: 2001-07-02 12:00:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,15 +95,26 @@ struct LibDescriptor ::com::sun::star::uno::Sequence< ::rtl::OUString > aElementNames; }; +struct LibDescriptorArray +{ + LibDescriptor* mpLibs; + sal_Int32 mnLibCount; + + LibDescriptorArray( void ) { mpLibs = NULL; } + LibDescriptorArray( sal_Int32 nLibCount ); + + ~LibDescriptorArray(); + +}; + SAL_DLLEXPORT void SAL_CALL exportLibraryContainer( ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut, - LibDescriptor* pLibs, sal_Int32 nLibCount ) + const LibDescriptorArray* pLibArray ) SAL_THROW( (::com::sun::star::uno::Exception) ); SAL_DLLEXPORT ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > -SAL_CALL importLibraryContainer( - LibDescriptor*& rpLibs, sal_Int32& rnLibCount ) +SAL_CALL importLibraryContainer( LibDescriptorArray* pLibArray ) SAL_THROW( (::com::sun::star::uno::Exception) ); //================================================================================================== diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx index a2a2c0e59268..09d7b1b08d36 100644 --- a/xmlscript/source/xmllib_imexp/imp_share.hxx +++ b/xmlscript/source/xmllib_imexp/imp_share.hxx @@ -2,9 +2,9 @@ * * $RCSfile: imp_share.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dbo $ $Date: 2001-05-04 09:14:57 $ + * last change: $Author: ab $ $Date: 2001-07-02 12:02:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -154,14 +154,12 @@ struct LibraryImport { friend class LibrariesElement; - LibDescriptor*& mrpLibs; - sal_Int32& mrnLibCount; + LibDescriptorArray* mpLibArray; public: - inline LibraryImport( LibDescriptor*& rpLibs, sal_Int32& rnLibCount ) + inline LibraryImport( LibDescriptorArray* pLibArray ) SAL_THROW( () ) - : mrpLibs( rpLibs ) - , mrnLibCount( rnLibCount ) {} + : mpLibArray( pLibArray ) {} virtual ~LibraryImport() SAL_THROW( () ); diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx index 27a277bc0a8c..f040cfddfb76 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmllib_export.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ab $ $Date: 2001-05-22 14:05:53 $ + * last change: $Author: ab $ $Date: 2001-07-02 12:02:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,7 +76,7 @@ namespace xmlscript SAL_DLLEXPORT void SAL_CALL exportLibraryContainer( Reference< xml::sax::XExtendedDocumentHandler > const & xOut, - LibDescriptor* pLibs, sal_Int32 nLibCount ) + const LibDescriptorArray* pLibArray ) SAL_THROW( (Exception) ) { xOut->startDocument(); @@ -103,9 +103,10 @@ SAL_CALL exportLibraryContainer( OUString aTrueStr ( RTL_CONSTASCII_USTRINGPARAM("true") ); OUString aFalseStr( RTL_CONSTASCII_USTRINGPARAM("false") ); + int nLibCount = pLibArray->mnLibCount; for( sal_Int32 i = 0 ; i < nLibCount ; i++ ) { - LibDescriptor& rLib = pLibs[i]; + LibDescriptor& rLib = pLibArray->mpLibs[i]; OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":library") ); XMLElement* pLibElement = new XMLElement( aLibraryName ); diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx b/xmlscript/source/xmllib_imexp/xmllib_import.cxx index 6554d64ca063..04bde7c95548 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmllib_import.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dbo $ $Date: 2001-05-04 09:14:57 $ + * last change: $Author: ab $ $Date: 2001-07-02 12:02:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -265,13 +265,13 @@ Reference< xml::XImportContext > LibrariesElement::createChildContext( void LibrariesElement::endElement() throw (xml::sax::SAXException, RuntimeException) { - sal_Int32 nLibCount = _pImport->mrnLibCount = (sal_Int32)mLibDescriptors.size(); - _pImport->mrpLibs = new LibDescriptor[ nLibCount ]; + sal_Int32 nLibCount = _pImport->mpLibArray->mnLibCount = (sal_Int32)mLibDescriptors.size(); + _pImport->mpLibArray->mpLibs = new LibDescriptor[ nLibCount ]; for( sal_Int32 i = 0 ; i < nLibCount ; i++ ) { const LibDescriptor& rLib = mLibDescriptors[i]; - _pImport->mrpLibs[i] = rLib; + _pImport->mpLibArray->mpLibs[i] = rLib; } } @@ -323,8 +323,8 @@ void LibraryElement::endElement() //################################################################################################## -SAL_DLLEXPORT Reference< xml::sax::XDocumentHandler > SAL_CALL importLibraryContainer( - LibDescriptor*& rpLibs, sal_Int32& rnLibCount ) +SAL_DLLEXPORT Reference< ::com::sun::star::xml::sax::XDocumentHandler > +SAL_CALL importLibraryContainer( LibDescriptorArray* pLibArray ) SAL_THROW( (Exception) ) { NameSpaceUid arNamespaceUids[] = { @@ -335,8 +335,23 @@ SAL_DLLEXPORT Reference< xml::sax::XDocumentHandler > SAL_CALL importLibraryCont return ::xmlscript::createDocumentHandler( arNamespaceUids, sizeof(arNamespaceUids) / sizeof(NameSpaceUid), -1 /* unknown namespace id */, - static_cast< xml::XImporter * >( new LibraryImport( rpLibs, rnLibCount ) ) ); + static_cast< xml::XImporter * >( new LibraryImport( pLibArray ) ) ); } +//################################################################################################## + +LibDescriptorArray::LibDescriptorArray( sal_Int32 nLibCount ) +{ + mnLibCount = nLibCount; + mpLibs = new LibDescriptor[ mnLibCount ]; +} + +LibDescriptorArray::~LibDescriptorArray() +{ + delete[] mpLibs; +} + + + }; |