From aa1800bb89880306ee2e8be9a12625ec292b4a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 26 Jan 2014 11:23:20 +0100 Subject: [PATCH] TextDocumentLayout: Remove any extra ParagraphLayouts ... ... when adapting to changes in the TextDocument. There should be more explicit listener support for keeping the TextDocumentLayout in sync with the document. --- src/apps/haiku-depot/textview/TextDocumentLayout.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apps/haiku-depot/textview/TextDocumentLayout.cpp b/src/apps/haiku-depot/textview/TextDocumentLayout.cpp index 78bf6bf87b..1e1b8d6d80 100644 --- a/src/apps/haiku-depot/textview/TextDocumentLayout.cpp +++ b/src/apps/haiku-depot/textview/TextDocumentLayout.cpp @@ -101,6 +101,10 @@ TextDocumentLayout::InvalidateParagraphs(int32 start, int32 count) start++; count--; } + + // Remove any extra paragraph layouts + while (paragraphs.CountItems() < fParagraphLayouts.CountItems()) + fParagraphLayouts.Remove(fParagraphLayouts.CountItems() - 1); }