[Libreoffice-commits] core.git: stoc/source

Stephan Bergmann sbergman at redhat.com
Wed Jan 7 07:35:57 PST 2015


 stoc/source/security/access_controller.cxx |   33 +----------------------------
 1 file changed, 2 insertions(+), 31 deletions(-)

New commits:
commit 27a166bcb8bdf56efff987b08895d2c676125426
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 7 16:34:23 2015 +0100

    Just use WeakImplHelper1 instead of ImplHelper1
    
    Change-Id: Iadc5960ef22289c044a0c85accaefb4f60b6097f

diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index 4fc3de1..721b095 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -21,7 +21,6 @@
 #include <vector>
 
 #include <osl/diagnose.h>
-#include <osl/interlck.h>
 #include <osl/mutex.hxx>
 #include <osl/thread.hxx>
 
@@ -217,10 +216,8 @@ void acc_Policy::checkPermission(
 /** current context overriding dynamic ac restriction
 */
 class acc_CurrentContext
-    : public ImplHelper1< XCurrentContext >
+    : public WeakImplHelper1< XCurrentContext >
 {
-    oslInterlockedCount m_refcount;
-
     Reference< XCurrentContext > m_xDelegate;
     Any m_restriction;
 
@@ -228,13 +225,6 @@ public:
     inline acc_CurrentContext(
         Reference< XCurrentContext > const & xDelegate,
         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
     virtual Any SAL_CALL getValueByName( OUString const & name )
@@ -244,8 +234,7 @@ public:
 inline acc_CurrentContext::acc_CurrentContext(
     Reference< XCurrentContext > const & xDelegate,
     Reference< security::XAccessControlContext > const & xRestriction )
-    : m_refcount( 0 )
-    , m_xDelegate( xDelegate )
+    : m_xDelegate( xDelegate )
 {
     if (xRestriction.is())
     {
@@ -254,24 +243,6 @@ inline acc_CurrentContext::acc_CurrentContext(
     // 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 )
     throw (RuntimeException, std::exception)
 {


More information about the Libreoffice-commits mailing list