[Libreoffice-commits] core.git: editeng/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 25 17:22:07 UTC 2018


 editeng/source/editeng/editeng.cxx  |    6 +++---
 editeng/source/editeng/impedit.cxx  |    9 ++++++---
 editeng/source/editeng/impedit.hxx  |    5 -----
 editeng/source/editeng/impedit2.cxx |   22 ++--------------------
 editeng/source/editeng/impedit3.cxx |    3 ++-
 5 files changed, 13 insertions(+), 32 deletions(-)

New commits:
commit 67c8049a3abcaf9aa692fc9ba768b5db9fbb2f05
Author:     Paul Trojahn <paul.trojahn at gmail.com>
AuthorDate: Sat Sep 22 15:28:52 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Sep 25 19:21:43 2018 +0200

    Queue notifications only once
    
    AccessibleTextHelper already queues notifications, so another queue in
    editeng isn't needed.
    
    Change-Id: I31c69a21e2379da99cba559208eb5475ddccddfe
    Reviewed-on: https://gerrit.libreoffice.org/60918
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 40a1dcb5adfe..e082645a0d59 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2482,7 +2482,7 @@ void EditEngine::ParagraphInserted( sal_Int32 nPara )
     {
         EENotify aNotify( EE_NOTIFY_PARAGRAPHINSERTED );
         aNotify.nParagraph = nPara;
-        pImpEditEngine->QueueNotify( aNotify );
+        pImpEditEngine->GetNotifyHdl().Call( aNotify );
     }
 }
 
@@ -2493,7 +2493,7 @@ void EditEngine::ParagraphDeleted( sal_Int32 nPara )
     {
         EENotify aNotify( EE_NOTIFY_PARAGRAPHREMOVED );
         aNotify.nParagraph = nPara;
-        pImpEditEngine->QueueNotify( aNotify );
+        pImpEditEngine->GetNotifyHdl().Call( aNotify );
     }
 }
 void EditEngine::ParagraphConnected( sal_Int32 /*nLeftParagraph*/, sal_Int32 /*nRightParagraph*/ )
@@ -2515,7 +2515,7 @@ void EditEngine::ParagraphHeightChanged( sal_Int32 nPara )
     {
         EENotify aNotify( EE_NOTIFY_TextHeightChanged );
         aNotify.nParagraph = nPara;
-        pImpEditEngine->QueueNotify( aNotify );
+        pImpEditEngine->GetNotifyHdl().Call( aNotify );
     }
 }
 
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 7d14198c67b2..042b0a3d77a1 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -148,10 +148,13 @@ void ImpEditView::SetEditSelection( const EditSelection& rEditSelection )
             eNotifyType = EE_NOTIFY_TEXTVIEWSELECTIONCHANGED;
         }
         EENotify aNotify( eNotifyType );
-        pEditEngine->pImpEditEngine->QueueNotify( aNotify );
+        pEditEngine->pImpEditEngine->GetNotifyHdl().Call( aNotify );
     }
     if(pEditEngine->pImpEditEngine->IsFormatted())
-        pEditEngine->pImpEditEngine->SendNotifications();
+    {
+        EENotify aNotify(EE_NOTIFY_PROCESSNOTIFICATIONS);
+        pEditEngine->pImpEditEngine->GetNotifyHdl().Call(aNotify);
+    }
 }
 
 /// Translate absolute <-> relative twips: LOK wants absolute coordinates as output and gives absolute coordinates as input.
@@ -1274,7 +1277,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
         if ( pEditEngine->pImpEditEngine->GetNotifyHdl().IsSet() )
         {
             EENotify aNotify( EE_NOTIFY_TEXTVIEWSCROLLED );
-            pEditEngine->pImpEditEngine->QueueNotify( aNotify );
+            pEditEngine->pImpEditEngine->GetNotifyHdl().Call( aNotify );
         }
     }
 
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 5945e9d449f3..16deb64c85f2 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -455,8 +455,6 @@ private:
 
     std::unique_ptr<ImplIMEInfos> mpIMEInfos;
 
-    std::vector<EENotify> aNotifyCache;
-
     OUString            aWordDelimiters;
 
     EditSelFunctionSet  aSelFuncSet;
@@ -915,9 +913,6 @@ public:
     void                CallStatusHdl();
     void                DelayedCallStatusHdl()  { aStatusTimer.Start(); }
 
-    void                QueueNotify( EENotify& rNotify );
-    void                SendNotifications();
-
     void                UndoActionStart( sal_uInt16 nId );
     void                UndoActionStart( sal_uInt16 nId, const ESelection& rSel );
     void                UndoActionEnd();
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index f85c9138ef44..9b62005b34c8 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -174,18 +174,6 @@ void ImpEditEngine::Dispose()
     pSharedVCL.reset();
 }
 
-void ImpEditEngine::SendNotifications()
-{
-    while(!aNotifyCache.empty())
-    {
-        GetNotifyHdl().Call( aNotifyCache[0] );
-        aNotifyCache.erase(aNotifyCache.begin());
-    }
-
-    EENotify aNotify(EE_NOTIFY_PROCESSNOTIFICATIONS);
-    GetNotifyHdl().Call(aNotify);
-}
-
 ImpEditEngine::~ImpEditEngine()
 {
     aStatusTimer.Stop();
@@ -741,7 +729,7 @@ void ImpEditEngine::TextModified()
     if ( GetNotifyHdl().IsSet() )
     {
         EENotify aNotify( EE_NOTIFY_TEXTMODIFIED );
-        QueueNotify( aNotify );
+        GetNotifyHdl().Call( aNotify );
     }
 }
 
@@ -2209,7 +2197,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n
         aNotify.nParagraph = nNewPos;
         aNotify.nParam1 = aOldPositions.Min();
         aNotify.nParam2 = aOldPositions.Max();
-        QueueNotify( aNotify );
+        GetNotifyHdl().Call( aNotify );
     }
 
     aEditDoc.SetModified( true );
@@ -4399,12 +4387,6 @@ bool ImpEditEngine::DoVisualCursorTraveling()
     return IsVisualCursorTravelingEnabled();
 }
 
-
-void ImpEditEngine::QueueNotify( EENotify& rNotify )
-{
-    aNotifyCache.push_back(rNotify);
-}
-
 IMPL_LINK_NOARG(ImpEditEngine, DocModified, LinkParamNone*, void)
 {
     aModifyHdl.Call( nullptr /*GetEditEnginePtr()*/ ); // NULL, because also used for Outliner
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 320707ecda59..6d2a12983ecb 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4238,7 +4238,8 @@ void ImpEditEngine::FormatAndUpdate( EditView* pCurView, bool bCalledFromUndo )
         UpdateViews( pCurView );
     }
 
-    SendNotifications();
+    EENotify aNotify(EE_NOTIFY_PROCESSNOTIFICATIONS);
+    GetNotifyHdl().Call(aNotify);
 }
 
 void ImpEditEngine::SetFlatMode( bool bFlat )


More information about the Libreoffice-commits mailing list