diff options
author | Caolán McNamara <cmc@openoffice.org> | 2010-03-10 12:16:18 +0000 |
---|---|---|
committer | Caolán McNamara <cmc@openoffice.org> | 2010-03-10 12:16:18 +0000 |
commit | d534254e52733c1345d12a226a315f14eae44104 (patch) | |
tree | f17140702cc9da547e97459bf935d3f79a044895 /linguistic | |
parent | 8d8c715352d37c28e0e4987a29dbdb3e3db50ac8 (diff) |
cmcfixes73: #i110009# use rtl::StaticWithInit
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/convdiclist.cxx | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index c1280fc799b0..49ab2b485c13 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -397,41 +397,12 @@ void ConvDicNameContainer::AddConvDics( namespace { -template<typename T, typename InitData, - typename Unique = InitData, typename Data = T> -class StaticWithInit_ { -public: - /** Gets the static. Mutual exclusion is performed using the - osl global mutex. - - @return - static variable - */ - static T & get() { - return *rtl_Instance< - T, StaticInstanceWithInit, - ::osl::MutexGuard, ::osl::GetGlobalMutex, - Data, InitData >::create( StaticInstanceWithInit(), - ::osl::GetGlobalMutex(), - InitData() ); - } -private: - struct StaticInstanceWithInit { - T * operator () ( Data d ) { - static T instance(d); - return &instance; + struct StaticConvDicList : public rtl::StaticWithInit< + uno::Reference<XInterface>, StaticConvDicList> { + uno::Reference<XInterface> operator () () { + return (cppu::OWeakObject *) new ConvDicList; } }; -}; - -//after src680m62 you can replace StaticWithInit_ with rtl::StaticWithInit and remove the above definition of StaticWithInit_ - -struct StaticConvDicList : public StaticWithInit_< - uno::Reference<XInterface>, StaticConvDicList> { - uno::Reference<XInterface> operator () () { - return (cppu::OWeakObject *) new ConvDicList; - } -}; } |