summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-17 12:25:11 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-17 12:25:11 +0100
commit3099c70b11c7e5b80fe4dbe3dc99171fb38c6fc2 (patch)
tree63699b525800b2c6708e90b817853bb60be5f6d8 /sdext
parent5229726b4d4e7d76f410d221f8f8cd8abcfd5a19 (diff)
Fix various XServiceInfo implementations
...to match what is recorded in the .component files Change-Id: Ie548cd37872d3b8540222201afaac73040e65c8f
Diffstat (limited to 'sdext')
-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
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.cxx20
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.hxx15
9 files changed, 135 insertions, 19 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;
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx
index 50d69f4dca79..c18625492d74 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/presentation/XSlideShowView.hpp>
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -289,6 +290,25 @@ void SAL_CALL PresenterProtocolHandler::initialize (const Sequence<Any>& aArgume
}
}
+OUString PresenterProtocolHandler::getImplementationName()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return getImplementationName_static();
+}
+
+sal_Bool PresenterProtocolHandler::supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return cppu::supportsService(this, ServiceName);
+}
+
+css::uno::Sequence<OUString>
+PresenterProtocolHandler::getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return getSupportedServiceNames_static();
+}
+
//----- XDispatchProvider -----------------------------------------------------
Reference<frame::XDispatch> SAL_CALL PresenterProtocolHandler::queryDispatch (
diff --git a/sdext/source/presenter/PresenterProtocolHandler.hxx b/sdext/source/presenter/PresenterProtocolHandler.hxx
index 287dcd06096f..ecae6661329c 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.hxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.hxx
@@ -20,19 +20,21 @@
#ifndef INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPROTOCOLHANDLER_HXX
#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPROTOCOLHANDLER_HXX
-#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <rtl/ref.hxx>
namespace sdext { namespace presenter {
namespace {
- typedef ::cppu::WeakComponentImplHelper2 <
+ typedef ::cppu::WeakComponentImplHelper <
css::lang::XInitialization,
+ css::lang::XServiceInfo,
css::frame::XDispatchProvider
> PresenterProtocolHandlerInterfaceBase;
}
@@ -60,6 +62,15 @@ public:
const css::uno::Sequence<css::uno::Any>& aArguments)
throw (css::uno::Exception, 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;
+
// XDispatchProvider
virtual css::uno::Reference<css::frame::XDispatch > SAL_CALL