mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Fix bug #11588.
Check for the local file before calling kpsewhich.
(cherry picked from commit 2e433654c7
)
This commit is contained in:
parent
c047dc64bf
commit
1e98580988
@ -2468,17 +2468,25 @@ FileName Buffer::getBibfilePath(docstring const & bibid) const
|
|||||||
map<docstring, FileName>::const_iterator it =
|
map<docstring, FileName>::const_iterator it =
|
||||||
bibfileCache.find(bibid);
|
bibfileCache.find(bibid);
|
||||||
if (it != bibfileCache.end()) {
|
if (it != bibfileCache.end()) {
|
||||||
// i.e., bibfileCache[bibid]
|
// i.e., return bibfileCache[bibid];
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
LYXERR(Debug::FILES, "Reading file location for " << bibid);
|
LYXERR(Debug::FILES, "Reading file location for " << bibid);
|
||||||
string texfile = changeExtension(to_utf8(bibid), "bib");
|
string const texfile = changeExtension(to_utf8(bibid), "bib");
|
||||||
// note that, if the filename can be found directly from the path,
|
// we need to check first if this file exists where it's said to be.
|
||||||
// findtexfile will just return a FileName object for that path.
|
// there's a weird bug that occurs otherwise: if the file is in the
|
||||||
FileName file(findtexfile(texfile, "bib"));
|
// Buffer's directory but has the same name as some file that would be
|
||||||
if (file.empty())
|
// found by kpsewhich, then we find the latter, not the former.
|
||||||
file = FileName(makeAbsPath(texfile, filePath()));
|
FileName const local_file = makeAbsPath(texfile, filePath());
|
||||||
|
FileName file = local_file;
|
||||||
|
if (!file.exists()) {
|
||||||
|
// there's no need now to check whether the file can be found
|
||||||
|
// locally
|
||||||
|
file = findtexfile(texfile, "bib", true);
|
||||||
|
if (file.empty())
|
||||||
|
file = local_file;
|
||||||
|
}
|
||||||
LYXERR(Debug::FILES, "Found at: " << file);
|
LYXERR(Debug::FILES, "Found at: " << file);
|
||||||
|
|
||||||
bibfileCache[bibid] = file;
|
bibfileCache[bibid] = file;
|
||||||
|
@ -65,6 +65,9 @@ Avoid using text mode for unicode symbols representable in math mode (bug 9616).
|
|||||||
|
|
||||||
- Fix problem on Windows with saving files in Dropbox folders (bug 10091).
|
- Fix problem on Windows with saving files in Dropbox folders (bug 10091).
|
||||||
|
|
||||||
|
- Find local bib files when they exist in the same directory as the LyX
|
||||||
|
file (bug 11588).
|
||||||
|
|
||||||
|
|
||||||
* USER INTERFACE
|
* USER INTERFACE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user