summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-06-21 19:42:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-06-22 14:00:49 +0200
commit40e08851304e5c179842dcf2e1e3b352f1baee21 (patch)
treeb2e456bc398b8d45c507fcdca83f654f36908fe4 /sc/source/ui/view
parent858bc4d76bb49ff1766e5d4bd404b04d61201c37 (diff)
fix O(n^2) behaviour when fetching field info from EditEngine
Change-Id: I324a1814fc1b3321eed5b29922790600e7092c17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169344 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/gridwin.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 5d298458cb75..ee06a5aa4835 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5839,11 +5839,9 @@ static std::vector<std::unique_ptr<SvxFieldItem>> lcl_GetEditEngineFields(std::s
sal_Int32 nPara = pEditEngine->GetParagraphCount();
for (sal_Int32 nCurrPara = 0; nCurrPara < nPara; ++nCurrPara)
{
- sal_Int16 nField = pEditEngine->GetFieldCount(nCurrPara);
- for (sal_Int16 nCurrField = 0; nCurrField < nField; ++nCurrField)
+ for (EFieldInfo& rFieldInfo : pEditEngine->GetFieldInfo(nCurrPara))
{
- EFieldInfo aFieldInfo = pEditEngine->GetFieldInfo(nCurrPara, nCurrField);
- vFieldVect.push_back(std::move(aFieldInfo.pFieldItem));
+ vFieldVect.push_back(std::move(rFieldInfo.pFieldItem));
}
}
return vFieldVect;