]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetinclude.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insetinclude.C
index e3edbbab4d17103e50813fb7bc21c11364dc0c0e..03f9d0d5eba96ccad37331829bda998246e65ee0 100644 (file)
 
 #include <cstdlib>
 
+using namespace lyx::support;
+
 using std::ostream;
 using std::endl;
 using std::vector;
 using std::pair;
+using std::auto_ptr;
+
 
 extern BufferList bufferlist;
 
 
-class InsetInclude::PreviewImpl : public grfx::PreviewedInset {
+class InsetInclude::PreviewImpl : public lyx::graphics::PreviewedInset {
 public:
        ///
        PreviewImpl(InsetInclude & p) : PreviewedInset(p) {}
@@ -109,7 +113,7 @@ InsetInclude::InsetInclude(InsetCommandParams const & p, Buffer const & b)
 
 
 InsetInclude::InsetInclude(InsetInclude const & other)
-       : Inset(other),
+       : InsetOld(other),
          params_(other.params_),
          include_label(other.include_label),
          preview_(new PreviewImpl(*this)),
@@ -149,7 +153,7 @@ dispatch_result InsetInclude::localDispatch(FuncRequest const & cmd)
                return DISPATCHED;
 
        default:
-               return Inset::localDispatch(cmd);
+               return InsetOld::localDispatch(cmd);
        }
 }
 
@@ -199,18 +203,18 @@ void InsetInclude::set(Params const & p)
        if (preview_->monitoring())
                preview_->stopMonitoring();
 
-       if (grfx::PreviewedInset::activated() && params_.flag == INPUT)
+       if (lyx::graphics::PreviewedInset::activated() && params_.flag == INPUT)
                preview_->generatePreview();
 }
 
 
-InsetBase * InsetInclude::clone() const
+auto_ptr<InsetBase> InsetInclude::clone() const
 {
        //Params p(params_);
        //p.masterFilename_ = buffer.fileName();
 #warning FIXME: broken cross-doc copy/paste - must fix
 
-       return new InsetInclude(params_);
+       return auto_ptr<InsetBase>(new InsetInclude(params_));
 }
 
 
@@ -341,7 +345,7 @@ int InsetInclude::latex(Buffer const * buffer, ostream & os,
                tmp->markDepClean(buffer->tmppath);
 
                tmp->makeLaTeXFile(writefile, OnlyPath(getMasterFilename()),
-                                  runparams, true);
+                                  runparams, false);
        }
 
        if (isVerbatim()) {
@@ -556,7 +560,7 @@ BufferView * InsetInclude::view() const
 // preview stuff
 //
 
-void InsetInclude::addPreview(grfx::PreviewLoader & ploader) const
+void InsetInclude::addPreview(lyx::graphics::PreviewLoader & ploader) const
 {
        preview_->addPreview(ploader);
 }
@@ -609,7 +613,7 @@ InsetIncludeMailer::InsetIncludeMailer(InsetInclude & inset)
 {}
 
 
-string const InsetIncludeMailer::inset2string() const
+string const InsetIncludeMailer::inset2string(Buffer const &) const
 {
        return params2string(inset_.params());
 }