diff options
-rw-r--r-- | sw/inc/hintids.hxx | 1 | ||||
-rw-r--r-- | sw/inc/unocrsr.hxx | 22 | ||||
-rw-r--r-- | sw/source/core/doc/doccorr.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unocrsr.cxx | 2 |
5 files changed, 16 insertions, 15 deletions
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index fe940046277d..6b628d6d4300 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -332,7 +332,6 @@ RES_MSG_BEGIN = RES_FMT_END, RES_NAME_CHANGED, RES_TITLE_CHANGED, RES_DESCRIPTION_CHANGED, - RES_UNOCURSOR_LEAVES_SECTION, RES_LINKED_GRAPHIC_STREAM_ARRIVED, RES_MSG_END }; diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx index e6cbee0e622f..eeb1b4a4ef2a 100644 --- a/sw/inc/unocrsr.hxx +++ b/sw/inc/unocrsr.hxx @@ -24,10 +24,18 @@ namespace sw { - struct SW_DLLPUBLIC DocDisposingHint final : public SfxHint + enum class UnoCursorHintType { - DocDisposingHint() {} - virtual ~DocDisposingHint() override; + DOC_DISPOSING, + LEAVES_SECTION + }; + + struct SW_DLLPUBLIC UnoCursorHint final : public SfxHint + { + UnoCursorHintType m_eType; + UnoCursorHint(UnoCursorHintType eType) + : m_eType(eType) {}; + virtual ~UnoCursorHint() override; }; } @@ -132,14 +140,8 @@ namespace sw SwClient::SwClientNotify(rModify, rHint); if(m_pCursor) { - if(typeid(rHint) == typeid(DocDisposingHint)) + if(typeid(rHint) == typeid(UnoCursorHint)) m_pCursor->Remove(this); - else if(m_bSectionRestricted && typeid(rHint) == typeid(LegacyModifyHint)) - { - const auto pLegacyHint = static_cast<const LegacyModifyHint*>(&rHint); - if(pLegacyHint->m_pOld && pLegacyHint->m_pOld->Which() == RES_UNOCURSOR_LEAVES_SECTION) - m_pCursor->Remove(this); - } } if(!GetRegisteredIn()) m_pCursor.reset(); diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index e207e856117d..cb07e364052f 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -159,8 +159,8 @@ void PaMCorrAbs( const SwPaM& rRange, if (bChange && bLeaveSection) { // the UNO cursor has left its section. We need to notify it! - SwMsgPoolItem aHint( RES_UNOCURSOR_LEAVES_SECTION ); - pUnoCursor->ModifyNotification( &aHint, nullptr ); + sw::UnoCursorHint aHint(sw::UnoCursorHintType::LEAVES_SECTION); + pUnoCursor->CallSwClientNotify(aHint); } } } diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index dc07f061a6e4..ff5327dc7d89 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -413,7 +413,7 @@ SwDoc::~SwDoc() getIDocumentRedlineAccess().GetRedlineTable().DeleteAndDestroyAll(); getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteAndDestroyAll(); - const sw::DocDisposingHint aHint; + const sw::UnoCursorHint aHint(sw::UnoCursorHintType::DOC_DISPOSING); cleanupUnoCursorTable(); for(const auto& pWeakCursor : mvUnoCursorTable) { diff --git a/sw/source/core/unocore/unocrsr.cxx b/sw/source/core/unocore/unocrsr.cxx index 515459024f4d..de18ef4651ec 100644 --- a/sw/source/core/unocore/unocrsr.cxx +++ b/sw/source/core/unocore/unocrsr.cxx @@ -25,7 +25,7 @@ #include <rootfrm.hxx> #include <calbck.hxx> -sw::DocDisposingHint::~DocDisposingHint() {} +sw::UnoCursorHint::~UnoCursorHint() {} IMPL_FIXEDMEMPOOL_NEWDEL( SwUnoCursor ) |