diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-06-03 00:36:14 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-06-09 12:54:59 +0200 |
commit | a2c467a58ade9f55e0154b2935c747bb283ebd45 (patch) | |
tree | 7f5d684130fc09498c87196d8dc85714574be586 /sw/inc/unocrsr.hxx | |
parent | 683bac5b9661367bce9a8b0ccd81046183ed9c9d (diff) |
use UnoCursorPointer in SwNavigationMgr
Change-Id: I7c7431edd79cf4527f97c7dc0695d49174b61e2c
Diffstat (limited to 'sw/inc/unocrsr.hxx')
-rw-r--r-- | sw/inc/unocrsr.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx index 6952506e7765..323607395151 100644 --- a/sw/inc/unocrsr.hxx +++ b/sw/inc/unocrsr.hxx @@ -115,6 +115,13 @@ namespace sw { m_pCursor->Add(this); } + UnoCursorPointer(const UnoCursorPointer& pOther) + : SwClient(nullptr) + , m_pCursor(pOther.m_pCursor) + { + if(m_pCursor) + m_pCursor->Add(this); + } virtual ~UnoCursorPointer() SAL_OVERRIDE { if(m_pCursor) @@ -132,6 +139,13 @@ namespace sw { return *m_pCursor.get(); } SwUnoCrsr* operator->() const { return m_pCursor.get(); } + UnoCursorPointer& operator=(UnoCursorPointer aOther) + { + if(aOther.m_pCursor) + aOther.m_pCursor->Add(this); + m_pCursor = aOther.m_pCursor; + return *this; + } explicit operator bool() const { return static_cast<bool>(m_pCursor); } void reset(std::shared_ptr<SwUnoCrsr> pNew) |