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@collabora.co.uk>
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 9b2a98e..20028e1 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 )