From: Abdelrazak Younes Date: Fri, 22 Feb 2008 11:07:41 +0000 (+0000) Subject: Fix this bug: X-Git-Tag: 1.6.10~6168 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6564e9bb4e0398623ccf2249e3e4fbadf3b72ea3;p=features.git Fix this bug: 1. scroll a bit so that the cursor is not visible anymore 2. hit the keyboard arrow keys to move the cursor or type something The problem was that TextMetrics::parMetric() automatically creates a new parmetrics on const access. This was needed in the old architecture but I don't think anymore. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23126 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Text3.cpp b/src/Text3.cpp index 99ec81105b..0736f0d67f 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -406,10 +406,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // Signals that a full-screen update is required bool needsUpdate = !(lyxaction.funcHasFlag(cmd.action, LyXAction::NoUpdate) || singleParUpdate); - // Remember the old paragraph metric (_outer_ paragraph!) - ParagraphMetrics const & pm = cur.bv().parMetrics( - cur.bottom().text(), cur.bottom().pit()); - Dimension olddim = pm.dim(); switch (cmd.action) { @@ -1820,16 +1816,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // FIXME: the following code should go in favor of fine grained // update flag treatment. if (singleParUpdate) { - // Inserting characters does not change par height - ParagraphMetrics const & pms - = cur.bv().parMetrics(cur.bottom().text(), cur.bottom().pit()); - if (pms.dim().height() == olddim.height()) { - // if so, update _only_ this paragraph - cur.updateFlags(Update::SinglePar | - Update::FitCursor); - return; - } - needsUpdate = true; + // Inserting characters does not change par height in general. So, try + // to update _only_ this paragraph. BufferView will detect if a full + // metrics update is needed anyway. + cur.updateFlags(Update::SinglePar | Update::FitCursor); + return; } if (!needsUpdate