From 154f6a2e73c839763cfc52d140f13a2f0e88eff2 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Fri, 2 Sep 2011 13:35:07 +0200 Subject: [PATCH] QGlyphRun: don't detach if the decoration wasn't actually changed Merge-request: 2652 Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit f550d219378e5669601de416254b3585fe3f5708) Change-Id: Ib74ae82fbeaf2b0f5eabad9568cfa9fcea09053b Reviewed-on: http://codereview.qt.nokia.com/4138 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qglyphrun.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp index be9c058693..26e7e97de7 100644 --- a/src/gui/text/qglyphrun.cpp +++ b/src/gui/text/qglyphrun.cpp @@ -295,6 +295,9 @@ bool QGlyphRun::overline() const */ void QGlyphRun::setOverline(bool overline) { + if (d->overline == overline) + return; + detach(); d->overline = overline; } @@ -317,6 +320,9 @@ bool QGlyphRun::underline() const */ void QGlyphRun::setUnderline(bool underline) { + if (d->underline == underline) + return; + detach(); d->underline = underline; } @@ -339,6 +345,9 @@ bool QGlyphRun::strikeOut() const */ void QGlyphRun::setStrikeOut(bool strikeOut) { + if (d->strikeOut == strikeOut) + return; + detach(); d->strikeOut = strikeOut; }