mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
parlist-19-a.diff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7042 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
40df686312
commit
9aee8a07b0
@ -1,3 +1,14 @@
|
||||
2003-05-25 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||
|
||||
* undo_funcs.C (createUndo): use the id functions directly, adjust.
|
||||
|
||||
* paragraph_pimpl.C (Pimpl): get rid of same_ids parameter
|
||||
|
||||
* paragraph.C (Paragraph): get rid of same_ids parameter
|
||||
|
||||
* ParagraphList.C (insert): adjust
|
||||
(push_back): adjust
|
||||
|
||||
2003-05-24 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||
|
||||
* paragraph_funcs.C (breakParagraph): adjust
|
||||
|
@ -112,7 +112,7 @@ ParagraphList & ParagraphList::operator=(ParagraphList const & rhs)
|
||||
ParagraphList::iterator
|
||||
ParagraphList::insert(ParagraphList::iterator it, Paragraph const & p)
|
||||
{
|
||||
Paragraph * par = new Paragraph(p, false);
|
||||
Paragraph * par = new Paragraph(p);
|
||||
|
||||
if (it != end()) {
|
||||
Paragraph * prev = it->prev_par_;
|
||||
@ -281,7 +281,7 @@ Paragraph & ParagraphList::back()
|
||||
|
||||
void ParagraphList::push_back(Paragraph const & pr)
|
||||
{
|
||||
Paragraph * p = new Paragraph(pr, false);
|
||||
Paragraph * p = new Paragraph(pr);
|
||||
|
||||
if (!parlist) {
|
||||
parlist = p;
|
||||
|
@ -80,8 +80,8 @@ Paragraph::Paragraph()
|
||||
}
|
||||
|
||||
|
||||
Paragraph::Paragraph(Paragraph const & lp, bool same_ids)
|
||||
: pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this, same_ids))
|
||||
Paragraph::Paragraph(Paragraph const & lp)
|
||||
: pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this))
|
||||
{
|
||||
enumdepth = 0;
|
||||
itemdepth = 0;
|
||||
@ -93,13 +93,13 @@ Paragraph::Paragraph(Paragraph const & lp, bool same_ids)
|
||||
// follow footnotes
|
||||
layout_ = lp.layout();
|
||||
buffer_ = lp.buffer_;
|
||||
|
||||
|
||||
// copy everything behind the break-position to the new paragraph
|
||||
insetlist = lp.insetlist;
|
||||
InsetList::iterator it = insetlist.begin();
|
||||
InsetList::iterator end = insetlist.end();
|
||||
for (; it != end; ++it) {
|
||||
it.setInset(it.getInset()->clone(**buffer_, same_ids));
|
||||
it.setInset(it.getInset()->clone(**buffer_, false));
|
||||
// tell the new inset who is the boss now
|
||||
it.getInset()->parOwner(this);
|
||||
}
|
||||
|
@ -64,7 +64,9 @@ public:
|
||||
Paragraph();
|
||||
|
||||
///
|
||||
Paragraph(Paragraph const &, bool same_ids);
|
||||
Paragraph(Paragraph const &);
|
||||
///
|
||||
//void operator=(Paragraph const &);
|
||||
/// the destructor removes the new paragraph from the list
|
||||
~Paragraph();
|
||||
|
||||
@ -308,8 +310,6 @@ public:
|
||||
private:
|
||||
///
|
||||
LyXLayout_ptr layout_;
|
||||
/// if anything uses this we don't want it to.
|
||||
Paragraph(Paragraph const &);
|
||||
#ifdef NO_STD_LIST
|
||||
Paragraph * next_par_;
|
||||
Paragraph * prev_par_;
|
||||
@ -323,8 +323,6 @@ private:
|
||||
///
|
||||
Pimpl * pimpl_;
|
||||
|
||||
/// unimplemented
|
||||
void operator=(Paragraph const &);
|
||||
};
|
||||
|
||||
|
||||
|
@ -63,16 +63,13 @@ Paragraph::Pimpl::Pimpl(Paragraph * owner)
|
||||
}
|
||||
|
||||
|
||||
Paragraph::Pimpl::Pimpl(Pimpl const & p, Paragraph * owner, bool same_ids)
|
||||
Paragraph::Pimpl::Pimpl(Pimpl const & p, Paragraph * owner)
|
||||
: params(p.params), owner_(owner)
|
||||
{
|
||||
inset_owner = p.inset_owner;
|
||||
text = p.text;
|
||||
fontlist = p.fontlist;
|
||||
if (same_ids)
|
||||
id_ = p.id_;
|
||||
else
|
||||
id_ = paragraph_id++;
|
||||
id_ = paragraph_id++;
|
||||
|
||||
if (p.tracking())
|
||||
changes_.reset(new Changes(*p.changes_.get()));
|
||||
|
@ -24,7 +24,7 @@ struct Paragraph::Pimpl {
|
||||
///
|
||||
Pimpl(Paragraph * owner);
|
||||
/// Copy constructor
|
||||
Pimpl(Pimpl const &, Paragraph * owner, bool same_ids = false);
|
||||
Pimpl(Pimpl const &, Paragraph * owner);
|
||||
///
|
||||
lyx::pos_type size() const {
|
||||
return text.size();
|
||||
|
@ -293,11 +293,20 @@ bool createUndo(BufferView * bv, Undo::undo_kind kind,
|
||||
}
|
||||
|
||||
// Create a new Undo.
|
||||
#warning FIXME Why is this a vector and not a ParagraphList?
|
||||
std::vector<Paragraph *> undo_pars;
|
||||
|
||||
for (ParagraphList::iterator it = *first; it != *last; ++it)
|
||||
undo_pars.push_back(new Paragraph(*it, true));
|
||||
undo_pars.push_back(new Paragraph(**last, true));
|
||||
for (ParagraphList::iterator it = *first; it != *last; ++it) {
|
||||
int id = it->id();
|
||||
Paragraph * tmp = new Paragraph(*it);
|
||||
tmp->id(id);
|
||||
undo_pars.push_back(tmp);
|
||||
}
|
||||
|
||||
int const id = last->id();
|
||||
Paragraph * tmp = new Paragraph(**last);
|
||||
tmp->id(id);
|
||||
undo_pars.push_back(tmp);
|
||||
|
||||
// A memory optimization: Just store the layout
|
||||
// information when only edit.
|
||||
|
Loading…
Reference in New Issue
Block a user