diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-10-12 07:45:01 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-12 06:52:56 +0000 |
commit | ccc5ea08d64c38a9ce925d448c3010aca19ed35c (patch) | |
tree | e50c45ee596185f9a030641465796394c71ad410 /basic | |
parent | 898aff0d190b09d16cce866909b64cf023cba43f (diff) |
cppcheck:variableScope
Change-Id: I037feb335499629300309851dcda3bb661f03d4f
Reviewed-on: https://gerrit.libreoffice.org/19316
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/uno/namecont.cxx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 9c2d29d85b67..a9e2c0e454f5 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -3225,22 +3225,20 @@ Sequence< Type > SfxLibrary::getTypes() throw( RuntimeException, std::exception ) { static OTypeCollection * s_pTypes_NameContainer = 0; + if( !s_pTypes_NameContainer ) { + MutexGuard aGuard( Mutex::getGlobalMutex() ); if( !s_pTypes_NameContainer ) { - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if( !s_pTypes_NameContainer ) - { - static OTypeCollection s_aTypes_NameContainer( - cppu::UnoType<XNameContainer>::get(), - cppu::UnoType<XContainer>::get(), - cppu::UnoType<XChangesNotifier>::get(), - OComponentHelper::getTypes() ); - s_pTypes_NameContainer = &s_aTypes_NameContainer; - } + static OTypeCollection s_aTypes_NameContainer( + cppu::UnoType<XNameContainer>::get(), + cppu::UnoType<XContainer>::get(), + cppu::UnoType<XChangesNotifier>::get(), + OComponentHelper::getTypes() ); + s_pTypes_NameContainer = &s_aTypes_NameContainer; } - return s_pTypes_NameContainer->getTypes(); } + return s_pTypes_NameContainer->getTypes(); } |