summaryrefslogtreecommitdiff
path: root/sw/inc/fldbas.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-06-11 16:40:54 +0200
committerMichael Stahl <mstahl@redhat.com>2013-06-12 11:33:37 +0200
commitb2d084811c259a136c302b52c43665037f389e6e (patch)
treeef867e244ee026d625d544e04065dfefb623fb88 /sw/inc/fldbas.hxx
parentad3105a2933aff80b8fd471d32c0846440a508c5 (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.hxx12
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.