mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-21 07:12:10 +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>
|
2003-03-04 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||||
|
|
||||||
* paragraph_funcs.C (TeXEnvironment): remove all usage of
|
* paragraph_funcs.C (TeXEnvironment): remove all usage of
|
||||||
|
@ -88,11 +88,20 @@ ParagraphList::ParagraphList()
|
|||||||
ParagraphList::iterator
|
ParagraphList::iterator
|
||||||
ParagraphList::insert(ParagraphList::iterator it, Paragraph * par)
|
ParagraphList::insert(ParagraphList::iterator it, Paragraph * par)
|
||||||
{
|
{
|
||||||
|
if (it != end()) {
|
||||||
Paragraph * prev = it->previous();
|
Paragraph * prev = it->previous();
|
||||||
par->next(&*it);
|
par->next(&*it);
|
||||||
par->previous(prev);
|
par->previous(prev);
|
||||||
prev->next(par);
|
prev->next(par);
|
||||||
it->previous(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);
|
return iterator(par);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +121,9 @@ void ParagraphList::erase(ParagraphList::iterator it)
|
|||||||
Paragraph * prev = it->previous();
|
Paragraph * prev = it->previous();
|
||||||
Paragraph * next = it->next();
|
Paragraph * next = it->next();
|
||||||
|
|
||||||
|
if (prev)
|
||||||
prev->next(next);
|
prev->next(next);
|
||||||
|
if (next)
|
||||||
next->previous(prev);
|
next->previous(prev);
|
||||||
|
|
||||||
delete &*it;
|
delete &*it;
|
||||||
|
@ -1406,6 +1406,10 @@ void LyXText::breakParagraph(BufferView * bview, char keep_layout)
|
|||||||
|
|
||||||
setHeightOfRow(bview, cursor.row());
|
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()
|
while (!cursor.par()->next()->empty()
|
||||||
&& cursor.par()->next()->isNewline(0))
|
&& cursor.par()->next()->isNewline(0))
|
||||||
cursor.par()->next()->erase(0);
|
cursor.par()->next()->erase(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user