Kaydet (Commit) 51a2b574 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, API CHANGE: update ScannerManager service

API CHANGE: The ScannerManager service now returns XScannerManager2

Don't know why this wasn't done already, the service already implements it.

Change-Id: I22355749bc859420174a132f3a21cc7a4984bf5f
üst 3475d91b
...@@ -21,20 +21,16 @@ ...@@ -21,20 +21,16 @@
#ifndef __com_sun_star_scanner_ScannerManager_idl__ #ifndef __com_sun_star_scanner_ScannerManager_idl__
#define __com_sun_star_scanner_ScannerManager_idl__ #define __com_sun_star_scanner_ScannerManager_idl__
#include <com/sun/star/scanner/XScannerManager.idl> #include <com/sun/star/scanner/XScannerManager2.idl>
module com { module sun { module star { module scanner { module com { module sun { module star { module scanner {
// DOCUMENTATION CHANGED FOR ScannerManager
/** ScannerManager provides a simple method to access scanner devices /** ScannerManager provides a simple method to access scanner devices
(or other image producing devices) (or other image producing devices)
Note that implementations should actually implement
<type>XScannerManager2</type>.
*/ */
published service ScannerManager : XScannerManager; published service ScannerManager : XScannerManager2;
}; }; }; }; }; }; }; };
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#ifndef __com_sun_star_scanner_XScannerManager2_idl__ #ifndef __com_sun_star_scanner_XScannerManager2_idl__
#define __com_sun_star_scanner_XScannerManager2_idl__ #define __com_sun_star_scanner_XScannerManager2_idl__
#include <com/sun/star/scanner/ScannerManager.idl> #include <com/sun/star/scanner/XScannerManager.idl>
module com { module sun { module star { module scanner { module com { module sun { module star { module scanner {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "DrawViewShell.hxx" #include "DrawViewShell.hxx"
#include <com/sun/star/scanner/ScannerManager.hpp>
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase1.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#ifndef _SVX_SIZEITEM #ifndef _SVX_SIZEITEM
...@@ -81,7 +82,7 @@ sal_Bool DrawViewShell::mbPipette = sal_False; ...@@ -81,7 +82,7 @@ sal_Bool DrawViewShell::mbPipette = sal_False;
// - ScannerEventListener - // - ScannerEventListener -
// ------------------------ // ------------------------
class ScannerEventListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener > class ScannerEventListener : public ::cppu::WeakImplHelper1< lang::XEventListener >
{ {
private: private:
...@@ -93,7 +94,7 @@ public: ...@@ -93,7 +94,7 @@ public:
~ScannerEventListener(); ~ScannerEventListener();
// XEventListener // XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rEventObject ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL disposing( const lang::EventObject& rEventObject ) throw (uno::RuntimeException);
void ParentDestroyed() { mpParent = NULL; } void ParentDestroyed() { mpParent = NULL; }
}; };
...@@ -106,7 +107,7 @@ ScannerEventListener::~ScannerEventListener() ...@@ -106,7 +107,7 @@ ScannerEventListener::~ScannerEventListener()
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void SAL_CALL ScannerEventListener::disposing( const ::com::sun::star::lang::EventObject& rEventObject ) throw (::com::sun::star::uno::RuntimeException) void SAL_CALL ScannerEventListener::disposing( const lang::EventObject& rEventObject ) throw (uno::RuntimeException)
{ {
if( mpParent ) if( mpParent )
mpParent->ScannerEvent( rEventObject ); mpParent->ScannerEvent( rEventObject );
...@@ -356,21 +357,13 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) ...@@ -356,21 +357,13 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
mnLockCount = 0UL; mnLockCount = 0UL;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
if( xMgr.is() ) mxScannerManager = scanner::ScannerManager::create( xContext );
{
mxScannerManager = ::com::sun::star::uno::Reference< ::com::sun::star::scanner::XScannerManager2 >(
xMgr->createInstance( "com.sun.star.scanner.ScannerManager" ),
::com::sun::star::uno::UNO_QUERY );
if( mxScannerManager.is() ) mxScannerListener = uno::Reference< lang::XEventListener >(
{ static_cast< ::cppu::OWeakObject* >( new ScannerEventListener( this ) ),
mxScannerListener = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >( uno::UNO_QUERY );
static_cast< ::cppu::OWeakObject* >( new ScannerEventListener( this ) ),
::com::sun::star::uno::UNO_QUERY );
}
}
mpAnnotationManager.reset( new AnnotationManager( GetViewShellBase() ) ); mpAnnotationManager.reset( new AnnotationManager( GetViewShellBase() ) );
mpViewOverlayManager.reset( new ViewOverlayManager( GetViewShellBase() ) ); mpViewOverlayManager.reset( new ViewOverlayManager( GetViewShellBase() ) );
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include <svx/extrusioncolorcontrol.hxx> #include <svx/extrusioncolorcontrol.hxx>
#include <svx/fontworkgallery.hxx> #include <svx/fontworkgallery.hxx>
#include <svx/modctrl.hxx> #include <svx/modctrl.hxx>
#include <com/sun/star/scanner/XScannerManager2.hpp> #include <com/sun/star/scanner/ScannerManager.hpp>
#include <com/sun/star/container/XSet.hpp> #include <com/sun/star/container/XSet.hpp>
#include <com/sun/star/linguistic2/LanguageGuessing.hpp> #include <com/sun/star/linguistic2/LanguageGuessing.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
...@@ -209,17 +209,7 @@ SwModule::GetScannerManager() ...@@ -209,17 +209,7 @@ SwModule::GetScannerManager()
{ {
if (!m_xScannerManager.is()) if (!m_xScannerManager.is())
{ {
uno::Reference< lang::XMultiServiceFactory > xMgr ( m_xScannerManager = scanner::ScannerManager::create( comphelper::getProcessComponentContext() );
comphelper::getProcessServiceFactory() );
if( xMgr.is() )
{
m_xScannerManager =
uno::Reference< scanner::XScannerManager2 >(
xMgr->createInstance(
rtl::OUString(
"com.sun.star.scanner.ScannerManager") ),
uno::UNO_QUERY );
}
} }
return m_xScannerManager; return m_xScannerManager;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment