The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 288c1e0faad85d4b0f17e366cb5c44473a133957
Author: Richard Heck <rgh...@lyx.org>
Date:   Tue May 22 08:23:27 2012 -0400

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

diff --git a/lib/scripts/include_bib.py b/lib/scripts/include_bib.py
index bf8ee96..d9c0e83 100644
--- a/lib/scripts/include_bib.py
+++ b/lib/scripts/include_bib.py
@@ -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.
 #
diff --git a/lib/scripts/prefs2prefs_prefs.py b/lib/scripts/prefs2prefs_prefs.py
index a5e9e34..4115453 100644
--- a/lib/scripts/prefs2prefs_prefs.py
+++ b/lib/scripts/prefs2prefs_prefs.py
@@ -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, []]
 ]
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 54c34c2..d4dde78 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -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_)
diff --git a/src/Converter.cpp b/src/Converter.cpp
index 7199fa5..d803309 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -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);
diff --git a/src/Converter.h b/src/Converter.h
index 8f131bb..f4c8458 100644
--- a/src/Converter.h
+++ b/src/Converter.h
@@ -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;

-----------------------------------------------------------------------

Summary of changes:
 lib/scripts/include_bib.py       |    5 ++++-
 lib/scripts/prefs2prefs_prefs.py |   16 ++++++++++------
 src/Buffer.cpp                   |   10 +++++++++-
 src/Converter.cpp                |    2 ++
 src/Converter.h                  |    2 ++
 5 files changed, 27 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to