#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
-#include "latexrunparams.h"
-#include "lyx_main.h"
#include "lyxlex.h"
#include "lyxrc.h"
-#include "Lsstream.h"
+#include "support/std_sstream.h"
#include "frontends/lyx_gui.h"
-#include "frontends/LyXView.h"
-#include "frontends/Dialogs.h"
-#include "support/FileInfo.h"
#include "support/filetools.h"
#include "support/forkedcall.h"
#include "support/lstrings.h"
#include "support/path.h"
#include "support/path_defines.h"
#include "support/tostr.h"
-#include "support/LAssert.h"
#include "support/translator.h"
#include <boost/bind.hpp>
-#include <cstdio>
-#include <utility>
-
namespace support = lyx::support;
-using std::ostream;
using std::endl;
using std::auto_ptr;
+using std::ostream;
+
namespace lyx {
namespace graphics {
// Replace the inset's store
setParams(params, buffer);
- lyxerr[Debug::INFO] << "InsetExternal::Read: "
- << "template: '" << params_.templatename
- << "' filename: '" << params_.filename.absFilename()
- << "' display: '" << params_.display
- << "' scale: '" << params_.lyxscale
- << '\'' << endl;
+ lyxerr[Debug::EXTERNAL]
+ << "InsetExternal::Read: "
+ << "template: '" << params_.templatename
+ << "' filename: '" << params_.filename.absFilename()
+ << "' display: '" << params_.display
+ << "' scale: '" << params_.lyxscale
+ << '\'' << endl;
}
ExternalTemplate::Formats::const_iterator cit =
et.formats.find(format);
if (cit == et.formats.end()) {
- lyxerr << "External template format '" << format
- << "' not specified in template "
- << params_.templatename << endl;
+ lyxerr[Debug::EXTERNAL]
+ << "External template format '" << format
+ << "' not specified in template "
+ << params_.templatename << endl;
return 0;
}
return;
ExternalTemplate const & et = *et_ptr;
- ExternalTemplate::Formats::const_iterator cit =
- et.formats.find("LaTeX");
-
+ ExternalTemplate::Formats::const_iterator cit = et.formats.find("LaTeX");
if (cit == et.formats.end())
return;
- if (!cit->second.requirement.empty()) {
+ if (!cit->second.requirement.empty())
features.require(cit->second.requirement);
- }
- if (!cit->second.preamble.empty()) {
- features.addExternalPreamble(cit->second.preamble);
- }
+
+ ExternalTemplateManager & etm = ExternalTemplateManager::get();
+ string const preamble = etm.getPreambleDefByName(cit->second.preambleName);
+ if (!preamble.empty())
+ features.addExternalPreamble(preamble);
}
return;
if (!converters.isReachable(from_format, to_format)) {
- lyxerr << "InsetExternal::updateExternal. "
- "Unable to convert from "
- << from_format << " to " << to_format << endl;
+ lyxerr[Debug::EXTERNAL]
+ << "InsetExternal::updateExternal. "
+ << "Unable to convert from "
+ << from_format << " to " << to_format << endl;
return;
}
support::Path p(buffer.filePath());
support::Forkedcall call;
- if (lyxerr.debugging()) {
+ if (lyxerr.debugging(Debug::EXTERNAL)) {
lyxerr << "Executing '" << command << "' in '"
<< buffer.filePath() << '\'' << endl;
}