Kaydet (Commit) c9a34393 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

use UnoCursorPointer in SwXTextPortion

Change-Id: I8628fd1fecb3e2cf54704f9844ff921862da46e5
üst 50924ebf
......@@ -114,7 +114,7 @@ private:
::std::unique_ptr< ::com::sun::star::uno::Any > m_pRubyStyle;
::std::unique_ptr< ::com::sun::star::uno::Any > m_pRubyAdjust;
::std::unique_ptr< ::com::sun::star::uno::Any > m_pRubyIsAbove;
std::shared_ptr<SwUnoCrsr> m_pUnoCursor;
sw::UnoCursorPointer m_pUnoCursor;
const SwDepend m_FrameDepend;
SwFrameFormat * m_pFrameFormat;
......@@ -151,8 +151,6 @@ protected:
//SwClient
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
virtual void SwClientNotify(const SwModify& rModify, const SfxHint& rHint) SAL_OVERRIDE;
public:
SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwTextPortionType eType );
......@@ -242,7 +240,7 @@ public:
SwTextPortionType GetTextPortionType() const { return m_ePortionType; }
SwUnoCrsr* GetCursor() const
{return static_cast<SwUnoCrsr*>(const_cast<SwModify*>(GetRegisteredIn()));}
{ return const_cast<SwUnoCrsr*>(&(*m_pUnoCursor)); }
};
class SwXTextPortionEnumeration
......
......@@ -69,7 +69,6 @@ void SwXTextPortion::init(const SwUnoCrsr* pPortionCursor)
m_pUnoCursor->SetMark();
*m_pUnoCursor->GetMark() = *pPortionCursor->GetMark();
}
m_pUnoCursor->Add(this);
}
SwXTextPortion::SwXTextPortion(
......@@ -138,10 +137,7 @@ SwXTextPortion::SwXTextPortion(
}
SwXTextPortion::~SwXTextPortion()
{
if(m_pUnoCursor)
m_pUnoCursor->Remove(this);
};
{ }
uno::Reference< text::XText > SwXTextPortion::getText()
throw( uno::RuntimeException, std::exception )
......@@ -922,17 +918,7 @@ void SwXTextPortion::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
ClientModify(this, pOld, pNew);
if (!m_FrameDepend.GetRegisteredIn())
{
m_pFrameFormat = 0;
}
}
void SwXTextPortion::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
{
SwClient::SwClientNotify(rModify, rHint);
if(m_pUnoCursor && typeid(rHint) == typeid(sw::DocDisposingHint))
{
m_pUnoCursor->Remove(this);
m_pUnoCursor.reset();
m_pFrameFormat = nullptr;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment