summaryrefslogtreecommitdiff
path: root/sdext/source/pdfimport
diff options
context:
space:
mode:
Diffstat (limited to 'sdext/source/pdfimport')
-rw-r--r--sdext/source/pdfimport/filterdet.cxx20
-rw-r--r--sdext/source/pdfimport/filterdet.hxx15
-rw-r--r--sdext/source/pdfimport/pdfiadaptor.cxx38
-rw-r--r--sdext/source/pdfimport/pdfiadaptor.hxx34
-rw-r--r--sdext/source/pdfimport/services.cxx6
-rw-r--r--sdext/source/pdfimport/test/pdf2xml.cxx2
-rw-r--r--sdext/source/pdfimport/test/tests.cxx4
7 files changed, 102 insertions, 17 deletions
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index 75840e78fff7..33c3f44c4af9 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/io/TempFile.hpp>
-
+#include <cppuhelper/supportsservice.hxx>
#include <boost/scoped_ptr.hpp>
#include <string.h>
@@ -388,6 +388,24 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF
return aOutTypeName;
}
+OUString PDFDetector::getImplementationName()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return OUString("org.libreoffice.comp.documents.PDFDetector");
+}
+
+sal_Bool PDFDetector::supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return cppu::supportsService(this, ServiceName);
+}
+
+css::uno::Sequence<OUString> PDFDetector::getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return css::uno::Sequence<OUString>{"com.sun.star.document.ImportFilter"};
+}
+
bool checkDocChecksum( const OUString& rInPDFFileURL,
sal_uInt32 nBytes,
const OUString& rChkSum )
diff --git a/sdext/source/pdfimport/filterdet.hxx b/sdext/source/pdfimport/filterdet.hxx
index 334e68fc8aa8..fede97c8dce8 100644
--- a/sdext/source/pdfimport/filterdet.hxx
+++ b/sdext/source/pdfimport/filterdet.hxx
@@ -26,15 +26,15 @@
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
namespace pdfi
{
-typedef ::cppu::WeakComponentImplHelper1<
- css::document::XExtendedFilterDetection > PDFDetectorBase;
+typedef ::cppu::WeakComponentImplHelper<
+ css::document::XExtendedFilterDetection, css::lang::XServiceInfo> PDFDetectorBase;
class PDFDetector : private cppu::BaseMutex,
public PDFDetectorBase
@@ -51,6 +51,15 @@ public:
virtual OUString SAL_CALL detect( css::uno::Sequence<
css::beans::PropertyValue >& io_rDescriptor )
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
};
diff --git a/sdext/source/pdfimport/pdfiadaptor.cxx b/sdext/source/pdfimport/pdfiadaptor.cxx
index 6162d27b049d..d9832bd76c48 100644
--- a/sdext/source/pdfimport/pdfiadaptor.cxx
+++ b/sdext/source/pdfimport/pdfiadaptor.cxx
@@ -32,6 +32,7 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/io/XInputStream.hpp>
@@ -200,10 +201,27 @@ void SAL_CALL PDFIHybridAdaptor::setTargetDocument( const uno::Reference< lang::
throw lang::IllegalArgumentException();
}
+OUString PDFIHybridAdaptor::getImplementationName()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return OUString("org.libreoffice.comp.documents.HybridPDFImport");
+}
+
+sal_Bool PDFIHybridAdaptor::supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return cppu::supportsService(this, ServiceName);
+}
+css::uno::Sequence<OUString> PDFIHybridAdaptor::getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return css::uno::Sequence<OUString>{"com.sun.star.document.ImportFilter"};
+}
-PDFIRawAdaptor::PDFIRawAdaptor( const uno::Reference< uno::XComponentContext >& xContext ) :
+PDFIRawAdaptor::PDFIRawAdaptor( OUString const & implementationName, const uno::Reference< uno::XComponentContext >& xContext ) :
PDFIAdaptorBase( m_aMutex ),
+ m_implementationName(implementationName),
m_xContext( xContext ),
m_xModel(),
m_pVisitorFactory(),
@@ -316,6 +334,24 @@ void SAL_CALL PDFIRawAdaptor::setTargetDocument( const uno::Reference< lang::XCo
throw lang::IllegalArgumentException();
}
+OUString PDFIRawAdaptor::getImplementationName()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return m_implementationName;
+}
+
+sal_Bool PDFIRawAdaptor::supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return cppu::supportsService(this, ServiceName);
+}
+
+css::uno::Sequence<OUString> PDFIRawAdaptor::getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return css::uno::Sequence<OUString>{"com.sun.star.document.ImportFilter"};
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/pdfimport/pdfiadaptor.hxx b/sdext/source/pdfimport/pdfiadaptor.hxx
index 0b7c749b08c5..ab25dc288cd4 100644
--- a/sdext/source/pdfimport/pdfiadaptor.hxx
+++ b/sdext/source/pdfimport/pdfiadaptor.hxx
@@ -23,6 +23,7 @@
#include "xmlemitter.hxx"
#include "treevisitorfactory.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/xml/XImportFilter.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -33,15 +34,16 @@
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/frame/XModel.hpp>
-#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
namespace pdfi
{
- typedef ::cppu::WeakComponentImplHelper2<
+ typedef ::cppu::WeakComponentImplHelper<
css::document::XFilter,
- css::document::XImporter > PDFIHybridAdaptorBase;
+ css::document::XImporter,
+ css::lang::XServiceInfo> PDFIHybridAdaptorBase;
class PDFIHybridAdaptor : private cppu::BaseMutex,
public PDFIHybridAdaptorBase
@@ -64,11 +66,20 @@ namespace pdfi
virtual void SAL_CALL setTargetDocument( const css::uno::Reference< css::lang::XComponent >& xDocument )
throw( css::lang::IllegalArgumentException, std::exception ) SAL_OVERRIDE;
+ OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
};
- typedef ::cppu::WeakComponentImplHelper2<
+ typedef ::cppu::WeakComponentImplHelper<
css::xml::XImportFilter,
- css::document::XImporter > PDFIAdaptorBase;
+ css::document::XImporter,
+ css::lang::XServiceInfo> PDFIAdaptorBase;
/** Adapts raw pdf import to XImportFilter interface
*/
@@ -76,6 +87,7 @@ namespace pdfi
public PDFIAdaptorBase
{
private:
+ OUString const m_implementationName;
css::uno::Reference<
css::uno::XComponentContext > m_xContext;
css::uno::Reference<
@@ -92,7 +104,8 @@ namespace pdfi
const OUString& rFilterOptions = OUString());
public:
- explicit PDFIRawAdaptor( const css::uno::Reference<
+ explicit PDFIRawAdaptor( OUString const & implementationName,
+ const css::uno::Reference<
css::uno::XComponentContext >& xContext );
/** Set factory object used to create the tree visitors
@@ -125,6 +138,15 @@ namespace pdfi
// XImporter
virtual void SAL_CALL setTargetDocument( const css::uno::Reference< css::lang::XComponent >& xDocument )
throw( css::lang::IllegalArgumentException, std::exception ) SAL_OVERRIDE;
+
+ OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
};
}
diff --git a/sdext/source/pdfimport/services.cxx b/sdext/source/pdfimport/services.cxx
index 156244fc5677..6e0d175d4b50 100644
--- a/sdext/source/pdfimport/services.cxx
+++ b/sdext/source/pdfimport/services.cxx
@@ -40,7 +40,7 @@ namespace
static Reference< XInterface > Create_PDFIRawAdaptor_Writer( const Reference< XComponentContext >& _rxContext )
{
- pdfi::PDFIRawAdaptor* pAdaptor = new pdfi::PDFIRawAdaptor( _rxContext );
+ pdfi::PDFIRawAdaptor* pAdaptor = new pdfi::PDFIRawAdaptor( "org.libreoffice.comp.documents.WriterPDFImport", _rxContext );
pAdaptor->setTreeVisitorFactory(pdfi::createWriterTreeVisitorFactory());
pAdaptor->enableToplevelText(); // TEMP! TEMP!
@@ -50,7 +50,7 @@ namespace
static Reference< XInterface > Create_PDFIRawAdaptor_Draw( const Reference< XComponentContext >& _rxContext )
{
- pdfi::PDFIRawAdaptor* pAdaptor = new pdfi::PDFIRawAdaptor( _rxContext );
+ pdfi::PDFIRawAdaptor* pAdaptor = new pdfi::PDFIRawAdaptor( "org.libreoffice.comp.documents.DrawPDFImport", _rxContext );
pAdaptor->setTreeVisitorFactory(pdfi::createDrawTreeVisitorFactory());
@@ -59,7 +59,7 @@ namespace
static Reference< XInterface > Create_PDFIRawAdaptor_Impress( const Reference< XComponentContext >& _rxContext )
{
- pdfi::PDFIRawAdaptor* pAdaptor = new pdfi::PDFIRawAdaptor( _rxContext );
+ pdfi::PDFIRawAdaptor* pAdaptor = new pdfi::PDFIRawAdaptor( "org.libreoffice.comp.documents.ImpressPDFImport", _rxContext );
pAdaptor->setTreeVisitorFactory(pdfi::createImpressTreeVisitorFactory());
diff --git a/sdext/source/pdfimport/test/pdf2xml.cxx b/sdext/source/pdfimport/test/pdf2xml.cxx
index 974822de0953..518b0ef2c938 100644
--- a/sdext/source/pdfimport/test/pdf2xml.cxx
+++ b/sdext/source/pdfimport/test/pdf2xml.cxx
@@ -72,7 +72,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
test::BootstrapFixtureBase aEnv;
aEnv.setUp();
- pdfi::PDFIRawAdaptor aAdaptor( aEnv.getComponentContext() );
+ pdfi::PDFIRawAdaptor aAdaptor( OUString(), aEnv.getComponentContext() );
aAdaptor.setTreeVisitorFactory(pTreeFactory);
aAdaptor.odfConvert( aSrcURL, new OutputWrap(aDstURL), NULL );
}
diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx
index 8388377f8e7f..e1e399b0202d 100644
--- a/sdext/source/pdfimport/test/tests.cxx
+++ b/sdext/source/pdfimport/test/tests.cxx
@@ -473,7 +473,7 @@ namespace
void testOdfDrawExport()
{
- pdfi::PDFIRawAdaptor aAdaptor( getComponentContext() );
+ pdfi::PDFIRawAdaptor aAdaptor( OUString(), getComponentContext() );
aAdaptor.setTreeVisitorFactory( createDrawTreeVisitorFactory() );
OUString tempFileURL;
@@ -488,7 +488,7 @@ namespace
void testOdfWriterExport()
{
- pdfi::PDFIRawAdaptor aAdaptor( getComponentContext() );
+ pdfi::PDFIRawAdaptor aAdaptor( OUString(), getComponentContext() );
aAdaptor.setTreeVisitorFactory( createWriterTreeVisitorFactory() );
OUString tempFileURL;