From 97405fa6235c9ed6c8b40c651bd21b69955a88e4 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 19 May 2013 14:42:27 +0200 Subject: [PATCH] Fix bug 7673 by reverting changes to BufferView::checkDepm This reverts commit 210a4406 and a part of 5577e877. --- src/BufferView.cpp | 7 +++++-- src/Cursor.cpp | 9 ++------- src/Cursor.h | 2 -- src/Text2.cpp | 3 --- src/Text3.cpp | 24 ++++-------------------- 5 files changed, 11 insertions(+), 34 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index daa05a60d9..d26f949687 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -2400,9 +2400,12 @@ bool BufferView::checkDepm(Cursor & cur, Cursor & old) return false; d->cursor_ = cur; + + // we would rather not do this here, but it needs to be done before + // the changed() signal is sent. + buffer_.updateBuffer(); - cur.forceBufferUpdate(); - cur.screenUpdateFlags(Update::Force); + buffer_.changed(true); return true; } diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 7f8edc281e..3ad16f49ff 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -2048,12 +2048,8 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded) updateNeeded |= bv().checkDepm(dummy, *this); updateTextTargetOffset(); - if (updateNeeded) { + if (updateNeeded) forceBufferUpdate(); - // DEPM may have requested a screen update - this->screenUpdateFlags( - this->screenUpdate() | dummy.screenUpdate()); - } } return false; } @@ -2078,8 +2074,7 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded) ++dummy.pos(); if (bv().checkDepm(dummy, old)) { updateNeeded = true; - // Make sure that cur gets back whatever happened to dummy (Lgb) - // This will include any screen update requested by DEPM + // Make sure that cur gets back whatever happened to dummy (Lgb) operator=(dummy); } } else { diff --git a/src/Cursor.h b/src/Cursor.h index e84702cb71..006919bfd6 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -297,8 +297,6 @@ public: * Not using noScreenUpdate() should never be wrong. */ void noScreenUpdate() const; - /// - Update::flags screenUpdate() const { return disp_.screenUpdate(); } /// fix cursor in circumstances that should never happen. /// \retval true if a fix occured. bool fixIfBroken(); diff --git a/src/Text2.cpp b/src/Text2.cpp index 8dfcd4a230..012eb69b50 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -551,9 +551,6 @@ bool Text::setCursor(Cursor & cur, pit_type par, pos_type pos, bool const update_needed = !tm.contains(par); Cursor old = cur; setCursorIntern(cur, par, pos, setfont, boundary); - // FIXME There is a chance that we'll miss a screen update here. - // If so, then do DEPM and then check if cur wants an update and - // go ahead and do it, if so. return cur.bv().checkDepm(cur, old) || update_needed; } diff --git a/src/Text3.cpp b/src/Text3.cpp index 6e6e9e6f3b..70453620ac 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -648,12 +648,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // provide it with two different cursors. Cursor dummy = cur; dummy.pos() = dummy.pit() = 0; - if (cur.bv().checkDepm(dummy, cur)) { + if (cur.bv().checkDepm(dummy, cur)) cur.forceBufferUpdate(); - // DEPM may have requested a screen update - cur.screenUpdateFlags( - cur.screenUpdate() | dummy.screenUpdate()); - } } } break; @@ -679,12 +675,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) Cursor dummy = cur; dummy.pos() = cur.lastpos(); dummy.pit() = cur.lastpit(); - if (cur.bv().checkDepm(dummy, cur)) { + if (cur.bv().checkDepm(dummy, cur)) cur.forceBufferUpdate(); - // DEPM may have requested a screen update - cur.screenUpdateFlags( - cur.screenUpdate() | dummy.screenUpdate()); - } } } break; @@ -867,12 +859,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // provide it with two different cursors. Cursor dummy = cur; dummy.pos() = dummy.pit() = 0; - if (cur.bv().checkDepm(dummy, cur)) { + if (cur.bv().checkDepm(dummy, cur)) cur.forceBufferUpdate(); - // DEPM may have requested a screen update - cur.screenUpdateFlags( - cur.screenUpdate() | dummy.screenUpdate()); - } } } break; @@ -921,12 +909,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) Cursor dummy = cur; dummy.pos() = cur.lastpos(); dummy.pit() = cur.lastpit(); - if (cur.bv().checkDepm(dummy, cur)) { + if (cur.bv().checkDepm(dummy, cur)) cur.forceBufferUpdate(); - // DEPM may have requested a screen update - cur.screenUpdateFlags( - cur.screenUpdate() | dummy.screenUpdate()); - } } } break; -- 2.39.5