From b534149b1d3c3b1ef4f6e0dc836b0513dd5cd545 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 13 Jan 2004 20:25:47 +0000 Subject: When styling is performed outside a styleneeded event, increment the style clock so the layout cache is invalidated and so the styling is displayed. --- src/Document.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index fb28144dd..9f5018c7e 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1246,10 +1246,7 @@ bool Document::SetStyles(int length, char *styles) { bool Document::EnsureStyledTo(int pos) { if (pos > GetEndStyled()) { - styleClock++; - if (styleClock > 0x100000) { - styleClock = 0; - } + IncrementStyleClock(); // Ask the watchers to style, and stop as soon as one responds. for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++) { watchers[i].watcher->NotifyStyleNeeded(this, watchers[i].userData, pos); @@ -1258,6 +1255,13 @@ bool Document::EnsureStyledTo(int pos) { return pos <= GetEndStyled(); } +void Document::IncrementStyleClock() { + styleClock++; + if (styleClock > 0x100000) { + styleClock = 0; + } +} + bool Document::AddWatcher(DocWatcher *watcher, void *userData) { for (int i = 0; i < lenWatchers; i++) { if ((watchers[i].watcher == watcher) && -- cgit v1.2.3