]> git.lyx.org Git - features.git/commitdiff
Fixed compatibility read between LaTeX paragraphs and minipages and multi
authorJürgen Vigna <jug@sad.it>
Mon, 24 Dec 2001 13:55:59 +0000 (13:55 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 24 Dec 2001 13:55:59 +0000 (13:55 +0000)
depth (short TableExamples.lyx is now read correct ;)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3263 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/buffer.C

index 123d2ebd718318ed070965c5290744318a1cc1b8..00da49a87525992d31116b9189135dd1bc367f40 100644 (file)
@@ -1,5 +1,10 @@
 2001-12-24  Juergen Vigna  <jug@sad.it>
 
+       * buffer.C (parseSingleLyXformat2Token): fixed 2 compatibility read
+       problems. First check a minipage also if we have some ert-contents
+       (not only on par->size(), second set the right depth of the paragraph
+       on the relink to the root-paragraph-list!
+
        * undo_funcs.C (textHandleUndo): fixed a stupid earlier wrong fix
        which then did not anymore update the main paragraphs on undo/redo!
 
index 7ae0873b3715c7cc0c0819677febdeb8b9b85a50..acda02ef18a14878a951d80f4d3d94d71655e851 100644 (file)
@@ -1194,7 +1194,8 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
 #ifndef NO_PEXTRA_REALLY
        // I wonder if we could use this blanket fix for all the
        // checkminipage cases...
-       if (par && par->size()) {
+       // don't forget about ert paragraphs and compatibility read for'em
+       if (par && (par->size() || !ert_comp.contents.empty())) {
                // It is possible that this will check to often,
                // but that should not be an correctness issue.
                // Only a speed issue.
@@ -1208,6 +1209,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
        //
        // BEGIN pextra_minipage compability
        // This should be removed in 1.3.x (Lgb)
+       // I don't think we should remove this so fast (Jug)
        
        // This compability code is not perfect. In a couple
        // of rand cases it fails. When the minipage par is
@@ -1259,7 +1261,16 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                            lyxerr << "WP:" << mini->width() << endl;
                            mini->width(tostr(par->params().pextraWidthp())+"%");
                        }
+                       Paragraph * op = mini->firstParagraph();
                        mini->inset.paragraph(par);
+                       //
+                       // and free the old ones!
+                       //
+                       while(op) {
+                               Paragraph * pp = op->next();
+                               delete op;
+                               op = pp;
+                       }
                        // Insert the minipage last in the
                        // previous paragraph.
                        if (par->params().pextraHfill()) {
@@ -1296,6 +1307,8 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                        tmp = tmp->next();
                }
                depth = parBeforeMinipage->params().depth();
+               // and set this depth on the par as it has not been set already
+               par->params().depth(depth);
                minipar = parBeforeMinipage = 0;
        } else if (!minipar &&
                   (par->params().pextraType() == Paragraph::PEXTRA_MINIPAGE))