From fb27166b7795abfd3ad84add588f3e59d5d3a472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 27 Jun 2003 09:44:26 +0000 Subject: [PATCH] rename fullRebreak() to partialRebreak() and implement a fullRebreak() that really breaks fully git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7215 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.C | 2 +- src/BufferView_pimpl.C | 4 ++-- src/ChangeLog | 4 ++++ src/insets/insetert.C | 5 +---- src/insets/insetminipage.C | 5 +---- src/insets/insettext.C | 2 +- src/lyxtext.h | 4 +++- src/text2.C | 8 ++++++++ src/text3.C | 2 +- 9 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/BufferView.C b/src/BufferView.C index a71a3b01d3..697d85cc2b 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -636,7 +636,7 @@ bool BufferView::ChangeInsets(Inset::Code code, text->setCursorIntern(it.pit(), 0); text->redoParagraphs(text->cursor, boost::next(text->cursor.par())); - text->fullRebreak(); + text->partialRebreak(); } } } diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index b5e6a52038..59c7df3c5a 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -617,7 +617,7 @@ void BufferView::Pimpl::update(LyXText * text, BufferView::UpdateCodes f) text->selection.cursor = text->cursor; } - text->fullRebreak(); + text->partialRebreak(); if (text->inset_owner) { text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); @@ -636,7 +636,7 @@ void BufferView::Pimpl::update(BufferView::UpdateCodes f) text->selection.cursor = text->cursor; } - text->fullRebreak(); + text->partialRebreak(); if (text->inset_owner) { text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); diff --git a/src/ChangeLog b/src/ChangeLog index 11a0a61570..cdb7f140be 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -12,6 +12,10 @@ * text2.C: * text3.C: remove LyXCursor::row_ member + * lyxtext.h: + * text.C: rename fullRebreak() to partialRebreak() and implement + a fullRebreak() that really bereks fully + 2003-06-26 Alfredo Brauntein * lyx_main.C (LyX): get full path of document loaded on the diff --git a/src/insets/insetert.C b/src/insets/insetert.C index f4b142bace..4940913e0f 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -452,10 +452,7 @@ Inset::RESULT InsetERT::localDispatch(FuncRequest const & cmd) * Open (needfullrow) to Inlined (only the space * taken by the text). */ - LyXText * t = inset.getLyXText(cmd.view()); - t->need_break_row = t->rows().begin(); - t->fullRebreak(); - t->setCursorIntern(t->cursor.par(), t->cursor.pos()); + inset.getLyXText(cmd.view())->fullRebreak(); inset.update(cmd.view(), true); bv->updateInset(this); result = DISPATCHED; diff --git a/src/insets/insetminipage.C b/src/insets/insetminipage.C index a346f5f60d..ecd4a0070d 100644 --- a/src/insets/insetminipage.C +++ b/src/insets/insetminipage.C @@ -118,11 +118,8 @@ dispatch_result InsetMinipage::localDispatch(FuncRequest const & cmd) /* FIXME: I refuse to believe we have to live * with ugliness like this ... */ - LyXText * t = inset.getLyXText(cmd.view()); - t->need_break_row = t->rows().begin(); - t->fullRebreak(); + inset.getLyXText(cmd.view())->fullRebreak(); inset.update(cmd.view(), true); - t->setCursorIntern(t->cursor.par(), t->cursor.pos()); cmd.view()->updateInset(this); return DISPATCHED; } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 634855a0dc..9e8c0a868d 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -524,7 +524,7 @@ void InsetText::updateLocal(BufferView * bv, int what, bool mark_dirty) lt = getLyXText(bv); clear = true; } - lt->fullRebreak(); + lt->partialRebreak(); setUpdateStatus(bv, what); bool flag = mark_dirty || (((need_update != CURSOR) && (need_update != NONE)) || diff --git a/src/lyxtext.h b/src/lyxtext.h index 0f53ba0b90..ddc07bee46 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -180,7 +180,9 @@ public: /// void insertInset(Inset * inset); - /// Completes the insertion with a full rebreak + /// Completes the insertion with a rebreak from 'need_break_row' on + void partialRebreak(); + /// a full rebreak of the whole text void fullRebreak(); /// diff --git a/src/text2.C b/src/text2.C index 4fef3bdb4e..bbfcad9eca 100644 --- a/src/text2.C +++ b/src/text2.C @@ -723,6 +723,14 @@ void LyXText::redoParagraphs(LyXCursor const & cur, void LyXText::fullRebreak() +{ + need_break_row = rows().begin(); + partialRebreak(); + setCursorIntern(cursor.par(), cursor.pos()); +} + + +void LyXText::partialRebreak() { if (rows().empty()) { init(bv()); diff --git a/src/text3.C b/src/text3.C index c1117c6f95..33284bc3e9 100644 --- a/src/text3.C +++ b/src/text3.C @@ -1393,7 +1393,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd) // Clear the selection bv->screen().toggleSelection(bv->text, bv); bv->text->clearSelection(); - bv->text->fullRebreak(); + bv->text->partialRebreak(); bv->update(); bv->updateScrollbar();