diff options
22 files changed, 155 insertions, 48 deletions
diff --git a/extensions/inc/pch/precompiled_extensions.hxx b/extensions/inc/pch/precompiled_extensions.hxx index 4582abbdb282..7b266a1a7e6e 100644 --- a/extensions/inc/pch/precompiled_extensions.hxx +++ b/extensions/inc/pch/precompiled_extensions.hxx @@ -271,7 +271,7 @@ #include "com/sun/star/registry/XSimpleRegistry.hpp" #include "com/sun/star/resource/XResourceBundleLoader.hpp" #include "com/sun/star/scanner/ScannerException.hpp" -#include "com/sun/star/scanner/XScannerManager.hpp" +#include "com/sun/star/scanner/XScannerManager2.hpp" #include "com/sun/star/script/ContextInformation.hpp" #include "com/sun/star/script/FailReason.hpp" #include "com/sun/star/script/FinishEngineEvent.hpp" diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 39b88620d5d9..c83406fec628 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -48,16 +48,18 @@ ResId SaneResId( sal_uInt32 nID ) return ResId( nID, *pResMgr ); } -SaneDlg::SaneDlg( Window* pParent, Sane& rSane ) : +SaneDlg::SaneDlg( Window* pParent, Sane& rSane, bool bScanEnabled ) : ModalDialog( pParent, SaneResId( RID_SANE_DIALOG ) ), mrSane( rSane ), mbIsDragging( sal_False ), + mbScanEnabled( bScanEnabled ), mbDragDrawn( sal_False ), maMapMode( MAP_APPFONT ), maOKButton( this, SaneResId( RID_SCAN_OK ) ), maCancelButton( this, SaneResId( RID_SCAN_CANCEL ) ), maDeviceInfoButton( this, SaneResId( RID_DEVICEINFO_BTN ) ), maPreviewButton( this, SaneResId( RID_PREVIEW_BTN ) ), + maScanButton( this, SaneResId( RID_SCAN_BTN ) ), maButtonOption( this, SaneResId( RID_SCAN_BUTTON_OPTION_BTN ) ), maOptionsTxt( this, SaneResId( RID_SCAN_OPTION_TXT ) ), maOptionTitle( this, SaneResId( RID_SCAN_OPTIONTITLE_TXT ) ), @@ -86,7 +88,8 @@ SaneDlg::SaneDlg( Window* pParent, Sane& rSane ) : maStringEdit( this, SaneResId( RID_SCAN_STRING_OPTION_EDT ) ), maNumericEdit( this, SaneResId( RID_SCAN_NUMERIC_OPTION_EDT ) ), maOptionBox( this, SaneResId( RID_SCAN_OPTION_BOX ) ), - mpRange( 0 ) + mpRange( 0 ), + doScan( false ) { if( Sane::IsSane() ) { @@ -97,6 +100,7 @@ SaneDlg::SaneDlg( Window* pParent, Sane& rSane ) : maDeviceInfoButton.SetClickHdl( LINK( this, SaneDlg, ClickBtnHdl ) ); maPreviewButton.SetClickHdl( LINK( this, SaneDlg, ClickBtnHdl ) ); + maScanButton.SetClickHdl( LINK( this, SaneDlg, ClickBtnHdl ) ); maButtonOption.SetClickHdl( LINK( this, SaneDlg, ClickBtnHdl ) ); maDeviceBox.SetSelectHdl( LINK( this, SaneDlg, SelectHdl ) ); maOptionBox.SetSelectHdl( LINK( this, SaneDlg, OptionsBoxSelectHdl ) ); @@ -189,6 +193,7 @@ void SaneDlg::InitFields() maReslBox.Clear(); maMinTopLeft = Point( 0, 0 ); maMaxBottomRight = Point( PREVIEW_WIDTH, PREVIEW_HEIGHT ); + maScanButton.Show( mbScanEnabled ); if( ! mrSane.IsOpen() ) return; @@ -476,13 +481,14 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton ) ReloadSaneOptionsHdl( NULL ); } } - if( pButton == &maOKButton ) + if( pButton == &maOKButton || pButton == &maScanButton ) { double fRes = (double)maReslBox.GetValue(); SetAdjustedNumericalValue( "resolution", fRes ); UpdateScanArea( sal_True ); SaveState(); EndDialog( mrSane.IsOpen() ? 1 : 0 ); + doScan = (pButton == &maScanButton); } else if( pButton == &maCancelButton ) { @@ -1376,4 +1382,9 @@ sal_Bool SaneDlg::SetAdjustedNumericalValue( return sal_True; } +bool SaneDlg::getDoScan() +{ + return doScan; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/scanner/sanedlg.hrc b/extensions/source/scanner/sanedlg.hrc index ca893122c9a9..2c20ad1c6fd3 100644 --- a/extensions/source/scanner/sanedlg.hrc +++ b/extensions/source/scanner/sanedlg.hrc @@ -62,6 +62,7 @@ #define RID_SCAN_BITMAP_MINUS 32 #define RID_SCAN_ADVANCED_BOX 33 #define RID_SCAN_ADVANCED_TXT 34 +#define RID_SCAN_BTN 35 #define RID_SANE_DEVICEINFO_TXT 1001 #define RID_SANE_SCANERROR_TXT 1002 diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx index c3f72eafaebe..b7fe581293e0 100644 --- a/extensions/source/scanner/sanedlg.hxx +++ b/extensions/source/scanner/sanedlg.hxx @@ -53,6 +53,7 @@ private: Point maMinTopLeft, maMaxBottomRight; sal_Bool mbDragEnable; sal_Bool mbIsDragging; + bool mbScanEnabled; int mnDragMode; sal_Bool mbDragDrawn; DragDirection meDragDirection; @@ -65,6 +66,7 @@ private: CancelButton maCancelButton; PushButton maDeviceInfoButton; PushButton maPreviewButton; + PushButton maScanButton; PushButton maButtonOption; FixedText maOptionsTxt; @@ -107,6 +109,8 @@ private: double* mpRange; double mfMin, mfMax; + bool doScan; + DECL_LINK( ClickBtnHdl, Button* ); DECL_LINK( SelectHdl, ListBox* ); DECL_LINK( ModifyHdl, Edit* ); @@ -141,10 +145,11 @@ private: virtual void MouseButtonDown( const MouseEvent& rMEvt ); virtual void MouseButtonUp( const MouseEvent& rMEvt ); public: - SaneDlg( Window*, Sane& ); + SaneDlg( Window*, Sane&, bool ); ~SaneDlg(); virtual short Execute(); + bool getDoScan(); }; diff --git a/extensions/source/scanner/sanedlg.src b/extensions/source/scanner/sanedlg.src index 961f0ed39cf1..fc17d3e219f4 100644 --- a/extensions/source/scanner/sanedlg.src +++ b/extensions/source/scanner/sanedlg.src @@ -59,6 +59,13 @@ ModalDialog RID_SANE_DIALOG Size = MAP_APPFONT ( 55 , 22 ) ; Text [ en-US ] = "Create\nPreview" ; }; + PushButton RID_SCAN_BTN + { + HelpID = "extensions:PushButton:RID_SANE_DIALOG:RID_SCAN_BTN"; + Pos = MAP_APPFONT ( THIRD_COLUMN , 98 ) ; + Size = MAP_APPFONT ( 55 , 14 ) ; + Text [ en-US ] = "Scan" ; + }; FixedLine RID_PREVIEW_BOX { Pos = MAP_APPFONT ( PREVIEW_UPPER_LEFT - 5 , PREVIEW_UPPER_TOP - 8 ) ; diff --git a/extensions/source/scanner/scanner.cxx b/extensions/source/scanner/scanner.cxx index e833c4f1d56d..ea5e49e132f9 100644 --- a/extensions/source/scanner/scanner.cxx +++ b/extensions/source/scanner/scanner.cxx @@ -59,7 +59,7 @@ ScannerManager::~ScannerManager() ANY SAL_CALL ScannerManager::queryInterface( const Type& rType ) throw( RuntimeException ) { const ANY aRet( cppu::queryInterface( rType, - static_cast< XScannerManager* >( this ), + static_cast< XScannerManager2* >( this ), static_cast< AWT::XBitmap* >( this ) ) ); return( aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ) ); @@ -104,4 +104,10 @@ SEQ( OUString ) ScannerManager::getSupportedServiceNames_Static() throw () return aSNS; } +sal_Bool SAL_CALL ScannerManager::configureScanner( ScannerContext& rContext ) + throw( ScannerException ) +{ + return configureScannerAndScan( rContext, NULL ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/scanner/scanner.hxx b/extensions/source/scanner/scanner.hxx index abe2ae3694c8..f1b5ab509332 100644 --- a/extensions/source/scanner/scanner.hxx +++ b/extensions/source/scanner/scanner.hxx @@ -39,7 +39,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/lang/EventObject.hpp> -#include <com/sun/star/scanner/XScannerManager.hpp> +#include <com/sun/star/scanner/XScannerManager2.hpp> #include <com/sun/star/scanner/ScannerException.hpp> using namespace cppu; @@ -61,7 +61,7 @@ using ::rtl::OUString; // - ScannerManager - // ------------------ -class ScannerManager : public OWeakObject, XScannerManager, AWT::XBitmap +class ScannerManager : public OWeakObject, XScannerManager2, AWT::XBitmap { protected: @@ -83,7 +83,8 @@ public: // XScannerManager virtual SEQ( ScannerContext ) SAL_CALL getAvailableScanners() throw(); - virtual sal_Bool SAL_CALL configureScanner( ScannerContext& scanner_context ) throw( ScannerException ); + virtual sal_Bool SAL_CALL configureScanner( ScannerContext& scanner_context ) throw( ScannerException ); + virtual sal_Bool SAL_CALL configureScannerAndScan( ScannerContext& scanner_context, const REF( com::sun::star::lang::XEventListener )& rxListener ) throw( ScannerException ); virtual void SAL_CALL startScan( const ScannerContext& scanner_context, const REF( com::sun::star::lang::XEventListener )& rxListener ) throw( ScannerException ); virtual ScanError SAL_CALL getError( const ScannerContext& scanner_context ) throw( ScannerException ); virtual REF( AWT::XBitmap ) SAL_CALL getBitmap( const ScannerContext& scanner_context ) throw( ScannerException ); diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index 1f481f668a7e..286f40bb1e28 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -278,34 +278,42 @@ SEQ( ScannerContext ) ScannerManager::getAvailableScanners() throw() // ----------------------------------------------------------------------------- -sal_Bool ScannerManager::configureScanner( ScannerContext& scanner_context ) throw( ScannerException ) +sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_context, + const REF( com::sun::star::lang::XEventListener )& listener ) throw( ScannerException ) { - osl::MutexGuard aGuard( theSaneProtector::get() ); - sanevec &rSanes = theSanes::get().m_aSanes; + bool bRet; + bool bScan; + { + osl::MutexGuard aGuard( theSaneProtector::get() ); + sanevec &rSanes = theSanes::get().m_aSanes; #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "ScannerManager::configureScanner\n" ); + fprintf( stderr, "ScannerManager::configureScanner\n" ); #endif - if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) - throw ScannerException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner does not exist")), - REF( XScannerManager )( this ), - ScanError_InvalidContext + if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) + throw ScannerException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner does not exist")), + REF( XScannerManager )( this ), + ScanError_InvalidContext ); - boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData]; - if( pHolder->m_bBusy ) - throw ScannerException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner is busy")), - REF( XScannerManager )( this ), - ScanError_ScanInProgress + boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData]; + if( pHolder->m_bBusy ) + throw ScannerException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner is busy")), + REF( XScannerManager )( this ), + ScanError_ScanInProgress ); - pHolder->m_bBusy = true; - SaneDlg aDlg( NULL, pHolder->m_aSane ); - sal_Bool bRet = (sal_Bool)aDlg.Execute(); - pHolder->m_bBusy = false; + pHolder->m_bBusy = true; + SaneDlg aDlg( NULL, pHolder->m_aSane, listener.is() ); + bRet = aDlg.Execute(); + bScan = aDlg.getDoScan(); + pHolder->m_bBusy = false; + } + if ( bScan ) + startScan( scanner_context, listener ); return bRet; } diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx index 5f6d47e44e48..7a7c86bf8676 100644 --- a/extensions/source/scanner/scanwin.cxx +++ b/extensions/source/scanner/scanwin.cxx @@ -1004,7 +1004,7 @@ SEQ( ScannerContext ) SAL_CALL ScannerManager::getAvailableScanners() throw() // ----------------------------------------------------------------------------- -sal_Bool SAL_CALL ScannerManager::configureScanner( ScannerContext& rContext ) +sal_Bool SAL_CALL ScannerManager::configureScannerAndScan( ScannerContext& rContext, const uno::Reference< lang::XEventListener >& ) throw( ScannerException ) { osl::MutexGuard aGuard( maProtector ); diff --git a/extensions/source/scanner/scn.component b/extensions/source/scanner/scn.component index d7daf3ae36d4..076b745bd56e 100644 --- a/extensions/source/scanner/scn.component +++ b/extensions/source/scanner/scn.component @@ -28,7 +28,7 @@ <component loader="com.sun.star.loader.SharedLibrary" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.scanner.ScannerManager"> + <implementation name="com.sun.star.scanner.ScannerManager"> <service name="com.sun.star.scanner.ScannerManager"/> </implementation> </component> diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 69c0926a3f2d..8ae72cb5579b 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -2958,6 +2958,7 @@ $(eval $(call gb_UnoApiTarget_add_idlfiles,offapi,offapi/com/sun/star/scanner,\ ScannerContext \ ScannerException \ XScannerManager \ + XScannerManager2 \ )) $(eval $(call gb_UnoApiTarget_add_idlfiles,offapi,offapi/com/sun/star/script,\ LibraryNotLoadedException \ diff --git a/offapi/com/sun/star/scanner/ScannerManager.idl b/offapi/com/sun/star/scanner/ScannerManager.idl index ad06759c89a0..c2b1b7e01d15 100644 --- a/offapi/com/sun/star/scanner/ScannerManager.idl +++ b/offapi/com/sun/star/scanner/ScannerManager.idl @@ -40,6 +40,9 @@ module com { module sun { module star { module scanner { // DOCUMENTATION CHANGED FOR ScannerManager /** ScannerManager provides a simple method to access scanner devices (or other image producing devices) + + Note that implementations should actually implement + <type>XScannerManager2</type>. */ published service ScannerManager { diff --git a/offapi/com/sun/star/scanner/XScannerManager2.idl b/offapi/com/sun/star/scanner/XScannerManager2.idl new file mode 100644 index 000000000000..df21f95af0ed --- /dev/null +++ b/offapi/com/sun/star/scanner/XScannerManager2.idl @@ -0,0 +1,62 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * [ Copyright (C) 2011 Rob Snelders <programming@ertai.nl> (initial + * developer) ] + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef __com_sun_star_scanner_XScannerManager2_idl__ +#define __com_sun_star_scanner_XScannerManager2_idl__ + +#include <com/sun/star/scanner/ScannerManager.idl> + +//============================================================================= + +module com { module sun { module star { module scanner { + +//============================================================================= + +/** + Extension of <type>XScannerManager</type>. + + @since LibreOffice 3.5 +*/ +published interface XScannerManager2: com::sun::star::scanner::XScannerManager +{ + //------------------------------------------------------------------------- + /** produce some kind of User Interface to let the user have a preview, + configure the scan area, etc., it, and scan it + returns FALSE if user cancelled this process + */ + boolean configureScannerAndScan( [inout] com::sun::star::scanner::ScannerContext scanner_context, + [in] com::sun::star::lang::XEventListener listener ) + raises( com::sun::star::scanner::ScannerException ); + +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index 51524bf49a73..6a501d86d677 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -293,7 +293,7 @@ #include "com/sun/star/presentation/XPresentationSupplier.hpp" #include "com/sun/star/registry/XRegistryKey.hpp" #include "com/sun/star/rendering/XSpriteCanvas.hpp" -#include "com/sun/star/scanner/XScannerManager.hpp" +#include "com/sun/star/scanner/XScannerManager2.hpp" #include "com/sun/star/sdbc/XResultSet.hpp" #include "com/sun/star/sdbc/XRow.hpp" #include "com/sun/star/style/LineSpacing.hpp" diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 5e7a345e9114..57b32386ada5 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -36,7 +36,7 @@ #include "TabControl.hxx" #include "pres.hxx" #include <com/sun/star/lang/XEventListener.hpp> -#include <com/sun/star/scanner/XScannerManager.hpp> +#include <com/sun/star/scanner/XScannerManager2.hpp> #include <unotools/caserotate.hxx> class SdPage; @@ -451,7 +451,7 @@ private: SdPage* pPage, const sal_Int32 nInsertPosition = -1); - ::com::sun::star::uno::Reference< ::com::sun::star::scanner::XScannerManager > mxScannerManager; + ::com::sun::star::uno::Reference< ::com::sun::star::scanner::XScannerManager2 > mxScannerManager; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > mxScannerListener; TransferableClipboardListener* mpClipEvtLstnr; sal_Bool mbPastePossible; diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index b12c10e276e7..726e9be7746d 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -360,7 +360,7 @@ void DrawViewShell::FuTemp01(SfxRequest& rReq) if( aContexts.getLength() ) { ::com::sun::star::scanner::ScannerContext aContext( aContexts.getConstArray()[ 0 ] ); - mxScannerManager->configureScanner( aContext ); + mxScannerManager->configureScannerAndScan( aContext, mxScannerListener ); } } catch(...) diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 5f7c07ef70a1..43ab2dad852d 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -393,7 +393,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) if( xMgr.is() ) { - mxScannerManager = ::com::sun::star::uno::Reference< ::com::sun::star::scanner::XScannerManager >( + mxScannerManager = ::com::sun::star::uno::Reference< ::com::sun::star::scanner::XScannerManager2 >( xMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.scanner.ScannerManager" )) ), ::com::sun::star::uno::UNO_QUERY ); diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index bc40045e9695..b154f630f1b4 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -271,7 +271,7 @@ #include "com/sun/star/packages/WrongPasswordException.hpp" #include "com/sun/star/packages/zip/ZipIOException.hpp" #include "com/sun/star/scanner/ScannerContext.hpp" -#include "com/sun/star/scanner/XScannerManager.hpp" +#include "com/sun/star/scanner/XScannerManager2.hpp" #include "com/sun/star/script/XEventAttacher.hpp" #include "com/sun/star/script/XEventAttacherManager.hpp" #include "com/sun/star/script/XLibraryContainer.hpp" diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index dd2b27c72341..763923725958 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -72,7 +72,7 @@ struct SwDBData; #define VIEWOPT_DEST_VIEW_ONLY 3 //ViewOptions are set only at ::com::sun::star::sdbcx::View, not at the appl. namespace com{ namespace sun{ namespace star{ namespace scanner{ - class XScannerManager; + class XScannerManager2; }}}} class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::ConfigurationListener @@ -113,7 +113,7 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguServiceEventListener > xLngSvcEvtListener; ::com::sun::star::uno::Reference< - ::com::sun::star::scanner::XScannerManager > m_xScannerManager; + ::com::sun::star::scanner::XScannerManager2 > m_xScannerManager; ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > m_xLanguageGuesser; @@ -242,7 +242,7 @@ public: void CreateLngSvcEvtListener(); ::com::sun::star::uno::Reference< - ::com::sun::star::scanner::XScannerManager > + ::com::sun::star::scanner::XScannerManager2 > GetScannerManager(); ::com::sun::star::uno::Reference< diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index 0e50081d9faf..4a663622a10b 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -65,7 +65,7 @@ #include <svx/extrusioncolorcontrol.hxx> #include <svx/fontworkgallery.hxx> #include <svx/modctrl.hxx> -#include <com/sun/star/scanner/XScannerManager.hpp> +#include <com/sun/star/scanner/XScannerManager2.hpp> #include <com/sun/star/container/XSet.hpp> #include <comphelper/processfactory.hxx> #include <docsh.hxx> @@ -215,7 +215,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, // at the view options. GetColorConfig(); } -uno::Reference< scanner::XScannerManager > +uno::Reference< scanner::XScannerManager2 > SwModule::GetScannerManager() { if (!m_xScannerManager.is()) @@ -225,7 +225,7 @@ SwModule::GetScannerManager() if( xMgr.is() ) { m_xScannerManager = - uno::Reference< scanner::XScannerManager >( + uno::Reference< scanner::XScannerManager2 >( xMgr->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.scanner.ScannerManager")) ), diff --git a/sw/source/ui/uiview/uivwimp.cxx b/sw/source/ui/uiview/uivwimp.cxx index aff53fe8f20a..b2faff69d654 100644 --- a/sw/source/ui/uiview/uivwimp.cxx +++ b/sw/source/ui/uiview/uivwimp.cxx @@ -33,7 +33,7 @@ #include "globals.hrc" #include <tools/shl.hxx> -#include <com/sun/star/scanner/XScannerManager.hpp> +#include <com/sun/star/scanner/XScannerManager2.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -131,19 +131,21 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq ) case SID_TWAIN_SELECT: { sal_Bool bDone = sal_False; - Reference< XScannerManager > xScanMgr = SW_MOD()->GetScannerManager(); + Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager(); if( xScanMgr.is() ) { try { + SwScannerEventListener& rListener = GetScannerEventListener(); const Sequence< ScannerContext > aContexts( xScanMgr->getAvailableScanners() ); if( aContexts.getLength() ) { + Reference< XEventListener > xLstner = &rListener; ScannerContext aContext( aContexts.getConstArray()[ 0 ] ); - bDone = xScanMgr->configureScanner( aContext ); + bDone = xScanMgr->configureScannerAndScan( aContext, xLstner ); } } catch(...) @@ -164,7 +166,7 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq ) { sal_Bool bDone = sal_False; - Reference< XScannerManager > xScanMgr = SW_MOD()->GetScannerManager(); + Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager(); if( xScanMgr.is() ) { SwScannerEventListener& rListener = GetScannerEventListener(); diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 9ddbc8c9f2a5..d9cbad6720e8 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -98,7 +98,7 @@ #include <editeng/unolingu.hxx> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/scanner/ScannerContext.hpp> -#include <com/sun/star/scanner/XScannerManager.hpp> +#include <com/sun/star/scanner/XScannerManager2.hpp> #include <toolkit/unohlp.hxx> #include <rtl/ustrbuf.hxx> #include <sax/tools/converter.hxx> @@ -1682,7 +1682,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) void SwView::ScannerEventHdl( const EventObject& /*rEventObject*/ ) { - uno::Reference< XScannerManager > xScanMgr = SW_MOD()->GetScannerManager(); + uno::Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager(); if( xScanMgr.is() ) { const ScannerContext aContext( xScanMgr->getAvailableScanners().getConstArray()[ 0 ] ); |