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 /svtools | |
parent | f04c48a7e764775bdd98715e5d17845f1786bd44 (diff) |
properly prefix various global variables and hide them
Change-Id: I6b97e6a4c6ac4c0e26bcbb2b132b333920c16f19
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/config/menuoptions.cxx | 10 | ||||
-rw-r--r-- | svtools/source/config/miscopt.cxx | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx index be735a618ec2..c0fcaefb0491 100644 --- a/svtools/source/config/menuoptions.cxx +++ b/svtools/source/config/menuoptions.cxx @@ -315,18 +315,22 @@ Sequence< OUString > SvtMenuOptions_Impl::impl_GetPropertyNames() return seqPropertyNames; } -std::weak_ptr<SvtMenuOptions_Impl> m_pMenuOptions; +namespace { + +std::weak_ptr<SvtMenuOptions_Impl> g_pMenuOptions; + +} SvtMenuOptions::SvtMenuOptions() { // Global access, must be guarded (multithreading!). MutexGuard aGuard( GetOwnStaticMutex() ); - m_pImpl = m_pMenuOptions.lock(); + m_pImpl = g_pMenuOptions.lock(); if( !m_pImpl ) { m_pImpl = std::make_shared<SvtMenuOptions_Impl>(); - m_pMenuOptions = m_pImpl; + g_pMenuOptions = m_pImpl; svtools::ItemHolder2::holdConfigItem(E_MENUOPTIONS); } } diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index e0ecfd82f1b4..2d30403096a3 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -643,18 +643,22 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames() return seqPropertyNames; } -std::weak_ptr<SvtMiscOptions_Impl> m_pMiscOptions; +namespace { + +std::weak_ptr<SvtMiscOptions_Impl> g_pMiscOptions; + +} SvtMiscOptions::SvtMiscOptions() { // Global access, must be guarded (multithreading!). MutexGuard aGuard( GetInitMutex() ); - m_pImpl = m_pMiscOptions.lock(); + m_pImpl = g_pMiscOptions.lock(); if( !m_pImpl ) { m_pImpl = std::make_shared<SvtMiscOptions_Impl>(); - m_pMiscOptions = m_pImpl; + g_pMiscOptions = m_pImpl; svtools::ItemHolder2::holdConfigItem(E_MISCOPTIONS); } } |