From: Jürgen Vigna Date: Tue, 12 Mar 2002 13:27:51 +0000 (+0000) Subject: Set layout informations on newly created paragraphs and don't resize InsetTexts X-Git-Tag: 1.6.10~19674 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6bb95ff114bf81883cf7748a94d37570824597c0;p=lyx.git Set layout informations on newly created paragraphs and don't resize InsetTexts LyXText if we didn't create a new LyXText as it is not needed then. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3726 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index ee13214810..af028664e5 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -311,6 +311,7 @@ int BufferView::Pimpl::resizeCurrentBuffer() pos_type selendpos = 0; bool selection = false; bool mark_set = false; + bool text_found = false; owner_->prohibitInput(); @@ -334,6 +335,7 @@ int BufferView::Pimpl::resizeCurrentBuffer() // the new buffer_ with the correct width. bv_->text = textcache.findFit(buffer_, workarea_.workWidth()); if (bv_->text) { + text_found = true; if (lyxerr.debugging()) { lyxerr << "Found a LyXText that fits:\n"; textcache.show(lyxerr, make_pair(buffer_, make_pair(workarea_.workWidth(), bv_->text))); @@ -372,7 +374,8 @@ int BufferView::Pimpl::resizeCurrentBuffer() // please tell me WHY the heck you deactivated this code, whoever // 'you' are (Jug 20020311) #if 1 - buffer_->resizeInsets(bv_); + if (!text_found) + buffer_->resizeInsets(bv_); #endif // this will scroll the screen such that the cursor becomes visible updateScrollbar(); diff --git a/src/ChangeLog b/src/ChangeLog index be41a94531..2c7b08f663 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2002-03-12 Juergen Vigna + + * BufferView_pimpl.C (resizeCurrentBuffer): only resize insets if we + did resize the LyXText too. + + * buffer.C (readLyXformat2): set layout information on newly allocated + paragraphs. + + * tabular.C (OldFormatRead): set layout information on the paragraph. + 2002-03-12 José Abílio Oliveira Matos * buffer.C (simpleDocBookOnePar): fix empty definition case for now. diff --git a/src/buffer.C b/src/buffer.C index a0b1332003..1afe9c8d78 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -333,6 +333,7 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par) if (!par) { par = new Paragraph; + par->layout(textclasslist[params.textclass].defaultLayoutName()); } else { // We are inserting into an existing document users->text->breakParagraph(users); @@ -544,6 +545,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, first_par = par; else { par = new Paragraph(par); + par->layout(textclasslist[params.textclass].defaultLayoutName()); } pos = 0; par->layout(layoutname); diff --git a/src/tabular.C b/src/tabular.C index 9ca78ad16f..abb3821685 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -35,6 +35,7 @@ #include "frontends/Alert.h" #include "gettext.h" #include "tabular_funcs.h" +#include "lyxtextclasslist.h" #include #include @@ -197,7 +198,7 @@ LyXTabular * LyXTabular::clone(BufferParams const & bp, /* activates all lines and sets all widths to 0 */ void LyXTabular::Init(BufferParams const & bp, - int rows_arg, int columns_arg, LyXTabular const * lt) + int rows_arg, int columns_arg, LyXTabular const * lt) { rows_ = rows_arg; columns_ = columns_arg; @@ -1309,7 +1310,7 @@ void LyXTabular::ReadNew(Buffer const * buf, istream & is, void LyXTabular::OldFormatRead(BufferParams const & bp, - LyXLex & lex, string const & fl) + LyXLex & lex, string const & fl) { int version; int i; @@ -1443,6 +1444,7 @@ void LyXTabular::OldFormatRead(BufferParams const & bp, Paragraph * par = new Paragraph; Paragraph * return_par = 0; + par->layout(textclasslist[bp.textclass].defaultLayoutName()); string tmptok; int pos = 0; Paragraph::depth_type depth = 0;