From: Jürgen Vigna Date: Mon, 24 Dec 2001 13:55:59 +0000 (+0000) Subject: Fixed compatibility read between LaTeX paragraphs and minipages and multi X-Git-Tag: 1.6.10~20122 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=35dc964fe7deb9ea39503d5524a15ff4eea9ce5c;p=features.git Fixed compatibility read between LaTeX paragraphs and minipages and multi 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 --- diff --git a/src/ChangeLog b/src/ChangeLog index 123d2ebd71..00da49a875 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2001-12-24 Juergen Vigna + * 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! diff --git a/src/buffer.C b/src/buffer.C index 7ae0873b37..acda02ef18 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -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))