Commit 9bf9474e authored by Daniel Teske's avatar Daniel Teske Committed by hjk
Browse files

BaseTextMark: Remove checks for linenumber after updateLineNumber



The breakpoints are deleted in some cases on updateLineNumber, thus we
can't call anything on the mark after calling updateLineNumber

Change-Id: Ib6c7bddc980fc72e9d4f4b9ec9e2eeb8292c1e15
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent e4aa2b58
......@@ -84,7 +84,7 @@ bool DocumentMarker::addMark(TextEditor::ITextMark *mark)
userData->addMark(mark);
m_marksCache.append(mark);
mark->updateLineNumber(blockNumber + 1);
QTC_CHECK(mark->lineNumber() == blockNumber + 1);
QTC_CHECK(mark->lineNumber() == blockNumber + 1); // Checks that the base class is called
mark->updateBlock(block);
documentLayout->hasMarks = true;
documentLayout->maxMarkWidthFactor = qMax(mark->widthFactor(),
......@@ -716,14 +716,14 @@ void BaseTextDocumentLayout::documentClosing()
void BaseTextDocumentLayout::updateMarksLineNumber()
{
// Note: the breakpointmanger deletes breakpoint marks and readds them
// if it doesn't agree with our updating
QTextBlock block = document()->begin();
int blockNumber = 0;
while (block.isValid()) {
if (const TextBlockUserData *userData = testUserData(block))
foreach (ITextMark *mrk, userData->marks()) {
foreach (ITextMark *mrk, userData->marks())
mrk->updateLineNumber(blockNumber + 1);
QTC_CHECK(mrk->lineNumber() == blockNumber +1);
}
block = block.next();
++blockNumber;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment