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
This commit is contained in:
André Pönitz 2003-06-27 09:44:26 +00:00
parent 5795dddd40
commit fb27166b77
9 changed files with 22 additions and 14 deletions

View File

@ -636,7 +636,7 @@ bool BufferView::ChangeInsets(Inset::Code code,
text->setCursorIntern(it.pit(), 0); text->setCursorIntern(it.pit(), 0);
text->redoParagraphs(text->cursor, text->redoParagraphs(text->cursor,
boost::next(text->cursor.par())); boost::next(text->cursor.par()));
text->fullRebreak(); text->partialRebreak();
} }
} }
} }

View File

@ -617,7 +617,7 @@ void BufferView::Pimpl::update(LyXText * text, BufferView::UpdateCodes f)
text->selection.cursor = text->cursor; text->selection.cursor = text->cursor;
} }
text->fullRebreak(); text->partialRebreak();
if (text->inset_owner) { if (text->inset_owner) {
text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); text->inset_owner->setUpdateStatus(bv_, InsetText::NONE);
@ -636,7 +636,7 @@ void BufferView::Pimpl::update(BufferView::UpdateCodes f)
text->selection.cursor = text->cursor; text->selection.cursor = text->cursor;
} }
text->fullRebreak(); text->partialRebreak();
if (text->inset_owner) { if (text->inset_owner) {
text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); text->inset_owner->setUpdateStatus(bv_, InsetText::NONE);

View File

@ -12,6 +12,10 @@
* text2.C: * text2.C:
* text3.C: remove LyXCursor::row_ member * 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 <abraunst@lyx.org> 2003-06-26 Alfredo Brauntein <abraunst@lyx.org>
* lyx_main.C (LyX): get full path of document loaded on the * lyx_main.C (LyX): get full path of document loaded on the

View File

@ -452,10 +452,7 @@ Inset::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
* Open (needfullrow) to Inlined (only the space * Open (needfullrow) to Inlined (only the space
* taken by the text). * taken by the text).
*/ */
LyXText * t = inset.getLyXText(cmd.view()); inset.getLyXText(cmd.view())->fullRebreak();
t->need_break_row = t->rows().begin();
t->fullRebreak();
t->setCursorIntern(t->cursor.par(), t->cursor.pos());
inset.update(cmd.view(), true); inset.update(cmd.view(), true);
bv->updateInset(this); bv->updateInset(this);
result = DISPATCHED; result = DISPATCHED;

View File

@ -118,11 +118,8 @@ dispatch_result InsetMinipage::localDispatch(FuncRequest const & cmd)
/* FIXME: I refuse to believe we have to live /* FIXME: I refuse to believe we have to live
* with ugliness like this ... */ * with ugliness like this ... */
LyXText * t = inset.getLyXText(cmd.view()); inset.getLyXText(cmd.view())->fullRebreak();
t->need_break_row = t->rows().begin();
t->fullRebreak();
inset.update(cmd.view(), true); inset.update(cmd.view(), true);
t->setCursorIntern(t->cursor.par(), t->cursor.pos());
cmd.view()->updateInset(this); cmd.view()->updateInset(this);
return DISPATCHED; return DISPATCHED;
} }

View File

@ -524,7 +524,7 @@ void InsetText::updateLocal(BufferView * bv, int what, bool mark_dirty)
lt = getLyXText(bv); lt = getLyXText(bv);
clear = true; clear = true;
} }
lt->fullRebreak(); lt->partialRebreak();
setUpdateStatus(bv, what); setUpdateStatus(bv, what);
bool flag = mark_dirty || bool flag = mark_dirty ||
(((need_update != CURSOR) && (need_update != NONE)) || (((need_update != CURSOR) && (need_update != NONE)) ||

View File

@ -180,7 +180,9 @@ public:
/// ///
void insertInset(Inset * inset); 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(); void fullRebreak();
/// ///

View File

@ -723,6 +723,14 @@ void LyXText::redoParagraphs(LyXCursor const & cur,
void LyXText::fullRebreak() void LyXText::fullRebreak()
{
need_break_row = rows().begin();
partialRebreak();
setCursorIntern(cursor.par(), cursor.pos());
}
void LyXText::partialRebreak()
{ {
if (rows().empty()) { if (rows().empty()) {
init(bv()); init(bv());

View File

@ -1393,7 +1393,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
// Clear the selection // Clear the selection
bv->screen().toggleSelection(bv->text, bv); bv->screen().toggleSelection(bv->text, bv);
bv->text->clearSelection(); bv->text->clearSelection();
bv->text->fullRebreak(); bv->text->partialRebreak();
bv->update(); bv->update();
bv->updateScrollbar(); bv->updateScrollbar();