]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
Fix crash when running lyx -dbg insets -e ...
[lyx.git] / src / paragraph.C
index 99564189715530e13631cf719b86a544cb67bbef..5e70fda1ec300f62ad0ebcaee94a7e99486f5980 100644 (file)
@@ -430,7 +430,7 @@ void Paragraph::cutIntoMinibuffer(BufferParams const & bparams,
 bool Paragraph::insertFromMinibuffer(Paragraph::size_type pos)
 {
        if ((minibuffer_char == Paragraph::META_INSET) &&
-           !insertInsetAllowed(minibuffer_inset))
+           !insetAllowed(minibuffer_inset->lyxCode()))
                return false;
        if (minibuffer_char == Paragraph::META_INSET)
                insertInset(pos, minibuffer_inset, minibuffer_font);
@@ -489,12 +489,12 @@ void Paragraph::insertInset(Paragraph::size_type pos,
 }
 
 
-bool Paragraph::insertInsetAllowed(Inset * inset)
+bool Paragraph::insetAllowed(Inset::Code code)
 {
        //lyxerr << "Paragraph::InsertInsetAllowed" << endl;
        
        if (pimpl_->inset_owner)
-               return pimpl_->inset_owner->insertInsetAllowed(inset);
+               return pimpl_->inset_owner->insetAllowed(code);
        return true;
 }
 
@@ -1896,7 +1896,7 @@ string const Paragraph::asString(Buffer const * buffer, bool label)
                        s += c;
                else if (c == META_INSET &&
                         getInset(i)->lyxCode() == Inset::MATH_CODE) {
-                       std::ostringstream ost;
+                       ostringstream ost;
                        getInset(i)->ascii(buffer, ost);
                        s += subst(ost.str().c_str(),'\n',' ');
                }
@@ -1913,7 +1913,7 @@ string const Paragraph::asString(Buffer const * buffer,
                            Paragraph::size_type beg,
                            Paragraph::size_type end)
 {
-       std::ostringstream ost;
+       ostringstream ost;
 
        if (beg == 0 && !params().labelString().empty())
                ost << params().labelString() << ' ';
@@ -2056,9 +2056,7 @@ void Paragraph::setChar(size_type pos, value_type c)
 
 Paragraph::inset_iterator::inset_iterator(Paragraph::InsetList::iterator const & iter)
  : it(iter) 
-{
-
-}
+{}
 
 
 Paragraph::inset_iterator Paragraph::inset_iterator_begin()
@@ -2078,11 +2076,13 @@ ParagraphParameters & Paragraph::params()
        return pimpl_->params;
 }
 
+
 ParagraphParameters const & Paragraph::params() const
 {
        return pimpl_->params;
 }
 
+
 Paragraph * Paragraph::getParFromID(int id) const
 {
        return pimpl_->getParFromID(id);