]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetminipage.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insetminipage.C
index aeab0d39e96e7fc5dd59a659dc23891a6297ba34..7800b273abf176b22cfb31bc4e26fe057eb5dff1 100644 (file)
@@ -33,6 +33,7 @@
 
 using std::ostream;
 using std::endl;
+using std::auto_ptr;
 
 
 // Some information about Minipages in LaTeX:
@@ -94,9 +95,9 @@ InsetMinipage::InsetMinipage(InsetMinipage const & in)
 {}
 
 
-InsetBase * InsetMinipage::clone() const
+auto_ptr<InsetBase> InsetMinipage::clone() const
 {
-       return new InsetMinipage(*this);
+       return auto_ptr<InsetBase>(new InsetMinipage(*this));
 }
 
 
@@ -275,9 +276,9 @@ int InsetMinipage::latex(Buffer const * buf, ostream & os,
 }
 
 
-bool InsetMinipage::insetAllowed(Inset::Code code) const
+bool InsetMinipage::insetAllowed(InsetOld::Code code) const
 {
-       if (code == Inset::FLOAT_CODE || code == Inset::MARGIN_CODE)
+       if (code == InsetOld::FLOAT_CODE || code == InsetOld::MARGIN_CODE)
                return false;
 
        return InsetCollapsable::insetAllowed(code);