lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Can't delete repeatedly from list end in CensusView [Was: swit


From: Greg Chicares
Subject: Re: [lmi] Can't delete repeatedly from list end in CensusView [Was: switch census view to use wxDataViewCtrl]
Date: Mon, 08 Aug 2011 00:12:21 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

On 2011-08-03 23:56Z, Greg Chicares wrote:
> On 2011-08-03 23:42Z, Greg Chicares wrote:
>> On 2011-08-03 19:21Z, Greg Chicares wrote:
> [...]
>> This made it easier to stumble across a hitherto-unnoticed defect that
>> I'll describe in a follow-up message.
> 
> To reproduce [some commands are deliberately duplicated]:
>   File | New | Census
>   Census | Add cell
>   Census | Add cell
>   Census | Delete cell(s) | Yes
>   Census | Delete cell(s) | Yes
> That causes:
>   Assertion 'expurgated_cell_parms.size() == n_items - n_sel_items' failed.
>   [file /lmi/src/lmi/census_view.cpp, line 931]
> 
> AFAICT, repeated deletions from the top or the middle succeed, and this
> defect appears only for repeated deletions from the end.
> 
> If I always select the bottom row before deleting it, then everything seems
> to work okay. Otherwise, after the first deletion, no row has the selection
> highlight, but there's apparently an attempt to delete something, because
> the confirmation dialog says:
>   Confirm deletion
>   Irrevocably delete 1 of 2 cells?
>   Yes   No

Just before the above assertion fires:
  erasures.size() is 1
  erasures[0]     is -1

I experimentally changed CensusView::UponDeleteCells() as follows:

    unsigned int n_items = list_model_->GetCount();
    wxDataViewItemArray selection;
    unsigned int n_sel_items = list_window_->GetSelections(selection);
    LMI_ASSERT(n_sel_items == selection.size());
+   LMI_ASSERT(0 == n_sel_items || list_window_->GetSelection().IsOk());

and, in the scenario above, the new assertion fires. Thus, it appears that
  GetSelection() returns an invalid item...implying no  item was selected; but
  GetSelections() returns the number one...implying one item was selected.
I think I need to ask for help on this.



reply via email to

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