- string format;
- string using_format = Converter::SplitFormat(format0, format);
-
- string backend_format = (format == "txt")
- ? format : BufferExtension(buffer);
- bool only_backend = backend_format == format;
+ string backend_format;
+ vector<string> backends = Backends(buffer);
+ if (find(backends.begin(), backends.end(), format) == backends.end()) {
+ for (vector<string>::const_iterator it = backends.begin();
+ it != backends.end(); ++it) {
+ Converters::EdgePath p =
+ converters.GetPath(*it, format);
+ if (!p.empty()) {
+ lyxrc.pdf_mode = converters.UsePdflatex(p);
+ backend_format = *it;
+ break;
+ }
+ }
+ if (backend_format.empty()) {
+ WriteAlert(_("Can not export file"),
+ _("No information for exporting to ")
+ + formats.PrettyName(format));
+ return false;
+ }
+ } else
+ backend_format = format;