summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-06-24 16:12:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-24 20:51:05 +0200
commitab7652aabf9c1c91980d47c9d1be30b24313f142 (patch)
tree4f4a1a9be67268b30418fa4f173b675714d221d1 /cui
parente82d7514fd8eae433690690738d6a3d1b60e5cef (diff)
tdf#109158 slow AutoCorrect table, speedup switching away from language
Switching from the large table to another language could result in freezing up for some time, so use the nice weld::TreeIter API here too Change-Id: I28f422dcdbc762b282ed6bd1dffc8140ee77900f Reviewed-on: https://gerrit.libreoffice.org/74646 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/autocdlg.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 9b2a98e20584..20028e16456b 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -793,16 +793,14 @@ void OfaAutocorrReplacePage::RefillReplaceBox(bool bFromReset,
pArray = &aDoubleStringTable[eOldLanguage]; // create new array
}
- sal_uInt32 nListBoxCount = m_xReplaceTLB->n_children();
- sal_uInt32 i;
- for(i = 0; i < nListBoxCount; i++)
- {
+ m_xReplaceTLB->all_foreach([this, &pArray](weld::TreeIter& rIter) {
pArray->push_back(DoubleString());
- DoubleString& rDouble = (*pArray)[pArray->size() - 1];
- rDouble.sShort = m_xReplaceTLB->get_text(i, 0);
- rDouble.sLong = m_xReplaceTLB->get_text(i, 1);
- rDouble.pUserData = reinterpret_cast<void*>(m_xReplaceTLB->get_id(i).toInt64());
- }
+ DoubleString& rDouble = pArray->back();
+ rDouble.sShort = m_xReplaceTLB->get_text(rIter, 0);
+ rDouble.sLong = m_xReplaceTLB->get_text(rIter, 1);
+ rDouble.pUserData = reinterpret_cast<void*>(m_xReplaceTLB->get_id(rIter).toInt64());
+ return false;
+ });
}
if( !bSWriter )