diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-09 09:21:53 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-09 08:11:34 +0000 |
commit | 538f276ae0414ea34ede6090b5f56e8fecd6fc65 (patch) | |
tree | efbfb952f3236a6f56540ddae6a896c8c73774a0 /extensions | |
parent | f12e483589888f87843026ceff5ae3c1e615ca02 (diff) |
Formatting changes across all modules
+ Removed comment cruft
+ Tab formatting in number of files
+ Some commented out code removed
+ Tab characters replaced with spaces
+ Newline cleanup in quite a few files
+ Tweak header guard #endifs
Change-Id: I3208ff2f047da890edcc49b73389aca22442f5fc
Reviewed-on: https://gerrit.libreoffice.org/22221
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/macosx/spotlight/main.m | 20 | ||||
-rw-r--r-- | extensions/source/scanner/sane.hxx | 10 | ||||
-rw-r--r-- | extensions/source/scanner/scanner.cxx | 11 | ||||
-rw-r--r-- | extensions/source/scanner/scanunx.cxx | 24 |
4 files changed, 15 insertions, 50 deletions
diff --git a/extensions/source/macosx/spotlight/main.m b/extensions/source/macosx/spotlight/main.m index 6457ff7127c6..d3c3f44c80c0 100644 --- a/extensions/source/macosx/spotlight/main.m +++ b/extensions/source/macosx/spotlight/main.m @@ -37,9 +37,7 @@ #include "GetMetadataForFile.h" -// ----------------------------------------------------------------------------- // constants -// ----------------------------------------------------------------------------- #define PLUGIN_ID "A3FCC88D-B9A6-4364-8B93-92123C8A2D18" @@ -52,9 +50,7 @@ // -// ----------------------------------------------------------------------------- // typedefs -// ----------------------------------------------------------------------------- // The layout for an instance of MetaDataImporterPlugIn typedef struct __MetadataImporterPluginType @@ -64,9 +60,7 @@ typedef struct __MetadataImporterPluginType UInt32 refCount; } MetadataImporterPluginType; -// ----------------------------------------------------------------------------- // prototypes -// ----------------------------------------------------------------------------- // Forward declaration for the IUnknown implementation. // @@ -75,9 +69,7 @@ void DeallocMetadataImporterPluginType(MetadataImporterPlug HRESULT MetadataImporterQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv); ULONG MetadataImporterPluginAddRef(void *thisInstance); ULONG MetadataImporterPluginRelease(void *thisInstance); -// ----------------------------------------------------------------------------- // testInterfaceFtbl definition -// ----------------------------------------------------------------------------- // The TestInterface function table. // @@ -90,9 +82,7 @@ static MDImporterInterfaceStruct testInterfaceFtbl = { }; -// ----------------------------------------------------------------------------- // AllocMetadataImporterPluginType -// ----------------------------------------------------------------------------- // Utility function that allocates a new instance. // You can do some initial setup for the importer here if you wish // like allocating globals etc... @@ -116,9 +106,7 @@ MetadataImporterPluginType *AllocMetadataImporterPluginType(CFUUIDRef inFactoryI return theNewInstance; } -// ----------------------------------------------------------------------------- // DeallocSpotlightTesterMDImporterPluginType -// ----------------------------------------------------------------------------- // Utility function that deallocates the instance when // the refCount goes to zero. // In the current implementation importer interfaces are never deallocated @@ -136,9 +124,7 @@ void DeallocMetadataImporterPluginType(MetadataImporterPluginType *thisInstance) } } -// ----------------------------------------------------------------------------- // MetadataImporterQueryInterface -// ----------------------------------------------------------------------------- // Implementation of the IUnknown QueryInterface function. // HRESULT MetadataImporterQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv) @@ -172,9 +158,7 @@ HRESULT MetadataImporterQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv } } -// ----------------------------------------------------------------------------- // MetadataImporterPluginAddRef -// ----------------------------------------------------------------------------- // Implementation of reference counting for this type. Whenever an interface // is requested, bump the refCount for the instance. NOTE: returning the // refcount is a convention but is not required so don't rely on it. @@ -185,9 +169,7 @@ ULONG MetadataImporterPluginAddRef(void *thisInstance) return ((MetadataImporterPluginType*) thisInstance)->refCount; } -// ----------------------------------------------------------------------------- // SampleCMPluginRelease -// ----------------------------------------------------------------------------- // When an interface is released, decrement the refCount. // If the refCount goes to zero, deallocate the instance. // @@ -202,9 +184,7 @@ ULONG MetadataImporterPluginRelease(void *thisInstance) } } -// ----------------------------------------------------------------------------- // SpotlightTesterMDImporterPluginFactory -// ----------------------------------------------------------------------------- // Implementation of the factory function for this type. // __attribute__ ((visibility("default"))) diff --git a/extensions/source/scanner/sane.hxx b/extensions/source/scanner/sane.hxx index b96e89cced3a..1257cf32824c 100644 --- a/extensions/source/scanner/sane.hxx +++ b/extensions/source/scanner/sane.hxx @@ -26,9 +26,6 @@ #include <scanner.hxx> -// - BitmapTransporter - - - class BitmapTransporter: public cppu::WeakImplHelper<css::awt::XBitmap> { SvMemoryStream m_aStream; @@ -50,9 +47,6 @@ public: }; -// - Sane - - - class Sane { private: @@ -165,6 +159,7 @@ public: inline Link<Sane&,void> SetReloadOptionsHdl( const Link<Sane&,void>& rLink ); }; + inline int Sane::GetOptionElements( int n ) { if( mppOptions[n]->type == SANE_TYPE_FIXED || @@ -175,6 +170,7 @@ inline int Sane::GetOptionElements( int n ) return 1; } + inline Link<Sane&,void> Sane::SetReloadOptionsHdl( const Link<Sane&,void>& rLink ) { Link<Sane&,void> aRet = maReloadOptionsLink; @@ -182,6 +178,6 @@ inline Link<Sane&,void> Sane::SetReloadOptionsHdl( const Link<Sane&,void>& rLink return aRet; } -#endif +#endif // INCLUDED_EXTENSIONS_SOURCE_SCANNER_SANE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/scanner/scanner.cxx b/extensions/source/scanner/scanner.cxx index 2cf61f5d5f53..5e4c5d6b0fce 100644 --- a/extensions/source/scanner/scanner.cxx +++ b/extensions/source/scanner/scanner.cxx @@ -21,8 +21,6 @@ #include <cppuhelper/supportsservice.hxx> -// - ScannerManager - - Reference< XInterface > SAL_CALL ScannerManager_CreateInstance( const Reference< css::lang::XMultiServiceFactory >& /*rxFactory*/ ) throw ( Exception ) { @@ -30,7 +28,6 @@ Reference< XInterface > SAL_CALL ScannerManager_CreateInstance( const Reference< } - ScannerManager::ScannerManager() : mpData( nullptr ) { @@ -38,48 +35,52 @@ ScannerManager::ScannerManager() : } - ScannerManager::~ScannerManager() { ReleaseData(); } + Sequence< sal_Int8 > SAL_CALL ScannerManager::getMaskDIB() throw(std::exception) { return Sequence< sal_Int8 >(); } + OUString ScannerManager::getImplementationName() throw (css::uno::RuntimeException, std::exception) { return getImplementationName_Static(); } + sal_Bool ScannerManager::supportsService(OUString const & ServiceName) throw (css::uno::RuntimeException, std::exception) { return cppu::supportsService(this, ServiceName); } + css::uno::Sequence<OUString> ScannerManager::getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) { return getSupportedServiceNames_Static(); } + OUString ScannerManager::getImplementationName_Static() throw() { return OUString( "com.sun.star.scanner.ScannerManager" ); } - Sequence< OUString > ScannerManager::getSupportedServiceNames_Static() throw () { Sequence< OUString > aSNS { "com.sun.star.scanner.ScannerManager" }; return aSNS; } + sal_Bool SAL_CALL ScannerManager::configureScanner( ScannerContext& rContext ) throw( ScannerException, std::exception ) { diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index aae2b25f6e27..33075998caa0 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -34,6 +34,7 @@ BitmapTransporter::BitmapTransporter() #endif } + BitmapTransporter::~BitmapTransporter() { #if OSL_DEBUG_LEVEL > 1 @@ -41,6 +42,7 @@ BitmapTransporter::~BitmapTransporter() #endif } + css::awt::Size BitmapTransporter::getSize() throw(std::exception) { osl::MutexGuard aGuard( m_aProtector ); @@ -64,7 +66,6 @@ css::awt::Size BitmapTransporter::getSize() throw(std::exception) } - Sequence< sal_Int8 > BitmapTransporter::getDIB() throw(std::exception) { osl::MutexGuard aGuard( m_aProtector ); @@ -83,9 +84,6 @@ Sequence< sal_Int8 > BitmapTransporter::getDIB() throw(std::exception) } -// - SaneHolder - - - struct SaneHolder { Sane m_aSane; @@ -97,6 +95,7 @@ struct SaneHolder SaneHolder() : m_nError(ScanError_ScanErrorNone), m_bBusy(false) {} }; + namespace { typedef std::vector< std::shared_ptr<SaneHolder> > sanevec; @@ -130,9 +129,6 @@ namespace } -// - ScannerThread - - - class ScannerThread : public osl::Thread { std::shared_ptr<SaneHolder> m_pHolder; @@ -150,7 +146,6 @@ public: }; - ScannerThread::ScannerThread( std::shared_ptr<SaneHolder> pHolder, const Reference< css::lang::XEventListener >& listener, @@ -162,6 +157,7 @@ ScannerThread::ScannerThread( #endif } + ScannerThread::~ScannerThread() { #if OSL_DEBUG_LEVEL > 1 @@ -169,6 +165,7 @@ ScannerThread::~ScannerThread() #endif } + void ScannerThread::run() { osl_setThreadName("ScannerThread"); @@ -200,15 +197,13 @@ void ScannerThread::run() } -// - ScannerManager - - - void ScannerManager::AcquireData() { osl::MutexGuard aGuard( theSaneProtector::get() ); theSanes::get().acquire(); } + void ScannerManager::ReleaseData() { osl::MutexGuard aGuard( theSaneProtector::get() ); @@ -216,7 +211,6 @@ void ScannerManager::ReleaseData() } - css::awt::Size ScannerManager::getSize() throw(std::exception) { css::awt::Size aRet; @@ -225,14 +219,12 @@ css::awt::Size ScannerManager::getSize() throw(std::exception) } - Sequence< sal_Int8 > ScannerManager::getDIB() throw(std::exception) { return Sequence< sal_Int8 >(); } - Sequence< ScannerContext > ScannerManager::getAvailableScanners() throw(std::exception) { osl::MutexGuard aGuard( theSaneProtector::get() ); @@ -257,7 +249,6 @@ Sequence< ScannerContext > ScannerManager::getAvailableScanners() throw(std::exc } - sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_context, const Reference< css::lang::XEventListener >& listener ) throw (ScannerException, RuntimeException, std::exception) @@ -300,7 +291,6 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex } - void ScannerManager::startScan( const ScannerContext& scanner_context, const Reference< css::lang::XEventListener >& listener ) throw( ScannerException, std::exception ) { @@ -331,7 +321,6 @@ void ScannerManager::startScan( const ScannerContext& scanner_context, } - ScanError ScannerManager::getError( const ScannerContext& scanner_context ) throw( ScannerException, std::exception ) { osl::MutexGuard aGuard( theSaneProtector::get() ); @@ -350,7 +339,6 @@ ScanError ScannerManager::getError( const ScannerContext& scanner_context ) thro } - Reference< css::awt::XBitmap > ScannerManager::getBitmap( const ScannerContext& scanner_context ) throw( ScannerException, std::exception ) { osl::MutexGuard aGuard( theSaneProtector::get() ); |