Project

General

Profile

WStandardItemCompare if WT_TARGET_JAVA isn't defined causes assert

Added by Randy Voet over 14 years ago

Do:

- Create a WTreeView and associate a WStandardItemModel.

- Add WStandardItem instances of the same WString.

- Click the column sorting icon twice.

See:

- You get an assert in _Debug_lt_pred (xutility).

Remark:

- If both item1 and item2 exist in WStandardItemCompare and WT_TARGET_JAVA isn't defined the result is either --1 or 1.

- On the other hand the compare function in WAbstractItemModel.c returns 0 if the two 'cells' are equal.

  • Since WStandardItemCompare only calls the < operator (and not the ==), it loses precision because it considers 'item1 < item2' to be 1 and 'item2 < item1' also to be 1. The result however should be 0 since they are equal.

Replies (1)

RE: WStandardItemCompare if WT_TARGET_JAVA isn't defined causes assert - Added by Randy Voet over 14 years ago

Added as an issue instead. Sorry for the mixup.

    (1-1/1)