mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
add more functions to ParagraphList
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6906 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f5e07fb302
commit
5c44cab01c
@ -1,5 +1,9 @@
|
||||
2003-05-01 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||
|
||||
* ParagraphList.C (ParagraphList): implement copy constructor
|
||||
(operator=): implement, base on copy constructor.
|
||||
(assign): new func
|
||||
|
||||
* paragraph.C (erase): return a bool
|
||||
|
||||
* paragraph_pimpl.C (erasePos): remove function, move contents...
|
||||
|
@ -86,13 +86,35 @@ bool operator!=(ParagraphList::iterator const & i1,
|
||||
return !(i1 == i2);
|
||||
}
|
||||
|
||||
|
||||
//////////
|
||||
////////// The ParagraphList proper
|
||||
//////////
|
||||
|
||||
ParagraphList::ParagraphList()
|
||||
: parlist(0)
|
||||
{}
|
||||
|
||||
|
||||
ParagraphList::ParagraphList(ParagraphList const & pl)
|
||||
: parlist(0)
|
||||
{
|
||||
// Deep copy.
|
||||
ParagraphList::iterator it = pl.begin();
|
||||
ParagraphList::iterator end = pl.end();
|
||||
for (; it != end; ++it) {
|
||||
push_back(new Paragraph(*it, false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ParagraphList & ParagraphList::operator=(ParagraphList const & rhs)
|
||||
{
|
||||
ParagraphList tmp(rhs);
|
||||
std::swap(parlist, tmp.parlist);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
ParagraphList::iterator
|
||||
ParagraphList::insert(ParagraphList::iterator it, Paragraph * par)
|
||||
{
|
||||
@ -136,6 +158,16 @@ ParagraphList::insert(ParagraphList::iterator it, Paragraph * par)
|
||||
}
|
||||
|
||||
|
||||
void ParagraphList::assign(iterator beg, iterator end)
|
||||
{
|
||||
clear();
|
||||
for (; beg != end; ++beg) {
|
||||
push_back(new Paragraph(*beg, false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ParagraphList::clear()
|
||||
{
|
||||
#ifndef NO_NEXT
|
||||
|
@ -47,8 +47,14 @@ public:
|
||||
///
|
||||
ParagraphList();
|
||||
///
|
||||
ParagraphList(ParagraphList const &);
|
||||
///
|
||||
ParagraphList & operator=(ParagraphList const &);
|
||||
///
|
||||
iterator insert(iterator it, Paragraph * par);
|
||||
///
|
||||
void assign(iterator beg, iterator end);
|
||||
///
|
||||
void clear();
|
||||
///
|
||||
void erase(iterator it);
|
||||
|
Loading…
Reference in New Issue
Block a user