Fix crash in QTextBlock::next()/previous()
authorJiang Jiang <jiang.jiang@nokia.com>
Fri, 7 Jan 2011 15:15:25 +0000 (16:15 +0100)
committerJason McDonald <jason.mcdonald@nokia.com>
Tue, 11 Jan 2011 09:50:57 +0000 (19:50 +1000)
commit497cd0564b2471354b1ac86f00c5ba90845aa2e1
tree57c1bb693b2d1896be59de3670e50bae66a01c2f
parent414b50fa6f436d04e5d709d337c04a380662bf40
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
(cherry picked from commit 64852122ba71bbb297b4f1e440f6fabee16ca2fe)
src/gui/text/qtextobject.cpp