more ParagraphList::iterator usage

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6340 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-03-04 18:50:31 +00:00
parent 3910647ab4
commit 70687ca7fc
4 changed files with 26 additions and 14 deletions

View File

@ -1,3 +1,12 @@
2003-03-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* paragraph_funcs.C (mergeParagraph): make it take a
ParagraphList::iterator instead of a Paragraph *, adjust
accordingly.
* paragraph.h: move an #endif so that the change tracking stuff
also works in the NO_NEXT case.
2003-03-04 Angus Leeming <leeming@lyx.org>
* commandtags.h:

View File

@ -154,6 +154,14 @@ public:
///
Paragraph const * next() const;
///
void previous(Paragraph *);
///
Paragraph * previous();
///
Paragraph const * previous() const;
#endif
/// initialise tracking for this par
void trackChanges(Change::Type = Change::UNCHANGED);
@ -184,13 +192,6 @@ public:
/// mark whole par as erased
void markErased();
///
void previous(Paragraph *);
///
Paragraph * previous();
///
Paragraph const * previous() const;
#endif
/// for the environments
Paragraph * depthHook(depth_type depth);
/// for the environments

View File

@ -154,9 +154,9 @@ void breakParagraphConservative(BufferParams const & bparams,
}
void mergeParagraph(BufferParams const & bparams, Paragraph * par)
void mergeParagraph(BufferParams const & bparams, ParagraphList::iterator par)
{
Paragraph * the_next = par->next();
ParagraphList::iterator the_next = boost::next(par);
// first the DTP-stuff
par->params().lineBottom(the_next->params().lineBottom());
@ -174,10 +174,12 @@ void mergeParagraph(BufferParams const & bparams, Paragraph * par)
}
// delete the next paragraph
Paragraph * ppar = the_next->previous();
Paragraph * npar = the_next->next();
delete the_next;
ppar->next(npar);
#warning a ParagraphList::erase is needed. (Lgb)
// Isn't this really just par?
ParagraphList::iterator ppar = boost::prior(the_next);
ParagraphList::iterator npar = boost::next(the_next);
delete &*the_next;
ppar->next(&*npar);
}

View File

@ -35,7 +35,7 @@ void breakParagraphConservative(BufferParams const & bparams,
* Append the next paragraph onto the tail of this one.
* Be careful, this doesent make any check at all.
*/
void mergeParagraph(BufferParams const & bparams, Paragraph *);
void mergeParagraph(BufferParams const & bparams, ParagraphList::iterator);
#if 0