From 174154bcac2780cb704011662f2e9c1233fec933 Mon Sep 17 00:00:00 2001 From: Jonas Karlsson Date: Fri, 21 Aug 2020 13:01:43 +0200 Subject: Remove "internal" parameter in QTextLine::draw() The method is split up into a private and public version, where the parameter is moved into the private method. Fixes: QTBUG-84210 Change-Id: I79e9e02c9b4cc25d31db066e5a9567fdb9bc9fd0 Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Konstantin Ritt --- src/gui/text/qtextlayout.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/gui/text/qtextlayout.cpp') diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index cd064364d5..35dbf677a3 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1184,7 +1184,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QList for (int line = firstLine; line < lastLine; ++line) { QTextLine l(line, d); - l.draw(p, position, &selection); + l.draw_internal(p, position, &selection); } p->restore(); @@ -1208,7 +1208,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QList selection.format.setProperty(SuppressBackground, true); for (int line = firstLine; line < lastLine; ++line) { QTextLine l(line, d); - l.draw(p, position, &selection); + l.draw_internal(p, position, &selection); } p->restore(); } @@ -2473,12 +2473,17 @@ QList QTextLine::glyphRuns(int from, int length) const #endif // QT_NO_RAWFONT /*! - \fn void QTextLine::draw(QPainter *painter, const QPointF &position, const QTextLayout::FormatRange *selection) const + \fn void QTextLine::draw(QPainter *painter, const QPointF &position) const Draws a line on the given \a painter at the specified \a position. - The \a selection is reserved for internal use. */ -void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatRange *selection) const +void QTextLine::draw(QPainter *painter, const QPointF &position) const +{ + draw_internal(painter, position, nullptr); +} + +void QTextLine::draw_internal(QPainter *p, const QPointF &pos, + const QTextLayout::FormatRange *selection) const { #ifndef QT_NO_RAWFONT // Not intended to work with rawfont -- cgit v1.2.3