From a1f836e40d30fa39478e31ed8bc7bd947d4803c9 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 15 Jun 2016 20:26:14 +0200 Subject: tdf#89329: use shared_ptr for pImpl in dynamicmenuoptions Change-Id: I66bdeeee7f70e6ca16a39e8804aaf8a5f0d08205 Reviewed-on: https://gerrit.libreoffice.org/26327 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/unotools/dynamicmenuoptions.hxx | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'include/unotools') diff --git a/include/unotools/dynamicmenuoptions.hxx b/include/unotools/dynamicmenuoptions.hxx index e56d27ac9c38..d78c894c50f7 100644 --- a/include/unotools/dynamicmenuoptions.hxx +++ b/include/unotools/dynamicmenuoptions.hxx @@ -25,6 +25,7 @@ #include #include #include +#include /*-************************************************************************************************************ @descr The method GetList() returns a list of property values. @@ -63,17 +64,6 @@ class SvtDynamicMenuOptions_Impl; class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtDynamicMenuOptions : public utl::detail::Options { public: - /*-**************************************************************************************************** - @short standard constructor and destructor - @descr This will initialize an instance with default values. - We implement these class with a refcount mechanism! Every instance of this class increase it - at create and decrease it at delete time - but all instances use the same data container! - He is implemented as a static member ... - - @seealso member m_nRefCount - @seealso member m_pDataContainer - *//*-*****************************************************************************************************/ - SvtDynamicMenuOptions(); virtual ~SvtDynamicMenuOptions(); @@ -101,17 +91,7 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtDynamicMenuOptions : public utl::det UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex(); private: - - /*Attention - - Don't initialize these static members in these headers! - a) Double defined symbols will be detected ... - b) and unresolved externals exist at linking time. - Do it in your source only. - */ - - static SvtDynamicMenuOptions_Impl* m_pDataContainer; - static sal_Int32 m_nRefCount; + std::shared_ptr m_pImpl; }; // class SvtDynamicMenuOptions -- cgit