mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +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>
|
2003-05-24 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||||
|
|
||||||
* paragraph_funcs.C (breakParagraph): adjust
|
* paragraph_funcs.C (breakParagraph): adjust
|
||||||
|
@ -112,7 +112,7 @@ ParagraphList & ParagraphList::operator=(ParagraphList const & rhs)
|
|||||||
ParagraphList::iterator
|
ParagraphList::iterator
|
||||||
ParagraphList::insert(ParagraphList::iterator it, Paragraph const & p)
|
ParagraphList::insert(ParagraphList::iterator it, Paragraph const & p)
|
||||||
{
|
{
|
||||||
Paragraph * par = new Paragraph(p, false);
|
Paragraph * par = new Paragraph(p);
|
||||||
|
|
||||||
if (it != end()) {
|
if (it != end()) {
|
||||||
Paragraph * prev = it->prev_par_;
|
Paragraph * prev = it->prev_par_;
|
||||||
@ -281,7 +281,7 @@ Paragraph & ParagraphList::back()
|
|||||||
|
|
||||||
void ParagraphList::push_back(Paragraph const & pr)
|
void ParagraphList::push_back(Paragraph const & pr)
|
||||||
{
|
{
|
||||||
Paragraph * p = new Paragraph(pr, false);
|
Paragraph * p = new Paragraph(pr);
|
||||||
|
|
||||||
if (!parlist) {
|
if (!parlist) {
|
||||||
parlist = p;
|
parlist = p;
|
||||||
|
@ -80,8 +80,8 @@ Paragraph::Paragraph()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Paragraph::Paragraph(Paragraph const & lp, bool same_ids)
|
Paragraph::Paragraph(Paragraph const & lp)
|
||||||
: pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this, same_ids))
|
: pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this))
|
||||||
{
|
{
|
||||||
enumdepth = 0;
|
enumdepth = 0;
|
||||||
itemdepth = 0;
|
itemdepth = 0;
|
||||||
@ -99,7 +99,7 @@ Paragraph::Paragraph(Paragraph const & lp, bool same_ids)
|
|||||||
InsetList::iterator it = insetlist.begin();
|
InsetList::iterator it = insetlist.begin();
|
||||||
InsetList::iterator end = insetlist.end();
|
InsetList::iterator end = insetlist.end();
|
||||||
for (; it != end; ++it) {
|
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
|
// tell the new inset who is the boss now
|
||||||
it.getInset()->parOwner(this);
|
it.getInset()->parOwner(this);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,9 @@ public:
|
|||||||
Paragraph();
|
Paragraph();
|
||||||
|
|
||||||
///
|
///
|
||||||
Paragraph(Paragraph const &, bool same_ids);
|
Paragraph(Paragraph const &);
|
||||||
|
///
|
||||||
|
//void operator=(Paragraph const &);
|
||||||
/// the destructor removes the new paragraph from the list
|
/// the destructor removes the new paragraph from the list
|
||||||
~Paragraph();
|
~Paragraph();
|
||||||
|
|
||||||
@ -308,8 +310,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
LyXLayout_ptr layout_;
|
LyXLayout_ptr layout_;
|
||||||
/// if anything uses this we don't want it to.
|
|
||||||
Paragraph(Paragraph const &);
|
|
||||||
#ifdef NO_STD_LIST
|
#ifdef NO_STD_LIST
|
||||||
Paragraph * next_par_;
|
Paragraph * next_par_;
|
||||||
Paragraph * prev_par_;
|
Paragraph * prev_par_;
|
||||||
@ -323,8 +323,6 @@ private:
|
|||||||
///
|
///
|
||||||
Pimpl * pimpl_;
|
Pimpl * pimpl_;
|
||||||
|
|
||||||
/// unimplemented
|
|
||||||
void operator=(Paragraph const &);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,15 +63,12 @@ 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)
|
: params(p.params), owner_(owner)
|
||||||
{
|
{
|
||||||
inset_owner = p.inset_owner;
|
inset_owner = p.inset_owner;
|
||||||
text = p.text;
|
text = p.text;
|
||||||
fontlist = p.fontlist;
|
fontlist = p.fontlist;
|
||||||
if (same_ids)
|
|
||||||
id_ = p.id_;
|
|
||||||
else
|
|
||||||
id_ = paragraph_id++;
|
id_ = paragraph_id++;
|
||||||
|
|
||||||
if (p.tracking())
|
if (p.tracking())
|
||||||
|
@ -24,7 +24,7 @@ struct Paragraph::Pimpl {
|
|||||||
///
|
///
|
||||||
Pimpl(Paragraph * owner);
|
Pimpl(Paragraph * owner);
|
||||||
/// Copy constructor
|
/// Copy constructor
|
||||||
Pimpl(Pimpl const &, Paragraph * owner, bool same_ids = false);
|
Pimpl(Pimpl const &, Paragraph * owner);
|
||||||
///
|
///
|
||||||
lyx::pos_type size() const {
|
lyx::pos_type size() const {
|
||||||
return text.size();
|
return text.size();
|
||||||
|
@ -293,11 +293,20 @@ bool createUndo(BufferView * bv, Undo::undo_kind kind,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a new Undo.
|
// Create a new Undo.
|
||||||
|
#warning FIXME Why is this a vector and not a ParagraphList?
|
||||||
std::vector<Paragraph *> undo_pars;
|
std::vector<Paragraph *> undo_pars;
|
||||||
|
|
||||||
for (ParagraphList::iterator it = *first; it != *last; ++it)
|
for (ParagraphList::iterator it = *first; it != *last; ++it) {
|
||||||
undo_pars.push_back(new Paragraph(*it, true));
|
int id = it->id();
|
||||||
undo_pars.push_back(new Paragraph(**last, true));
|
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
|
// A memory optimization: Just store the layout
|
||||||
// information when only edit.
|
// information when only edit.
|
||||||
|
Loading…
Reference in New Issue
Block a user