Turns out that a small further fix is needed for proper rendering of
insets that change their size and placement when written into.

This patch replaces an earlier patch, which offered only a partial fix.

OK to commit?

- Martin

Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.322
diff -u -p -r1.322 text3.C
--- text3.C     19 Dec 2005 12:30:34 -0000      1.322
+++ text3.C     31 Dec 2005 10:50:16 -0000
@@ -308,8 +308,8 @@ void LyXText::dispatch(LCursor & cur, Fu
        // Signals that a full-screen update is required
        bool needsUpdate = !(lyxaction.funcHasFlag(cmd.action, 
                LyXAction::NoUpdate) || singleParUpdate);
-       // Remember the old paragraph metric
-       Dimension olddim = cur.paragraph().dim();
+       // Remember the old paragraph metric (_outer_ paragraph!)
+       Dimension olddim = cur.bottom().paragraph().dim();
 
        switch (cmd.action) {
 
@@ -1531,8 +1531,8 @@ void LyXText::dispatch(LCursor & cur, Fu
 
        if (singleParUpdate)
                // Inserting characters does not change par height
-               if (cur.paragraph().dim().asc == olddim.asc
-                && cur.paragraph().dim().des == olddim.des) {
+               if (cur.bottom().paragraph().dim().height() 
+                   == olddim.height()) {
                        // if so, update _only_ this paragraph
                        cur.bv().update(Update::SinglePar | Update::Force);
                } else
Index: insets/insetcollapsable.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.281
diff -u -p -r1.281 insetcollapsable.C
--- insets/insetcollapsable.C   16 Dec 2005 12:48:18 -0000      1.281
+++ insets/insetcollapsable.C   31 Dec 2005 10:50:16 -0000
@@ -138,10 +138,7 @@ void InsetCollapsable::metrics(MetricsIn
                dim = dimensionCollapsed();
                if (status() == Open) {
                        InsetText::metrics(mi, textdim_);
-                       bool oldopeninlined = openinlined_;
                        openinlined_ = (textdim_.wid + dim.wid <= 
mi.base.textwidth);
-                       if (openinlined_ != oldopeninlined)
-                               InsetText::metrics(mi, textdim_);
                        if (openinlined_) {
                                dim.wid += textdim_.wid;
                                dim.des = max(dim.des - textdim_.asc + dim.asc, 
textdim_.des);

Attachment: pgpDJnBnM5Aw9.pgp
Description: PGP signature

Reply via email to