summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-07-27 11:04:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-07-27 17:07:54 +0200
commit8e5c1982c41c234027245fe2da6bf9bc3f5fe238 (patch)
tree1dc9f9fba79cf15af138d8cf98098523148638e8 /svx/source
parent150f89d3b39fd062af56e21aa6d185758af67c0e (diff)
tdf#108560 horribly slow to paste many lines into editeng with a11y active
looks to me that once the bound rect (and visible children) are synced that they won't change again so continued recalculation of bounds doesn't achieve anything except super expensive calc for no effect. Change-Id: I1684e3724bca28d03f7c255c2d7a40eee1b70eae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137497 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/accessibility/AccessibleTextHelper.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index 5c8ce773b028..b18c33510211 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -1118,6 +1118,8 @@ namespace accessibility
bEverythingUpdated = true;
}
+ bool bUpdatedBoundRectAndVisibleChildren(false);
+
while( !maEventQueue.IsEmpty() )
{
::std::unique_ptr< SfxHint > pHint( maEventQueue.PopFront() );
@@ -1252,14 +1254,22 @@ namespace accessibility
}
// in all cases, check visibility afterwards.
- UpdateVisibleChildren();
- UpdateBoundRect();
+ if (!bUpdatedBoundRectAndVisibleChildren)
+ {
+ UpdateVisibleChildren();
+ UpdateBoundRect();
+ bUpdatedBoundRectAndVisibleChildren = true;
+ }
}
else if ( dynamic_cast<const SvxViewChangedHint*>( &rHint ) )
{
// just check visibility
- UpdateVisibleChildren();
- UpdateBoundRect();
+ if (!bUpdatedBoundRectAndVisibleChildren)
+ {
+ UpdateVisibleChildren();
+ UpdateBoundRect();
+ bUpdatedBoundRectAndVisibleChildren = true;
+ }
}
// it's VITAL to keep the SfxSimpleHint last! It's the base of some classes above!
else if( rHint.GetId() == SfxHintId::Dying)