[Libreoffice-commits] core.git: sw/inc sw/source

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Tue Nov 29 09:28:24 UTC 2016


 sw/inc/hintids.hxx                 |    1 -
 sw/inc/unocrsr.hxx                 |   22 ++++++++++++----------
 sw/source/core/doc/doccorr.cxx     |    4 ++--
 sw/source/core/doc/docnew.cxx      |    2 +-
 sw/source/core/unocore/unocrsr.cxx |    2 +-
 5 files changed, 16 insertions(+), 15 deletions(-)

New commits:
commit a029a479429d334875b73e2fc4e34b314a1ad369
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Mon Nov 28 05:24:24 2016 +0100

    get rid of LegacyModifyHint
    
    Change-Id: Idb789f8786abeed07299baf4ce7507628f9ff173
    Reviewed-on: https://gerrit.libreoffice.org/31304
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index fe94004..6b628d6 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 e6cbee0..eeb1b4a 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 e207e85..cb07e36 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 dc07f06..ff5327d 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 5154590..de18ef4 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 )
 


More information about the Libreoffice-commits mailing list