Kaydet (Commit) 27a166bc authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Just use WeakImplHelper1 instead of ImplHelper1

Change-Id: Iadc5960ef22289c044a0c85accaefb4f60b6097f
üst 1079ccf0
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <vector> #include <vector>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <osl/interlck.h>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <osl/thread.hxx> #include <osl/thread.hxx>
...@@ -217,10 +216,8 @@ void acc_Policy::checkPermission( ...@@ -217,10 +216,8 @@ void acc_Policy::checkPermission(
/** current context overriding dynamic ac restriction /** current context overriding dynamic ac restriction
*/ */
class acc_CurrentContext class acc_CurrentContext
: public ImplHelper1< XCurrentContext > : public WeakImplHelper1< XCurrentContext >
{ {
oslInterlockedCount m_refcount;
Reference< XCurrentContext > m_xDelegate; Reference< XCurrentContext > m_xDelegate;
Any m_restriction; Any m_restriction;
...@@ -228,13 +225,6 @@ public: ...@@ -228,13 +225,6 @@ public:
inline acc_CurrentContext( inline acc_CurrentContext(
Reference< XCurrentContext > const & xDelegate, Reference< XCurrentContext > const & xDelegate,
Reference< security::XAccessControlContext > const & xRestriction ); Reference< security::XAccessControlContext > const & xRestriction );
virtual ~acc_CurrentContext();
// XInterface impl
virtual void SAL_CALL acquire()
throw () SAL_OVERRIDE;
virtual void SAL_CALL release()
throw () SAL_OVERRIDE;
// XCurrentContext impl // XCurrentContext impl
virtual Any SAL_CALL getValueByName( OUString const & name ) virtual Any SAL_CALL getValueByName( OUString const & name )
...@@ -244,8 +234,7 @@ public: ...@@ -244,8 +234,7 @@ public:
inline acc_CurrentContext::acc_CurrentContext( inline acc_CurrentContext::acc_CurrentContext(
Reference< XCurrentContext > const & xDelegate, Reference< XCurrentContext > const & xDelegate,
Reference< security::XAccessControlContext > const & xRestriction ) Reference< security::XAccessControlContext > const & xRestriction )
: m_refcount( 0 ) : m_xDelegate( xDelegate )
, m_xDelegate( xDelegate )
{ {
if (xRestriction.is()) if (xRestriction.is())
{ {
...@@ -254,24 +243,6 @@ inline acc_CurrentContext::acc_CurrentContext( ...@@ -254,24 +243,6 @@ inline acc_CurrentContext::acc_CurrentContext(
// return empty any otherwise on getValueByName(), not null interface // return empty any otherwise on getValueByName(), not null interface
} }
acc_CurrentContext::~acc_CurrentContext()
{}
void acc_CurrentContext::acquire()
throw ()
{
osl_atomic_increment( &m_refcount );
}
void acc_CurrentContext::release()
throw ()
{
if (! osl_atomic_decrement( &m_refcount ))
{
delete this;
}
}
Any acc_CurrentContext::getValueByName( OUString const & name ) Any acc_CurrentContext::getValueByName( OUString const & name )
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment