diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-06 20:53:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-07 17:51:52 +0200 |
commit | 4c76bcb5f35527283c6070fc8e3911a35734eba1 (patch) | |
tree | 87fc65acaebf7d7c11834cb364416d63cb8c4e61 /editeng | |
parent | f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d (diff) |
tdf#132740 avoid some WeakReference cost in accessibility
reduces time by 20% for me
Change-Id: Ife78248fd36099298eb2401b362f16a1ae3c0434
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118534
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/accessibility/AccessibleParaManager.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/editeng/source/accessibility/AccessibleParaManager.cxx b/editeng/source/accessibility/AccessibleParaManager.cxx index 2fb3006da7b7..12aff3e2df63 100644 --- a/editeng/source/accessibility/AccessibleParaManager.cxx +++ b/editeng/source/accessibility/AccessibleParaManager.cxx @@ -144,6 +144,17 @@ namespace accessibility } } + bool AccessibleParaManager::HasCreatedChild( sal_Int32 nParagraphIndex ) const + { + if( 0 <= nParagraphIndex && maChildren.size() > o3tl::make_unsigned(nParagraphIndex) ) + { + auto const & rChild = maChildren[ nParagraphIndex ]; + return rChild.second.Width != 0 || rChild.second.Height != 0; + } + else + return false; + } + AccessibleParaManager::Child AccessibleParaManager::CreateChild( sal_Int32 nChild, const uno::Reference< XAccessible >& xFrontEnd, SvxEditSourceAdapter& rEditSource, |