summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--comphelper/source/misc/namedvaluecollection.cxx9
-rw-r--r--cppu/source/threadpool/threadpool.cxx16
-rw-r--r--cppu/source/uno/lbenv.cxx5
-rw-r--r--cppuhelper/source/macro_expander.cxx21
-rw-r--r--dbaccess/source/core/resource/core_resource.cxx7
-rw-r--r--desktop/source/app/app.cxx5
-rw-r--r--desktop/source/app/officeipcthread.cxx9
7 files changed, 15 insertions, 57 deletions
diff --git a/comphelper/source/misc/namedvaluecollection.cxx b/comphelper/source/misc/namedvaluecollection.cxx
index 0bda6c197267..f572f7136f0d 100644
--- a/comphelper/source/misc/namedvaluecollection.cxx
+++ b/comphelper/source/misc/namedvaluecollection.cxx
@@ -204,19 +204,14 @@ namespace comphelper
return false;
}
- namespace
- {
- class theEmptyDefault : public rtl::Static<Any, theEmptyDefault> {};
- }
-
-
const Any& NamedValueCollection::impl_get( const OUString& _rValueName ) const
{
+ static Any theEmptyDefault;
auto pos = maValues.find( _rValueName );
if ( pos != maValues.end() )
return pos->second;
- return theEmptyDefault::get();
+ return theEmptyDefault;
}
diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx
index 86c280b4b352..512ddb095cd2 100644
--- a/cppu/source/threadpool/threadpool.cxx
+++ b/cppu/source/threadpool/threadpool.cxx
@@ -25,7 +25,6 @@
#include <unordered_map>
#include <osl/diagnose.h>
-#include <rtl/instance.hxx>
#include <sal/log.hxx>
#include <uno/threadpool.h>
@@ -43,21 +42,10 @@ namespace cppu_threadpool
rtl::Reference<ORequestThread> const & theThread): thread(theThread)
{}
- namespace {
-
- struct theDisposedCallerAdmin :
- public rtl::StaticWithInit< DisposedCallerAdminHolder, theDisposedCallerAdmin >
- {
- DisposedCallerAdminHolder operator () () {
- return std::make_shared<DisposedCallerAdmin>();
- }
- };
-
- }
-
DisposedCallerAdminHolder const & DisposedCallerAdmin::getInstance()
{
- return theDisposedCallerAdmin::get();
+ static DisposedCallerAdminHolder theDisposedCallerAdmin = std::make_shared<DisposedCallerAdmin>();
+ return theDisposedCallerAdmin;
}
DisposedCallerAdmin::~DisposedCallerAdmin()
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index 03dbc99eafcc..ad61cee0cf67 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -819,11 +819,10 @@ namespace
const OUString& getOIdPart() const { return m_sOidPart; }
};
- class theStaticOIdPart : public rtl::Static<makeOIdPart, theStaticOIdPart> {};
-
const OUString & unoenv_getStaticOIdPart()
{
- return theStaticOIdPart::get().getOIdPart();
+ static makeOIdPart theStaticOIdPart;
+ return theStaticOIdPart.getOIdPart();
}
}
diff --git a/cppuhelper/source/macro_expander.cxx b/cppuhelper/source/macro_expander.cxx
index 85c649dd437c..93f758becc12 100644
--- a/cppuhelper/source/macro_expander.cxx
+++ b/cppuhelper/source/macro_expander.cxx
@@ -69,21 +69,6 @@ OUString expandMacros(OUString const & text) {
namespace
{
-class ImplNames
-{
-private:
- Sequence<OUString> m_aNames;
-public:
- ImplNames() : m_aNames(2)
- {
- m_aNames[0] = SERVICE_NAME_A;
- m_aNames[1] = SERVICE_NAME_B;
- }
- const Sequence<OUString>& getNames() const { return m_aNames; }
-};
-
-class theImplNames : public rtl::Static<ImplNames, theImplNames> {};
-
OUString s_impl_name()
{
return IMPL_NAME;
@@ -91,7 +76,11 @@ OUString s_impl_name()
Sequence< OUString > const & s_get_service_names()
{
- return theImplNames::get().getNames();
+ static const Sequence< OUString > IMPL_NAMES {
+ SERVICE_NAME_A,
+ SERVICE_NAME_B
+ };
+ return IMPL_NAMES;
}
typedef cppu::WeakComponentImplHelper<
diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx
index ecf73939eec2..864280452d92 100644
--- a/dbaccess/source/core/resource/core_resource.cxx
+++ b/dbaccess/source/core/resource/core_resource.cxx
@@ -26,13 +26,6 @@
namespace dbaccess
{
- // ResourceManager
- namespace
- {
- // access safety
- struct theResourceManagerMutex : public rtl::Static< osl::Mutex, theResourceManagerMutex > {};
- }
-
OUString ResourceManager::loadString(TranslateId pResId)
{
return Translate::get(pResId, Translate::Create("dba"));
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ade68fd5efc0..f65f93d63f80 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -383,13 +383,12 @@ void FatalError(const OUString& sMessage)
_exit(EXITHELPER_FATAL_ERROR);
}
-struct theCommandLineArgs : public rtl::Static< CommandLineArgs, theCommandLineArgs > {};
-
}
CommandLineArgs& Desktop::GetCommandLineArgs()
{
- return theCommandLineArgs::get();
+ static CommandLineArgs theCommandLineArgs;
+ return theCommandLineArgs;
}
OUString ReplaceStringHookProc( const OUString& rStr )
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index a0e6b98cc006..61827856f3e9 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -635,15 +635,10 @@ void DbusIpcThread::close() {
#endif
-namespace
-{
- class theRequestHandlerMutex
- : public rtl::Static<osl::Mutex, theRequestHandlerMutex> {};
-}
-
::osl::Mutex& RequestHandler::GetMutex()
{
- return theRequestHandlerMutex::get();
+ static ::osl::Mutex theRequestHandlerMutex;
+ return theRequestHandlerMutex;
}
void RequestHandler::SetDowning()