From f29244136563eb29f50996df8444060cde3dd0f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Tue, 18 Dec 2001 14:36:27 +0000 Subject: [PATCH] More fixes to the autocollapsing of paragraphs. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3240 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 11 +++++++++++ src/insets/insetcollapsable.C | 2 +- src/insets/insetert.C | 4 ++-- src/insets/insettext.C | 4 ++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index e0f5ddd5be..a867597191 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,9 +1,20 @@ 2001-12-18 Juergen Vigna + * 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 diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index c314aa2f82..8a0ab06fb5 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -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); } diff --git a/src/insets/insetert.C b/src/insets/insetert.C index 6b3c6f61cf..ebbfed5233 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -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(this), false); + bv->updateInset(const_cast(&inset), false); } } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index d4ed590e85..7ac5893769 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -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(); -- 2.39.2