Widgets: remove pointless assignments
Assignment of a value was two times successively for same variable while the variable itself is not used between these assignments. Change-Id: I3c457e3af0505d32a64f6c8576b458cd15a951e5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>bb10
parent
4dae1a685c
commit
7af329fdf2
|
|
@ -746,9 +746,8 @@ void QScroller::ensureVisible(const QRectF &rect, qreal xmargin, qreal ymargin,
|
|||
return;
|
||||
|
||||
// -- calculate the current pos (or the position after the current scroll)
|
||||
QPointF startPos = d->contentPosition + d->overshootPosition;
|
||||
startPos = QPointF(d->scrollingSegmentsEndPos(Qt::Horizontal),
|
||||
d->scrollingSegmentsEndPos(Qt::Vertical));
|
||||
QPointF startPos(d->scrollingSegmentsEndPos(Qt::Horizontal),
|
||||
d->scrollingSegmentsEndPos(Qt::Vertical));
|
||||
|
||||
QRectF marginRect(rect.x() - xmargin, rect.y() - ymargin,
|
||||
rect.width() + 2 * xmargin, rect.height() + 2 * ymargin);
|
||||
|
|
|
|||
|
|
@ -1877,14 +1877,12 @@ void QLineEdit::paintEvent(QPaintEvent *)
|
|||
{
|
||||
Q_D(QLineEdit);
|
||||
QPainter p(this);
|
||||
|
||||
QRect r = rect();
|
||||
QPalette pal = palette();
|
||||
|
||||
QStyleOptionFrameV2 panel;
|
||||
initStyleOption(&panel);
|
||||
style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, this);
|
||||
r = style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
|
||||
QRect r = style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
|
||||
r.setX(r.x() + d->effectiveLeftTextMargin());
|
||||
r.setY(r.y() + d->topTextMargin);
|
||||
r.setRight(r.right() - d->effectiveRightTextMargin());
|
||||
|
|
|
|||
|
|
@ -690,10 +690,9 @@ void QPlainTextEditPrivate::ensureVisible(int position, bool center, bool forceC
|
|||
QRectF br = control->blockBoundingRect(block);
|
||||
if (!br.isValid())
|
||||
return;
|
||||
QRectF lr = br;
|
||||
QTextLine line = block.layout()->lineForTextPosition(position - block.position());
|
||||
Q_ASSERT(line.isValid());
|
||||
lr = line.naturalTextRect().translated(br.topLeft());
|
||||
QRectF lr = line.naturalTextRect().translated(br.topLeft());
|
||||
|
||||
if (lr.bottom() >= visible.bottom() || (center && lr.top() < visible.top()) || forceCenter){
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue