diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-08-19 23:29:32 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-08-20 16:40:16 +0200 |
commit | 14eb485c5c62a4f745b24a3798f313623f283e55 (patch) | |
tree | fab271ff05b8bb802a66b714b32171cf6f04099e /sw/inc | |
parent | 1e28d7901dbebf77f75e5770d11a49fef036976c (diff) |
i#107771: sw: implement thread-safe instance caching for SwXReferenceMark
Change-Id: I4f3b6789dde053ca913e12233b20d45dfe50c7ec
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/fmtrfmrk.hxx | 16 | ||||
-rw-r--r-- | sw/inc/unocoll.hxx | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/sw/inc/fmtrfmrk.hxx b/sw/inc/fmtrfmrk.hxx index d8e807d18381..4825699a6fae 100644 --- a/sw/inc/fmtrfmrk.hxx +++ b/sw/inc/fmtrfmrk.hxx @@ -20,10 +20,15 @@ #define INCLUDED_SW_INC_FMTRFMRK_HXX #include <rtl/ustring.hxx> +#include <cppuhelper/weakref.hxx> #include <svl/poolitem.hxx> #include <calbck.hxx> +namespace com { namespace sun { namespace star { + namespace text { class XTextContent; } +} } } + class SwTxtRefMark; // ATT_REFMARK @@ -39,6 +44,8 @@ class SwFmtRefMark SwFmtRefMark& operator=(const SwFmtRefMark& rRefMark); OUString aRefName; + css::uno::WeakReference<css::text::XTextContent> m_wXReferenceMark; + public: SwFmtRefMark( const OUString& rTxt ); SwFmtRefMark( const SwFmtRefMark& rRefMark ); @@ -48,6 +55,10 @@ public: virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE; + // SwClient + virtual void Modify(SfxPoolItem const* pOld, SfxPoolItem const* pNew) + SAL_OVERRIDE; + void InvalidateRefMark(); const SwTxtRefMark *GetTxtRefMark() const { return pTxtAttr; } @@ -55,6 +66,11 @@ public: inline OUString &GetRefName() { return aRefName; } inline const OUString &GetRefName() const { return aRefName; } + + css::uno::WeakReference<css::text::XTextContent> const& GetXRefMark() const + { return m_wXReferenceMark; } + void SetXRefMark(css::uno::Reference<css::text::XTextContent> const& xMark) + { m_wXReferenceMark = xMark; } }; #endif diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx index eb55c8116f84..d5c97bb44d21 100644 --- a/sw/inc/unocoll.hxx +++ b/sw/inc/unocoll.hxx @@ -521,7 +521,6 @@ public: virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - static SwXReferenceMark* GetObject( SwDoc* pDoc, const SwFmtRefMark* pMark ); }; #endif |