#41 QDocumentCursor operator

SVN
closed-wont-fix
nobody
Crash (8)
5
2009-01-05
2008-12-30
No

Hi,

If we compare to cursor and one of cursor is null (m_handle is 0), the operator doesn't work.

Like
cursorA < cursorB and cursorB is null

I think the correction will be (for this operator, but other operators will be change too) :
bool QDocumentCursor::operator < (const QDocumentCursor& c) const
{
return (m_handle == 0 && c.m_handle != 0) || (m_handle != 0 && c.m_handle != 0 && m_handle->lt(c.m_handle) );
}

Discussion

  • fullmetalcoder
    fullmetalcoder
    2008-12-31

    There is no "correct" convention... A cursor can become invalid if you try to go too down or up so theoretically an invalid cursor should be superior and inferior to every other cursor but that would be a little puzzling and not very useful. The best thing to do is not to compare invalid cursors...

     
  • Ok.
    I change my software

     
  • fullmetalcoder
    fullmetalcoder
    2009-01-05

    • status: open --> closed-wont-fix