incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r1182524 - in /incubator/ooo/trunk/main/unotools: inc/unotools/configmgr.hxx source/config/configmgr.cxx
Date Wed, 12 Oct 2011 18:56:07 GMT
Author: pfg
Date: Wed Oct 12 18:56:07 2011
New Revision: 1182524

URL: http://svn.apache.org/viewvc?rev=1182524&view=rev
Log:
i112786 - unotools: make ConfigManager a well-behaved singleton: short version

Modified:
    incubator/ooo/trunk/main/unotools/inc/unotools/configmgr.hxx
    incubator/ooo/trunk/main/unotools/source/config/configmgr.cxx

Modified: incubator/ooo/trunk/main/unotools/inc/unotools/configmgr.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/unotools/inc/unotools/configmgr.hxx?rev=1182524&r1=1182523&r2=1182524&view=diff
==============================================================================
--- incubator/ooo/trunk/main/unotools/inc/unotools/configmgr.hxx (original)
+++ incubator/ooo/trunk/main/unotools/inc/unotools/configmgr.hxx Wed Oct 12 18:56:07 2011
@@ -54,7 +54,6 @@ namespace utl
                                 xConfigurationProvider;
             ConfigMgr_Impl*     pMgrImpl;
 
-            static  ConfigManager*  pConfigManager;
             static void getBasisAboutBoxProductVersion( rtl::OUString& rVersion );
 
         public:
@@ -81,7 +80,6 @@ namespace utl
             void StoreConfigItems();
 
             static ConfigManager*           GetConfigManager();
-            static void                     RemoveConfigManager();
             static rtl::OUString            GetConfigBaseURL();
 
             enum ConfigProperty

Modified: incubator/ooo/trunk/main/unotools/source/config/configmgr.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/unotools/source/config/configmgr.cxx?rev=1182524&r1=1182523&r2=1182524&view=diff
==============================================================================
--- incubator/ooo/trunk/main/unotools/source/config/configmgr.cxx (original)
+++ incubator/ooo/trunk/main/unotools/source/config/configmgr.cxx Wed Oct 12 18:56:07 2011
@@ -352,28 +352,14 @@ void ConfigManager::StoreConfigItems()
 		}
 	}
 }
-ConfigManager*	 ConfigManager::pConfigManager = 0;
 /* -----------------------------07.09.00 11:06--------------------------------
 
  ---------------------------------------------------------------------------*/
-ConfigManager*	ConfigManager::GetConfigManager()
-{
-	if(!pConfigManager)
-	{
-		pConfigManager = new ConfigManager();
-	}
-	return pConfigManager;
-}
-/* -----------------------------07.09.00 11:06--------------------------------
+struct theConfigManager : public rtl::Static<ConfigManager, theConfigManager> {};
 
- ---------------------------------------------------------------------------*/
-void	ConfigManager::RemoveConfigManager()
+ConfigManager* ConfigManager::GetConfigManager()
 {
-	if(pConfigManager)
-	{
-		delete pConfigManager;
-		pConfigManager = 0;
-	}
+    return &theConfigManager::get();
 }
 /* -----------------------------08.09.00 13:22--------------------------------
 



Mime
View raw message