]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
move some selection related stuff over to textcursor.C
[lyx.git] / src / paragraph.C
index 5d711ee3c0dcdc552a56f14c005e7a92e58bf678..fbedfeedc9ebcf65a828d1212cc7926d429e9d2a 100644 (file)
@@ -90,7 +90,8 @@ Paragraph::Paragraph(Paragraph const & lp)
        InsetList::iterator it = insetlist.begin();
        InsetList::iterator end = insetlist.end();
        for (; it != end; ++it) {
-               it->inset = it->inset->clone();
+               // currently we hold Inset*, not InsetBase*
+               it->inset = static_cast<Inset*>(it->inset->clone());
                // tell the new inset who is the boss now
                it->inset->parOwner(this);
        }
@@ -117,7 +118,7 @@ void Paragraph::operator=(Paragraph const & lp)
        InsetList::iterator it = insetlist.begin();
        InsetList::iterator end = insetlist.end();
        for (; it != end; ++it) {
-               it->inset = it->inset->clone();
+               it->inset = static_cast<Inset*>(it->inset->clone());
                // tell the new inset who is the boss now
                it->inset->parOwner(this);
        }
@@ -256,7 +257,7 @@ void Paragraph::copyIntoMinibuffer(Buffer const & buffer, pos_type pos) const
        minibuffer_inset = 0;
        if (minibuffer_char == Paragraph::META_INSET) {
                if (getInset(pos)) {
-                       minibuffer_inset = getInset(pos)->clone();
+                       minibuffer_inset = static_cast<Inset *>(getInset(pos)->clone());
                } else {
                        minibuffer_inset = 0;
                        minibuffer_char = ' ';
@@ -1191,6 +1192,7 @@ bool Paragraph::isMultiLingual(BufferParams const & bparams)
 // Used for building the table of contents
 string const Paragraph::asString(Buffer const * buffer, bool label) const
 {
+#if 0
        string s;
        if (label && !params().labelString().empty())
                s += params().labelString() + ' ';
@@ -1208,6 +1210,11 @@ string const Paragraph::asString(Buffer const * buffer, bool label) const
        }
 
        return s;
+#else
+       // This should really be done by the caller and not here.
+       string ret(asString(buffer, 0, size(), label));
+       return subst(ret, '\n', ' ');
+#endif
 }