Fix bug #6020: Reverse DVI/PDF search fails with child documents.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@30216 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-06-22 06:18:12 +00:00
parent 56b70e512b
commit 9d46e0b6e5
2 changed files with 22 additions and 3 deletions

View File

@ -327,9 +327,26 @@ Buffer * BufferList::getBufferFromTmp(string const & s)
{
BufferStorage::iterator it = bstore.begin();
BufferStorage::iterator end = bstore.end();
for (; it < end; ++it)
if (prefixIs(s, (*it)->temppath()))
return *it;
for (; it < end; ++it) {
if (prefixIs(s, (*it)->temppath())) {
// check whether the filename matches the master
string const master_name = changeExtension(onlyFilename(
(*it)->absFileName()), ".tex");
if (suffixIs(s, master_name))
return *it;
// if not, try with the children
vector<Buffer *> clist = (*it)->getChildren();
vector<Buffer *>::const_iterator cit = clist.begin();
vector<Buffer *>::const_iterator cend = clist.end();
for (; cit < cend; ++cit) {
string const mangled_child_name = DocFileName(
changeExtension((*cit)->absFileName(),
".tex")).mangledFilename();
if (suffixIs(s, mangled_child_name))
return *cit;
}
}
}
return 0;
}

View File

@ -101,6 +101,8 @@ What's new
- Fix loading of UTF-8 encoded files when a byte order mark (BOM) is present
(bug 6030).
- Fix reverse DVI/PDF search with child documents (bug 6020).
* USER INTERFACE