diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-17 12:25:11 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-17 12:25:11 +0100 |
commit | 3099c70b11c7e5b80fe4dbe3dc99171fb38c6fc2 (patch) | |
tree | 63699b525800b2c6708e90b817853bb60be5f6d8 /extensions | |
parent | 5229726b4d4e7d76f410d221f8f8cd8abcfd5a19 (diff) |
Fix various XServiceInfo implementations
...to match what is recorded in the .component files
Change-Id: Ie548cd37872d3b8540222201afaac73040e65c8f
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/scanner/scanner.cxx | 35 | ||||
-rw-r--r-- | extensions/source/scanner/scanner.hxx | 21 |
2 files changed, 26 insertions, 30 deletions
diff --git a/extensions/source/scanner/scanner.cxx b/extensions/source/scanner/scanner.cxx index c6537db18968..1e99fd651b07 100644 --- a/extensions/source/scanner/scanner.cxx +++ b/extensions/source/scanner/scanner.cxx @@ -19,7 +19,7 @@ #include <scanner.hxx> -#include <cppuhelper/queryinterface.hxx> +#include <cppuhelper/supportsservice.hxx> // - ScannerManager - @@ -44,40 +44,29 @@ ScannerManager::~ScannerManager() ReleaseData(); } - - -Any SAL_CALL ScannerManager::queryInterface( const Type& rType ) throw( RuntimeException, std::exception ) +Sequence< sal_Int8 > SAL_CALL ScannerManager::getMaskDIB() throw(std::exception) { - const Any aRet( cppu::queryInterface( rType, - static_cast< XScannerManager2* >( this ), - static_cast< css::awt::XBitmap* >( this ) ) ); - - return( aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ) ); + return Sequence< sal_Int8 >(); } - - -void SAL_CALL ScannerManager::acquire() throw() +OUString ScannerManager::getImplementationName() + throw (css::uno::RuntimeException, std::exception) { - OWeakObject::acquire(); + return getImplementationName_Static(); } - - -void SAL_CALL ScannerManager::release() throw() +sal_Bool ScannerManager::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException, std::exception) { - OWeakObject::release(); + return cppu::supportsService(this, ServiceName); } - - -Sequence< sal_Int8 > SAL_CALL ScannerManager::getMaskDIB() throw(std::exception) +css::uno::Sequence<OUString> ScannerManager::getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) { - return Sequence< sal_Int8 >(); + return getSupportedServiceNames_Static(); } - - OUString ScannerManager::getImplementationName_Static() throw() { return OUString( "com.sun.star.scanner.ScannerManager" ); diff --git a/extensions/source/scanner/scanner.hxx b/extensions/source/scanner/scanner.hxx index 19e7761bdf61..4b4a18e64318 100644 --- a/extensions/source/scanner/scanner.hxx +++ b/extensions/source/scanner/scanner.hxx @@ -23,12 +23,13 @@ #include <tools/stream.hxx> #include <osl/mutex.hxx> #include <rtl/ustring.hxx> -#include <cppuhelper/weak.hxx> +#include <cppuhelper/implbase.hxx> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Sequence.h> #include <com/sun/star/awt/XBitmap.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XEventListener.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/EventObject.hpp> #include <com/sun/star/scanner/XScannerManager2.hpp> #include <com/sun/star/scanner/ScannerException.hpp> @@ -37,7 +38,9 @@ using namespace cppu; using namespace com::sun::star::uno; using namespace com::sun::star::scanner; -class ScannerManager : public OWeakObject, XScannerManager2, css::awt::XBitmap +class ScannerManager: + public cppu::WeakImplHelper< + XScannerManager2, css::awt::XBitmap, css::lang::XServiceInfo> { protected: @@ -52,11 +55,6 @@ public: ScannerManager(); virtual ~ScannerManager(); - // XInterface - virtual Any SAL_CALL queryInterface( const Type & rType ) throw( RuntimeException, std::exception ) SAL_OVERRIDE; - virtual void SAL_CALL acquire() throw() SAL_OVERRIDE; - virtual void SAL_CALL release() throw() SAL_OVERRIDE; - // XScannerManager virtual Sequence< ScannerContext > SAL_CALL getAvailableScanners() throw(std::exception) SAL_OVERRIDE; virtual sal_Bool SAL_CALL configureScanner( ScannerContext& scanner_context ) throw( ScannerException, std::exception ) SAL_OVERRIDE; @@ -70,6 +68,15 @@ public: virtual Sequence< sal_Int8 > SAL_CALL getDIB() throw(std::exception) SAL_OVERRIDE; virtual Sequence< sal_Int8 > SAL_CALL getMaskDIB() throw(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; + // Misc static OUString getImplementationName_Static() throw(); static Sequence< OUString > getSupportedServiceNames_Static() throw(); |