From 0cfefbbd47a5e06396235a0a6848330a565411cd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 9 Oct 2018 12:13:20 +0800 Subject: [PATCH] Merge pull request #1030 from RobinD42/fix-issue906 Fix wx.ListCtrl.Append when wx.LC_SORT style is used (cherry picked from commit 7b6fbf2a5272eb810b1c731216f6714b10984604) --- CHANGES.rst | 5 ++++- etg/listctrl.py | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 5f80bb96..5ca6a47d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -130,8 +130,11 @@ Changes in this release include the following: an AuiToolBar would not be updated when calling LoadPerspective. (#917) * Fixed a bug in wx.FileSystemHandler.OpenFile where the object ownership was - not being transferred corrcetly, causing a crash after a premature object + not being transferred correctly, causing a crash after a premature object deletion. (#926) + +* Fixed wx.ListCtrl.Append when wx.LC_SORT style is used, so appending items out + of order does not lose the data for the remaining columns. (#906) diff --git a/etg/listctrl.py b/etg/listctrl.py index 36672797..ab0de8d7 100644 --- a/etg/listctrl.py +++ b/etg/listctrl.py @@ -314,8 +314,7 @@ def run(): body="""\ if len(entry): from six import text_type - pos = self.GetItemCount() - self.InsertItem(pos, text_type(entry[0])) + pos = self.InsertItem(self.GetItemCount(), text_type(entry[0])) for i in range(1, len(entry)): self.SetItem(pos, i, text_type(entry[i])) return pos