summaryrefslogtreecommitdiff
path: root/svx/source/accessibility
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-23 20:35:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-23 22:17:23 +0200
commit04991eaf9f6767d94ad7c4e47708f47615beccf6 (patch)
tree229ad9a98ba9487fa89ae59c2e2298da6447b32e /svx/source/accessibility
parent7bc3da4ff0a6fda621340a4ded79f7ed4ce31d85 (diff)
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@collabora.co.uk>
Diffstat (limited to 'svx/source/accessibility')
-rw-r--r--svx/source/accessibility/AccessibleTextEventQueue.cxx13
-rw-r--r--svx/source/accessibility/AccessibleTextHelper.cxx2
2 files changed, 12 insertions, 3 deletions
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
{