[Libreoffice-commits] core.git: cui/source include/tools

Noel Grandin noel at peralex.com
Thu Jul 10 03:04:12 PDT 2014


 cui/source/dialogs/linkdlg.cxx |    2 +-
 include/tools/ref.hxx          |   21 +++++++--------------
 2 files changed, 8 insertions(+), 15 deletions(-)

New commits:
commit 5a3d129a46a9f749439eeaff473ffb848a9650cf
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jul 10 11:03:27 2014 +0200

    remove SvRefBase::ReleaseReference
    
    because no-one is using the return value of ReleaseRef, but everyone is
    calling ReleaseRef, so make ReleaseRef void-returning and remove
    ReleaseReference
    
    Change-Id: I0bedcb65a887ba7a4953132b4c1ccefbdd554a43

diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 9155325..27abd85 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -60,7 +60,7 @@ public:
         {
             SvBaseLink* p = *it;
             if( p )
-                p->ReleaseReference();
+                p->ReleaseRef();
         }
     }
 
diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx
index 87aed32..a87d099 100644
--- a/include/tools/ref.hxx
+++ b/include/tools/ref.hxx
@@ -37,13 +37,13 @@ public:
 
     SvRef(T * pObjP): pObj(pObjP) { if (pObj != 0) pObj->AddRef(); }
 
-    ~SvRef() { if (pObj != 0) pObj->ReleaseReference(); }
+    ~SvRef() { if (pObj != 0) pObj->ReleaseRef(); }
 
     void Clear() {
         if (pObj != 0) {
             T * pRefObj = pObj;
             pObj = 0;
-            pRefObj->ReleaseReference();
+            pRefObj->ReleaseRef();
         }
     }
 
@@ -54,7 +54,7 @@ public:
         T * pRefObj = pObj;
         pObj = rObj.pObj;
         if (pRefObj != 0) {
-            pRefObj->ReleaseReference();
+            pRefObj->ReleaseRef();
         }
         return *this;
     }
@@ -102,7 +102,7 @@ public:
         {
               T p = *it;
               if( p )
-                  p->ReleaseReference();
+                  p->ReleaseRef();
         }
         base_t::clear();
     }
@@ -126,7 +126,7 @@ public:
         T p = base_t::back();
         base_t::pop_back();
         if( p )
-            p->ReleaseReference();
+            p->ReleaseRef();
         return p;
     }
 };
@@ -159,18 +159,11 @@ public:
                             nRefCount -= SV_NO_DELETE_REFCOUNT;
                         return ++nRefCount;
                     }
-    void            ReleaseReference()
+    void            ReleaseRef()
                     {
                         if( !--nRefCount )
                             QueryDelete();
                     }
-    sal_uIntPtr     ReleaseRef()
-                    {
-                        sal_uIntPtr n = --nRefCount;
-                        if( !n )
-                            QueryDelete();
-                        return n;
-                    }
     sal_uIntPtr     GetRefCount() const { return nRefCount; }
 };
 
@@ -196,7 +189,7 @@ class SvCompatWeakBase
 public:
     SvCompatWeakHdl* GetHdl() { return _xHdl; }
 
-    // does not use Initalizer due to compiler warnings
+    // does not use initalizer due to compiler warnings
     SvCompatWeakBase( void* pObj ) { _xHdl = new SvCompatWeakHdl( pObj ); }
     ~SvCompatWeakBase() { _xHdl->ResetWeakBase(); }
 };


More information about the Libreoffice-commits mailing list