[Libreoffice-commits] core.git: writerperfect/Library_wpftdraw.mk writerperfect/source

Takeshi Abe tabe at fixedpoint.jp
Fri Oct 24 01:12:59 PDT 2014


 writerperfect/Library_wpftdraw.mk                   |    1 
 writerperfect/source/draw/CDRImportFilter.cxx       |    2 
 writerperfect/source/draw/CDRImportFilter.hxx       |   10 -
 writerperfect/source/draw/CMXImportFilter.cxx       |    2 
 writerperfect/source/draw/CMXImportFilter.hxx       |   10 -
 writerperfect/source/draw/DocumentHandlerForOdg.hxx |   31 +++
 writerperfect/source/draw/FreehandImportFilter.cxx  |    2 
 writerperfect/source/draw/FreehandImportFilter.hxx  |   10 -
 writerperfect/source/draw/ImportFilterBase.cxx      |  183 --------------------
 writerperfect/source/draw/ImportFilterBase.hxx      |  115 ------------
 writerperfect/source/draw/MSPUBImportFilter.cxx     |    2 
 writerperfect/source/draw/MSPUBImportFilter.hxx     |   10 -
 writerperfect/source/draw/MWAWDrawImportFilter.cxx  |    2 
 writerperfect/source/draw/MWAWDrawImportFilter.hxx  |   10 -
 writerperfect/source/draw/PageMakerImportFilter.cxx |    2 
 writerperfect/source/draw/PageMakerImportFilter.hxx |   10 -
 writerperfect/source/draw/VisioImportFilter.cxx     |    2 
 writerperfect/source/draw/VisioImportFilter.hxx     |   10 -
 writerperfect/source/draw/WPGImportFilter.cxx       |    2 
 writerperfect/source/draw/WPGImportFilter.hxx       |   10 -
 20 files changed, 87 insertions(+), 339 deletions(-)

New commits:
commit bddd965764130656ee8daf84b592de6de3c1db4f
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Mon Oct 20 22:34:24 2014 +0900

    fdo#84168 change writerperfect filters to use a new base class template
    
    in writerperfect/source/draw.
    
    Change-Id: I8ec2861da2af1e203157faa1319b837fe236b507
    Reviewed-on: https://gerrit.libreoffice.org/12072
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/writerperfect/Library_wpftdraw.mk b/writerperfect/Library_wpftdraw.mk
index c3a3ce0..29409c1 100644
--- a/writerperfect/Library_wpftdraw.mk
+++ b/writerperfect/Library_wpftdraw.mk
@@ -64,7 +64,6 @@ $(eval $(call gb_Library_add_exception_objects,wpftdraw,\
 	writerperfect/source/draw/CDRImportFilter \
 	writerperfect/source/draw/CMXImportFilter \
 	writerperfect/source/draw/FreehandImportFilter \
-	writerperfect/source/draw/ImportFilterBase \
 	writerperfect/source/draw/MSPUBImportFilter \
 	writerperfect/source/draw/MWAWDrawImportFilter \
 	writerperfect/source/draw/PageMakerImportFilter \
diff --git a/writerperfect/source/draw/CDRImportFilter.cxx b/writerperfect/source/draw/CDRImportFilter.cxx
index 8bb8fe8..e5671da 100644
--- a/writerperfect/source/draw/CDRImportFilter.cxx
+++ b/writerperfect/source/draw/CDRImportFilter.cxx
@@ -27,7 +27,7 @@ using com::sun::star::uno::Sequence;
 using com::sun::star::uno::XComponentContext;
 using com::sun::star::uno::XInterface;
 
-bool CDRImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &)
+bool CDRImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
 {
     return libcdr::CDRDocument::parse(&rInput, &rGenerator);
 }
diff --git a/writerperfect/source/draw/CDRImportFilter.hxx b/writerperfect/source/draw/CDRImportFilter.hxx
index f2a4d45..7754ac8 100644
--- a/writerperfect/source/draw/CDRImportFilter.hxx
+++ b/writerperfect/source/draw/CDRImportFilter.hxx
@@ -11,16 +11,18 @@
 #ifndef _CDRIMPORTFILTER_HXX
 #define _CDRIMPORTFILTER_HXX
 
-#include "ImportFilterBase.hxx"
+#include "writerperfect/ImportFilter.hxx"
+
+#include "DocumentHandlerForOdg.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 CDRImportFilter : public writerperfect::draw::ImportFilterBase
+class CDRImportFilter : public writerperfect::ImportFilter<OdgGenerator>
 {
 public:
     CDRImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
-        : writerperfect::draw::ImportFilterBase(rxContext)
+        : writerperfect::ImportFilter<OdgGenerator>(rxContext)
     {
     }
 
@@ -34,7 +36,7 @@ public:
 
 private:
     virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE;
-    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
 };
 
 OUString CDRImportFilter_getImplementationName()
diff --git a/writerperfect/source/draw/CMXImportFilter.cxx b/writerperfect/source/draw/CMXImportFilter.cxx
index 120e985..2670706 100644
--- a/writerperfect/source/draw/CMXImportFilter.cxx
+++ b/writerperfect/source/draw/CMXImportFilter.cxx
@@ -27,7 +27,7 @@ using com::sun::star::uno::Sequence;
 using com::sun::star::uno::XComponentContext;
 using com::sun::star::uno::XInterface;
 
-bool CMXImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &)
+bool CMXImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
 {
     return libcdr::CMXDocument::parse(&rInput, &rGenerator);
 }
diff --git a/writerperfect/source/draw/CMXImportFilter.hxx b/writerperfect/source/draw/CMXImportFilter.hxx
index dcb43e8..ac40cd8 100644
--- a/writerperfect/source/draw/CMXImportFilter.hxx
+++ b/writerperfect/source/draw/CMXImportFilter.hxx
@@ -11,16 +11,18 @@
 #ifndef _CMXIMPORTFILTER_HXX
 #define _CMXIMPORTFILTER_HXX
 
-#include "ImportFilterBase.hxx"
+#include "writerperfect/ImportFilter.hxx"
+
+#include "DocumentHandlerForOdg.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 CMXImportFilter : public writerperfect::draw::ImportFilterBase
+class CMXImportFilter : public writerperfect::ImportFilter<OdgGenerator>
 {
 public:
     CMXImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
-        : writerperfect::draw::ImportFilterBase(rxContext)
+        : writerperfect::ImportFilter<OdgGenerator>(rxContext)
     {
     }
 
@@ -34,7 +36,7 @@ public:
 
 private:
     virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE;
-    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
 };
 
 OUString CMXImportFilter_getImplementationName()
diff --git a/writerperfect/source/draw/DocumentHandlerForOdg.hxx b/writerperfect/source/draw/DocumentHandlerForOdg.hxx
new file mode 100644
index 0000000..c70c060
--- /dev/null
+++ b/writerperfect/source/draw/DocumentHandlerForOdg.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_DRAW_DOCUMENTHANDLERFORODG_HXX
+#define INCLUDED_WRITERPERFECT_SOURCE_DRAW_DOCUMENTHANDLERFORODG_HXX
+
+#include <libodfgen/libodfgen.hxx>
+
+#include "writerperfect/DocumentHandlerFor.hxx"
+
+namespace writerperfect
+{
+
+template<>
+struct DocumentHandlerFor<OdgGenerator>
+{
+    static const rtl::OUString name()
+    {
+        return rtl::OUString("com.sun.star.comp.Draw.XMLOasisImporter");
+    }
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/draw/FreehandImportFilter.cxx b/writerperfect/source/draw/FreehandImportFilter.cxx
index c977db3..2afe6d6 100644
--- a/writerperfect/source/draw/FreehandImportFilter.cxx
+++ b/writerperfect/source/draw/FreehandImportFilter.cxx
@@ -23,7 +23,7 @@ using com::sun::star::uno::Sequence;
 using com::sun::star::uno::XComponentContext;
 using com::sun::star::uno::XInterface;
 
-bool FreehandImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &)
+bool FreehandImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
 {
     return libfreehand::FreeHandDocument::parse(&rInput, &rGenerator);
 }
diff --git a/writerperfect/source/draw/FreehandImportFilter.hxx b/writerperfect/source/draw/FreehandImportFilter.hxx
index e6dd231..699f8c1 100644
--- a/writerperfect/source/draw/FreehandImportFilter.hxx
+++ b/writerperfect/source/draw/FreehandImportFilter.hxx
@@ -8,16 +8,18 @@
 #ifndef _FREEHANDIMPORTFILTER_HXX
 #define _FREEHANDIMPORTFILTER_HXX
 
-#include "ImportFilterBase.hxx"
+#include "writerperfect/ImportFilter.hxx"
+
+#include "DocumentHandlerForOdg.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 FreehandImportFilter : public writerperfect::draw::ImportFilterBase
+class FreehandImportFilter : public writerperfect::ImportFilter<OdgGenerator>
 {
 public:
     FreehandImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
-        : writerperfect::draw::ImportFilterBase(rxContext)
+        : writerperfect::ImportFilter<OdgGenerator>(rxContext)
     {
     }
 
@@ -31,7 +33,7 @@ public:
 
 private:
     virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE;
-    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
 };
 
 OUString FreehandImportFilter_getImplementationName()
diff --git a/writerperfect/source/draw/ImportFilterBase.cxx b/writerperfect/source/draw/ImportFilterBase.cxx
deleted file mode 100644
index cc8da90..0000000
--- a/writerperfect/source/draw/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 <libodfgen/libodfgen.hxx>
-
-#include "ImportFilterBase.hxx"
-
-namespace writerperfect
-{
-namespace draw
-{
-
-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;
-    for (sal_Int32 i = 0 ; i < nLength; i++)
-    {
-        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.Draw.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);
-
-    OdgGenerator 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(OdgGenerator &)
-{
-}
-
-}
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/draw/ImportFilterBase.hxx b/writerperfect/source/draw/ImportFilterBase.hxx
deleted file mode 100644
index 1701af1..0000000
--- a/writerperfect/source/draw/ImportFilterBase.hxx
+++ /dev/null
@@ -1,115 +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_DRAW_IMPORTFILTERBASE_HXX
-#define INCLUDED_WRITERPERFECT_SOURCE_DRAW_IMPORTFILTERBASE_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;
-}
-}
-}
-}
-}
-
-class OdgGenerator;
-
-namespace writerperfect
-{
-namespace draw
-{
-
-/* 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::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &) = 0;
-    virtual void doRegisterHandlers(OdgGenerator &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_DRAW_IMPORTFILTERBASE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/draw/MSPUBImportFilter.cxx b/writerperfect/source/draw/MSPUBImportFilter.cxx
index 97231de..b0f5e63 100644
--- a/writerperfect/source/draw/MSPUBImportFilter.cxx
+++ b/writerperfect/source/draw/MSPUBImportFilter.cxx
@@ -25,7 +25,7 @@ using com::sun::star::uno::Sequence;
 using com::sun::star::uno::XComponentContext;
 using com::sun::star::uno::XInterface;
 
-bool MSPUBImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &)
+bool MSPUBImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
 {
     return libmspub::MSPUBDocument::parse(&rInput, &rGenerator);
 }
diff --git a/writerperfect/source/draw/MSPUBImportFilter.hxx b/writerperfect/source/draw/MSPUBImportFilter.hxx
index 8fe58ba..d8ed490 100644
--- a/writerperfect/source/draw/MSPUBImportFilter.hxx
+++ b/writerperfect/source/draw/MSPUBImportFilter.hxx
@@ -8,16 +8,18 @@
 #ifndef _MSPUBIMPORTFILTER_HXX
 #define _MSPUBIMPORTFILTER_HXX
 
-#include "ImportFilterBase.hxx"
+#include "writerperfect/ImportFilter.hxx"
+
+#include "DocumentHandlerForOdg.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 MSPUBImportFilter : public writerperfect::draw::ImportFilterBase
+class MSPUBImportFilter : public writerperfect::ImportFilter<OdgGenerator>
 {
 public:
     MSPUBImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
-        : writerperfect::draw::ImportFilterBase(rxContext)
+        : writerperfect::ImportFilter<OdgGenerator>(rxContext)
     {
     }
 
@@ -31,7 +33,7 @@ public:
 
 private:
     virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE;
-    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
 };
 
 OUString MSPUBImportFilter_getImplementationName()
diff --git a/writerperfect/source/draw/MWAWDrawImportFilter.cxx b/writerperfect/source/draw/MWAWDrawImportFilter.cxx
index 535a084..f4c0f18 100644
--- a/writerperfect/source/draw/MWAWDrawImportFilter.cxx
+++ b/writerperfect/source/draw/MWAWDrawImportFilter.cxx
@@ -39,7 +39,7 @@ static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData
     return MWAWDocument::decodeSpreadsheet(data, &exporter);
 }
 
-bool MWAWDrawImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &)
+bool MWAWDrawImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
 {
     return MWAWDocument::MWAW_R_OK == MWAWDocument::parse(&rInput, &rGenerator);
 }
diff --git a/writerperfect/source/draw/MWAWDrawImportFilter.hxx b/writerperfect/source/draw/MWAWDrawImportFilter.hxx
index 84a562b..29ce1e0 100644
--- a/writerperfect/source/draw/MWAWDrawImportFilter.hxx
+++ b/writerperfect/source/draw/MWAWDrawImportFilter.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 "DocumentHandlerForOdg.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 MWAWDrawImportFilter : public writerperfect::draw::ImportFilterBase
+class MWAWDrawImportFilter : public writerperfect::ImportFilter<OdgGenerator>
 {
 public:
     MWAWDrawImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
-        : writerperfect::draw::ImportFilterBase(rxContext) {}
+        : writerperfect::ImportFilter<OdgGenerator>(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::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
     virtual void doRegisterHandlers(OdgGenerator &rGenerator) SAL_OVERRIDE;
 };
 
diff --git a/writerperfect/source/draw/PageMakerImportFilter.cxx b/writerperfect/source/draw/PageMakerImportFilter.cxx
index fa08c76..915b2c2 100644
--- a/writerperfect/source/draw/PageMakerImportFilter.cxx
+++ b/writerperfect/source/draw/PageMakerImportFilter.cxx
@@ -25,7 +25,7 @@ using com::sun::star::uno::Sequence;
 using com::sun::star::uno::XComponentContext;
 using com::sun::star::uno::XInterface;
 
-bool PageMakerImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &)
+bool PageMakerImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
 {
     return libpagemaker::PMDocument::parse(&rInput, &rGenerator);
 }
diff --git a/writerperfect/source/draw/PageMakerImportFilter.hxx b/writerperfect/source/draw/PageMakerImportFilter.hxx
index 5665759..6c63d63 100644
--- a/writerperfect/source/draw/PageMakerImportFilter.hxx
+++ b/writerperfect/source/draw/PageMakerImportFilter.hxx
@@ -8,16 +8,18 @@
 #ifndef _PAGEMAKERIMPORTFILTER_HXX
 #define _PAGEMAKERIMPORTFILTER_HXX
 
-#include "ImportFilterBase.hxx"
+#include "writerperfect/ImportFilter.hxx"
+
+#include "DocumentHandlerForOdg.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 PageMakerImportFilter : public writerperfect::draw::ImportFilterBase
+class PageMakerImportFilter : public writerperfect::ImportFilter<OdgGenerator>
 {
 public:
     PageMakerImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
-        : writerperfect::draw::ImportFilterBase(rxContext)
+        : writerperfect::ImportFilter<OdgGenerator>(rxContext)
     {
     }
 
@@ -31,7 +33,7 @@ public:
 
 private:
     virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE;
-    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
 };
 
 OUString PageMakerImportFilter_getImplementationName()
diff --git a/writerperfect/source/draw/VisioImportFilter.cxx b/writerperfect/source/draw/VisioImportFilter.cxx
index d68e413..bfa1cbe 100644
--- a/writerperfect/source/draw/VisioImportFilter.cxx
+++ b/writerperfect/source/draw/VisioImportFilter.cxx
@@ -23,7 +23,7 @@ using com::sun::star::uno::Sequence;
 using com::sun::star::uno::XComponentContext;
 using com::sun::star::uno::XInterface;
 
-bool VisioImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &)
+bool VisioImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
 {
     return libvisio::VisioDocument::parse(&rInput, &rGenerator);
 }
diff --git a/writerperfect/source/draw/VisioImportFilter.hxx b/writerperfect/source/draw/VisioImportFilter.hxx
index 175dfa3..9b94620 100644
--- a/writerperfect/source/draw/VisioImportFilter.hxx
+++ b/writerperfect/source/draw/VisioImportFilter.hxx
@@ -8,16 +8,18 @@
 #ifndef _VISIOIMPORTFILTER_HXX
 #define _VISIOIMPORTFILTER_HXX
 
-#include "ImportFilterBase.hxx"
+#include "writerperfect/ImportFilter.hxx"
+
+#include "DocumentHandlerForOdg.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 VisioImportFilter : public writerperfect::draw::ImportFilterBase
+class VisioImportFilter : public writerperfect::ImportFilter<OdgGenerator>
 {
 public:
     VisioImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
-        : writerperfect::draw::ImportFilterBase(rxContext)
+        : writerperfect::ImportFilter<OdgGenerator>(rxContext)
     {
     }
 
@@ -31,7 +33,7 @@ public:
 
 private:
     virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE;
-    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
 };
 
 OUString VisioImportFilter_getImplementationName()
diff --git a/writerperfect/source/draw/WPGImportFilter.cxx b/writerperfect/source/draw/WPGImportFilter.cxx
index fbf06b3..d99572a 100644
--- a/writerperfect/source/draw/WPGImportFilter.cxx
+++ b/writerperfect/source/draw/WPGImportFilter.cxx
@@ -30,7 +30,7 @@ using com::sun::star::uno::Sequence;
 using com::sun::star::uno::XComponentContext;
 using com::sun::star::uno::XInterface;
 
-bool WPGImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &)
+bool WPGImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
 {
     return libwpg::WPGraphics::parse(&rInput, &rGenerator);
 }
diff --git a/writerperfect/source/draw/WPGImportFilter.hxx b/writerperfect/source/draw/WPGImportFilter.hxx
index 98bbf65..1a0dd99 100644
--- a/writerperfect/source/draw/WPGImportFilter.hxx
+++ b/writerperfect/source/draw/WPGImportFilter.hxx
@@ -13,16 +13,18 @@
 #ifndef _WPGIMPORTFILTER_HXX
 #define _WPGIMPORTFILTER_HXX
 
-#include "ImportFilterBase.hxx"
+#include "writerperfect/ImportFilter.hxx"
+
+#include "DocumentHandlerForOdg.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 WPGImportFilter : public writerperfect::draw::ImportFilterBase
+class WPGImportFilter : public writerperfect::ImportFilter<OdgGenerator>
 {
 public:
     WPGImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
-        : writerperfect::draw::ImportFilterBase(rxContext)
+        : writerperfect::ImportFilter<OdgGenerator>(rxContext)
     {
     }
 
@@ -36,7 +38,7 @@ public:
 
 private:
     virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE;
-    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGDrawingInterface &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) SAL_OVERRIDE;
 };
 
 OUString WPGImportFilter_getImplementationName()


More information about the Libreoffice-commits mailing list