diff options
Diffstat (limited to 'vcl/unx/gtk3/gtk3gtkinst.cxx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 5230dcf92a88..8a15f98530d7 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -14551,14 +14551,25 @@ public: virtual void insert_vector(const std::vector<weld::ComboBoxEntry>& rItems, bool bKeepExisting) override { freeze(); + + int nInsertionPoint; if (!bKeepExisting) + { clear(); + nInsertionPoint = 0; + } + else + nInsertionPoint = get_count(); + GtkTreeIter iter; - for (const auto& rItem : rItems) + // tdf#125241 inserting backwards is faster + for (auto aI = rItems.rbegin(); aI != rItems.rend(); ++aI) { - insert_row(GTK_LIST_STORE(m_pTreeModel), iter, -1, rItem.sId.isEmpty() ? nullptr : &rItem.sId, + const auto& rItem = *aI; + insert_row(GTK_LIST_STORE(m_pTreeModel), iter, nInsertionPoint, rItem.sId.isEmpty() ? nullptr : &rItem.sId, rItem.sString, rItem.sImage.isEmpty() ? nullptr : &rItem.sImage, nullptr); } + thaw(); } |