lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] CensusView cell-deletion anomaly


From: Vaclav Slavik
Subject: Re: [lmi] CensusView cell-deletion anomaly
Date: Fri, 19 Aug 2011 19:14:31 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9

On 2011-08-19 12:26, Greg Chicares wrote:
> Try this:
>   File | New | Census
>   Census | Add cell
>   Census | Delete cell(s) | Yes
> Now "Census" commands that require a single selection should be available,
> but are not. Furthermore, attempting
>   Census | Delete cell(s)
> again should produce a messagebox saying I can't delete all cells, but
> instead I see:
>   Assertion 'n_sel_items < n_items' failed.

I can reproduce this with wx-2.9.2, but not with week-old trunk. This must be
caused by the selection bug I fixed after 2.9.2. Here's a workaround that works
with 2.9.2:

---
 census_view.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/census_view.cpp b/census_view.cpp
index 9dd122e..ee44f37 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -913,6 +913,12 @@ void CensusView::UponDeleteCells(wxCommandEvent&)
 //    cell_parms().swap(expurgated_cell_parms); // TODO ?? Would this be 
better?
     cell_parms() = expurgated_cell_parms;
 
+#if !wxCHECK_VERSION(2,9,3)
+    // Remove selection to work around wx-2.9.2 bug in GetSelections()
+    // (we'll set it again below).
+    list_window_->UnselectAll();
+#endif
+
     // Send notifications about changes to the wxDataViewCtrl model. Two things
     // changed: some rows were deleted and cell number of some rows shifted
     // accordingly.
-- 

Regards,
Vaclav




reply via email to

[Prev in Thread] Current Thread [Next in Thread]