freeze() and thaw() a widget during creation (tdf#149112)
The repeated inserts each trigger SvTreeList::GetVisibleCount(),
which has a poor performance because of repeated uses of the
SvListView::Impl::m_DataTable map.
Change-Id: Ibb261a8501a1d5c168b37675e34498386f161595
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134415
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 439ee35..aa5f388 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -257,6 +257,7 @@ void ScTpSubTotalGroup::FillListBoxes()
mxLbColumns->clear();
mxLbGroup->insert_text(0, aStrNone );
mxLbColumns->freeze();
sal_uInt16 i=0;
for ( col=nFirstCol; col<=nMaxCol && i<SC_MAXFIELDS(pDoc->GetSheetLimits()); col++ )
{
@@ -273,6 +274,8 @@ void ScTpSubTotalGroup::FillListBoxes()
mxLbColumns->set_id(i, "0");
i++;
}
mxLbColumns->thaw();
// subsequent initialization of the constant:
nFieldCount = i;
}