]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
64 bit compile fixes.
[lyx.git] / src / paragraph.C
index 2be105b73b34677e7989a48cd9562a8ee61985fd..365600571cd6c1d89b9101511e986a53e3f97c26 100644 (file)
@@ -80,6 +80,7 @@ Paragraph::Paragraph(Paragraph const & par)
                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)
@@ -87,32 +88,30 @@ Paragraph::Paragraph(Paragraph const & par)
 }
 
 
-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;
 }
 
 
@@ -646,7 +645,7 @@ void Paragraph::applyLayout(LyXLayout_ptr const & new_layout)
 }
 
 
-int Paragraph::beginOfBody() const
+pos_type Paragraph::beginOfBody() const
 {
        return begin_of_body_;
 }