mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
fix some rand cases
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6349 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
58f79c1b87
commit
40d00da985
@ -1,3 +1,8 @@
|
||||
2003-03-05 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||
|
||||
* ParagraphList.C (insert): handle insert right before end()
|
||||
(erase): fix cases where it can be first or last paragraph.
|
||||
|
||||
2003-03-04 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||
|
||||
* paragraph_funcs.C (TeXEnvironment): remove all usage of
|
||||
|
@ -88,11 +88,20 @@ ParagraphList::ParagraphList()
|
||||
ParagraphList::iterator
|
||||
ParagraphList::insert(ParagraphList::iterator it, Paragraph * par)
|
||||
{
|
||||
Paragraph * prev = it->previous();
|
||||
par->next(&*it);
|
||||
par->previous(prev);
|
||||
prev->next(par);
|
||||
it->previous(par);
|
||||
if (it != end()) {
|
||||
Paragraph * prev = it->previous();
|
||||
par->next(&*it);
|
||||
par->previous(prev);
|
||||
prev->next(par);
|
||||
it->previous(par);
|
||||
} else {
|
||||
// Find last par.
|
||||
Paragraph * last = parlist;
|
||||
while (last->next())
|
||||
last = last->next();
|
||||
last->next(par);
|
||||
par->previous(last);
|
||||
}
|
||||
return iterator(par);
|
||||
}
|
||||
|
||||
@ -112,8 +121,10 @@ void ParagraphList::erase(ParagraphList::iterator it)
|
||||
Paragraph * prev = it->previous();
|
||||
Paragraph * next = it->next();
|
||||
|
||||
prev->next(next);
|
||||
next->previous(prev);
|
||||
if (prev)
|
||||
prev->next(next);
|
||||
if (next)
|
||||
next->previous(prev);
|
||||
|
||||
delete &*it;
|
||||
}
|
||||
|
@ -1406,6 +1406,10 @@ void LyXText::breakParagraph(BufferView * bview, char keep_layout)
|
||||
|
||||
setHeightOfRow(bview, cursor.row());
|
||||
|
||||
#warning Trouble Point! (Lgb)
|
||||
// When ::breakParagraph is called from within an inset we must
|
||||
// ensure that the correct ParagraphList is used. Today that is not
|
||||
// the case and the Buffer::paragraphs is used. Not good. (Lgb)
|
||||
while (!cursor.par()->next()->empty()
|
||||
&& cursor.par()->next()->isNewline(0))
|
||||
cursor.par()->next()->erase(0);
|
||||
|
Loading…
Reference in New Issue
Block a user