From 3b42898219691e2e2fdd4da742e73767d35c469c Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 6 Dec 2010 19:19:39 +0100 Subject: [PATCH] Fix QTextLayout crash with zero length excludedRegion --- src/gui/text/qtextlayout.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index f1278b9..fd95772 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1265,7 +1265,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QVectorrestore(); } - if (!excludedRegion.isEmpty()) { + if (!excludedRegion.isEmpty() && excludedRegion.length()) { p->save(); QPainterPath path; QRectF br = boundingRect().translated(position); @@ -1281,7 +1281,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QVectorrestore(); -- 1.7.2.2