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 <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
bb10
Jonas Karlsson 2020-08-21 13:01:43 +02:00
parent 3558704ed5
commit 174154bcac
2 changed files with 13 additions and 6 deletions

View File

@ -1184,7 +1184,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QList<FormatRange>
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<FormatRange>
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<QGlyphRun> 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

View File

@ -264,7 +264,7 @@ public:
int lineNumber() const { return index; }
void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = nullptr) const;
void draw(QPainter *painter, const QPointF &position) const;
#if !defined(QT_NO_RAWFONT)
QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const;
@ -273,6 +273,8 @@ public:
private:
QTextLine(int line, QTextEngine *e) : index(line), eng(e) {}
void layout_helper(int numGlyphs);
void draw_internal(QPainter *p, const QPointF &pos,
const QTextLayout::FormatRange *selection) const;
friend class QTextLayout;
friend class QTextFragment;