From be1bd533f37a3eb73b915c83edd55a7afab1f144 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Thu, 28 Mar 2002 13:21:37 +0000 Subject: [PATCH] Fix old tabularcode/ert compatibility read (fix #305). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3860 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/insets/ChangeLog | 6 ++++++ src/insets/insettabular.C | 5 ++++- src/tabular.C | 9 ++++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 31874f4331..9dc92e4d2d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2002-03-28 Juergen Vigna + + * tabular.C (OldFormatRead): fix ert compatibility read inside cells. + 2002-03-27 Jean-Marc Lasgouttes * lyxfunc.C (getStatus): return 'disabled' early for LFUN_NOACTION diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index c67460b7a2..b39b21599b 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,9 @@ +2002-03-28 Juergen Vigna + + * insettabular.C (insetAllowed): return true as default value otherwise + we're not able to insert insets inside paragraphs of an not locked + insettext! + 2002-03-27 Herbert Voss * insetgraphicsparam.C: change c%, p% to col%, page% diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 8fb923bdef..11e692028a 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -2781,7 +2781,10 @@ bool InsetTabular::insetAllowed(Inset::Code code) const { if (the_locking_inset) return the_locking_inset->insetAllowed(code); - return false; + // we return true here because if the inset is not locked someone + // wants to insert something in one of our insettexts and we generally + // allow to do so. + return true; } diff --git a/src/tabular.C b/src/tabular.C index d38a35714d..7f05319dbd 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -1462,7 +1462,8 @@ void LyXTabular::OldFormatRead(BufferParams const & bp, continue; if (token == "\\layout" || token == "\\end_float" - || token == "\\end_deeper") { + || token == "\\end_deeper") + { lex.pushToken(token); #ifndef NO_COMPABILITY // Here we need to insert the inset_ert_contents into the last @@ -1471,6 +1472,12 @@ void LyXTabular::OldFormatRead(BufferParams const & bp, #endif break; } +#ifndef NO_COMPABILITY + if (token == "\\newline") + // Here we need to insert the inset_ert_contents into the last + // cell of the tabular. + owner_->bufferOwner()->insertErtContents(par, pos, false); +#endif if (owner_->bufferOwner()->parseSingleLyXformat2Token(lex, par, return_par, token, pos, -- 2.39.5