LyX singleton.
Mostly, this is very boring, but it might be good if someone would
check what I did about the dummy implementation in tex2lyx.
FileName const bname(
addName(path, onlyFileName(
changeExtension(filename,
- formats.extension(params().bufferFormat()) + ".out"))));
+ theFormats().extension(params().bufferFormat()) + ".out"))));
// Also consider the master buffer log file
FileName masterfname = fname;
bool Buffer::importString(string const & format, docstring const & contents, ErrorList & errorList)
{
- Format const * fmt = formats.getFormat(format);
+ Format const * fmt = theFormats().getFormat(format);
if (!fmt)
return false;
// It is important to use the correct extension here, since some
d->file_fully_loaded = true;
d->read_only = !d->filename.isWritable();
- params().compressed = formats.isZippedFile(d->filename);
+ params().compressed = theFormats().isZippedFile(d->filename);
saveCheckSum();
return ReadSuccess;
}
case LFUN_BUFFER_EXPORT_CUSTOM: {
string format_name;
string command = split(argument, format_name, ' ');
- Format const * format = formats.getFormat(format_name);
+ Format const * format = theFormats().getFormat(format_name);
if (!format) {
lyxerr << "Format \"" << format_name
<< "\" not recognized!"
}
case LFUN_BUFFER_VIEW_CACHE:
- if (!formats.view(*this, d->preview_file_,
+ if (!theFormats().view(*this, d->preview_file_,
d->preview_format_))
dr.setMessage(_("Error viewing the output file."));
break;
// file (not for previewing).
Alert::error(_("Couldn't export file"), bformat(
_("No information for exporting the format %1$s."),
- formats.prettyName(format)));
+ theFormats().prettyName(format)));
}
return ExportNoPathToFormat;
}
string filename = latexName(false);
filename = addName(temppath(), filename);
filename = changeExtension(filename,
- formats.extension(backend_format));
+ theFormats().extension(backend_format));
LYXERR(Debug::FILES, "filename=" << filename);
// Plain text backend
string const error_type = (format == "program")
? "Build" : params().bufferFormat();
ErrorList & error_list = d->errorLists[error_type];
- string const ext = formats.extension(format);
+ string const ext = theFormats().extension(format);
FileName const tmp_result_file(changeExtension(filename, ext));
bool const success = converters.convert(this, FileName(filename),
tmp_result_file, FileName(absFileName()), backend_format, format,
vector<ExportedFile>::const_iterator it = files.begin();
vector<ExportedFile>::const_iterator const en = files.end();
for (; it != en && status != CANCEL; ++it) {
- string const fmt = formats.getFormatFromFile(it->sourceName);
+ string const fmt = theFormats().getFormatFromFile(it->sourceName);
string fixedName = it->exportName;
if (!runparams.export_folder.empty()) {
// Relative pathnames starting with ../ will be sanitized
} else {
message(bformat(_("Document exported as %1$s "
"to file `%2$s'"),
- formats.prettyName(format),
+ theFormats().prettyName(format),
makeDisplayPath(result_file)));
}
} else {
// This must be a dummy converter like fax (bug 1888)
message(bformat(_("Document exported as %1$s"),
- formats.prettyName(format)));
+ theFormats().prettyName(format)));
}
return success ? ExportSuccess : ExportConverterError;
return status;
if (previewFile.exists())
- return formats.view(*this, previewFile, format) ?
+ return theFormats().view(*this, previewFile, format) ?
PreviewSuccess : PreviewError;
// Successful export but no output file?
need_auth_ = true;
}
if (!result_dir_.empty() && result_file_.empty())
- result_file_ = "index." + formats.extension(to_);
+ result_file_ = "index." + theFormats().extension(to_);
//if (!contains(command, token_from))
// latex = true;
}
void Converters::add(string const & from, string const & to,
string const & command, string const & flags)
{
- formats.add(from);
- formats.add(to);
+ theFormats().add(from);
+ theFormats().add(to);
ConverterList::iterator it = find_if(converterlist_.begin(),
converterlist_.end(),
ConverterEqual(from , to));
ConverterList::iterator it = converterlist_.begin();
ConverterList::iterator end = converterlist_.end();
for (; it != end; ++it) {
- it->setFrom(formats.getFormat(it->from()));
- it->setTo(formats.getFormat(it->to()));
+ it->setFrom(theFormats().getFormat(it->from()));
+ it->setTo(theFormats().getFormat(it->to()));
}
}
{
if (converterlist_.begin() != converterlist_.end()) {
ConverterList::iterator it = converterlist_.end() - 1;
- it->setFrom(formats.getFormat(it->from()));
- it->setTo(formats.getFormat(it->to()));
+ it->setFrom(theFormats().getFormat(it->from()));
+ it->setTo(theFormats().getFormat(it->to()));
}
}
// default one from ImageMagic.
string const from_ext = from_format.empty() ?
getExtension(from_file.absFileName()) :
- formats.extension(from_format);
- string const to_ext = formats.extension(to_format);
+ theFormats().extension(from_format);
+ string const to_ext = theFormats().extension(to_format);
string const command =
os::python() + ' ' +
quoteName(libFileSearch("scripts", "convertDefault.py").toFilesystemEncoding()) +
void Converters::buildGraph()
{
// clear graph's data structures
- G_.init(formats.size());
+ G_.init(theFormats().size());
// each of the converters knows how to convert one format to another
// so, for each of them, we create an arrow on the graph, going from
// the one to the other
ConverterList::iterator it = converterlist_.begin();
ConverterList::iterator const end = converterlist_.end();
for (; it != end ; ++it) {
- int const from = formats.getNumber(it->from());
- int const to = formats.getNumber(it->to());
+ int const from = theFormats().getNumber(it->from());
+ int const to = theFormats().getNumber(it->to());
LASSERT(from >= 0, continue);
LASSERT(to >= 0, continue);
G_.addEdge(from, to);
vector<int>::const_iterator const end = input.end();
FormatList::iterator rit = result.begin();
for ( ; it != end; ++it, ++rit) {
- *rit = &formats.get(*it);
+ *rit = &theFormats().get(*it);
}
return result;
}
bool const clear_visited)
{
vector<int> const & reachablesto =
- G_.getReachableTo(formats.getNumber(target), clear_visited);
+ G_.getReachableTo(theFormats().getNumber(target), clear_visited);
return intToFormat(reachablesto);
}
set<string>::const_iterator sit = excludes.begin();
set<string>::const_iterator const end = excludes.end();
for (; sit != end; ++sit)
- excluded_numbers.insert(formats.getNumber(*sit));
+ excluded_numbers.insert(theFormats().getNumber(*sit));
vector<int> const & reachables =
- G_.getReachable(formats.getNumber(from),
+ G_.getReachable(theFormats().getNumber(from),
only_viewable,
clear_visited,
excluded_numbers);
bool Converters::isReachable(string const & from, string const & to)
{
- return G_.isReachable(formats.getNumber(from),
- formats.getNumber(to));
+ return G_.isReachable(theFormats().getNumber(from),
+ theFormats().getNumber(to));
}
Graph::EdgePath Converters::getPath(string const & from, string const & to)
{
- return G_.getPath(formats.getNumber(from),
- formats.getNumber(to));
+ return G_.getPath(theFormats().getNumber(from),
+ theFormats().getNumber(to));
}
// cached files on opening. This slows LyX startup a lot. It
// would be better if this information was retrieved in a
// delayed fashion.
- formats.getFormatFromFile(orig_from_name);
+ theFormats().getFormatFromFile(orig_from_name);
format_cache.cache[to_format] = item;
}
is.close();
FormatCache & format_cache = pimpl_->cache[orig_from];
if (format_cache.from_format.empty())
format_cache.from_format =
- formats.getFormatFromFile(orig_from);
+ theFormats().getFormatFromFile(orig_from);
format_cache.cache[to_format] = new_item;
} else
LYXERR(Debug::FILES, "ConverterCache::add(" << orig_from << "):\n"
return flavorTranslator().find(fmt);
} */
-Formats formats;
-
-Formats system_formats;
-
-
} // namespace lyx
// Not currently used.
// OutputParams::FLAVOR format2flavor(std::string fmt);
-extern Formats formats;
-
-extern Formats system_formats;
+/// The global instance.
+/// Implementation is in LyX.cpp.
+extern Formats & theFormats();
+/// The global copy after reading lyxrc.defaults.
+/// Implementation is in LyX.cpp.
+extern Formats & theSystemFormats();
} // namespace lyx
while (!Q.empty()) {
int const current = Q.front();
Q.pop();
- if (current != target || formats.get(target).name() != "lyx")
+ if (current != target || theFormats().get(target).name() != "lyx")
result.push_back(current);
vector<Arrow *>::iterator it = vertices_[current].in_arrows.begin();
while (!Q.empty()) {
int const current = Q.front();
Q.pop();
- Format const & format = formats.get(current);
+ Format const & format = theFormats().get(current);
if (!only_viewable || !format.viewer().empty())
result.push_back(current);
else if (format.isChildFormat()) {
Format const * const parent =
- formats.getFormat(format.parentFormat());
+ theFormats().getFormat(format.parentFormat());
if (parent && !parent->viewer().empty())
result.push_back(current);
}
bool Lexer::Pimpl::setFile(FileName const & filename)
{
// Check the format of the file.
- if (formats.isZippedFile(filename)) {
+ if (theFormats().isZippedFile(filename)) {
LYXERR(Debug::LYXLEX, "lyxlex: compressed");
// The check only outputs a debug message, because it triggers
// a bug in compaq cxx 6.2, where is_open() returns 'true' for
/// The file converters.
Converters converters_;
-
- // The system converters copy after reading lyxrc.defaults.
+ /// The system converters after reading lyxrc.defaults.
Converters system_converters_;
+
+ /// Global format information
+ Formats formats_;
+ /// The system formats after reading lyxrc.defaults.
+ Formats system_formats_;
+
///
Movers movers_;
return false;
// Query the OS to know what formats are viewed natively
- formats.setAutoOpen();
+ theFormats().setAutoOpen();
// Read lyxrc.dist again to be able to override viewer auto-detection.
readRcFile("lyxrc.dist");
system_lyxrc = lyxrc;
- system_formats = formats;
+ theSystemFormats() = theFormats();
pimpl_->system_converters_ = pimpl_->converters_;
pimpl_->system_movers_ = pimpl_->movers_;
system_lcolor = lcolor;
}
+Formats & theFormats()
+{
+ LAPPERR(singleton_);
+ return singleton_->pimpl_->formats_;
+}
+
+
+Formats & theSystemFormats()
+{
+ LAPPERR(singleton_);
+ return singleton_->pimpl_->system_formats_;
+}
+
+
Converters & theConverters()
{
LAPPERR(singleton_);
- return singleton_->pimpl_->converters_;
+ return singleton_->pimpl_->converters_;
}
Converters & theSystemConverters()
{
LAPPERR(singleton_);
- return singleton_->pimpl_->system_converters_;
+ return singleton_->pimpl_->system_converters_;
}
class Converters;
class DispatchResult;
class ErrorItem;
+class Formats;
class FuncRequest;
class FuncStatus;
class KeyMap;
friend ServerSocket & theServerSocket();
friend Converters & theConverters();
friend Converters & theSystemConverters();
+ friend Formats & theFormats();
+ friend Formats & theSystemFormats();
friend Messages const & getMessages(std::string const & language);
friend Messages const & getGuiMessages();
friend KeyMap & theTopLevelKeymap();
case RC_VIEWER: {
string format, command;
lexrc >> format >> command;
- formats.setViewer(format, command);
+ theFormats().setViewer(format, command);
break;
}
case RC_FILEFORMAT: {
if (theConverters().formatIsUsed(format))
LYXERR0("Can't delete format " << format);
else
- formats.erase(format);
+ theFormats().erase(format);
} else {
- formats.add(format, extensions, prettyname,
+ theFormats().add(format, extensions, prettyname,
shortcut, viewer, editor, mime, flgs);
}
break;
}
/// Update converters data-structures
- theConverters().update(formats);
+ theConverters().update(theFormats());
theConverters().buildGraph();
theBufferList().invalidateConverterCache();
case RC_FILEFORMAT:
// New/modified formats
- for (Formats::const_iterator cit = formats.begin();
- cit != formats.end(); ++cit) {
+ for (Formats::const_iterator cit = theFormats().begin();
+ cit != theFormats().end(); ++cit) {
Format const * format =
- system_formats.getFormat(cit->name());
+ theSystemFormats().getFormat(cit->name());
if (!format ||
format->extensions() != cit->extensions() ||
format->prettyname() != cit->prettyname() ||
}
// Look for deleted formats
- for (Formats::const_iterator cit = system_formats.begin();
- cit != system_formats.end(); ++cit)
- if (!formats.getFormat(cit->name()))
+ for (Formats::const_iterator cit = theSystemFormats().begin();
+ cit != theSystemFormats().end(); ++cit)
+ if (!theFormats().getFormat(cit->name()))
os << "\\format \"" << cit->name()
<< "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
if (tag != RC_LAST)
bool GuiPreferences::initialiseParams(string const &)
{
rc_ = lyxrc;
- formats_ = lyx::formats;
+ formats_ = theFormats();
converters_ = theConverters();
converters_.update(formats_);
movers_ = theMovers();
Author(from_utf8(rc_.user_name), from_utf8(rc_.user_email));
theBufferList().recordCurrentAuthor(author);
- lyx::formats = formats_;
+ theFormats() = formats_;
theConverters() = converters_;
- theConverters().update(lyx::formats);
+ theConverters().update(formats_);
theConverters().buildGraph();
theBufferList().invalidateConverterCache();
static void handleExportStatus(GuiView * view, Buffer::ExportStatus status,
string const & format)
{
- docstring const fmt = formats.prettyName(format);
+ docstring const fmt = theFormats().prettyName(format);
docstring msg;
switch (status) {
case Buffer::ExportSuccess:
string const tofile =
support::changeExtension(filename.absFileName(),
- formats.extension(*it));
+ theFormats().extension(*it));
if (!theConverters().convert(0, filename, FileName(tofile),
filename, format, *it, errorList))
return false;
if (loader_format.empty()) {
frontend::Alert::error(_("Couldn't import file"),
bformat(_("No information for importing the format %1$s."),
- formats.prettyName(format)));
+ theFormats().prettyName(format)));
return false;
}
} else
bool as_paragraphs = loader_format == "textparagraph";
string filename2 = (loader_format == format) ? filename.absFileName()
: support::changeExtension(filename.absFileName(),
- formats.extension(loader_format));
+ theFormats().extension(loader_format));
lv->currentBufferView()->insertPlaintextFile(FileName(filename2),
as_paragraphs);
guiApp->setCurrentView(lv);
}
docstring const text = bformat(_("Select %1$s file to import"),
- formats.prettyName(format));
+ theFormats().prettyName(format));
FileDialog dlg(toqstr(text));
dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
dlg.setButton2(qt_("Examples|#E#e"),
toqstr(addPath(package().system_support().absFileName(), "examples")));
- docstring filter = formats.prettyName(format);
+ docstring filter = theFormats().prettyName(format);
filter += " (*.{";
// FIXME UNICODE
- filter += from_utf8(formats.extensions(format));
+ filter += from_utf8(theFormats().extensions(format));
filter += "})";
FileDialog::Result result =
types << anyformat;
vector<Format const *> export_formats;
- for (Format const & f : formats)
+ for (Format const & f : theFormats())
if (f.documentFormat())
export_formats.push_back(&f);
sort(export_formats.begin(), export_formats.end(), Format::formatSorter);
string fmt_name;
fname.set(fromqstr(result.second));
if (filter == anyformat)
- fmt_name = formats.getFormatFromExtension(fname.extension());
+ fmt_name = theFormats().getFormatFromExtension(fname.extension());
else
fmt_name = fmap[filter];
LYXERR(Debug::FILES, "filter=" << fromqstr(filter)
// Compute the actual format used
string const format = !bv ? ""
: flavor2format(bv->buffer().params().getOutputFlavor(view_format_));
- Format const * f = formats.getFormat(format.empty() ? view_format_ : format);
+ Format const * f = theFormats().getFormat(format.empty() ? view_format_ : format);
return f ? f->prettyname() : from_utf8(view_format_);
}
vector<string>::const_iterator en = tmp.end();
for (; it != en; ++it) {
string const format = *it;
- Format const * fmt = formats.getFormat(format);
+ Format const * fmt = theFormats().getFormat(format);
if (!fmt) {
LYXERR0("Can't find format for backend " << format << "!");
continue;
if (!buf)
break;
string const format = buf->params().getDefaultOutputFormat();
- Format const * f = formats.getFormat(format);
+ Format const * f = theFormats().getFormat(format);
docstring const name = f ? f->prettyname() : from_utf8(format);
docstring const label = bformat(_("Export [%1$s]|E"), name);
MenuItem item(MenuItem::Command, toqstr(label),
return fmts;
// The formats recognised by LyX
- Formats::const_iterator begin = formats.begin();
- Formats::const_iterator end = formats.end();
+ Formats::const_iterator begin = theFormats().begin();
+ Formats::const_iterator end = theFormats().end();
// The formats natively loadable.
vector<string> nformat = frontend::loadableImageFormats();
typedef vector<string> FormatList;
-static string const findTargetFormat(FormatList const & formats, string const & from)
+static string const findTargetFormat(FormatList const & format_list, string const & from)
{
// There must be a format to load from.
- LASSERT(!formats.empty(), return string());
+ LASSERT(!theFormats().empty(), return string());
// Use the standard converter if we don't know the format to load
// from.
return string("ppm");
// First ascertain if we can load directly with no conversion
- FormatList::const_iterator it = formats.begin();
- FormatList::const_iterator end = formats.end();
+ FormatList::const_iterator it = format_list.begin();
+ FormatList::const_iterator end = format_list.end();
for (; it != end; ++it) {
if (from == *it)
return *it;
}
// So, we have to convert to a loadable format. Can we?
- it = formats.begin();
+ it = format_list.begin();
for (; it != end; ++it) {
if (lyx::graphics::Converter::isReachable(from, *it))
return *it;
return false;
}
- zipped_ = formats.isZippedFile(filename_);
+ zipped_ = theFormats().isZippedFile(filename_);
if (zipped_) {
string tempname = unzippedFileName(filename_.toFilesystemEncoding());
string const ext = getExtension(tempname);
<< "\tAttempting to convert image file: " << filename
<< "\n\twith displayed filename: " << to_utf8(displayed_filename));
- from = formats.getFormatFromFile(filename);
+ from = theFormats().getFormatFromFile(filename);
if (from.empty()) {
status_ = ErrorConverting;
LYXERR(Debug::GRAPHICS, "\tCould not determine file format.");
// The converted image is to be stored in this file (we do not
// use ChangeExtension because this is a basename which may
// nevertheless contain a '.')
- to_file_ = FileName(to_file_base + '.' + formats.extension(to_format));
+ to_file_ = FileName(to_file_base + '.' + theFormats().extension(to_format));
// The conversion commands are stored in a stringstream
ostringstream script;
// end of the file. Than we have in the header:
// %%BoundingBox: (atend)
// In this case we must check the end.
- bool const zipped = formats.isZippedFile(file);
+ bool const zipped = theFormats().isZippedFile(file);
FileName const file_ = zipped ? unzipFile(file) : file;
- string const format = formats.getFormatFromFile(file_);
+ string const format = theFormats().getFormatFromFile(file_);
if (!Formats::isPostScriptFileFormat(format)) {
LYXERR(Debug::GRAPHICS, "[readBB_from_PSFile] no(e)ps-format");
void editExternal(InsetExternalParams const & params, Buffer const & buffer)
{
- formats.edit(buffer, params.filename,
- formats.getFormatFromFile(params.filename));
+ theFormats().edit(buffer, params.filename,
+ theFormats().getFormatFromFile(params.filename));
}
// This is for raster images and pdflatex:
// Since pdflatex supports both jpg and png, we choose the best format:
// jpg if the original file is jpg to retain the compression, else png.
- string format = formats.getFormatFromFile(params.filename);
+ string format = theFormats().getFormatFromFile(params.filename);
if (format == "jpg")
result = subst(result, "$$pngOrjpg", "jpg");
else
return; // NOT_NEEDED
// Try and ascertain the file format from its contents.
- from_format = formats.getFormatFromFile(params.filename);
+ from_format = theFormats().getFormatFromFile(params.filename);
if (from_format.empty())
return; // FAILURE
}
vector<docstring>::const_iterator en = bibfilelist.end();
for (; it != en; ++it) {
FileName const bibfile = getBibTeXPath(*it, buffer());
- formats.edit(buffer(), bibfile,
- formats.getFormatFromFile(bibfile));
+ theFormats().edit(buffer(), bibfile,
+ theFormats().getFormatFromFile(bibfile));
}
}
|| runparams.flavor == OutputParams::XETEX
|| runparams.flavor == OutputParams::LUATEX) {
LYXERR(Debug::GRAPHICS, "findTargetFormat: PDF mode");
- Format const * const f = formats.getFormat(format);
+ Format const * const f = theFormats().getFormat(format);
// Convert vector graphics to pdf
if (f && f->vectorFormat())
return "pdf6";
}
// for HTML, we leave the known formats and otherwise convert to png
if (runparams.flavor == OutputParams::HTML) {
- Format const * const f = formats.getFormat(format);
+ Format const * const f = theFormats().getFormat(format);
// Convert vector graphics to svg
if (f && f->vectorFormat() && theConverters().isReachable(format, "svg"))
return "svg";
// Nothing to do...
return make_pair(IDENTICAL_CONTENTS, file_out);
- Mover const & mover = getMover(formats.getFormatFromFile(file_in));
+ Mover const & mover = getMover(theFormats().getFormatFromFile(file_in));
bool const success = mover.copy(file_in, file_out);
if (!success) {
// FIXME UNICODE
return make_pair(IDENTICAL_PATHS, FileName(file_in));
string mangled = file.mangledFileName();
- if (formats.isZippedFile(file)) {
+ if (theFormats().isZippedFile(file)) {
// We need to change _eps.gz to .eps.gz. The mangled name is
// still unique because of the counter in mangledFileName().
// We can't just call mangledFileName() with the zip
{
// No conversion is needed. LaTeX can handle the graphic file as is.
// This is true even if the orig_file is compressed.
- string const to_format = formats.getFormat(to)->extension();
+ string const to_format = theFormats().getFormat(to)->extension();
string const file_format = getExtension(file);
// for latex .ps == .eps
if (to_format == file_format ||
// determine the export format
string const tex_format = flavor2format(runparams.flavor);
- if (formats.isZippedFile(params().filename)) {
+ if (theFormats().isZippedFile(params().filename)) {
FileName const unzipped_temp_file =
FileName(unzippedFileName(temp_file.absFileName()));
output_file = unzippedFileName(output_file);
}
}
- string const from = formats.getFormatFromFile(temp_file);
+ string const from = theFormats().getFormatFromFile(temp_file);
if (from.empty())
LYXERR(Debug::GRAPHICS, "\tCould not get file format.");
string const to = findTargetFormat(from, runparams);
- string const ext = formats.extension(to);
+ string const ext = theFormats().extension(to);
LYXERR(Debug::GRAPHICS, "\t we have: from " << from << " to " << to);
// We're going to be running the exported buffer through the LaTeX
if (status == FAILURE)
return string();
- string const from = formats.getFormatFromFile(temp_file);
+ string const from = theFormats().getFormatFromFile(temp_file);
if (from.empty()) {
LYXERR(Debug::GRAPHICS, "\tCould not get file format.");
return string();
}
string const to = findTargetFormat(from, runparams);
- string const ext = formats.extension(to);
+ string const ext = theFormats().extension(to);
string const orig_file = params().filename.absFileName();
string output_file = onlyFileName(temp_file.absFileName());
LYXERR(Debug::GRAPHICS, "\t we have: from " << from << " to " << to);
void InsetGraphics::editGraphics(InsetGraphicsParams const & p) const
{
- formats.edit(buffer(), p.filename,
- formats.getFormatFromFile(p.filename));
+ theFormats().edit(buffer(), p.filename,
+ theFormats().getFormatFromFile(p.filename));
}
{
if (getParam("type") == "file:") {
FileName url = makeAbsPath(to_utf8(getParam("target")), buffer().filePath());
- string const format = formats.getFormatFromFile(url);
- formats.view(buffer(), url, format);
+ string const format = theFormats().getFormatFromFile(url);
+ theFormats().view(buffer(), url, format);
}
}
lyx::dispatch(fr);
} else
// tex file or other text file in verbatim mode
- formats.edit(buffer(),
+ theFormats().edit(buffer(),
support::makeAbsPath(file, support::onlyPath(buffer().absFileName())),
"text");
}
// Don't assume the child's format is latex
string const inc_format = tmp->params().bufferFormat();
FileName const tmpwritefile(changeExtension(writefile.absFileName(),
- formats.extension(inc_format)));
+ theFormats().extension(inc_format)));
// FIXME: handle non existing files
// The included file might be written in a different encoding
// Dummy formats support (needed by Lexer)
//
-Formats formats;
+
+Formats & theFormats()
+{
+ static Formats dummy_formats;
+ return dummy_formats;
+}
bool Formats::isZippedFile(support::FileName const&) const
{