]> git.lyx.org Git - features.git/commitdiff
More fixes to the autocollapsing of paragraphs.
authorJürgen Vigna <jug@sad.it>
Tue, 18 Dec 2001 14:36:27 +0000 (14:36 +0000)
committerJürgen Vigna <jug@sad.it>
Tue, 18 Dec 2001 14:36:27 +0000 (14:36 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3240 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetcollapsable.C
src/insets/insetert.C
src/insets/insettext.C

index e0f5ddd5be442f5cdb6c4a8a478aafeeaf6b1fe3..a867597191fdf16d7653765f99bf66900784f5da 100644 (file)
@@ -1,9 +1,20 @@
 2001-12-18  Juergen Vigna  <jug@sad.it>
 
+       * insettext.C (updateInsetInInset): look if we have to autocollapse
+       paragraps and return if the update is requested for ourself.
+
+       * insetert.C (status): update the insettext not myself as that is what
+       we need.
+
+       * insetcollapsable.C (updateInsetInInset): always call the InsetText's
+       function only return if the update was requested with myself.
+
        * insettext.C (insetButtonPress): fixed stupid bug.
        (various functions): pay attention that lt is cleared BEFORE calling
        updateLocal() and try to use it in the right manner (don't use it
        if it's not really neccessary!)
+       (collapseParagraphs): insert a blank between collapsing paragraphs
+       if neccessary (not already there!).
 
 2001-12-18  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
index c314aa2f82e7fec75790c5ecdd8adf1150df581a..8a0ab06fb517cb1ba72e968b7fda00b0165d45c9 100644 (file)
@@ -453,7 +453,7 @@ bool InsetCollapsable::unlockInsetInInset(BufferView * bv, UpdatableInset * in,
 
 bool InsetCollapsable::updateInsetInInset(BufferView * bv, Inset *in)
 {
-       if (&inset == in)
+       if (in == this)
                return true;
        return inset.updateInsetInInset(bv, in);
 }
index 6b3c6f61cf1eebe2a909cb4e0375fe864afae809..ebbfed5233d6f3eb57643b00fa43e680ce836a07 100644 (file)
@@ -267,8 +267,8 @@ void InsetERT::edit(BufferView * bv, int x, int y, unsigned int button)
        } else {
                InsetCollapsable::edit(bv, x, y, button);
        }
-       updateStatus(0);
        set_latex_font(bv);
+       updateStatus(bv);
 }
 
 
@@ -633,7 +633,7 @@ void InsetERT::status(BufferView * bv, ERTStatus const st) const
                        break;
                }
                if (bv)
-                       bv->updateInset(const_cast<InsetERT *>(this), false);
+                       bv->updateInset(const_cast<InsetText *>(&inset), false);
        }
 }
 
index d4ed590e852380580f8d7880ec3f32a1ee916a30..7ac589376914b5e73ff01deb5023905a22d0c00c 100644 (file)
@@ -839,6 +839,8 @@ bool InsetText::updateInsetInInset(BufferView * bv, Inset * inset)
 {
        if (!autoBreakRows && par->next())
                collapseParagraphs(bv->buffer()->params);
+       if (inset == this)
+               return true;
        bool clear = false;
        if (!lt) {
                lt = getLyXText(bv);
@@ -2585,6 +2587,8 @@ bool InsetText::checkInsertChar(LyXFont & font)
 void InsetText::collapseParagraphs(BufferParams const & bparams) const
 {
        while(par->next()) {
+               if (!par->isSeparator(par->size()-1))
+                       par->insertChar(par->size()-1, ' ');
                par->pasteParagraph(bparams);
        }
        reinitLyXText();