diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-05 08:16:10 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-06-05 08:17:51 +0200 |
commit | a8d5b0c81550ac224ef1278e764216afbbfea4b3 (patch) | |
tree | 9a912f85cf4898f010a46f1b5727c43e6f402e60 /stoc/source/security | |
parent | 579d1f61b0300434801e9b37012254a506fc0230 (diff) |
stoc: remove SAL_THROW macro
Change-Id: I7443c855a7145837621887030b0d3d01cca2a5ac
Diffstat (limited to 'stoc/source/security')
-rw-r--r-- | stoc/source/security/access_controller.cxx | 70 | ||||
-rw-r--r-- | stoc/source/security/file_policy.cxx | 58 | ||||
-rw-r--r-- | stoc/source/security/lru_cache.h | 35 | ||||
-rw-r--r-- | stoc/source/security/permissions.cxx | 55 | ||||
-rw-r--r-- | stoc/source/security/permissions.h | 24 |
5 files changed, 88 insertions, 154 deletions
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 76b83da2b5c0..71b54df142ef 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -78,17 +78,14 @@ class acc_Intersection inline acc_Intersection( Reference< security::XAccessControlContext > const & x1, - Reference< security::XAccessControlContext > const & x2 ) - SAL_THROW(()); + Reference< security::XAccessControlContext > const & x2 ); public: - virtual ~acc_Intersection() - SAL_THROW(()); + virtual ~acc_Intersection(); static inline Reference< security::XAccessControlContext > create( Reference< security::XAccessControlContext > const & x1, - Reference< security::XAccessControlContext > const & x2 ) - SAL_THROW(()); + Reference< security::XAccessControlContext > const & x2 ); // XAccessControlContext impl virtual void SAL_CALL checkPermission( @@ -99,19 +96,16 @@ public: inline acc_Intersection::acc_Intersection( Reference< security::XAccessControlContext > const & x1, Reference< security::XAccessControlContext > const & x2 ) - SAL_THROW(()) : m_x1( x1 ) , m_x2( x2 ) {} acc_Intersection::~acc_Intersection() - SAL_THROW(()) {} inline Reference< security::XAccessControlContext > acc_Intersection::create( Reference< security::XAccessControlContext > const & x1, Reference< security::XAccessControlContext > const & x2 ) - SAL_THROW(()) { if (! x1.is()) return x2; @@ -137,17 +131,14 @@ class acc_Union inline acc_Union( Reference< security::XAccessControlContext > const & x1, - Reference< security::XAccessControlContext > const & x2 ) - SAL_THROW(()); + Reference< security::XAccessControlContext > const & x2 ); public: - virtual ~acc_Union() - SAL_THROW(()); + virtual ~acc_Union(); static inline Reference< security::XAccessControlContext > create( Reference< security::XAccessControlContext > const & x1, - Reference< security::XAccessControlContext > const & x2 ) - SAL_THROW(()); + Reference< security::XAccessControlContext > const & x2 ); // XAccessControlContext impl virtual void SAL_CALL checkPermission( @@ -158,19 +149,16 @@ public: inline acc_Union::acc_Union( Reference< security::XAccessControlContext > const & x1, Reference< security::XAccessControlContext > const & x2 ) - SAL_THROW(()) : m_x1( x1 ) , m_x2( x2 ) {} acc_Union::~acc_Union() - SAL_THROW(()) {} inline Reference< security::XAccessControlContext > acc_Union::create( Reference< security::XAccessControlContext > const & x1, Reference< security::XAccessControlContext > const & x2 ) - SAL_THROW(()) { if (! x1.is()) return Reference< security::XAccessControlContext >(); // unrestricted @@ -202,10 +190,8 @@ class acc_Policy public: inline acc_Policy( - PermissionCollection const & permissions ) - SAL_THROW(()); - virtual ~acc_Policy() - SAL_THROW(()); + PermissionCollection const & permissions ); + virtual ~acc_Policy(); // XAccessControlContext impl virtual void SAL_CALL checkPermission( @@ -215,12 +201,10 @@ public: inline acc_Policy::acc_Policy( PermissionCollection const & permissions ) - SAL_THROW(()) : m_permissions( permissions ) {} acc_Policy::~acc_Policy() - SAL_THROW(()) {} void acc_Policy::checkPermission( @@ -243,9 +227,8 @@ class acc_CurrentContext public: inline acc_CurrentContext( Reference< XCurrentContext > const & xDelegate, - Reference< security::XAccessControlContext > const & xRestriction ) - SAL_THROW(()); - virtual ~acc_CurrentContext() SAL_THROW(()); + Reference< security::XAccessControlContext > const & xRestriction ); + virtual ~acc_CurrentContext(); // XInterface impl virtual void SAL_CALL acquire() @@ -261,7 +244,6 @@ public: inline acc_CurrentContext::acc_CurrentContext( Reference< XCurrentContext > const & xDelegate, Reference< security::XAccessControlContext > const & xRestriction ) - SAL_THROW(()) : m_refcount( 0 ) , m_xDelegate( xDelegate ) { @@ -273,7 +255,6 @@ inline acc_CurrentContext::acc_CurrentContext( } acc_CurrentContext::~acc_CurrentContext() - SAL_THROW(()) {} void acc_CurrentContext::acquire() @@ -312,7 +293,6 @@ Any acc_CurrentContext::getValueByName( OUString const & name ) static inline Reference< security::XAccessControlContext > getDynamicRestriction( Reference< XCurrentContext > const & xContext ) - SAL_THROW( (RuntimeException) ) { if (xContext.is()) { @@ -341,9 +321,9 @@ class cc_reset { void * m_cc; public: - inline cc_reset( void * cc ) SAL_THROW(()) + inline cc_reset( void * cc ) : m_cc( cc ) {} - inline ~cc_reset() SAL_THROW(()) + inline ~cc_reset() { ::uno_setCurrentContext( m_cc, s_envType.pData, 0 ); } }; @@ -364,8 +344,7 @@ class AccessController Reference< XComponentContext > m_xComponentContext; Reference< security::XPolicy > m_xPolicy; - Reference< security::XPolicy > const & getPolicy() - SAL_THROW( (RuntimeException) ); + Reference< security::XPolicy > const & getPolicy(); // mode enum Mode { OFF, ON, DYNAMIC_ONLY, SINGLE_USER, SINGLE_DEFAULT_USER } m_mode; @@ -382,22 +361,19 @@ class AccessController ThreadData m_rec; typedef vector< pair< OUString, Any > > t_rec_vec; - inline void clearPostPoned() SAL_THROW(()); - void checkAndClearPostPoned() SAL_THROW( (RuntimeException) ); + inline void clearPostPoned(); + void checkAndClearPostPoned(); PermissionCollection getEffectivePermissions( Reference< XCurrentContext > const & xContext, - Any const & demanded_perm ) - SAL_THROW( (RuntimeException) ); + Any const & demanded_perm ); protected: virtual void SAL_CALL disposing() SAL_OVERRIDE; public: - AccessController( Reference< XComponentContext > const & xComponentContext ) - SAL_THROW( (RuntimeException) ); - virtual ~AccessController() - SAL_THROW(()); + AccessController( Reference< XComponentContext > const & xComponentContext ); + virtual ~AccessController(); // XInitialization impl virtual void SAL_CALL initialize( @@ -429,7 +405,6 @@ public: }; AccessController::AccessController( Reference< XComponentContext > const & xComponentContext ) - SAL_THROW( (RuntimeException) ) : t_helper( m_mutex ) , m_xComponentContext( xComponentContext ) , m_mode( ON ) // default @@ -492,7 +467,6 @@ AccessController::AccessController( Reference< XComponentContext > const & xComp } AccessController::~AccessController() - SAL_THROW(()) {} void AccessController::disposing() @@ -529,7 +503,6 @@ void AccessController::initialize( Reference< security::XPolicy > const & AccessController::getPolicy() - SAL_THROW( (RuntimeException) ) { // get policy singleton if (! m_xPolicy.is()) @@ -556,7 +529,7 @@ Reference< security::XPolicy > const & AccessController::getPolicy() #ifdef __DIAGNOSE static void dumpPermissions( - PermissionCollection const & collection, OUString const & userId = OUString() ) SAL_THROW(()) + PermissionCollection const & collection, OUString const & userId = OUString() ) { OUStringBuffer buf( 48 ); if (!userId.isEmpty()) @@ -584,13 +557,13 @@ static void dumpPermissions( -inline void AccessController::clearPostPoned() SAL_THROW(()) +inline void AccessController::clearPostPoned() { delete reinterpret_cast< t_rec_vec * >( m_rec.getData() ); m_rec.setData( 0 ); } -void AccessController::checkAndClearPostPoned() SAL_THROW( (RuntimeException) ) +void AccessController::checkAndClearPostPoned() { // check postponed permissions boost::scoped_ptr< t_rec_vec > rec( reinterpret_cast< t_rec_vec * >( m_rec.getData() ) ); @@ -658,7 +631,6 @@ void AccessController::checkAndClearPostPoned() SAL_THROW( (RuntimeException) ) PermissionCollection AccessController::getEffectivePermissions( Reference< XCurrentContext > const & xContext, Any const & demanded_perm ) - SAL_THROW( (RuntimeException) ) { OUString userId; diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index bf1fdacdca9d..90ddd78ec1eb 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -71,10 +71,8 @@ protected: virtual void SAL_CALL disposing() SAL_OVERRIDE; public: - FilePolicy( Reference< XComponentContext > const & xComponentContext ) - SAL_THROW(()); - virtual ~FilePolicy() - SAL_THROW(()); + FilePolicy( Reference< XComponentContext > const & xComponentContext ); + virtual ~FilePolicy(); // XPolicy impl virtual Sequence< Any > SAL_CALL getPermissions( @@ -95,7 +93,6 @@ public: }; FilePolicy::FilePolicy( Reference< XComponentContext > const & xComponentContext ) - SAL_THROW(()) : t_helper( m_mutex ) , m_xComponentContext( xComponentContext ) , m_ac( xComponentContext ) @@ -103,7 +100,6 @@ FilePolicy::FilePolicy( Reference< XComponentContext > const & xComponentContext {} FilePolicy::~FilePolicy() - SAL_THROW(()) {} void FilePolicy::disposing() @@ -160,42 +156,31 @@ class PolicyReader sal_Int32 m_pos; sal_Unicode m_back; - sal_Unicode get() - SAL_THROW( (RuntimeException) ); - inline void back( sal_Unicode c ) SAL_THROW(()) + sal_Unicode get(); + inline void back( sal_Unicode c ) { m_back = c; } - inline bool isWhiteSpace( sal_Unicode c ) const SAL_THROW(()) + inline bool isWhiteSpace( sal_Unicode c ) const { return (' ' == c || '\t' == c || '\n' == c || '\r' == c); } - void skipWhiteSpace() - SAL_THROW( (RuntimeException) ); + void skipWhiteSpace(); - inline bool isCharToken( sal_Unicode c ) const SAL_THROW(()) + inline bool isCharToken( sal_Unicode c ) const { return (';' == c || ',' == c || '{' == c || '}' == c); } public: - PolicyReader( OUString const & file, AccessControl & ac ) - SAL_THROW( (RuntimeException) ); - ~PolicyReader() - SAL_THROW(()); - - void error( OUString const & msg ) - SAL_THROW( (RuntimeException) ); - - OUString getToken() - SAL_THROW( (RuntimeException) ); - OUString assureToken() - SAL_THROW( (RuntimeException) ); - OUString getQuotedToken() - SAL_THROW( (RuntimeException) ); - OUString assureQuotedToken() - SAL_THROW( (RuntimeException) ); - void assureToken( sal_Unicode token ) - SAL_THROW( (RuntimeException) ); + PolicyReader( OUString const & file, AccessControl & ac ); + ~PolicyReader(); + + void error( OUString const & msg ); + + OUString getToken(); + OUString assureToken(); + OUString getQuotedToken(); + OUString assureQuotedToken(); + void assureToken( sal_Unicode token ); }; void PolicyReader::assureToken( sal_Unicode token ) - SAL_THROW( (RuntimeException) ) { skipWhiteSpace(); sal_Unicode c = get(); @@ -209,7 +194,6 @@ void PolicyReader::assureToken( sal_Unicode token ) } OUString PolicyReader::assureQuotedToken() - SAL_THROW( (RuntimeException) ) { OUString token( getQuotedToken() ); if (token.isEmpty()) @@ -218,7 +202,6 @@ OUString PolicyReader::assureQuotedToken() } OUString PolicyReader::getQuotedToken() - SAL_THROW( (RuntimeException) ) { skipWhiteSpace(); OUStringBuffer buf( 32 ); @@ -235,7 +218,6 @@ OUString PolicyReader::getQuotedToken() } OUString PolicyReader::assureToken() - SAL_THROW( (RuntimeException) ) { OUString token( getToken() ); if ( token.isEmpty()) @@ -244,7 +226,6 @@ OUString PolicyReader::assureToken() } OUString PolicyReader::getToken() - SAL_THROW( (RuntimeException) ) { skipWhiteSpace(); sal_Unicode c = get(); @@ -261,7 +242,6 @@ OUString PolicyReader::getToken() } void PolicyReader::skipWhiteSpace() - SAL_THROW( (RuntimeException) ) { sal_Unicode c; do @@ -323,7 +303,6 @@ void PolicyReader::skipWhiteSpace() } sal_Unicode PolicyReader::get() - SAL_THROW( (RuntimeException) ) { if ('\0' != m_back) // one char push back possible { @@ -360,7 +339,6 @@ sal_Unicode PolicyReader::get() } void PolicyReader::error( OUString const & msg ) - SAL_THROW( (RuntimeException) ) { OUStringBuffer buf( 32 ); buf.append( "error processing file \"" ); @@ -375,7 +353,6 @@ void PolicyReader::error( OUString const & msg ) } PolicyReader::PolicyReader( OUString const & fileName, AccessControl & ac ) - SAL_THROW( (RuntimeException) ) : m_fileName( fileName ) , m_linepos( 0 ) , m_pos( 1 ) // force readline @@ -393,7 +370,6 @@ PolicyReader::PolicyReader( OUString const & fileName, AccessControl & ac ) } PolicyReader::~PolicyReader() - SAL_THROW(()) { if ( ::osl_closeFile( m_file ) != osl_File_E_None ) { OSL_ASSERT( false ); diff --git a/stoc/source/security/lru_cache.h b/stoc/source/security/lru_cache.h index e9bf8b5c32ed..4688dc9b3278 100644 --- a/stoc/source/security/lru_cache.h +++ b/stoc/source/security/lru_cache.h @@ -52,57 +52,57 @@ class lru_cache Entry * m_block; mutable Entry * m_head; mutable Entry * m_tail; - inline void toFront( Entry * entry ) const SAL_THROW(()); + inline void toFront( Entry * entry ) const; public: /** Default Ctor. Does not cache. */ - inline lru_cache() SAL_THROW(()); + inline lru_cache(); /** Ctor. @param size number of elements to be cached; default param set to 128 */ - inline lru_cache( ::std::size_t size ) SAL_THROW(()); + inline lru_cache( ::std::size_t size ); /** Destructor: releases all cached elements and keys. */ - inline ~lru_cache() SAL_THROW(()); + inline ~lru_cache(); /** Retrieves a pointer to value in cache. Returns 0, if none was found. @param key a key @return pointer to value or 0 */ - inline t_val const * lookup( t_key const & key ) const SAL_THROW(()); + inline t_val const * lookup( t_key const & key ) const; /** Sets a value to be cached for given key. @param key a key @param val a value */ - inline void set( t_key const & key, t_val const & val ) SAL_THROW(()); + inline void set( t_key const & key, t_val const & val ); /** Tests whether a value is cached for given key. @param key a key @return true, if value is cached */ - inline bool has( t_key const & key ) const SAL_THROW(()); + inline bool has( t_key const & key ) const; /** Clears the cache, releasing all cached elements and keys. */ - inline void clear() SAL_THROW(()); + inline void clear(); /** Sets the number of elements to be cached. This will clear previous entries. @param cacheSize number of elements to be cached */ - inline void setSize( ::std::size_t size ) SAL_THROW(()); + inline void setSize( ::std::size_t size ); }; template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::setSize( - ::std::size_t size ) SAL_THROW(()) + ::std::size_t size ) { m_key2element.clear(); delete [] m_block; @@ -124,7 +124,7 @@ inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::setSize( template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lru_cache( - ::std::size_t size ) SAL_THROW(()) + ::std::size_t size ) : m_size( 0 ) , m_block( 0 ) , m_tail( 0 ) @@ -133,7 +133,7 @@ inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lru_cache( } template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > -inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lru_cache() SAL_THROW(()) +inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lru_cache() : m_size( 0 ) , m_block( 0 ) , m_head( 0 ) @@ -143,14 +143,13 @@ inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lru_cache() SAL_THROW(( template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::~lru_cache() - SAL_THROW(()) { delete [] m_block; } template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::toFront( - Entry * entry ) const SAL_THROW(()) + Entry * entry ) const { if (entry != m_head) { @@ -173,7 +172,7 @@ inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::toFront( template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > inline bool lru_cache< t_key, t_val, t_hashKey, t_equalKey >::has( - t_key const & key ) const SAL_THROW(()) + t_key const & key ) const { typename t_key2element::const_iterator const iFind( m_key2element.find( key ) ); return (iFind != m_key2element.end()); @@ -181,7 +180,7 @@ inline bool lru_cache< t_key, t_val, t_hashKey, t_equalKey >::has( template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > inline t_val const * lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lookup( - t_key const & key ) const SAL_THROW(()) + t_key const & key ) const { if (0 < m_size) { @@ -207,7 +206,7 @@ inline t_val const * lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lookup( template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::set( - t_key const & key, t_val const & val ) SAL_THROW(()) + t_key const & key, t_val const & val ) { if (0 < m_size) { @@ -257,7 +256,7 @@ inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::set( } template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > -inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::clear() SAL_THROW(()) +inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::clear() { m_key2element.clear(); for ( ::std::size_t nPos = m_size; nPos--; ) diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index 7b9994319b51..f613d356ddc0 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -46,7 +46,7 @@ namespace stoc_sec static inline sal_Int32 makeMask( - OUString const & items, char const * const * strings ) SAL_THROW(()) + OUString const & items, char const * const * strings ) { sal_Int32 mask = 0; @@ -83,7 +83,7 @@ static inline sal_Int32 makeMask( } static inline OUString makeStrings( - sal_Int32 mask, char const * const * strings ) SAL_THROW(()) + sal_Int32 mask, char const * const * strings ) { OUStringBuffer buf( 48 ); while (mask) @@ -116,15 +116,14 @@ class SocketPermission : public Permission mutable bool m_resolvedHost; bool m_wildCardHost; - inline bool resolveHost() const SAL_THROW(()); + inline bool resolveHost() const; public: SocketPermission( connection::SocketPermission const & perm, - ::rtl::Reference< Permission > const & next = ::rtl::Reference< Permission >() ) - SAL_THROW(()); - virtual bool implies( Permission const & perm ) const SAL_THROW(()) SAL_OVERRIDE; - virtual OUString toString() const SAL_THROW(()) SAL_OVERRIDE; + ::rtl::Reference< Permission > const & next = ::rtl::Reference< Permission >() ); + virtual bool implies( Permission const & perm ) const SAL_OVERRIDE; + virtual OUString toString() const SAL_OVERRIDE; }; char const * SocketPermission::s_actions [] = { "accept", "connect", "listen", "resolve", 0 }; @@ -132,7 +131,6 @@ char const * SocketPermission::s_actions [] = { "accept", "connect", "listen", " SocketPermission::SocketPermission( connection::SocketPermission const & perm, ::rtl::Reference< Permission > const & next ) - SAL_THROW(()) : Permission( SOCKET, next ) , m_actions( makeMask( perm.Actions, s_actions ) ) , m_host( perm.Host ) @@ -171,7 +169,7 @@ SocketPermission::SocketPermission( } } -inline bool SocketPermission::resolveHost() const SAL_THROW(()) +inline bool SocketPermission::resolveHost() const { if (m_resolveErr) return false; @@ -197,7 +195,7 @@ inline bool SocketPermission::resolveHost() const SAL_THROW(()) return m_resolvedHost; } -bool SocketPermission::implies( Permission const & perm ) const SAL_THROW(()) +bool SocketPermission::implies( Permission const & perm ) const { // check type if (SOCKET != perm.m_type) @@ -239,7 +237,7 @@ bool SocketPermission::implies( Permission const & perm ) const SAL_THROW(()) return m_ip.equals( demanded.m_ip ); } -OUString SocketPermission::toString() const SAL_THROW(()) +OUString SocketPermission::toString() const { OUStringBuffer buf( 48 ); // host @@ -285,15 +283,14 @@ class FilePermission : public Permission public: FilePermission( io::FilePermission const & perm, - ::rtl::Reference< Permission > const & next = ::rtl::Reference< Permission >() ) - SAL_THROW(()); - virtual bool implies( Permission const & perm ) const SAL_THROW(()) SAL_OVERRIDE; - virtual OUString toString() const SAL_THROW(()) SAL_OVERRIDE; + ::rtl::Reference< Permission > const & next = ::rtl::Reference< Permission >() ); + virtual bool implies( Permission const & perm ) const SAL_OVERRIDE; + virtual OUString toString() const SAL_OVERRIDE; }; char const * FilePermission::s_actions [] = { "read", "write", "execute", "delete", 0 }; -static OUString const & getWorkingDir() SAL_THROW(()) +static OUString const & getWorkingDir() { static OUString * s_workingDir = 0; if (! s_workingDir) @@ -314,7 +311,6 @@ static OUString const & getWorkingDir() SAL_THROW(()) FilePermission::FilePermission( io::FilePermission const & perm, ::rtl::Reference< Permission > const & next ) - SAL_THROW(()) : Permission( FILE, next ) , m_actions( makeMask( perm.Actions, s_actions ) ) , m_url( perm.URL ) @@ -356,7 +352,7 @@ FilePermission::FilePermission( } } -bool FilePermission::implies( Permission const & perm ) const SAL_THROW(()) +bool FilePermission::implies( Permission const & perm ) const { // check type if (FILE != perm.m_type) @@ -415,7 +411,7 @@ bool FilePermission::implies( Permission const & perm ) const SAL_THROW(()) return false; } -OUString FilePermission::toString() const SAL_THROW(()) +OUString FilePermission::toString() const { OUStringBuffer buf( 48 ); // url @@ -439,15 +435,14 @@ public: inline RuntimePermission( security::RuntimePermission const & perm, ::rtl::Reference< Permission > const & next = ::rtl::Reference< Permission >() ) - SAL_THROW(()) : Permission( RUNTIME, next ) , m_name( perm.Name ) {} - virtual bool implies( Permission const & perm ) const SAL_THROW(()) SAL_OVERRIDE; - virtual OUString toString() const SAL_THROW(()) SAL_OVERRIDE; + virtual bool implies( Permission const & perm ) const SAL_OVERRIDE; + virtual OUString toString() const SAL_OVERRIDE; }; -bool RuntimePermission::implies( Permission const & perm ) const SAL_THROW(()) +bool RuntimePermission::implies( Permission const & perm ) const { // check type if (RUNTIME != perm.m_type) @@ -458,7 +453,7 @@ bool RuntimePermission::implies( Permission const & perm ) const SAL_THROW(()) return m_name.equals( demanded.m_name ); } -OUString RuntimePermission::toString() const SAL_THROW(()) +OUString RuntimePermission::toString() const { OUStringBuffer buf( 48 ); buf.append( "com.sun.star.security.RuntimePermission (name=\"" ); @@ -470,12 +465,12 @@ OUString RuntimePermission::toString() const SAL_THROW(()) -bool AllPermission::implies( Permission const & ) const SAL_THROW(()) +bool AllPermission::implies( Permission const & ) const { return true; } -OUString AllPermission::toString() const SAL_THROW(()) +OUString AllPermission::toString() const { return OUString("com.sun.star.security.AllPermission"); } @@ -485,7 +480,6 @@ OUString AllPermission::toString() const SAL_THROW(()) PermissionCollection::PermissionCollection( Sequence< Any > const & permissions, PermissionCollection const & addition ) - SAL_THROW( (RuntimeException) ) : m_head( addition.m_head ) { Any const * perms = permissions.getConstArray(); @@ -525,7 +519,7 @@ PermissionCollection::PermissionCollection( } #ifdef __DIAGNOSE -Sequence< OUString > PermissionCollection::toStrings() const SAL_THROW(()) +Sequence< OUString > PermissionCollection::toStrings() const { vector< OUString > strings; strings.reserve( 8 ); @@ -539,7 +533,7 @@ Sequence< OUString > PermissionCollection::toStrings() const SAL_THROW(()) #endif inline static bool __implies( - ::rtl::Reference< Permission > const & head, Permission const & demanded ) SAL_THROW(()) + ::rtl::Reference< Permission > const & head, Permission const & demanded ) { for ( Permission * perm = head.get(); perm; perm = perm->m_next.get() ) { @@ -553,7 +547,6 @@ inline static bool __implies( static void demanded_diag( Permission const & perm ) - SAL_THROW(()) { OUStringBuffer buf( 48 ); buf.append( "demanding " ); @@ -567,7 +560,6 @@ static void demanded_diag( static void throwAccessControlException( Permission const & perm, Any const & demanded_perm ) - SAL_THROW( (security::AccessControlException) ) { OUStringBuffer buf( 48 ); buf.append( "access denied: " ); @@ -577,7 +569,6 @@ static void throwAccessControlException( } void PermissionCollection::checkPermission( Any const & perm ) const - SAL_THROW( (RuntimeException) ) { Type const & demanded_type = perm.getValueType(); diff --git a/stoc/source/security/permissions.h b/stoc/source/security/permissions.h index 58e7d1dbcadb..ee40365c15c2 100644 --- a/stoc/source/security/permissions.h +++ b/stoc/source/security/permissions.h @@ -40,13 +40,12 @@ public: inline Permission( t_type type, ::rtl::Reference< Permission > const & next = ::rtl::Reference< Permission >() ) - SAL_THROW(()) : m_next( next ) , m_type( type ) {} - virtual bool implies( Permission const & perm ) const SAL_THROW(()) = 0; - virtual OUString toString() const SAL_THROW(()) = 0; + virtual bool implies( Permission const & perm ) const = 0; + virtual OUString toString() const = 0; }; class AllPermission : public Permission @@ -54,12 +53,11 @@ class AllPermission : public Permission public: inline AllPermission( ::rtl::Reference< Permission > const & next = ::rtl::Reference< Permission >() ) - SAL_THROW(()) : Permission( ALL, next ) {} - virtual bool implies( Permission const & ) const SAL_THROW(()) SAL_OVERRIDE; - virtual OUString toString() const SAL_THROW(()) SAL_OVERRIDE; + virtual bool implies( Permission const & ) const SAL_OVERRIDE; + virtual OUString toString() const SAL_OVERRIDE; }; @@ -67,23 +65,21 @@ class PermissionCollection { ::rtl::Reference< Permission > m_head; public: - inline PermissionCollection() SAL_THROW(()) + inline PermissionCollection() {} - inline PermissionCollection( PermissionCollection const & collection ) SAL_THROW(()) + inline PermissionCollection( PermissionCollection const & collection ) : m_head( collection.m_head ) {} - inline PermissionCollection( ::rtl::Reference< Permission > const & single ) SAL_THROW(()) + inline PermissionCollection( ::rtl::Reference< Permission > const & single ) : m_head( single ) {} PermissionCollection( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > const & permissions, - PermissionCollection const & addition = PermissionCollection() ) - SAL_THROW( (::com::sun::star::uno::RuntimeException) ); + PermissionCollection const & addition = PermissionCollection() ); #ifdef __DIAGNOSE - ::com::sun::star::uno::Sequence< OUString > toStrings() const SAL_THROW(()); + ::com::sun::star::uno::Sequence< OUString > toStrings() const; #endif - void checkPermission( ::com::sun::star::uno::Any const & perm ) const - SAL_THROW( (::com::sun::star::uno::RuntimeException) ); + void checkPermission( ::com::sun::star::uno::Any const & perm ) const; }; } |