Add "nice" flag for converters, addressing final problem with bug #4624.

This commit is contained in:
Richard Heck 2012-05-22 08:23:27 -04:00
parent a7c3567452
commit 288c1e0faa
5 changed files with 27 additions and 8 deletions

View File

@ -19,7 +19,10 @@
# check it as a document format. Then create a LaTeX-->ltxbbl converter,
# with the command:
# python -tt $$s/scripts/include_bib.py $$i $$o
# and give it the "needaux" flag. You'll then have it in the export menu.
# and give it the flags:
# needaux,nice
# You'll then have it in the export menu.
#
# We do not activate this converter by default, because there are problems
# when one tries to use multiple bibliographies.
#

View File

@ -39,6 +39,9 @@
# Incremented to format 7, r40789 by gb
# Add mime type to file format
# Incremented to format 8, by rgh
# Add "nice" flag for converters
import re
###########################################################
@ -228,10 +231,11 @@ conversions = [
language_use_babel,
language_package
]],
[ 2, []],
[ 3, [ zipped_native ]],
[ 4, [ remove_default_papersize ]],
[ 5, []],
[ 6, []],
[ 7, [add_mime_types]],
[ 2, []],
[ 3, [ zipped_native ]],
[ 4, [ remove_default_papersize ]],
[ 5, []],
[ 6, []],
[ 7, [add_mime_types]],
[ 8, []]
]

View File

@ -3696,6 +3696,7 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
runparams.includeall = includeall;
vector<string> backs = params().backends();
Converters converters = theConverters();
bool need_nice_file = false;
if (find(backs.begin(), backs.end(), format) == backs.end()) {
// Get shortest path to format
converters.buildGraph();
@ -3719,6 +3720,13 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
return ExportNoPathToFormat;
}
runparams.flavor = converters.getFlavor(path, this);
Graph::EdgePath::const_iterator it = path.begin();
Graph::EdgePath::const_iterator en = path.end();
for (; it != en; ++it)
if (theConverters().get(*it).nice) {
need_nice_file = true;
break;
}
} else {
backend_format = format;
@ -3758,7 +3766,7 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
makeDocBookFile(FileName(filename), runparams);
}
// LaTeX backend
else if (backend_format == format) {
else if (backend_format == format || need_nice_file) {
runparams.nice = true;
bool const success = makeLaTeXFile(FileName(filename), string(), runparams);
if (d->cloned_buffer_)

View File

@ -125,6 +125,8 @@ void Converter::readFlags()
result_file = flag_value;
else if (flag_name == "parselog")
parselog = flag_value;
else if (flag_name == "nice")
nice = true;
}
if (!result_dir.empty() && result_file.empty())
result_file = "index." + formats.extension(to);

View File

@ -60,6 +60,8 @@ public:
bool xml;
/// This converter needs the .aux files
bool need_aux;
/// we need a "nice" file from the backend
bool nice;
/// If the converter put the result in a directory, then result_dir
/// is the name of the directory
std::string result_dir;