diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-10-19 22:00:59 +0900 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-10-22 11:01:05 +0000 |
commit | d19f950dc49ee4b635bfecfd1ff8f1b1b5f4358a (patch) | |
tree | 79d6cf692e95357b75ca436ea00aa8072d862134 /writerperfect | |
parent | 4b89bd55b094ff5ed0162e2f34cd560fbf47e524 (diff) |
fdo#84168 change writerperfect filters to use a new base class template
in writerperfect/source/writer.
Change-Id: I8840f13b44aa1060dab9383583bdb1db4db70aaa
Reviewed-on: https://gerrit.libreoffice.org/12038
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/Library_wpftwriter.mk | 6 | ||||
-rw-r--r-- | writerperfect/source/writer/AbiWordImportFilter.cxx | 2 | ||||
-rw-r--r-- | writerperfect/source/writer/AbiWordImportFilter.hxx | 10 | ||||
-rw-r--r-- | writerperfect/source/writer/DocumentHandlerForOdt.hxx | 31 | ||||
-rw-r--r-- | writerperfect/source/writer/EBookImportFilter.cxx | 2 | ||||
-rw-r--r-- | writerperfect/source/writer/EBookImportFilter.hxx | 10 | ||||
-rw-r--r-- | writerperfect/source/writer/ImportFilterBase.cxx | 183 | ||||
-rw-r--r-- | writerperfect/source/writer/ImportFilterBase.hxx | 114 | ||||
-rw-r--r-- | writerperfect/source/writer/MSWorksImportFilter.cxx | 2 | ||||
-rw-r--r-- | writerperfect/source/writer/MSWorksImportFilter.hxx | 10 | ||||
-rw-r--r-- | writerperfect/source/writer/MWAWImportFilter.cxx | 2 | ||||
-rw-r--r-- | writerperfect/source/writer/MWAWImportFilter.hxx | 10 |
12 files changed, 64 insertions, 318 deletions
diff --git a/writerperfect/Library_wpftwriter.mk b/writerperfect/Library_wpftwriter.mk index db6afdf49d46..b47c2717f65c 100644 --- a/writerperfect/Library_wpftwriter.mk +++ b/writerperfect/Library_wpftwriter.mk @@ -19,6 +19,11 @@ $(eval $(call gb_Library_Library,wpftwriter)) +$(eval $(call gb_Library_set_include,wpftwriter,\ + -I$(SRCDIR)/writerperfect/inc \ + $$(INCLUDE) \ +)) + $(eval $(call gb_Library_set_componentfile,wpftwriter,writerperfect/source/writer/wpftwriter)) $(eval $(call gb_Library_use_sdk_api,wpftwriter)) @@ -58,7 +63,6 @@ $(eval $(call gb_Library_use_externals,wpftwriter,\ $(eval $(call gb_Library_add_exception_objects,wpftwriter,\ writerperfect/source/writer/AbiWordImportFilter \ writerperfect/source/writer/EBookImportFilter \ - writerperfect/source/writer/ImportFilterBase \ writerperfect/source/writer/MSWorksImportFilter \ writerperfect/source/writer/MWAWImportFilter \ writerperfect/source/writer/WordPerfectImportFilter \ diff --git a/writerperfect/source/writer/AbiWordImportFilter.cxx b/writerperfect/source/writer/AbiWordImportFilter.cxx index 87a2a6e2ebef..11b3e18b1d01 100644 --- a/writerperfect/source/writer/AbiWordImportFilter.cxx +++ b/writerperfect/source/writer/AbiWordImportFilter.cxx @@ -24,7 +24,7 @@ using com::sun::star::uno::RuntimeException; using com::sun::star::uno::XComponentContext; using com::sun::star::uno::XInterface; -bool AbiWordImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGTextInterface &rGenerator, utl::MediaDescriptor &) +bool AbiWordImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &) { return libabw::AbiDocument::parse(&rInput, &rGenerator); } diff --git a/writerperfect/source/writer/AbiWordImportFilter.hxx b/writerperfect/source/writer/AbiWordImportFilter.hxx index b0ea57edfb83..2cee47b10f29 100644 --- a/writerperfect/source/writer/AbiWordImportFilter.hxx +++ b/writerperfect/source/writer/AbiWordImportFilter.hxx @@ -13,16 +13,18 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include "ImportFilterBase.hxx" +#include "writerperfect/ImportFilter.hxx" + +#include "DocumentHandlerForOdt.hxx" /* This component will be instantiated for both import or export. Whether it calls * setSourceDocument or setTargetDocument determines which Impl function the filter * member calls */ -class AbiWordImportFilter : public writerperfect::writer::ImportFilterBase +class AbiWordImportFilter : public writerperfect::ImportFilter<OdtGenerator> { public: AbiWordImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext) - : writerperfect::writer::ImportFilterBase(rxContext) {} + : writerperfect::ImportFilter<OdtGenerator>(rxContext) {} // XServiceInfo virtual OUString SAL_CALL getImplementationName() @@ -34,7 +36,7 @@ public: private: virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE; - virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGTextInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE; + virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE; }; OUString AbiWordImportFilter_getImplementationName() diff --git a/writerperfect/source/writer/DocumentHandlerForOdt.hxx b/writerperfect/source/writer/DocumentHandlerForOdt.hxx new file mode 100644 index 000000000000..baf14625a289 --- /dev/null +++ b/writerperfect/source/writer/DocumentHandlerForOdt.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_DOCUMENTHANDLERFORODT_HXX +#define INCLUDED_WRITERPERFECT_SOURCE_WRITER_DOCUMENTHANDLERFORODT_HXX + +#include <libodfgen/libodfgen.hxx> + +#include "writerperfect/DocumentHandlerFor.hxx" + +namespace writerperfect +{ + +template<> +struct DocumentHandlerFor<OdtGenerator> +{ + static const rtl::OUString name() + { + return rtl::OUString("com.sun.star.comp.Writer.XMLOasisImporter"); + } +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/writer/EBookImportFilter.cxx b/writerperfect/source/writer/EBookImportFilter.cxx index 14c4a48366a9..6f9ddf55892b 100644 --- a/writerperfect/source/writer/EBookImportFilter.cxx +++ b/writerperfect/source/writer/EBookImportFilter.cxx @@ -26,7 +26,7 @@ using com::sun::star::uno::XComponentContext; using libebook::EBOOKDocument; -bool EBookImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGTextInterface &rGenerator, utl::MediaDescriptor &rDescriptor) +bool EBookImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &rDescriptor) { EBOOKDocument::Type type = EBOOKDocument::TYPE_UNKNOWN; diff --git a/writerperfect/source/writer/EBookImportFilter.hxx b/writerperfect/source/writer/EBookImportFilter.hxx index b7047d8e7772..59184aa5381a 100644 --- a/writerperfect/source/writer/EBookImportFilter.hxx +++ b/writerperfect/source/writer/EBookImportFilter.hxx @@ -13,16 +13,18 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include "ImportFilterBase.hxx" +#include "writerperfect/ImportFilter.hxx" + +#include "DocumentHandlerForOdt.hxx" /* This component will be instantiated for both import or export. Whether it calls * setSourceDocument or setTargetDocument determines which Impl function the filter * member calls */ -class EBookImportFilter : public writerperfect::writer::ImportFilterBase +class EBookImportFilter : public writerperfect::ImportFilter<OdtGenerator> { public: EBookImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext) - : writerperfect::writer::ImportFilterBase(rxContext) {} + : writerperfect::ImportFilter<OdtGenerator>(rxContext) {} // XServiceInfo virtual OUString SAL_CALL getImplementationName() @@ -34,7 +36,7 @@ public: private: virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE; - virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGTextInterface &rGenerator, utl::MediaDescriptor &rDescriptor) SAL_OVERRIDE; + virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &rDescriptor) SAL_OVERRIDE; }; OUString EBookImportFilter_getImplementationName() diff --git a/writerperfect/source/writer/ImportFilterBase.cxx b/writerperfect/source/writer/ImportFilterBase.cxx deleted file mode 100644 index 9437c5d6c911..000000000000 --- a/writerperfect/source/writer/ImportFilterBase.cxx +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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/. - */ - -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/io/XInputStream.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> -#include <com/sun/star/xml/sax/XAttributeList.hpp> -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#include <com/sun/star/xml/sax/InputSource.hpp> -#include <com/sun/star/xml/sax/XParser.hpp> -#include <com/sun/star/io/XSeekable.hpp> -#include <com/sun/star/uno/Reference.h> - -#include <writerperfect/DocumentHandler.hxx> -#include <writerperfect/WPXSvInputStream.hxx> - -#include <xmloff/attrlist.hxx> - -#include "ImportFilterBase.hxx" - -namespace writerperfect -{ -namespace writer -{ - -using com::sun::star::uno::Reference; -using com::sun::star::io::XInputStream; -using com::sun::star::io::XSeekable; -using com::sun::star::uno::Sequence; -using com::sun::star::uno::Any; -using com::sun::star::uno::UNO_QUERY; -using com::sun::star::uno::XInterface; -using com::sun::star::uno::Exception; -using com::sun::star::uno::RuntimeException; -using com::sun::star::beans::PropertyValue; -using com::sun::star::document::XFilter; -using com::sun::star::document::XExtendedFilterDetection; -using com::sun::star::document::XImporter; -using com::sun::star::xml::sax::InputSource; -using com::sun::star::xml::sax::XAttributeList; -using com::sun::star::xml::sax::XDocumentHandler; -using com::sun::star::xml::sax::XParser; - -using writerperfect::DocumentHandler; -using writerperfect::WPXSvInputStream; - -ImportFilterImpl::ImportFilterImpl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext) - : mxContext(rxContext) -{ -} - -ImportFilterImpl::~ImportFilterImpl() -{ -} - -sal_Bool SAL_CALL ImportFilterImpl::filter(const Sequence< ::com::sun::star::beans::PropertyValue > &aDescriptor) -throw (RuntimeException, std::exception) -{ - sal_Int32 nLength = aDescriptor.getLength(); - const PropertyValue *pValue = aDescriptor.getConstArray(); - Reference < XInputStream > xInputStream; - rtl::OUString sFilterName; - for (sal_Int32 i = 0 ; i < nLength; i++) - { - if (pValue[i].Name == "FilterName") - pValue[i].Value >>= sFilterName; - else if (pValue[i].Name == "InputStream") - pValue[i].Value >>= xInputStream; - } - if (!xInputStream.is()) - { - OSL_ASSERT(false); - return sal_False; - } - - // An XML import service: what we push sax messages to.. - Reference < XDocumentHandler > xInternalHandler( - mxContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.comp.Writer.XMLOasisImporter", mxContext), - css::uno::UNO_QUERY_THROW); - - // The XImporter sets up an empty target document for XDocumentHandler to write to.. - Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY); - xImporter->setTargetDocument(mxDoc); - - // OO Graphics Handler: abstract class to handle document SAX messages, concrete implementation here - // writes to in-memory target doc - DocumentHandler xHandler(xInternalHandler); - - WPXSvInputStream input(xInputStream); - - OdtGenerator exporter; - exporter.addDocumentHandler(&xHandler, ODF_FLAT_XML); - - doRegisterHandlers(exporter); - - utl::MediaDescriptor aMediaDescriptor(aDescriptor); - return doImportDocument(input, exporter, aMediaDescriptor); -} - -void SAL_CALL ImportFilterImpl::cancel() -throw (RuntimeException, std::exception) -{ -} - -// XImporter -void SAL_CALL ImportFilterImpl::setTargetDocument(const Reference< ::com::sun::star::lang::XComponent > &xDoc) -throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException, std::exception) -{ - mxDoc = xDoc; -} - -// XExtendedFilterDetection -OUString SAL_CALL ImportFilterImpl::detect(com::sun::star::uno::Sequence< PropertyValue > &Descriptor) -throw(com::sun::star::uno::RuntimeException, std::exception) -{ - OUString sTypeName; - sal_Int32 nLength = Descriptor.getLength(); - sal_Int32 location = nLength; - const PropertyValue *pValue = Descriptor.getConstArray(); - Reference < XInputStream > xInputStream; - for (sal_Int32 i = 0 ; i < nLength; i++) - { - if (pValue[i].Name == "TypeName") - location=i; - else if (pValue[i].Name == "InputStream") - pValue[i].Value >>= xInputStream; - } - - if (!xInputStream.is()) - return OUString(); - - WPXSvInputStream input(xInputStream); - - if (doDetectFormat(input, sTypeName)) - { - assert(!sTypeName.isEmpty()); - - if (location == nLength) - { - Descriptor.realloc(nLength+1); - Descriptor[location].Name = "TypeName"; - } - - Descriptor[location].Value <<=sTypeName; - } - - return sTypeName; -} - -// XInitialization -void SAL_CALL ImportFilterImpl::initialize(const Sequence< Any > &aArguments) -throw (Exception, RuntimeException, std::exception) -{ - Sequence < PropertyValue > aAnySeq; - sal_Int32 nLength = aArguments.getLength(); - if (nLength && (aArguments[0] >>= aAnySeq)) - { - const PropertyValue *pValue = aAnySeq.getConstArray(); - nLength = aAnySeq.getLength(); - for (sal_Int32 i = 0 ; i < nLength; i++) - { - if (pValue[i].Name == "Type") - { - pValue[i].Value >>= msFilterName; - break; - } - } - } -} - -void ImportFilterImpl::doRegisterHandlers(OdtGenerator &) -{ -} - -} -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/writer/ImportFilterBase.hxx b/writerperfect/source/writer/ImportFilterBase.hxx deleted file mode 100644 index bee7612405e9..000000000000 --- a/writerperfect/source/writer/ImportFilterBase.hxx +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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/. - */ - -#ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_IMPORTFILTERBASE_HXX -#define INCLUDED_WRITERPERFECT_SOURCE_WRITER_IMPORTFILTERBASE_HXX - -#include <libodfgen/libodfgen.hxx> - -#include <librevenge/librevenge.h> -#include <librevenge-stream/librevenge-stream.h> - -#include <com/sun/star/document/XFilter.hpp> -#include <com/sun/star/document/XImporter.hpp> -#include <com/sun/star/document/XExtendedFilterDetection.hpp> -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <cppuhelper/implbase1.hxx> -#include <cppuhelper/implbase4.hxx> - -#include <unotools/mediadescriptor.hxx> - -namespace com -{ -namespace sun -{ -namespace star -{ -namespace beans -{ -struct PropertyValue; -} -namespace lang -{ -class XComponent; -} -namespace uno -{ -class XComponentContext; -} -namespace xml -{ -namespace sax -{ -class XDocumentHandler; -} -} -} -} -} - -namespace writerperfect -{ -namespace writer -{ - -/* This component will be instantiated for both import or export. Whether it calls - * setSourceDocument or setTargetDocument determines which Impl function the filter - * member calls */ -class ImportFilterImpl : public cppu::WeakImplHelper4 - < - com::sun::star::document::XFilter, - com::sun::star::document::XImporter, - com::sun::star::document::XExtendedFilterDetection, - com::sun::star::lang::XInitialization - > -{ -public: - ImportFilterImpl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext); - virtual ~ImportFilterImpl(); - - // XFilter - virtual sal_Bool SAL_CALL filter(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > &aDescriptor) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL cancel() - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // XImporter - virtual void SAL_CALL setTargetDocument(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &xDoc) - throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - //XExtendedFilterDetection - virtual OUString SAL_CALL detect(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > &Descriptor) - throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // XInitialization - virtual void SAL_CALL initialize(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > &aArguments) - throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - -private: - virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) = 0; - virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGTextInterface &rGenerator, utl::MediaDescriptor &rDescriptor) = 0; - virtual void doRegisterHandlers(OdtGenerator &rGenerator); - -private: - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc; - OUString msFilterName; - ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; -}; - -/** A base class for import filters. - */ -typedef cppu::ImplInheritanceHelper1<ImportFilterImpl, com::sun::star::lang::XServiceInfo> ImportFilterBase; - -} -} - -#endif // INCLUDED_WRITERPERFECT_SOURCE_WRITER_IMPORTFILTERBASE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx b/writerperfect/source/writer/MSWorksImportFilter.cxx index 21657a13978f..61c54f5779b4 100644 --- a/writerperfect/source/writer/MSWorksImportFilter.cxx +++ b/writerperfect/source/writer/MSWorksImportFilter.cxx @@ -31,7 +31,7 @@ static bool handleEmbeddedWKSObject(const librevenge::RVNGBinaryData &data, OdfD return libwps::WPSDocument::parse(data.getDataStream(), &exporter)==libwps::WPS_OK; } -bool MSWorksImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGTextInterface &rGenerator, utl::MediaDescriptor &) +bool MSWorksImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &) { return libwps::WPS_OK == libwps::WPSDocument::parse(&rInput, &rGenerator); } diff --git a/writerperfect/source/writer/MSWorksImportFilter.hxx b/writerperfect/source/writer/MSWorksImportFilter.hxx index 42ff7d2ecfeb..40802b510c81 100644 --- a/writerperfect/source/writer/MSWorksImportFilter.hxx +++ b/writerperfect/source/writer/MSWorksImportFilter.hxx @@ -13,16 +13,18 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include "ImportFilterBase.hxx" +#include "writerperfect/ImportFilter.hxx" + +#include "DocumentHandlerForOdt.hxx" /* This component will be instantiated for both import or export. Whether it calls * setSourceDocument or setTargetDocument determines which Impl function the filter * member calls */ -class MSWorksImportFilter : public writerperfect::writer::ImportFilterBase +class MSWorksImportFilter : public writerperfect::ImportFilter<OdtGenerator> { public: MSWorksImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext) - : writerperfect::writer::ImportFilterBase(rxContext) {} + : writerperfect::ImportFilter<OdtGenerator>(rxContext) {} // XServiceInfo virtual OUString SAL_CALL getImplementationName() @@ -34,7 +36,7 @@ public: private: virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE; - virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGTextInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE; + virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE; virtual void doRegisterHandlers(OdtGenerator &rGenerator) SAL_OVERRIDE; }; diff --git a/writerperfect/source/writer/MWAWImportFilter.cxx b/writerperfect/source/writer/MWAWImportFilter.cxx index 03c43cc0c69a..98b210cf24e5 100644 --- a/writerperfect/source/writer/MWAWImportFilter.cxx +++ b/writerperfect/source/writer/MWAWImportFilter.cxx @@ -38,7 +38,7 @@ static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData return MWAWDocument::decodeSpreadsheet(data, &exporter); } -bool MWAWImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGTextInterface &rGenerator, utl::MediaDescriptor &) +bool MWAWImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &) { return MWAWDocument::MWAW_R_OK == MWAWDocument::parse(&rInput, &rGenerator); } diff --git a/writerperfect/source/writer/MWAWImportFilter.hxx b/writerperfect/source/writer/MWAWImportFilter.hxx index b2883bb5fc7c..f4e6f6f1dc7c 100644 --- a/writerperfect/source/writer/MWAWImportFilter.hxx +++ b/writerperfect/source/writer/MWAWImportFilter.hxx @@ -13,16 +13,18 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include "ImportFilterBase.hxx" +#include "writerperfect/ImportFilter.hxx" + +#include "DocumentHandlerForOdt.hxx" /* This component will be instantiated for both import or export. Whether it calls * setSourceDocument or setTargetDocument determines which Impl function the filter * member calls */ -class MWAWImportFilter : public writerperfect::writer::ImportFilterBase +class MWAWImportFilter : public writerperfect::ImportFilter<OdtGenerator> { public: MWAWImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext) - : writerperfect::writer::ImportFilterBase(rxContext) {} + : writerperfect::ImportFilter<OdtGenerator>(rxContext) {} // XServiceInfo virtual OUString SAL_CALL getImplementationName() @@ -34,7 +36,7 @@ public: private: virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE; - virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGTextInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE; + virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE; virtual void doRegisterHandlers(OdtGenerator &rGenerator) SAL_OVERRIDE; }; |