diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-06-16 15:24:29 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-06-16 15:26:54 +0200 |
commit | ed8a2341b9631ad312ff40d23331c66d537aad20 (patch) | |
tree | d0958ffee6239ce97cb52c5a53ed1d63b82161a8 /svl | |
parent | f04c48a7e764775bdd98715e5d17845f1786bd44 (diff) |
properly prefix various global variables and hide them
Change-Id: I6b97e6a4c6ac4c0e26bcbb2b132b333920c16f19
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/config/cjkoptions.cxx | 13 | ||||
-rw-r--r-- | svl/source/config/ctloptions.cxx | 14 |
2 files changed, 17 insertions, 10 deletions
diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx index 3eba25b826d3..e0b1b9e0dafb 100644 --- a/svl/source/config/cjkoptions.cxx +++ b/svl/source/config/cjkoptions.cxx @@ -376,20 +376,23 @@ bool SvtCJKOptions_Impl::IsReadOnly(SvtCJKOptions::EOption eOption) const return bReadOnly; } -// global -std::weak_ptr<SvtCJKOptions_Impl> pCJKOptions; +namespace { -namespace { struct theCJKOptionsMutex : public rtl::Static< ::osl::Mutex , theCJKOptionsMutex >{}; } + // global + std::weak_ptr<SvtCJKOptions_Impl> g_pCJKOptions; + + struct theCJKOptionsMutex : public rtl::Static< ::osl::Mutex , theCJKOptionsMutex >{}; +} SvtCJKOptions::SvtCJKOptions(bool bDontLoad) { // Global access, must be guarded (multithreading) ::osl::MutexGuard aGuard( theCJKOptionsMutex::get() ); - pImpl = pCJKOptions.lock(); + pImpl = g_pCJKOptions.lock(); if ( !pImpl ) { pImpl = std::make_shared<SvtCJKOptions_Impl>(); - pCJKOptions = pImpl; + g_pCJKOptions = pImpl; ItemHolder2::holdConfigItem(E_CJKOPTIONS); } diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx index ef2a6106bfc2..245c385846f9 100644 --- a/svl/source/config/ctloptions.cxx +++ b/svl/source/config/ctloptions.cxx @@ -372,21 +372,25 @@ void SvtCTLOptions_Impl::SetCTLTextNumerals( SvtCTLOptions::TextNumerals _eNumer NotifyListeners(0); } } -// global -std::weak_ptr<SvtCTLOptions_Impl> pCTLOptions; -namespace { struct CTLMutex : public rtl::Static< osl::Mutex, CTLMutex > {}; } +namespace { + + // global + std::weak_ptr<SvtCTLOptions_Impl> g_pCTLOptions; + + struct CTLMutex : public rtl::Static< osl::Mutex, CTLMutex > {}; +} SvtCTLOptions::SvtCTLOptions( bool bDontLoad ) { // Global access, must be guarded (multithreading) ::osl::MutexGuard aGuard( CTLMutex::get() ); - m_pImpl = pCTLOptions.lock(); + m_pImpl = g_pCTLOptions.lock(); if ( !m_pImpl ) { m_pImpl = std::make_shared<SvtCTLOptions_Impl>(); - pCTLOptions = m_pImpl; + g_pCTLOptions = m_pImpl; ItemHolder2::holdConfigItem(E_CTLOPTIONS); } |