forked from qt-creator/qt-creator
Move BaseTextDocument::documentClosing to BaseTextDocumentLayout
Centralizing mark handling Change-Id: Ie29c15d97aa171fbf3516d4242fe3f962091477a Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -516,6 +516,7 @@ BaseTextDocumentLayout::BaseTextDocumentLayout(QTextDocument *doc)
|
||||
|
||||
BaseTextDocumentLayout::~BaseTextDocumentLayout()
|
||||
{
|
||||
documentClosing();
|
||||
}
|
||||
|
||||
void BaseTextDocumentLayout::setParentheses(const QTextBlock &block, const Parentheses &parentheses)
|
||||
@@ -699,6 +700,17 @@ QSizeF BaseTextDocumentLayout::documentSize() const
|
||||
return size;
|
||||
}
|
||||
|
||||
void BaseTextDocumentLayout::documentClosing()
|
||||
{
|
||||
QTextBlock block = document()->begin();
|
||||
while (block.isValid()) {
|
||||
if (TextBlockUserData *data = static_cast<TextBlockUserData *>(block.userData()))
|
||||
data->documentClosing();
|
||||
block = block.next();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BaseTextDocumentLayout::updateMarksLineNumber()
|
||||
{
|
||||
QTextBlock block = document()->begin();
|
||||
|
||||
Reference in New Issue
Block a user