diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-06-06 03:38:49 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-06-09 12:55:06 +0200 |
commit | a755edf0fba671d53659a4c5f03f549506edd65c (patch) | |
tree | 42c65e02baf721a1d3d4015d616b74913047c64b /sw/source/core/unocore/unoportenum.cxx | |
parent | c9a343935f6c480dcaf0145c2f27db08b4ae01a5 (diff) |
use new UnoCursorPointer in SwXTextPortionEnumeration
Change-Id: If6b64c92d4f6f786767802cc046ccd96bd8367cb
Diffstat (limited to 'sw/source/core/unocore/unoportenum.cxx')
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index d3cf0bb0f535..d95fd8bb4ea3 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -364,7 +364,6 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration( : m_Portions() { m_pUnoCrsr = rParaCrsr.GetDoc()->CreateUnoCrsr(*rParaCrsr.GetPoint(), false); - m_pUnoCrsr->Add(this); OSL_ENSURE(nEnd == -1 || (nStart <= nEnd && nEnd <= m_pUnoCrsr->Start()->nNode.GetNode().GetTextNode()->GetText().getLength()), @@ -373,7 +372,7 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration( // find all frames, graphics and OLEs that are bound AT character in para FrameClientSortList_t frames; ::CollectFrameAtNode(m_pUnoCrsr->GetPoint()->nNode, frames, true); - lcl_CreatePortions(m_Portions, xParentText, m_pUnoCrsr.get(), frames, nStart, nEnd); + lcl_CreatePortions(m_Portions, xParentText, GetCursor(), frames, nStart, nEnd); } SwXTextPortionEnumeration::SwXTextPortionEnumeration( @@ -382,14 +381,10 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration( : m_Portions( rPortions ) { m_pUnoCrsr = rParaCrsr.GetDoc()->CreateUnoCrsr(*rParaCrsr.GetPoint(), false); - m_pUnoCrsr->Add(this); } SwXTextPortionEnumeration::~SwXTextPortionEnumeration() -{ - if(m_pUnoCrsr) - m_pUnoCrsr->Remove(this); -} +{ } sal_Bool SwXTextPortionEnumeration::hasMoreElements() throw( uno::RuntimeException, std::exception ) @@ -1401,19 +1396,4 @@ static void lcl_CreatePortions( "CreatePortions: stack error" ); } -void SwXTextPortionEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) -{ - ClientModify(this, pOld, pNew); -} - -void SwXTextPortionEnumeration::SwClientNotify(const SwModify& rModify, const SfxHint& rHint) -{ - SwClient::SwClientNotify(rModify, rHint); - if(!GetRegisteredIn() || typeid(rHint) == typeid(sw::DocDisposingHint)) - { - m_pUnoCrsr->Remove(this); - m_pUnoCrsr.reset(); - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |