Georg Baum wrote:
Abdelrazak Younes wrote:

My patch was just moving some code. I did not want to change it at this
time because of no time to test it. But you are probably right in both
questions. If it compiles and works, just apply, it seems safe.

The code I cited was not moved, it was added.

Not correct. The code was moved from ctor and operator= of Paragraph class to ctor and operator= of ParagraphMetrics class. Here is the relevant part of the patch:

 Paragraph::Paragraph(Paragraph const & par)
-       :       itemdepth(par.itemdepth), insetlist(par.insetlist),
-               dim_(par.dim_),
-               rows_(par.rows_), rowSignature_(par.rowSignature_),
-               layout_(par.layout_),
-               text_(par.text_), begin_of_body_(par.begin_of_body_),
-         pimpl_(new Paragraph::Pimpl(*par.pimpl_, this))
+       : ParagraphMetrics(par),
+       itemdepth(par.itemdepth), insetlist(par.insetlist),
+       layout_(par.layout_),
+       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();
@@ -105,15 +186,14 @@
                for (; it != end; ++it)
                        it->inset = it->inset->clone().release();

-               rows_ = par.rows_;
-               dim_ = par.dim_;
-               rowSignature_ = par.rowSignature_;
                layout_ = par.layout();
                text_ = par.text_;
                begin_of_body_ = par.begin_of_body_;

                delete pimpl_;
                pimpl_ = new Pimpl(*par.pimpl_, this);
+
+               ParagraphMetrics::operator=(par);
        }
        return *this;
 }

I just wanted to know why,
because the compiler is supposed to generate it if needed, and I wanted to
make sure that I did not oversee something. I'll put it in later.

Fine.

Abdel.

Reply via email to