diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-06-11 21:49:44 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-06-12 11:33:38 +0200 |
commit | 15f431e595d0e0bd24ab185ab552d39a56d55986 (patch) | |
tree | 8fd6ee82a5b1257f476dda340f45e4af56716feb /sw/inc | |
parent | e61770f9749d2ea5003986db2a05d3e1347459fa (diff) |
fdo#65478, i#105557: thread safety of SwXTextField
- implement SwClient on Impl class
- add a WeakReference to SwFmtFld create the SwXTextField from,
instead of racy iteration of SwModify clients
Change-Id: Ia71b4fcbfceaa367a516a8353a4b66123d72305a
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/fmtfld.hxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx index 1ea8ccad663b..f18d31a7fd53 100644 --- a/sw/inc/fmtfld.hxx +++ b/sw/inc/fmtfld.hxx @@ -16,10 +16,15 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef _FMTFLD_HXX -#define _FMTFLD_HXX + +#ifndef SW_FMTFLD_HXX +#define SW_FMTFLD_HXX #include <list> + +#include <com/sun/star/text/XTextField.hpp> + +#include <cppuhelper/weakref.hxx> #include <svl/poolitem.hxx> #include <svl/brdcst.hxx> #include <svl/smplhint.hxx> @@ -38,6 +43,9 @@ class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBro friend class SwTxtFld; friend void _InitCore(); + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextField> m_wXTextField; + SwField *pField; SwTxtFld* pTxtAttr; @@ -86,6 +94,13 @@ public: void RegisterToFieldType( SwFieldType& ); sal_Bool IsFldInDoc() const; sal_Bool IsProtect() const; + + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextField> const& GetXTextField() const + { return m_wXTextField; } + SW_DLLPRIVATE void SetXTextField(::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextField> const& xTextField) + { m_wXTextField = xTextField; } }; class SW_DLLPUBLIC SwFmtFldHint : public SfxHint |