[Libreoffice-commits] core.git: 2 commits - connectivity/source include/comphelper mysqlc/source odk/examples vcl/source

Stephan Bergmann sbergman at redhat.com
Tue Sep 20 05:56:39 UTC 2016


 connectivity/source/drivers/firebird/SubComponent.hxx                  |   25 +++++-----
 include/comphelper/proparrhlp.hxx                                      |   25 +++++-----
 mysqlc/source/mysqlc_subcomponent.hxx                                  |   24 +++++----
 odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx |   24 +++++----
 vcl/source/window/taskpanelist.cxx                                     |    5 +-
 5 files changed, 57 insertions(+), 46 deletions(-)

New commits:
commit d5f1e7c5adac5f38379c56b536640f3aaf9ec7d5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Sep 19 21:30:51 2016 +0200

    Obsolete workaround for SUNPRO 5 compiler
    
    Change-Id: Ib51f08e1d0e0dff066b06ecd85976b777d722a33

diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index 21b94d2..b5d1738 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -28,7 +28,8 @@
 #include <functional>
 #include <algorithm>
 
-// can't have static linkage because SUNPRO 5.2 complains
+namespace {
+
 Point ImplTaskPaneListGetPos( const vcl::Window *w )
 {
     Point pos;
@@ -47,6 +48,8 @@ Point ImplTaskPaneListGetPos( const vcl::Window *w )
     return pos;
 }
 
+}
+
 // compares window pos left-to-right
 struct LTRSort : public ::std::binary_function< const vcl::Window*, const vcl::Window*, bool >
 {
commit 07339d03afe742c53c22cb4ff5f73fe3132cff54
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Sep 19 21:18:23 2016 +0200

    Remove obsolete workaround for SUNPRO 5 compiler
    
    ...copy/pasted into three more places
    
    Change-Id: I6661244d0248af509cd867fc3e8c451551068a78

diff --git a/connectivity/source/drivers/firebird/SubComponent.hxx b/connectivity/source/drivers/firebird/SubComponent.hxx
index 7a86cf1..5c87097 100644
--- a/connectivity/source/drivers/firebird/SubComponent.hxx
+++ b/connectivity/source/drivers/firebird/SubComponent.hxx
@@ -68,17 +68,7 @@ namespace connectivity
 
         public:
             OPropertyArrayUsageHelper();
-            virtual ~OPropertyArrayUsageHelper()
-            {   // ARGHHHHHHH ..... would like to implement this in proparrhlp_impl.hxx (as we do with all other methods)
-                // but SUNPRO 5 compiler (linker) doesn't like this
-                ::osl::MutexGuard aGuard(s_aMutex);
-                OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
-                if (!--s_nRefCount)
-                {
-                    delete s_pProps;
-                    s_pProps = nullptr;
-                }
-            }
+            virtual ~OPropertyArrayUsageHelper();
 
             /** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
                 class, which is created if necessary.
@@ -117,6 +107,19 @@ namespace connectivity
 
 
         template <class TYPE>
+        OPropertyArrayUsageHelper<TYPE>::~OPropertyArrayUsageHelper()
+        {
+            ::osl::MutexGuard aGuard(s_aMutex);
+            OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
+            if (!--s_nRefCount)
+            {
+                delete s_pProps;
+                s_pProps = nullptr;
+            }
+        }
+
+
+        template <class TYPE>
         ::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper<TYPE>::getArrayHelper()
         {
             OSL_ENSURE(s_nRefCount, "OPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");
diff --git a/include/comphelper/proparrhlp.hxx b/include/comphelper/proparrhlp.hxx
index 0f8fe7e..507c51b 100644
--- a/include/comphelper/proparrhlp.hxx
+++ b/include/comphelper/proparrhlp.hxx
@@ -45,18 +45,7 @@ protected:
 
 public:
     OPropertyArrayUsageHelper();
-    virtual ~OPropertyArrayUsageHelper()
-    {   // ARGHHHHHHH ..... would like to implement this after the class
-        // definition (as we do with all other methods) but SUNPRO 5 compiler
-        // (linker) doesn't like this
-        ::osl::MutexGuard aGuard(OPropertyArrayUsageHelperMutex<TYPE>::get());
-        OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
-        if (!--s_nRefCount)
-        {
-            delete s_pProps;
-            s_pProps = nullptr;
-        }
-    }
+    virtual ~OPropertyArrayUsageHelper();
 
     /** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
         class, which is created if necessary.
@@ -125,6 +114,18 @@ OPropertyArrayUsageHelper<TYPE>::OPropertyArrayUsageHelper()
 }
 
 template <class TYPE>
+OPropertyArrayUsageHelper<TYPE>::~OPropertyArrayUsageHelper()
+{
+    ::osl::MutexGuard aGuard(OPropertyArrayUsageHelperMutex<TYPE>::get());
+    OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
+    if (!--s_nRefCount)
+    {
+        delete s_pProps;
+        s_pProps = nullptr;
+    }
+}
+
+template <class TYPE>
 ::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper<TYPE>::getArrayHelper()
 {
     OSL_ENSURE(s_nRefCount, "OPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");
diff --git a/mysqlc/source/mysqlc_subcomponent.hxx b/mysqlc/source/mysqlc_subcomponent.hxx
index 384eeee..4041439 100644
--- a/mysqlc/source/mysqlc_subcomponent.hxx
+++ b/mysqlc/source/mysqlc_subcomponent.hxx
@@ -100,17 +100,7 @@ namespace connectivity
 
         public:
             OPropertyArrayUsageHelper();
-            virtual ~OPropertyArrayUsageHelper()
-            {   // ARGHHHHHHH ..... would like to implement this in proparrhlp_impl.hxx (as we do with all other methods)
-                // but SUNPRO 5 compiler (linker) doesn't like this
-                ::osl::MutexGuard aGuard(s_aMutex);
-                OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
-                if (!--s_nRefCount)
-                {
-                    delete s_pProps;
-                    s_pProps = nullptr;
-                }
-            }
+            virtual ~OPropertyArrayUsageHelper();
 
             /** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
                 class, which is created if necessary.
@@ -147,6 +137,18 @@ namespace connectivity
         }
 
         template <class TYPE>
+        OPropertyArrayUsageHelper<TYPE>::~OPropertyArrayUsageHelper()
+        {
+            ::osl::MutexGuard aGuard(s_aMutex);
+            OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
+            if (!--s_nRefCount)
+            {
+                delete s_pProps;
+                s_pProps = nullptr;
+            }
+        }
+
+        template <class TYPE>
         ::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper<TYPE>::getArrayHelper()
         {
             OSL_ENSURE(s_nRefCount, "OPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx
index 3aa08f1..3d50a87 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx
@@ -117,17 +117,7 @@ namespace connectivity
 
         public:
             OPropertyArrayUsageHelper();
-            virtual ~OPropertyArrayUsageHelper()
-            {   // ARGHHHHHHH ..... would like to implement this in proparrhlp_impl.hxx (as we do with all other methods)
-                // but SUNPRO 5 compiler (linker) doesn't like this
-                ::osl::MutexGuard aGuard(s_aMutex);
-                OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
-                if (!--s_nRefCount)
-                {
-                    delete s_pProps;
-                    s_pProps = NULL;
-                }
-            }
+            virtual ~OPropertyArrayUsageHelper();
 
             /** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
                 class, which is created if necessary.
@@ -164,6 +154,18 @@ namespace connectivity
         }
 
         template <class TYPE>
+        OPropertyArrayUsageHelper<TYPE>::~OPropertyArrayUsageHelper()
+        {
+            ::osl::MutexGuard aGuard(s_aMutex);
+            OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
+            if (!--s_nRefCount)
+            {
+                delete s_pProps;
+                s_pProps = NULL;
+            }
+        }
+
+        template <class TYPE>
         ::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper<TYPE>::getArrayHelper()
         {
             OSL_ENSURE(s_nRefCount, "OPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");


More information about the Libreoffice-commits mailing list