From f698ddfeffda7391965b7bb8b488420332ac37bf Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 15 Jun 2016 20:41:11 +0200 Subject: tdf#89329: use shared_ptr for pImpl in miscopt Change-Id: I7c60116d4f14e1451e7b96568104baada01dfaca Reviewed-on: https://gerrit.libreoffice.org/26330 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svtools/miscopt.hxx | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx index 31b745fb92f3..80835a9058e7 100644 --- a/include/svtools/miscopt.hxx +++ b/include/svtools/miscopt.hxx @@ -25,6 +25,7 @@ #include #include #include +#include /*-************************************************************************************************************ @short forward declaration to our private date container implementation @@ -45,17 +46,6 @@ class SvtMiscOptions_Impl; class SVT_DLLPUBLIC SvtMiscOptions: 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 - *//*-*****************************************************************************************************/ - SvtMiscOptions(); virtual ~SvtMiscOptions(); @@ -108,17 +98,7 @@ class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex(); 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 SvtMiscOptions_Impl* m_pDataContainer ; - static sal_Int32 m_nRefCount ; + std::shared_ptr m_pImpl; }; // class SvtMiscOptions -- cgit