Fix blank lines when scrolling up Hexdump

This commit is contained in:
Florian Märkl 2018-04-13 11:36:30 +02:00
parent 2af51a1af0
commit d3b8bcb62a

View File

@ -779,12 +779,11 @@ void HexdumpWidget::removeTopLinesWithoutScroll(QTextEdit *textEdit, int lines)
int height_before = textEdit->document()->size().height(); int height_before = textEdit->document()->size().height();
QTextBlock block = textEdit->document()->firstBlock(); QTextBlock block = textEdit->document()->firstBlock();
QTextCursor textCursor = textEdit->textCursor();
for (int i = 0; i < lines; i++) { for (int i = 0; i < lines; i++) {
QTextCursor cursor(block); QTextCursor cursor(block);
cursor.select(QTextCursor::BlockUnderCursor);
cursor.removeSelectedText();
block = block.next(); block = block.next();
cursor.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor);
cursor.removeSelectedText();
} }
int height_after = textEdit->document()->size().height(); int height_after = textEdit->document()->size().height();