diff --git a/src/ChangeLog b/src/ChangeLog index 04c8983bce..74816035ce 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2002-03-06 Juergen Vigna + + * buffer.C (parseSingleLyXformat2Token): changed "%" to "p%" as + otherwise it would not be a valid lenght. Fixed a special case in + the minipage compatibility read where we end the document with a + minipage. + + * text2.C (deleteEmptyParagraphMechanism): check if old_cursor.par() + was set as it could be 0 for InsetTexts first entry. + 2002-03-06 Lars Gullik Bjønnes * paragraph.C (writeFile): if layout is empty write out diff --git a/src/buffer.C b/src/buffer.C index ad3ac81b45..0c366f370f 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -433,7 +433,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, static int call_depth; ++call_depth; bool checkminipage = false; - static Paragraph * minipar; + static Paragraph * minipar = 0; static Paragraph * parBeforeMinipage; #endif #endif @@ -1172,6 +1172,8 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, the_end_read = true; #ifndef NO_COMPABILITY #ifndef NO_PEXTRA_REALLY + if (minipar == par) + par = 0; minipar = parBeforeMinipage = 0; #endif #endif @@ -1228,7 +1230,8 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, if (checkminipage && (call_depth == 1)) { checkminipage = false; if (minipar && (minipar != par) && - (par->params().pextraType() == Paragraph::PEXTRA_MINIPAGE)) { + (par->params().pextraType() == Paragraph::PEXTRA_MINIPAGE)) + { lyxerr << "minipages in a row" << endl; if (par->params().pextraStartMinipage()) { lyxerr << "start new minipage" << endl; @@ -1264,7 +1267,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, mini->pageWidth(LyXLength(par->params().pextraWidth())); if (!par->params().pextraWidthp().empty()) { lyxerr << "WP:" << mini->pageWidth().asString() << endl; - mini->pageWidth(LyXLength((par->params().pextraWidthp())+"%")); + mini->pageWidth(LyXLength((par->params().pextraWidthp())+"p%")); } Paragraph * op = mini->firstParagraph(); mini->inset.paragraph(par); @@ -1345,9 +1348,19 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, mini->pageWidth(LyXLength(minipar->params().pextraWidth())); if (!par->params().pextraWidthp().empty()) { lyxerr << "WP:" << mini->pageWidth().asString() << endl; - mini->pageWidth(LyXLength((par->params().pextraWidthp())+"%")); + mini->pageWidth(LyXLength((par->params().pextraWidthp())+"p%")); } + + Paragraph * op = mini->firstParagraph(); mini->inset.paragraph(minipar); + // + // and free the old ones! + // + while(op) { + Paragraph * pp = op->next(); + delete op; + op = pp; + } // Insert the minipage last in the // previous paragraph. diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index bbb041b960..ab612f90d6 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,6 +1,7 @@ 2002-03-06 Juergen Vigna * insettext.C (draw): fixed frame redrawing. + (clear): forgot to set the inset_owner of the paragraph. * insetert.C (status): pay attention the bv can be 0 here! (getMaxWidth): add the default leftMargin diff --git a/src/insets/insetert.C b/src/insets/insetert.C index 415879dbdd..5d8a8fee45 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -676,7 +676,7 @@ void InsetERT::close(BufferView * bv) const string const InsetERT::selectNextWordToSpellcheck(BufferView * bv, - float &) const + float &) const { bv->unlockInset(const_cast(this)); return string(); diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 2777f7a292..d0647d8cf2 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -227,6 +227,7 @@ void InsetText::clear() par = tmp; } par = new Paragraph; + par->setInsetOwner(this); par->layout(old_layout); reinitLyXText(); @@ -2137,12 +2138,13 @@ Row * InsetText::crow(BufferView * bv) const LyXText * InsetText::getLyXText(BufferView const * lbv, bool const recursive) const { - if (!recursive && (cached_bview == lbv)) { + if (cached_bview == lbv) { + if (recursive && the_locking_inset) + return the_locking_inset->getLyXText(lbv, true); LyXText * lt = cached_text.get(); lyx::Assert(lt && lt->firstRow()->par() == par); return lt; } - // Super UGLY! (Lgb) BufferView * bv = const_cast(lbv);