[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - cui/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 25 07:06:22 UTC 2019
cui/source/tabpages/autocdlg.cxx | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
New commits:
commit 3a2d31cdd684b42b0921917dc7a8c27d6f6bb25a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jun 24 16:12:52 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 25 09:05:43 2019 +0200
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/74649
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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 )
More information about the Libreoffice-commits
mailing list