summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-05-17 12:43:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-05-20 14:53:12 +0200
commit50588a1583e3cc5dc647a35889e50478c7bfd033 (patch)
tree460a6c4137c2ceade8132c760b79eac99dee4c81 /vcl/unx
parent092da974f180e6f166c2e5662ce11db72351700b (diff)
Related: tdf#109158 GtkTreeStore append performance is poor
so prepend in opposite order Change-Id: Ibfa2878d999b945e774b5a90309a663f11b132b5 Reviewed-on: https://gerrit.libreoffice.org/72488 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index d29fa4f4ef1a..3e8429e02cfc 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -6698,6 +6698,22 @@ public:
return aSearch.index;
}
+ virtual void bulk_insert_for_each(int nSourceCount, const std::function<void(weld::TreeIter&, int nSourceIndex)>& func) override
+ {
+ freeze();
+ clear();
+ GtkInstanceTreeIter aGtkIter(nullptr);
+
+ while (nSourceCount)
+ {
+ // tdf#125241 inserting backwards is massively faster
+ gtk_tree_store_prepend(m_pTreeStore, &aGtkIter.iter, nullptr);
+ func(aGtkIter, --nSourceCount);
+ }
+
+ thaw();
+ }
+
void move_before(int pos, int before)
{
if (pos == before)