summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-11-17 23:43:26 +0100
committerMichael Stahl <mstahl@redhat.com>2015-11-17 23:49:50 +0100
commit526bfba0a0ef5cfa213b2c978eed83e43bb3cd9a (patch)
tree5c139ce2e55709351fe540af93ffaf7249fb10ad
parentf324e507acf2875ac12d6ab1c1fca4fe95ba1817 (diff)
vcl, sd: rename some overly generic static variables
Change-Id: I89159df36361f9ceff3401ef379c8230465617b7
-rw-r--r--compilerplugins/clang/badstatics.cxx4
-rw-r--r--sd/source/ui/tools/IconCache.cxx14
-rw-r--r--vcl/source/gdi/impimagetree.cxx4
3 files changed, 11 insertions, 11 deletions
diff --git a/compilerplugins/clang/badstatics.cxx b/compilerplugins/clang/badstatics.cxx
index 3b2881f388d5..394c33e47aed 100644
--- a/compilerplugins/clang/badstatics.cxx
+++ b/compilerplugins/clang/badstatics.cxx
@@ -136,7 +136,7 @@ public:
|| name == "g_pHyphIter" // SwEditShell::HyphEnd()
|| name == "pFieldEditEngine" // ScGlobal::Clear()
|| name == "xDrawClipDocShellRef" // ScGlobal::Clear()
- || name == "instance"
+ || name == "s_ImplImageTree"
// ImplImageTree::get(), ImplImageTree::shutDown()
|| name == "s_pMouseFrame"
// vcl/osx/salframeview.mm, mouseEntered/Exited, not owning
@@ -146,7 +146,7 @@ public:
|| name == "s_pCaptureFrame" // vcl/osx/salframe.cxx, not owning
|| name == "pBlink"
// sw/source/core/text/blink.cxx, _TextFinit()
- || name == "mpInstance"
+ || name == "s_pIconCache"
// sd/source/ui/tools/IconCache.cxx, leaked
) // these variables appear unproblematic
{
diff --git a/sd/source/ui/tools/IconCache.cxx b/sd/source/ui/tools/IconCache.cxx
index 6c46806bd1b5..ecc15e15e1a1 100644
--- a/sd/source/ui/tools/IconCache.cxx
+++ b/sd/source/ui/tools/IconCache.cxx
@@ -37,7 +37,7 @@ private:
IconCache::Instance() is called to the end of the sd module when the
cache is destroyed from SdGlobalResourceContainer.
*/
- static IconCache* mpInstance;
+ static IconCache* s_pIconCache;
typedef std::unordered_map<sal_uInt16,Image> ImageContainer;
ImageContainer maContainer;
@@ -45,7 +45,7 @@ private:
Image GetIcon (sal_uInt16 nResourceId);
};
-IconCache* IconCache::Implementation::mpInstance = nullptr;
+IconCache* IconCache::Implementation::s_pIconCache = nullptr;
Image IconCache::Implementation::GetIcon (sal_uInt16 nResourceId)
{
@@ -67,17 +67,17 @@ Image IconCache::Implementation::GetIcon (sal_uInt16 nResourceId)
//static
IconCache& IconCache::Instance()
{
- if (Implementation::mpInstance == nullptr)
+ if (Implementation::s_pIconCache == nullptr)
{
::osl::GetGlobalMutex aMutexFunctor;
::osl::MutexGuard aGuard (aMutexFunctor());
- if (Implementation::mpInstance == nullptr)
+ if (Implementation::s_pIconCache == nullptr)
{
IconCache* pCache = new IconCache ();
SdGlobalResourceContainer::Instance().AddResource (
::std::unique_ptr<SdGlobalResource>(pCache));
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
- Implementation::mpInstance = pCache;
+ Implementation::s_pIconCache = pCache;
}
}
else
@@ -85,9 +85,9 @@ IconCache& IconCache::Instance()
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
}
- DBG_ASSERT(Implementation::mpInstance!=nullptr,
+ DBG_ASSERT(Implementation::s_pIconCache != nullptr,
"IconCache::Instance(): instance is NULL");
- return *Implementation::mpInstance;
+ return *Implementation::s_pIconCache;
}
Image IconCache::GetIcon (sal_uInt16 nResourceId)
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index 0a8d1a5b1e27..6726673c867d 100644
--- a/vcl/source/gdi/impimagetree.cxx
+++ b/vcl/source/gdi/impimagetree.cxx
@@ -100,8 +100,8 @@ static void loadImageFromStream(std::shared_ptr<SvStream> xStream, OUString cons
}
ImplImageTree & ImplImageTree::get() {
- static ImplImageTree instance;
- return instance;
+ static ImplImageTree s_ImplImageTree;
+ return s_ImplImageTree;
}
ImplImageTree::ImplImageTree()