diff options
author | Noel Grandin <noel@peralex.com> | 2013-02-04 10:34:03 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-02-12 10:14:43 +0200 |
commit | f1204419af34b1d2f0ecaa69ceeb1f8c8a7d87df (patch) | |
tree | af5cc696bc74c2825739b5e639d0bf96259fd4d5 | |
parent | 37ef449b93750b6101cf04b8112fa2ef64ba38ff (diff) |
fdo#46808, Adapt document::XMLOasisBasicImporter UNO service to new style
Change-Id: Ic494847cf56c7661474d2a096dccc675780c9ce1
-rw-r--r-- | offapi/UnoApi_offapi.mk | 3 | ||||
-rw-r--r-- | offapi/com/sun/star/document/XMLOasisBasicImporter.idl | 17 | ||||
-rw-r--r-- | offapi/com/sun/star/document/XXMLOasisBasicImporter.idl | 52 | ||||
-rw-r--r-- | offapi/type_reference/types.rdb | bin | 7440384 -> 7440384 bytes | |||
-rw-r--r-- | xmloff/source/script/xmlbasici.cxx | 23 | ||||
-rw-r--r-- | xmloff/source/script/xmlbasici.hxx | 4 | ||||
-rw-r--r-- | xmlscript/source/xmlflat_imexp/xmlbas_import.hxx | 10 |
7 files changed, 69 insertions, 40 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index da049875a358..257ccd07f89f 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -104,6 +104,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/document,\ OOXMLDocumentPropertiesImporter \ XMLBasicExporter \ XMLOasisBasicExporter \ + XMLOasisBasicImporter \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing,\ ShapeCollection \ @@ -668,7 +669,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/documen Settings \ TypeDetection \ XMLBasicImporter \ - XMLOasisBasicImporter \ )) $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/drawing,\ AccessibleDrawDocumentView \ @@ -2174,6 +2174,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/document,\ XUndoManagerSupplier \ XViewDataSupplier \ XXMLBasicExporter \ + XXMLOasisBasicImporter \ )) $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/drawing,\ Alignment \ diff --git a/offapi/com/sun/star/document/XMLOasisBasicImporter.idl b/offapi/com/sun/star/document/XMLOasisBasicImporter.idl index 399ac430f9d6..5f5bb33d89a4 100644 --- a/offapi/com/sun/star/document/XMLOasisBasicImporter.idl +++ b/offapi/com/sun/star/document/XMLOasisBasicImporter.idl @@ -19,8 +19,7 @@ #ifndef __com_sun_star_document_XMLOasisBasicImporter_idl__ #define __com_sun_star_document_XMLOasisBasicImporter_idl__ -#include <com/sun/star/document/XImporter.idl> -#include <com/sun/star/xml/sax/XDocumentHandler.idl> +#include <com/sun/star/document/XXMLOasisBasicImporter.idl> @@ -37,19 +36,7 @@ module com { module sun { module star { module document { @since OOo 2.0 */ -published service XMLOasisBasicImporter -{ - - /** sets the target document for this filter. - */ - interface com::sun::star::document::XImporter; - - - /** receives notification of general document events. - */ - interface com::sun::star::xml::sax::XDocumentHandler; - -}; +published service XMLOasisBasicImporter : XXMLOasisBasicImporter; }; }; }; }; diff --git a/offapi/com/sun/star/document/XXMLOasisBasicImporter.idl b/offapi/com/sun/star/document/XXMLOasisBasicImporter.idl new file mode 100644 index 000000000000..e867151c8f5a --- /dev/null +++ b/offapi/com/sun/star/document/XXMLOasisBasicImporter.idl @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_document_XXMLOasisBasicImporter_idl__ +#define __com_sun_star_document_XXMLOasisBasicImporter_idl__ + +#include <com/sun/star/document/XImporter.idl> +#include <com/sun/star/xml/sax/XDocumentHandler.idl> + + + +module com { module sun { module star { module document { + + +/** + @since LibreOffice 4.1 + */ +published interface XXMLOasisBasicImporter +{ + + /** sets the target document for this filter. + */ + interface com::sun::star::document::XImporter; + + + /** receives notification of general document events. + */ + interface com::sun::star::xml::sax::XDocumentHandler; + +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb Binary files differindex 527015291d91..dee150aff27e 100644 --- a/offapi/type_reference/types.rdb +++ b/offapi/type_reference/types.rdb diff --git a/xmloff/source/script/xmlbasici.cxx b/xmloff/source/script/xmlbasici.cxx index 97a468749f55..188608a19c85 100644 --- a/xmloff/source/script/xmlbasici.cxx +++ b/xmloff/source/script/xmlbasici.cxx @@ -21,6 +21,8 @@ #include <xmloff/attrlist.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmlimp.hxx> +#include <com/sun/star/document/XMLOasisBasicImporter.hpp> +#include <comphelper/processfactory.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -36,22 +38,10 @@ XMLBasicImportContext::XMLBasicImportContext( SvXMLImport& rImport, sal_uInt16 n ,m_xModel( rxModel ) { Reference< lang::XMultiServiceFactory > xMSF = GetImport().getServiceFactory(); - if ( xMSF.is() ) - { - m_xHandler.set( xMSF->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.XMLOasisBasicImporter" ) ) ), - UNO_QUERY ); - } + m_xHandler = document::XMLOasisBasicImporter::create( comphelper::getComponentContext(xMSF) ); - if ( m_xHandler.is() ) - { - Reference< document::XImporter > xImporter( m_xHandler, UNO_QUERY ); - if ( xImporter.is() ) - { - Reference< lang::XComponent > xComp( m_xModel, UNO_QUERY ); - xImporter->setTargetDocument( xComp ); - } - } + Reference< lang::XComponent > xComp( m_xModel, UNO_QUERY ); + m_xHandler->setTargetDocument( xComp ); } // ----------------------------------------------------------------------------- @@ -69,7 +59,8 @@ SvXMLImportContext* XMLBasicImportContext::CreateChildContext( SvXMLImportContext* pContext = 0; if ( m_xHandler.is() ) - pContext = new XMLBasicImportChildContext( GetImport(), nPrefix, rLocalName, m_xHandler ); + pContext = new XMLBasicImportChildContext( GetImport(), nPrefix, rLocalName, + Reference<xml::sax::XDocumentHandler>(m_xHandler, UNO_QUERY_THROW) ); if ( !pContext ) pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); diff --git a/xmloff/source/script/xmlbasici.hxx b/xmloff/source/script/xmlbasici.hxx index 0a1ab864b937..207f296e0627 100644 --- a/xmloff/source/script/xmlbasici.hxx +++ b/xmloff/source/script/xmlbasici.hxx @@ -21,7 +21,7 @@ #define _XMLOFF_XMLBASICI_HXX #include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/document/XXMLOasisBasicImporter.hpp> #include <xmloff/xmlictxt.hxx> @@ -33,7 +33,7 @@ class XMLBasicImportContext : public SvXMLImportContext { private: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; - ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler; + ::com::sun::star::uno::Reference< ::com::sun::star::document::XXMLOasisBasicImporter > m_xHandler; public: XMLBasicImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx index 61a84c30c52d..5f16ea61204e 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx @@ -20,15 +20,14 @@ #ifndef XMLSCRIPT_XMLBAS_IMPORT_HXX #define XMLSCRIPT_XMLBAS_IMPORT_HXX -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#include <com/sun/star/document/XImporter.hpp> +#include <com/sun/star/document/XXMLOasisBasicImporter.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/script/XLibraryContainer2.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/xml/input/XRoot.hpp> #include <cppuhelper/implbase1.hxx> -#include <cppuhelper/implbase3.hxx> +#include <cppuhelper/implbase2.hxx> #include <osl/mutex.hxx> #include <rtl/ustrbuf.hxx> @@ -245,10 +244,9 @@ namespace xmlscript // class XMLBasicImporterBase // ============================================================================= - typedef ::cppu::WeakImplHelper3< + typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::document::XImporter, - ::com::sun::star::xml::sax::XDocumentHandler > XMLBasicImporterBase_BASE; + ::com::sun::star::document::XXMLOasisBasicImporter > XMLBasicImporterBase_BASE; class XMLBasicImporterBase : public XMLBasicImporterBase_BASE { |