commit e7387fd348bade920a7c8094607f3e4861b85b6f
Author: Richard Kimberly Heck <[email protected]>
Date:   Wed Apr 25 13:40:37 2018 -0400

    Don't sort the bibfiles cache.
    
    This causes problems with biblatex. Instead, we sort the old and
    new lists and then compare them.
    
    (cherry picked from commit 6b095e2b7107110bec593edd02bbdcf25adae76a)
---
 src/Buffer.cpp |   13 ++++++++++---
 status.23x     |    3 +++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 42fc7bb..ea13fdc 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -4789,9 +4789,13 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType 
utype) const
                return;
 
        // if the bibfiles changed, the cache of bibinfo is invalid
-       sort(d->bibfiles_cache_.begin(), d->bibfiles_cache_.end());
-       // the old one should already be sorted
-       if (old_bibfiles != d->bibfiles_cache_) {
+       FileNamePairList new_bibfiles = d->bibfiles_cache_;
+       // this is a trick to determine whether the two vectors have
+       // the same elements.
+       sort(new_bibfiles.begin(), new_bibfiles.end());
+       sort(old_bibfiles.begin(), old_bibfiles.end());
+       if (old_bibfiles != new_bibfiles) {
+               LYXERR(Debug::FILES, "Reloading bibinfo cache.");
                invalidateBibinfoCache();
                reloadBibInfoCache();
                // We relied upon the bibinfo cache when recalculating labels. 
But that
@@ -4808,8 +4812,11 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType 
utype) const
                // updateMacros();
                setChangesPresent(false);
                updateBuffer(parit, utype);
+               // this will already have been done by reloadBibInfoCache();
+               // d->bibinfo_cache_valid_ = true;
        }
        else {
+               LYXERR(Debug::FILES, "Bibfiles unchanged.");
                // this is also set to true on the other path, by 
reloadBibInfoCache.
                d->bibinfo_cache_valid_ = true;
        }
diff --git a/status.23x b/status.23x
index 666a806..ddeea9a 100644
--- a/status.23x
+++ b/status.23x
@@ -143,6 +143,9 @@ What's new
 
 - Recompile grandchildren when they have updated (bug 11112).
 
+- Output list of bibliography files in the order given in the dialog, rather
+  than sorted.
+
 
 * LYX2LYX
 

Reply via email to