Fix crash in QTextBlock::next()/previous()
authorJiang Jiang <jiang.jiang@nokia.com>
Fri, 7 Jan 2011 15:15:25 +0000 (16:15 +0100)
committerJiang Jiang <jiang.jiang@nokia.com>
Fri, 7 Jan 2011 15:28:25 +0000 (16:28 +0100)
commit64852122ba71bbb297b4f1e440f6fabee16ca2fe
treec493d382210cb18ec75b5e5d1451d9cea41e7014
parent7a54885b1df9baf793374e3cb9fdf8be93ee7c80
Fix crash in QTextBlock::next()/previous()

We should check not just p but also n in next()/previous(),
which is what isValid() does. Otherwise n == 0 will cause
crash in QFragmentMap.

Task-number: QTBUG-16279
Reviewed-by: Eskil
src/gui/text/qtextobject.cpp