]> git.lyx.org Git - features.git/commitdiff
Fix old tabularcode/ert compatibility read (fix #305).
authorJürgen Vigna <jug@sad.it>
Thu, 28 Mar 2002 13:21:37 +0000 (13:21 +0000)
committerJürgen Vigna <jug@sad.it>
Thu, 28 Mar 2002 13:21:37 +0000 (13:21 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3860 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/insets/ChangeLog
src/insets/insettabular.C
src/tabular.C

index 31874f43312b03c435e38a5fc29ab4ff61590d04..9dc92e4d2d7a8b4b95df4058cdc91421548ee045 100644 (file)
@@ -1,3 +1,7 @@
+2002-03-28  Juergen Vigna  <jug@sad.it>
+
+       * tabular.C (OldFormatRead): fix ert compatibility read inside cells.
+
 2002-03-27  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * lyxfunc.C (getStatus): return 'disabled' early for LFUN_NOACTION
index c67460b7a2d18e4386e208d1fec04520d96ec9d1..b39b21599bb0560b2ab3698b83439f12cc00b96f 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-28  Juergen Vigna  <jug@sad.it>
+
+       * 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  <voss@lyx.org>
 
        * insetgraphicsparam.C: change c%, p% to col%, page%
index 8fb923bdefb25f97f38c3186b0c4e547bb91c43c..11e692028a5460118fd359de44760826319a0bcb 100644 (file)
@@ -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;
 }
 
 
index d38a35714dc56a303e2f4d7c0da129be3e15495c..7f05319dbdf454f72bca1bde9462e9287e1c771e 100644 (file)
@@ -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,