[Libreoffice-commits] core.git: include/svl svl/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 17 09:16:11 UTC 2019


 include/svl/inethist.hxx     |    6 ------
 svl/source/misc/inethist.cxx |   17 ++---------------
 2 files changed, 2 insertions(+), 21 deletions(-)

New commits:
commit e9e57a3dbd8b780e0ae3c9015d757719b893f190
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 17 09:14:23 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Dec 17 10:15:03 2019 +0100

    Elide use of rtl_Instance (which is obsoleted by C++11 thread-safe statics)
    
    Change-Id: Ic7b78dffb2f8d1908f3263d88c5912aec2ebce8b
    Reviewed-on: https://gerrit.libreoffice.org/85263
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/svl/inethist.hxx b/include/svl/inethist.hxx
index eef642a2b770..21f7b6e2f940 100644
--- a/include/svl/inethist.hxx
+++ b/include/svl/inethist.hxx
@@ -28,12 +28,6 @@
 class INetURLHistory_Impl;
 class SVL_DLLPUBLIC INetURLHistory final : public SfxBroadcaster
 {
-    struct SAL_DLLPRIVATE StaticInstance
-    {
-        INetURLHistory * operator()();
-    };
-    friend INetURLHistory * StaticInstance::operator()();
-
     /** Representation.
     */
     std::unique_ptr<INetURLHistory_Impl> m_pImpl;
diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx
index 19cae51df5ad..59f54ee80268 100644
--- a/svl/source/misc/inethist.cxx
+++ b/svl/source/misc/inethist.cxx
@@ -22,9 +22,7 @@
 #include <algorithm>
 #include <string.h>
 
-#include <rtl/instance.hxx>
 #include <rtl/crc.h>
-#include <osl/getglobalmutex.hxx>
 #include <tools/debug.hxx>
 #include <tools/urlobj.hxx>
 
@@ -273,15 +271,6 @@ bool INetURLHistory_Impl::queryUrl (const OUString &rUrl) const
     return (k < capacity()) && (m_pHash[k] == h);
 }
 
-/*
- * INetURLHistory::StaticInstance implementation.
- */
-INetURLHistory * INetURLHistory::StaticInstance::operator ()()
-{
-    static INetURLHistory g_aInstance;
-    return &g_aInstance;
-}
-
 INetURLHistory::INetURLHistory() : m_pImpl (new INetURLHistory_Impl())
 {
 }
@@ -295,10 +284,8 @@ INetURLHistory::~INetURLHistory()
  */
 INetURLHistory* INetURLHistory::GetOrCreate()
 {
-    return rtl_Instance<
-        INetURLHistory, StaticInstance,
-        osl::MutexGuard, osl::GetGlobalMutex >::create (
-            StaticInstance(), osl::GetGlobalMutex());
+    static INetURLHistory instance;
+    return &instance;
 }
 
 void INetURLHistory::NormalizeUrl_Impl (INetURLObject &rUrl)


More information about the Libreoffice-commits mailing list