diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-06-11 16:40:54 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-06-12 11:33:37 +0200 |
commit | b2d084811c259a136c302b52c43665037f389e6e (patch) | |
tree | ef867e244ee026d625d544e04065dfefb623fb88 /sw/inc/fldbas.hxx | |
parent | ad3105a2933aff80b8fd471d32c0846440a508c5 (diff) |
i#105557: thread safety of SwXFieldMaster
- implement SwClient on Impl class
- add a WeakReference to SwFieldType create the SwXFieldMaster from,
instead of racy iteration of SwModify clients
Change-Id: I2d1344b95dd00a7ea4d89f0184fff657d092d61c
Diffstat (limited to 'sw/inc/fldbas.hxx')
-rw-r--r-- | sw/inc/fldbas.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index 2c934321be8d..06e3f80976d7 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -23,7 +23,9 @@ #include <tools/string.hxx> #include "swdllapi.h" #include <calbck.hxx> +#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/uno/Any.hxx> +#include <cppuhelper/weakref.hxx> #include <vector> class SwDoc; @@ -229,6 +231,9 @@ String FormatNumber(sal_uInt32 nNum, sal_uInt32 nFormat); class SW_DLLPUBLIC SwFieldType : public SwModify { + ::com::sun::star::uno::WeakReference< + ::com::sun::star::beans::XPropertySet> m_wXFieldMaster; + sal_uInt16 nWhich; friend void _FinitUI(); ///< In order to delete pointer! @@ -242,6 +247,13 @@ protected: public: + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::beans::XPropertySet> const& GetXObject() const + { return m_wXFieldMaster; } + SW_DLLPRIVATE void SetXObject(::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet> const& xFieldMaster) + { m_wXFieldMaster = xFieldMaster; } + static const String& GetTypeStr( sal_uInt16 nTypeId ); /// Only in derived classes. |