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
This commit is contained in:
Jürgen Vigna 2001-12-24 13:55:59 +00:00
parent 455a8f6ca2
commit 35dc964fe7
2 changed files with 19 additions and 1 deletions

View 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!

View 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))