/animations/

option> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-04 11:17:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-04 13:28:52 +0200
commite278df1a14c5cb5dbb7add5d6ed5dd52da131e92 (patch)
tree10ca8af6f78a576fb9c11ffbeffd02a30e3fb5c6 /editeng
parent891e41fac81fbd8d5cdb277b26639abfd25a7143 (diff)
tdf#108608 Draw file unresponsive on large text pasted into textbox
We have O(n^2) algorithm here. The stack trace looks like: ImpEditEngine::CalcTextWidth EditEngine::CalcTextWidth Outliner::CalcTextSize SvxOutlinerForwarder::GetParaBounds SvxAccessibleTextAdapter::GetParaBounds accessibility::AccessibleEditableTextPara::getBounds ... OutlinerView::PasteSpecial where AccessibleEditableTextPara::getBounds iterates over all paragraphs, and so does ImpEditEngine::CalcTextWidth. To solve this, push the logic down from SvxOutlinerForwarder::GetParaBounds, to new logic in EditEngine and ImpEditEngine, where we can optimise the width calculation. Note that this means that the width returned for a specific paragraph is no longer the maximum width of all paragraphs, lets hope that does not cause regressions. Change-Id: I9f879d9a67b16a4aec08915328c99961b7313c2f Reviewed-on: https://gerrit.libreoffice.org/52369 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>