#include "insetinclude.h"
#include "buffer.h"
+#include "buffer_funcs.h"
#include "bufferlist.h"
#include "BufferView.h"
#include "debug.h"
#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) {}
InsetInclude::InsetInclude(InsetInclude const & other)
- : Inset(other),
+ : InsetOld(other),
params_(other.params_),
include_label(other.include_label),
preview_(new PreviewImpl(*this)),
return DISPATCHED;
default:
- return Inset::localDispatch(cmd);
+ return InsetOld::localDispatch(cmd);
}
}
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_));
}
FileInfo finfo(getFileName());
if (!finfo.isOK())
return false;
-
- return bufferlist.loadLyXFile(getFileName(), false) != 0;
+ return loadLyXFile(bufferlist.newBuffer(getFileName()),
+ getFileName());
}
tmp->markDepClean(buffer->tmppath);
tmp->makeLaTeXFile(writefile, OnlyPath(getMasterFilename()),
- runparams, true);
+ runparams, false);
}
if (isVerbatim()) {
}
-void InsetInclude::fillWithBibKeys(vector<pair<string,string> > & keys) const
+void InsetInclude::fillWithBibKeys(std::vector<std::pair<string,string> > & keys) const
{
if (loadIfNeeded()) {
Buffer * tmp = bufferlist.getBuffer(getFileName());
// preview stuff
//
-void InsetInclude::addPreview(grfx::PreviewLoader & ploader) const
+void InsetInclude::addPreview(lyx::graphics::PreviewLoader & ploader) const
{
preview_->addPreview(ploader);
}
{}
-string const InsetIncludeMailer::inset2string() const
+string const InsetIncludeMailer::inset2string(Buffer const &) const
{
return params2string(inset_.params());
}