Move BaseTextDocument::documentClosing to BaseTextDocumentLayout

Centralizing mark handling

Change-Id: Ie29c15d97aa171fbf3516d4242fe3f962091477a
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Daniel Teske
2012-02-15 13:39:10 +01:00
parent c44d65d3c6
commit 45850c23f2
4 changed files with 17 additions and 13 deletions

View File

@@ -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();