diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-06-15 19:57:51 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-16 06:43:44 +0000 |
commit | 11c2acfa5a837b7d1fff31e20a87eddbba08f742 (patch) | |
tree | 95d6e97b849a144cf66a4813edba261e6e51ce7f /include/unotools | |
parent | 2400c271748f85355b689391d3aec405fcf3bff7 (diff) |
tdf#89329: use shared_ptr for pImpl in printwarningoptions
Change-Id: I0b202ae78d2afe5fad4aa4bb4a3323f2672b1b93
Reviewed-on: https://gerrit.libreoffice.org/26321
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/unotools')
-rw-r--r-- | include/unotools/printwarningoptions.hxx | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/include/unotools/printwarningoptions.hxx b/include/unotools/printwarningoptions.hxx index 7c425539a6c2..b0f8ef9f2a63 100644 --- a/include/unotools/printwarningoptions.hxx +++ b/include/unotools/printwarningoptions.hxx @@ -25,6 +25,7 @@ #include <osl/mutex.hxx> #include <rtl/ustring.hxx> #include <unotools/options.hxx> +#include <memory> /*-************************************************************************************************************ @short forward declaration to our private date container implementation @@ -43,17 +44,6 @@ class SvtPrintWarningOptions_Impl; class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtPrintWarningOptions : 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 - *//*-*****************************************************************************************************/ - SvtPrintWarningOptions(); virtual ~SvtPrintWarningOptions(); @@ -86,17 +76,7 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtPrintWarningOptions : public utl::de 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 SvtPrintWarningOptions_Impl* m_pDataContainer; - static sal_Int32 m_nRefCount; + std::shared_ptr<SvtPrintWarningOptions_Impl> m_pImpl; }; // class SvtPrintWarningOptions |