diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-11-28 05:24:24 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2016-11-29 09:27:58 +0000 |
commit | a029a479429d334875b73e2fc4e34b314a1ad369 (patch) | |
tree | 87b99250da9d332a4940e9c69e7fdf12fa7ec9ff | |
parent | 361c6eb18c9ba4043652ba91036094379aeaf05f (diff) |
get rid of LegacyModifyHint
Change-Id: Idb789f8786abeed07299baf4ce7507628f9ff173
Reviewed-on: https://gerrit.libreoffice.org/31304
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
-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 ) |