From e1eb45f5d3e933d76214e74d3d8e3d09c8953533 Mon Sep 17 00:00:00 2001 From: Allan Rae Date: Wed, 5 Dec 2001 05:53:01 +0000 Subject: [PATCH] extend John's getLyXText() patch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3148 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 5 +++++ src/frontends/qt2/QParagraph.C | 22 ++++++++-------------- src/frontends/xforms/ChangeLog | 4 ++++ src/frontends/xforms/FormParagraph.C | 2 +- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 161b40e94b..882d92a465 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2001-12-05 Allan Rae + + * QParagraph.C (apply): + (update): Use the right LyXText -- extending John's fix + 2001-12-01 Maks Orlovich * moc/Makefile.am: diff --git a/src/frontends/qt2/QParagraph.C b/src/frontends/qt2/QParagraph.C index 602db737c5..025c63a503 100644 --- a/src/frontends/qt2/QParagraph.C +++ b/src/frontends/qt2/QParagraph.C @@ -56,14 +56,7 @@ void QParagraph::update(bool switched) dialog_->setReadOnly(readonly); } - LyXText * text = 0; - - if (lv_->view()->theLockingInset()) - text = lv_->view()->theLockingInset()->getLyXText(lv_->view()); - - if (!text) - text = lv_->view()->text; - + LyXText * text(lv_->view()->getLyXText()); Paragraph * par = text->cursor.par(); int align = par->getAlign(); @@ -142,11 +135,12 @@ void QParagraph::apply() lyxerr[Debug::GUI] << "Setting above space \"" << LyXGlueLength(spaceabove.length().asString()).asString() << "\"" << endl; lyxerr[Debug::GUI] << "Setting below space \"" << LyXGlueLength(spacebelow.length().asString()).asString() << "\"" << endl; - lv_->view()->text->setParagraph(lv_->view(), - dialog_->getLineAbove(), dialog_->getLineBelow(), - dialog_->getPagebreakAbove(), dialog_->getPagebreakBelow(), - spaceabove, spacebelow, Spacing(), dialog_->getAlign(), - dialog_->getLabelWidth(), dialog_->getNoIndent()); + LyXText * text(lv_->view()->getLyXText()); + text->setParagraph(lv_->view(), + dialog_->getLineAbove(), dialog_->getLineBelow(), + dialog_->getPagebreakAbove(), dialog_->getPagebreakBelow(), + spaceabove, spacebelow, Spacing(), dialog_->getAlign(), + dialog_->getLabelWidth(), dialog_->getNoIndent()); // extra stuff @@ -162,7 +156,7 @@ void QParagraph::apply() lyxerr[Debug::GUI] << "Setting extrawidth \"" << width << "\"" << endl; lyxerr[Debug::GUI] << "Setting percent extrawidth \"" << widthp << "\"" << endl; - lv_->view()->update(lv_->view()->text, + lv_->view()->update(text, BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE); diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 0fcfe18da4..3d66ddf16c 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2001-12-05 Allan Rae + + * FormParagraph.C (apply): One other LyXText fix. + 2001-12-05 John Levon * FormParagraph.C (getCurrentParagraph): diff --git a/src/frontends/xforms/FormParagraph.C b/src/frontends/xforms/FormParagraph.C index 791af6a5a2..27ac50bf9f 100644 --- a/src/frontends/xforms/FormParagraph.C +++ b/src/frontends/xforms/FormParagraph.C @@ -279,7 +279,7 @@ void FormParagraph::apply() // Actually apply these settings - lv_->view()->update(lv_->view()->text, + lv_->view()->update(text, BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE); lv_->buffer()->markDirty(); setMinibuffer(lv_, _("Paragraph layout set"));