fdo#46808, Adapt document::XMLOasisBasicImporter UNO service to new style
Change-Id: Ic494847cf56c7661474d2a096dccc675780c9ce1
This commit is contained in:
@@ -104,6 +104,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/document,\
|
|||||||
OOXMLDocumentPropertiesImporter \
|
OOXMLDocumentPropertiesImporter \
|
||||||
XMLBasicExporter \
|
XMLBasicExporter \
|
||||||
XMLOasisBasicExporter \
|
XMLOasisBasicExporter \
|
||||||
|
XMLOasisBasicImporter \
|
||||||
))
|
))
|
||||||
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing,\
|
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing,\
|
||||||
ShapeCollection \
|
ShapeCollection \
|
||||||
@@ -668,7 +669,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/documen
|
|||||||
Settings \
|
Settings \
|
||||||
TypeDetection \
|
TypeDetection \
|
||||||
XMLBasicImporter \
|
XMLBasicImporter \
|
||||||
XMLOasisBasicImporter \
|
|
||||||
))
|
))
|
||||||
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/drawing,\
|
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/drawing,\
|
||||||
AccessibleDrawDocumentView \
|
AccessibleDrawDocumentView \
|
||||||
@@ -2174,6 +2174,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/document,\
|
|||||||
XUndoManagerSupplier \
|
XUndoManagerSupplier \
|
||||||
XViewDataSupplier \
|
XViewDataSupplier \
|
||||||
XXMLBasicExporter \
|
XXMLBasicExporter \
|
||||||
|
XXMLOasisBasicImporter \
|
||||||
))
|
))
|
||||||
$(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/drawing,\
|
$(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/drawing,\
|
||||||
Alignment \
|
Alignment \
|
||||||
|
@@ -19,8 +19,7 @@
|
|||||||
#ifndef __com_sun_star_document_XMLOasisBasicImporter_idl__
|
#ifndef __com_sun_star_document_XMLOasisBasicImporter_idl__
|
||||||
#define __com_sun_star_document_XMLOasisBasicImporter_idl__
|
#define __com_sun_star_document_XMLOasisBasicImporter_idl__
|
||||||
|
|
||||||
#include <com/sun/star/document/XImporter.idl>
|
#include <com/sun/star/document/XXMLOasisBasicImporter.idl>
|
||||||
#include <com/sun/star/xml/sax/XDocumentHandler.idl>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -37,19 +36,7 @@ module com { module sun { module star { module document {
|
|||||||
|
|
||||||
@since OOo 2.0
|
@since OOo 2.0
|
||||||
*/
|
*/
|
||||||
published service XMLOasisBasicImporter
|
published service XMLOasisBasicImporter : 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;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}; }; }; };
|
}; }; }; };
|
||||||
|
52
offapi/com/sun/star/document/XXMLOasisBasicImporter.idl
Normal file
52
offapi/com/sun/star/document/XXMLOasisBasicImporter.idl
Normal file
@@ -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: */
|
Binary file not shown.
@@ -21,6 +21,8 @@
|
|||||||
#include <xmloff/attrlist.hxx>
|
#include <xmloff/attrlist.hxx>
|
||||||
#include <xmloff/nmspmap.hxx>
|
#include <xmloff/nmspmap.hxx>
|
||||||
#include <xmloff/xmlimp.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;
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
@@ -36,22 +38,10 @@ XMLBasicImportContext::XMLBasicImportContext( SvXMLImport& rImport, sal_uInt16 n
|
|||||||
,m_xModel( rxModel )
|
,m_xModel( rxModel )
|
||||||
{
|
{
|
||||||
Reference< lang::XMultiServiceFactory > xMSF = GetImport().getServiceFactory();
|
Reference< lang::XMultiServiceFactory > xMSF = GetImport().getServiceFactory();
|
||||||
if ( xMSF.is() )
|
m_xHandler = document::XMLOasisBasicImporter::create( comphelper::getComponentContext(xMSF) );
|
||||||
{
|
|
||||||
m_xHandler.set( xMSF->createInstance(
|
|
||||||
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.XMLOasisBasicImporter" ) ) ),
|
|
||||||
UNO_QUERY );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_xHandler.is() )
|
Reference< lang::XComponent > xComp( m_xModel, UNO_QUERY );
|
||||||
{
|
m_xHandler->setTargetDocument( xComp );
|
||||||
Reference< document::XImporter > xImporter( m_xHandler, UNO_QUERY );
|
|
||||||
if ( xImporter.is() )
|
|
||||||
{
|
|
||||||
Reference< lang::XComponent > xComp( m_xModel, UNO_QUERY );
|
|
||||||
xImporter->setTargetDocument( xComp );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -69,7 +59,8 @@ SvXMLImportContext* XMLBasicImportContext::CreateChildContext(
|
|||||||
SvXMLImportContext* pContext = 0;
|
SvXMLImportContext* pContext = 0;
|
||||||
|
|
||||||
if ( m_xHandler.is() )
|
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 )
|
if ( !pContext )
|
||||||
pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
|
pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
#define _XMLOFF_XMLBASICI_HXX
|
#define _XMLOFF_XMLBASICI_HXX
|
||||||
|
|
||||||
#include <com/sun/star/frame/XModel.hpp>
|
#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>
|
#include <xmloff/xmlictxt.hxx>
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ class XMLBasicImportContext : public SvXMLImportContext
|
|||||||
{
|
{
|
||||||
private:
|
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::xml::sax::XDocumentHandler > m_xHandler;
|
::com::sun::star::uno::Reference< ::com::sun::star::document::XXMLOasisBasicImporter > m_xHandler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
XMLBasicImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
|
XMLBasicImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
|
||||||
|
@@ -20,15 +20,14 @@
|
|||||||
#ifndef XMLSCRIPT_XMLBAS_IMPORT_HXX
|
#ifndef XMLSCRIPT_XMLBAS_IMPORT_HXX
|
||||||
#define XMLSCRIPT_XMLBAS_IMPORT_HXX
|
#define XMLSCRIPT_XMLBAS_IMPORT_HXX
|
||||||
|
|
||||||
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
|
#include <com/sun/star/document/XXMLOasisBasicImporter.hpp>
|
||||||
#include <com/sun/star/document/XImporter.hpp>
|
|
||||||
#include <com/sun/star/frame/XModel.hpp>
|
#include <com/sun/star/frame/XModel.hpp>
|
||||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||||
#include <com/sun/star/script/XLibraryContainer2.hpp>
|
#include <com/sun/star/script/XLibraryContainer2.hpp>
|
||||||
#include <com/sun/star/uno/XComponentContext.hpp>
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
||||||
#include <com/sun/star/xml/input/XRoot.hpp>
|
#include <com/sun/star/xml/input/XRoot.hpp>
|
||||||
#include <cppuhelper/implbase1.hxx>
|
#include <cppuhelper/implbase1.hxx>
|
||||||
#include <cppuhelper/implbase3.hxx>
|
#include <cppuhelper/implbase2.hxx>
|
||||||
#include <osl/mutex.hxx>
|
#include <osl/mutex.hxx>
|
||||||
#include <rtl/ustrbuf.hxx>
|
#include <rtl/ustrbuf.hxx>
|
||||||
|
|
||||||
@@ -245,10 +244,9 @@ namespace xmlscript
|
|||||||
// class XMLBasicImporterBase
|
// class XMLBasicImporterBase
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
typedef ::cppu::WeakImplHelper3<
|
typedef ::cppu::WeakImplHelper2<
|
||||||
::com::sun::star::lang::XServiceInfo,
|
::com::sun::star::lang::XServiceInfo,
|
||||||
::com::sun::star::document::XImporter,
|
::com::sun::star::document::XXMLOasisBasicImporter > XMLBasicImporterBase_BASE;
|
||||||
::com::sun::star::xml::sax::XDocumentHandler > XMLBasicImporterBase_BASE;
|
|
||||||
|
|
||||||
class XMLBasicImporterBase : public XMLBasicImporterBase_BASE
|
class XMLBasicImporterBase : public XMLBasicImporterBase_BASE
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user