diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-04-01 22:08:52 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-04-01 22:45:37 +0200 |
commit | 909fd7e71d0a075bf1318f5df062345f5c059c14 (patch) | |
tree | 11a11fe159b4805b7e53e0a23ed0d2a3b4679fd9 /extensions | |
parent | e09fbcb5647f18cf053052e49aa28d6f0003cd01 (diff) |
remove some more macros
Change-Id: Ia93a938309d25fb9932ed92ca2b2f93bf7991927
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/scanner/sane.hxx | 10 | ||||
-rw-r--r-- | extensions/source/scanner/scanner.cxx | 16 | ||||
-rw-r--r-- | extensions/source/scanner/scanner.hxx | 25 | ||||
-rw-r--r-- | extensions/source/scanner/scanunx.cxx | 62 | ||||
-rw-r--r-- | extensions/source/scanner/scanwin.cxx | 14 | ||||
-rw-r--r-- | extensions/source/scanner/scnserv.cxx | 4 |
6 files changed, 63 insertions, 68 deletions
diff --git a/extensions/source/scanner/sane.hxx b/extensions/source/scanner/sane.hxx index d1bf131948e1..914248433526 100644 --- a/extensions/source/scanner/sane.hxx +++ b/extensions/source/scanner/sane.hxx @@ -30,7 +30,7 @@ // - BitmapTransporter - // --------------------- -class BitmapTransporter : public OWeakObject, AWT::XBitmap +class BitmapTransporter : public OWeakObject, css::awt::XBitmap { SvMemoryStream m_aStream; osl::Mutex m_aProtector; @@ -42,13 +42,13 @@ public: // XInterface - virtual ANY SAL_CALL queryInterface( const Type & rType ) throw( RuntimeException ); + virtual Any SAL_CALL queryInterface( const Type & rType ) throw( RuntimeException ); virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } virtual void SAL_CALL release() throw() { OWeakObject::release(); } - virtual AWT::Size SAL_CALL getSize() throw(); - virtual SEQ( sal_Int8 ) SAL_CALL getDIB() throw(); - virtual SEQ( sal_Int8 ) SAL_CALL getMaskDIB() throw() { return SEQ( sal_Int8 )(); } + virtual css::awt::Size SAL_CALL getSize() throw(); + virtual Sequence< sal_Int8 > SAL_CALL getDIB() throw(); + virtual Sequence< sal_Int8 > SAL_CALL getMaskDIB() throw() { return Sequence< sal_Int8 >(); } // Misc void lock() { m_aProtector.acquire(); } diff --git a/extensions/source/scanner/scanner.cxx b/extensions/source/scanner/scanner.cxx index 11327284ef41..d415116dce17 100644 --- a/extensions/source/scanner/scanner.cxx +++ b/extensions/source/scanner/scanner.cxx @@ -23,7 +23,7 @@ // - ScannerManager - // ------------------ -REF( XInterface ) SAL_CALL ScannerManager_CreateInstance( const REF( com::sun::star::lang::XMultiServiceFactory )& /*rxFactory*/ ) throw ( Exception ) +Reference< XInterface > SAL_CALL ScannerManager_CreateInstance( const Reference< com::sun::star::lang::XMultiServiceFactory >& /*rxFactory*/ ) throw ( Exception ) { return *( new ScannerManager() ); } @@ -45,11 +45,11 @@ ScannerManager::~ScannerManager() // ----------------------------------------------------------------------------- -ANY SAL_CALL ScannerManager::queryInterface( const Type& rType ) throw( RuntimeException ) +Any SAL_CALL ScannerManager::queryInterface( const Type& rType ) throw( RuntimeException ) { - const ANY aRet( cppu::queryInterface( rType, + const Any aRet( cppu::queryInterface( rType, static_cast< XScannerManager2* >( this ), - static_cast< AWT::XBitmap* >( this ) ) ); + static_cast< css::awt::XBitmap* >( this ) ) ); return( aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ) ); } @@ -70,9 +70,9 @@ void SAL_CALL ScannerManager::release() throw() // ----------------------------------------------------------------------------- -SEQ( sal_Int8 ) SAL_CALL ScannerManager::getMaskDIB() throw() +Sequence< sal_Int8 > SAL_CALL ScannerManager::getMaskDIB() throw() { - return SEQ( sal_Int8 )(); + return Sequence< sal_Int8 >(); } // ----------------------------------------------------------------------------- @@ -84,9 +84,9 @@ OUString ScannerManager::getImplementationName_Static() throw() // ----------------------------------------------------------------------------- -SEQ( OUString ) ScannerManager::getSupportedServiceNames_Static() throw () +Sequence< OUString > ScannerManager::getSupportedServiceNames_Static() throw () { - SEQ( OUString ) aSNS( 1 ); + Sequence< OUString > aSNS( 1 ); aSNS.getArray()[0] = ::rtl::OUString( "com.sun.star.scanner.ScannerManager" ); diff --git a/extensions/source/scanner/scanner.hxx b/extensions/source/scanner/scanner.hxx index 2cf7664898cd..bfbbc99e2289 100644 --- a/extensions/source/scanner/scanner.hxx +++ b/extensions/source/scanner/scanner.hxx @@ -39,12 +39,7 @@ using namespace com::sun::star::scanner; using ::rtl::OUString; -#define REF( _def_Obj ) Reference< _def_Obj > -#define SEQ( _def_Obj ) Sequence< _def_Obj > -#define ANY Any -#define AWT com::sun::star::awt - -class ScannerManager : public OWeakObject, XScannerManager2, AWT::XBitmap +class ScannerManager : public OWeakObject, XScannerManager2, css::awt::XBitmap { protected: @@ -60,22 +55,22 @@ public: virtual ~ScannerManager(); // XInterface - virtual ANY SAL_CALL queryInterface( const Type & rType ) throw( RuntimeException ); + virtual Any SAL_CALL queryInterface( const Type & rType ) throw( RuntimeException ); virtual void SAL_CALL acquire() throw(); virtual void SAL_CALL release() throw(); // XScannerManager - virtual SEQ( ScannerContext ) SAL_CALL getAvailableScanners() throw(); + virtual Sequence< ScannerContext > SAL_CALL getAvailableScanners() throw(); 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 sal_Bool SAL_CALL configureScannerAndScan( ScannerContext& scanner_context, const Reference< com::sun::star::lang::XEventListener >& rxListener ) throw( ScannerException ); + virtual void SAL_CALL startScan( const ScannerContext& scanner_context, const Reference< 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 ); + virtual Reference< css::awt::XBitmap > SAL_CALL getBitmap( const ScannerContext& scanner_context ) throw( ScannerException ); // XBitmap - virtual AWT::Size SAL_CALL getSize() throw(); - virtual SEQ( sal_Int8 ) SAL_CALL getDIB() throw(); - virtual SEQ( sal_Int8 ) SAL_CALL getMaskDIB() throw(); + virtual css::awt::Size SAL_CALL getSize() throw(); + virtual Sequence< sal_Int8 > SAL_CALL getDIB() throw(); + virtual Sequence< sal_Int8 > SAL_CALL getMaskDIB() throw(); // Misc static OUString getImplementationName_Static() throw(); @@ -88,7 +83,7 @@ public: void SetData( void* pData ) { ReleaseData(); mpData = pData; } }; -REF( XInterface ) SAL_CALL ScannerManager_CreateInstance( const REF( com::sun::star::lang::XMultiServiceFactory )& rxFactory ) throw( Exception ); +Reference< XInterface > SAL_CALL ScannerManager_CreateInstance( const Reference< com::sun::star::lang::XMultiServiceFactory >& rxFactory ) throw( Exception ); #endif diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index 985a748a0ab8..aace9cb1511e 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -42,20 +42,20 @@ BitmapTransporter::~BitmapTransporter() // ----------------------------------------------------------------------------- -ANY SAL_CALL BitmapTransporter::queryInterface( const Type& rType ) throw( RuntimeException ) +Any SAL_CALL BitmapTransporter::queryInterface( const Type& rType ) throw( RuntimeException ) { - const ANY aRet( cppu::queryInterface( rType, static_cast< AWT::XBitmap* >( this ) ) ); + const Any aRet( cppu::queryInterface( rType, static_cast< css::awt::XBitmap* >( this ) ) ); return( aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ) ); } // ----------------------------------------------------------------------------- -AWT::Size BitmapTransporter::getSize() throw() +css::awt::Size BitmapTransporter::getSize() throw() { osl::MutexGuard aGuard( m_aProtector ); int nPreviousPos = m_aStream.Tell(); - AWT::Size aRet; + css::awt::Size aRet; // ensure that there is at least a header m_aStream.Seek( STREAM_SEEK_TO_END ); @@ -75,7 +75,7 @@ AWT::Size BitmapTransporter::getSize() throw() // ----------------------------------------------------------------------------- -SEQ( sal_Int8 ) BitmapTransporter::getDIB() throw() +Sequence< sal_Int8 > BitmapTransporter::getDIB() throw() { osl::MutexGuard aGuard( m_aProtector ); int nPreviousPos = m_aStream.Tell(); @@ -85,7 +85,7 @@ SEQ( sal_Int8 ) BitmapTransporter::getDIB() throw() int nBytes = m_aStream.Tell(); m_aStream.Seek( 0 ); - SEQ( sal_Int8 ) aValue( nBytes ); + Sequence< sal_Int8 > aValue( nBytes ); m_aStream.Read( aValue.getArray(), nBytes ); m_aStream.Seek( nPreviousPos ); @@ -99,7 +99,7 @@ SEQ( sal_Int8 ) BitmapTransporter::getDIB() throw() struct SaneHolder { Sane m_aSane; - REF( AWT::XBitmap ) m_xBitmap; + Reference< css::awt::XBitmap > m_xBitmap; osl::Mutex m_aProtector; ScanError m_nError; bool m_bBusy; @@ -146,7 +146,7 @@ namespace class ScannerThread : public osl::Thread { boost::shared_ptr<SaneHolder> m_pHolder; - REF( com::sun::star::lang::XEventListener ) m_xListener; + Reference< com::sun::star::lang::XEventListener > m_xListener; ScannerManager* m_pManager; // just for the disposing call public: @@ -154,7 +154,7 @@ public: virtual void onTerminated() { delete this; } public: ScannerThread( boost::shared_ptr<SaneHolder> pHolder, - const REF( com::sun::star::lang::XEventListener )& listener, + const Reference< com::sun::star::lang::XEventListener >& listener, ScannerManager* pManager ); virtual ~ScannerThread(); }; @@ -163,7 +163,7 @@ public: ScannerThread::ScannerThread( boost::shared_ptr<SaneHolder> pHolder, - const REF( com::sun::star::lang::XEventListener )& listener, + const Reference< com::sun::star::lang::XEventListener >& listener, ScannerManager* pManager ) : m_pHolder( pHolder ), m_xListener( listener ), m_pManager( pManager ) { @@ -183,9 +183,9 @@ void ScannerThread::run() { osl::MutexGuard aGuard( m_pHolder->m_aProtector ); BitmapTransporter* pTransporter = new BitmapTransporter; - REF( XInterface ) aIf( static_cast< OWeakObject* >( pTransporter ) ); + Reference< XInterface > aIf( static_cast< OWeakObject* >( pTransporter ) ); - m_pHolder->m_xBitmap = REF( AWT::XBitmap )( aIf, UNO_QUERY ); + m_pHolder->m_xBitmap = Reference< css::awt::XBitmap >( aIf, UNO_QUERY ); m_pHolder->m_bBusy = true; if( m_pHolder->m_aSane.IsOpen() ) @@ -202,7 +202,7 @@ void ScannerThread::run() m_pHolder->m_nError = ScanError_ScannerNotAvailable; - REF( XInterface ) xXInterface( static_cast< OWeakObject* >( m_pManager ) ); + Reference< XInterface > xXInterface( static_cast< OWeakObject* >( m_pManager ) ); m_xListener->disposing( com::sun::star::lang::EventObject(xXInterface) ); m_pHolder->m_bBusy = false; } @@ -225,23 +225,23 @@ void ScannerManager::ReleaseData() // ----------------------------------------------------------------------------- -AWT::Size ScannerManager::getSize() throw() +css::awt::Size ScannerManager::getSize() throw() { - AWT::Size aRet; + css::awt::Size aRet; aRet.Width = aRet.Height = 0; return aRet; } // ----------------------------------------------------------------------------- -SEQ( sal_Int8 ) ScannerManager::getDIB() throw() +Sequence< sal_Int8 > ScannerManager::getDIB() throw() { - return SEQ( sal_Int8 )(); + return Sequence< sal_Int8 >(); } // ----------------------------------------------------------------------------- -SEQ( ScannerContext ) ScannerManager::getAvailableScanners() throw() +Sequence< ScannerContext > ScannerManager::getAvailableScanners() throw() { osl::MutexGuard aGuard( theSaneProtector::get() ); sanevec &rSanes = theSanes::get().m_aSanes; @@ -255,19 +255,19 @@ SEQ( ScannerContext ) ScannerManager::getAvailableScanners() throw() if( Sane::IsSane() ) { - SEQ( ScannerContext ) aRet(1); + Sequence< ScannerContext > aRet(1); aRet.getArray()[0].ScannerName = ::rtl::OUString("SANE"); aRet.getArray()[0].InternalData = 0; return aRet; } - return SEQ( ScannerContext )(); + return Sequence< ScannerContext >(); } // ----------------------------------------------------------------------------- sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_context, - const REF( com::sun::star::lang::XEventListener )& listener ) throw( ScannerException ) + const Reference< com::sun::star::lang::XEventListener >& listener ) throw( ScannerException ) { bool bRet; bool bScan; @@ -282,7 +282,7 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) throw ScannerException( ::rtl::OUString("Scanner does not exist"), - REF( XScannerManager )( this ), + Reference< XScannerManager >( this ), ScanError_InvalidContext ); @@ -290,7 +290,7 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex if( pHolder->m_bBusy ) throw ScannerException( ::rtl::OUString("Scanner is busy"), - REF( XScannerManager )( this ), + Reference< XScannerManager >( this ), ScanError_ScanInProgress ); @@ -309,7 +309,7 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex // ----------------------------------------------------------------------------- void ScannerManager::startScan( const ScannerContext& scanner_context, - const REF( com::sun::star::lang::XEventListener )& listener ) throw( ScannerException ) + const Reference< com::sun::star::lang::XEventListener >& listener ) throw( ScannerException ) { osl::MutexGuard aGuard( theSaneProtector::get() ); sanevec &rSanes = theSanes::get().m_aSanes; @@ -321,14 +321,14 @@ void ScannerManager::startScan( const ScannerContext& scanner_context, if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) throw ScannerException( ::rtl::OUString("Scanner does not exist"), - REF( XScannerManager )( this ), + Reference< XScannerManager >( this ), ScanError_InvalidContext ); boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData]; if( pHolder->m_bBusy ) throw ScannerException( ::rtl::OUString("Scanner is busy"), - REF( XScannerManager )( this ), + Reference< XScannerManager >( this ), ScanError_ScanInProgress ); pHolder->m_bBusy = true; @@ -347,7 +347,7 @@ ScanError ScannerManager::getError( const ScannerContext& scanner_context ) thro if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) throw ScannerException( ::rtl::OUString("Scanner does not exist"), - REF( XScannerManager )( this ), + Reference< XScannerManager >( this ), ScanError_InvalidContext ); @@ -358,7 +358,7 @@ ScanError ScannerManager::getError( const ScannerContext& scanner_context ) thro // ----------------------------------------------------------------------------- -REF( AWT::XBitmap ) ScannerManager::getBitmap( const ScannerContext& scanner_context ) throw( ScannerException ) +Reference< css::awt::XBitmap > ScannerManager::getBitmap( const ScannerContext& scanner_context ) throw( ScannerException ) { osl::MutexGuard aGuard( theSaneProtector::get() ); sanevec &rSanes = theSanes::get().m_aSanes; @@ -366,15 +366,15 @@ REF( AWT::XBitmap ) ScannerManager::getBitmap( const ScannerContext& scanner_con if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) throw ScannerException( ::rtl::OUString("Scanner does not exist"), - REF( XScannerManager )( this ), + Reference< XScannerManager >( this ), ScanError_InvalidContext ); boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData]; osl::MutexGuard aProtGuard( pHolder->m_aProtector ); - REF( AWT::XBitmap ) xRet( pHolder->m_xBitmap ); - pHolder->m_xBitmap = REF( AWT::XBitmap )(); + Reference< css::awt::XBitmap > xRet( pHolder->m_xBitmap ); + pHolder->m_xBitmap = Reference< css::awt::XBitmap >(); return xRet; } diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx index e52b68867ff8..60e1d588a862 100644 --- a/extensions/source/scanner/scanwin.cxx +++ b/extensions/source/scanner/scanwin.cxx @@ -779,9 +779,9 @@ void ScannerManager::ReleaseData() } } -AWT::Size ScannerManager::getSize() throw() +awt::Size ScannerManager::getSize() throw() { - AWT::Size aRet; + awt::Size aRet; HGLOBAL hDIB = (HGLOBAL)(long) mpData; if( hDIB ) @@ -804,9 +804,9 @@ AWT::Size ScannerManager::getSize() throw() return aRet; } -SEQ( sal_Int8 ) ScannerManager::getDIB() throw() +uno::Sequence< sal_Int8 > ScannerManager::getDIB() throw() { - SEQ( sal_Int8 ) aRet; + uno::Sequence< sal_Int8 > aRet; if( mpData ) { @@ -845,7 +845,7 @@ SEQ( sal_Int8 ) ScannerManager::getDIB() throw() break; } - aRet = SEQ( sal_Int8 )( sizeof( BITMAPFILEHEADER ) + nDIBSize ); + aRet = uno::Sequence< sal_Int8 >( sizeof( BITMAPFILEHEADER ) + nDIBSize ); sal_Int8* pBuf = aRet.getArray(); SvMemoryStream* pMemStm = new SvMemoryStream( (char*) pBuf, sizeof( BITMAPFILEHEADER ), STREAM_WRITE ); @@ -864,10 +864,10 @@ SEQ( sal_Int8 ) ScannerManager::getDIB() throw() return aRet; } -SEQ( ScannerContext ) SAL_CALL ScannerManager::getAvailableScanners() throw() +uno::Sequence< ScannerContext > SAL_CALL ScannerManager::getAvailableScanners() throw() { osl::MutexGuard aGuard( maProtector ); - SEQ( ScannerContext ) aRet( 1 ); + uno::Sequence< ScannerContext > aRet( 1 ); aRet.getArray()[0].ScannerName = ::rtl::OUString( "TWAIN" ); aRet.getArray()[0].InternalData = 0; diff --git a/extensions/source/scanner/scnserv.cxx b/extensions/source/scanner/scnserv.cxx index dadaf3279269..daf2a07fb805 100644 --- a/extensions/source/scanner/scnserv.cxx +++ b/extensions/source/scanner/scnserv.cxx @@ -29,12 +29,12 @@ using namespace com::sun::star::registry; extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL scn_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ ) { - REF( ::com::sun::star::lang::XSingleServiceFactory ) xFactory; + Reference< ::com::sun::star::lang::XSingleServiceFactory > xFactory; void* pRet = 0; if( ::rtl::OUString::createFromAscii( pImplName ) == ScannerManager::getImplementationName_Static() ) { - xFactory = REF( ::com::sun::star::lang::XSingleServiceFactory )( ::cppu::createSingleFactory( + xFactory = Reference< ::com::sun::star::lang::XSingleServiceFactory >( ::cppu::createSingleFactory( static_cast< ::com::sun::star::lang::XMultiServiceFactory* >( pServiceManager ), ScannerManager::getImplementationName_Static(), ScannerManager_CreateInstance, |