text_(par.text_), begin_of_body_(par.begin_of_body_),
pimpl_(new Paragraph::Pimpl(*par.pimpl_, this))
{
+ //lyxerr << "Paragraph::Paragraph(Paragraph const&)" << endl;
InsetList::iterator it = insetlist.begin();
InsetList::iterator end = insetlist.end();
for (; it != end; ++it)
}
-void Paragraph::operator=(Paragraph const & par)
+Paragraph & Paragraph::operator=(Paragraph const & par)
{
// needed as we will destroy the pimpl_ before copying it
- if (&par != this)
- return;
-
- lyxerr << "Paragraph::operator=()" << endl;
-
- itemdepth = par.itemdepth;
-
- insetlist = par.insetlist;
- InsetList::iterator it = insetlist.begin();
- InsetList::iterator end = insetlist.end();
- for (; it != end; ++it)
- it->inset = it->inset->clone().release();
-
- rows = par.rows;
- y = par.y;
- height = par.height;
- width = par.width;
- layout_ = par.layout();
- text_ = par.text_;
- begin_of_body_ = par.begin_of_body_;
-
- delete pimpl_;
- pimpl_ = new Pimpl(*par.pimpl_, this);
+ if (&par != this) {
+ itemdepth = par.itemdepth;
+
+ insetlist = par.insetlist;
+ InsetList::iterator it = insetlist.begin();
+ InsetList::iterator end = insetlist.end();
+ for (; it != end; ++it)
+ it->inset = it->inset->clone().release();
+
+ rows = par.rows;
+ y = par.y;
+ height = par.height;
+ width = par.width;
+ layout_ = par.layout();
+ text_ = par.text_;
+ begin_of_body_ = par.begin_of_body_;
+
+ delete pimpl_;
+ pimpl_ = new Pimpl(*par.pimpl_, this);
+ }
+ return *this;
}
}
-int Paragraph::beginOfBody() const
+pos_type Paragraph::beginOfBody() const
{
return begin_of_body_;
}