summaryrefslogtreecommitdiff
path: root/idl/source/prj/globals.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-07-06 23:10:38 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-07-07 07:48:12 +0200
commite294fa9283071cb2816b6d8c759ed76ee552410e (patch)
tree10fc4d353de9409d769e74675536b8be4acf7c03 /idl/source/prj/globals.cxx
parentaf1be90e528ceeca70ee8f266fc6f6d8682b2c0d (diff)
Replace GetAppData(SHL_IDL) with an rtl::Static
Change-Id: Ia7a75c4686734aa811006858343666d2edfde8a1
Diffstat (limited to 'idl/source/prj/globals.cxx')
-rw-r--r--idl/source/prj/globals.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx
index 38b2d167edb4..b36b84511cdf 100644
--- a/idl/source/prj/globals.cxx
+++ b/idl/source/prj/globals.cxx
@@ -17,19 +17,20 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
-#include <tools/shl.hxx>
+#include <sal/config.h>
#include <globals.hxx>
#include <database.hxx>
-IdlDll * GetIdlApp()
+namespace {
+
+struct TheIdlDll: public rtl::Static<IdlDll, TheIdlDll> {};
+
+}
+
+IdlDll & GetIdlApp()
{
- if( !(*reinterpret_cast<IdlDll**>(GetAppData(SHL_IDL))) )
- {
- (*reinterpret_cast<IdlDll**>(GetAppData(SHL_IDL))) = new IdlDll();
- }
- return (*reinterpret_cast<IdlDll**>(GetAppData(SHL_IDL)));
+ return TheIdlDll::get();
}
IdlDll::IdlDll()
@@ -47,8 +48,8 @@ IdlDll::~IdlDll()
inline SvStringHashEntry * INS( const OString& rName )
{
sal_uInt32 nIdx;
- IDLAPP->pHashTable->Insert( rName, &nIdx );
- return IDLAPP->pHashTable->Get( nIdx );
+ GetIdlApp().pHashTable->Insert( rName, &nIdx );
+ return GetIdlApp().pHashTable->Get( nIdx );
}
#define A_ENTRY( Name ) , MM_##Name( INS( #Name ) )