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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 23 20:18:25 UTC 2019


 svx/source/accessibility/AccessibleTextEventQueue.cxx |   13 ++++++++++---
 svx/source/accessibility/AccessibleTextHelper.cxx     |    2 ++
 2 files changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 04991eaf9f6767d94ad7c4e47708f47615beccf6
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Aug 23 20:35:15 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Aug 23 22:17:23 2019 +0200

    tdf#119388 only enqueue events we actually process
    
    shaves 10% of the time off, deleting columns
    
    Change-Id: Id992572419a3c9a5693d37d7c5e5fe2da955bb23
    Reviewed-on: https://gerrit.libreoffice.org/78029
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/svx/source/accessibility/AccessibleTextEventQueue.cxx b/svx/source/accessibility/AccessibleTextEventQueue.cxx
index 6a586117ddd3..177950aac8ce 100644
--- a/svx/source/accessibility/AccessibleTextEventQueue.cxx
+++ b/svx/source/accessibility/AccessibleTextEventQueue.cxx
@@ -49,7 +49,13 @@ namespace accessibility
 
     void AccessibleTextEventQueue::Append( const SdrHint& rHint )
     {
-        maEventQueue.push_back( new SdrHint( rHint ) );
+        // only enqueue the events we actually care about in
+        // AccessibleTextHelper_Impl::ProcessQueue(), because
+        // the cost of some events adds up.
+        auto eKind = rHint.GetKind();
+        if (eKind == SdrHintKind::BeginEdit
+            || eKind == SdrHintKind::EndEdit)
+            maEventQueue.push_back( new SdrHint( rHint ) );
     }
 
     void AccessibleTextEventQueue::Append( const TextHint& rHint )
@@ -82,8 +88,9 @@ namespace accessibility
     void AccessibleTextEventQueue::Clear()
     {
         // clear queue
-        while( !IsEmpty() )
-            PopFront();
+        for( auto p : maEventQueue)
+            delete p;
+        maEventQueue.clear();
     }
 
 } // end of namespace accessibility
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index 288d2c3c362f..208f65945155 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -1134,6 +1134,8 @@ namespace accessibility
             {
                 const SfxHint& rHint = *pHint;
 
+                // Note, if you add events here, you need to update the AccessibleTextEventQueue::Append
+                // code, because only the events we process here, are actually queued there.
 
                 try
                 {


More information about the Libreoffice-commits mailing list