diff options
Diffstat (limited to 'stoc/source/security/permissions.cxx')
-rw-r--r-- | stoc/source/security/permissions.cxx | 55 |
1 files changed, 23 insertions, 32 deletions
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(); |