* insetcite.C (getNatbibLabel): prevent filesystem exception

if the bib file does not exist.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@14804 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2006-08-18 13:11:28 +00:00
parent 8e0a72ebd3
commit f7557a9294
3 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-08-18 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* insetcite.C (getNatbibLabel): prevent filesystem exception
if the bib file does not exist.
2006-08-17 Jean-Marc Lasgouttes <lasgouttes@lyx.org> 2006-08-17 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* insetbase.h (notifyCursorLeaves): return a bool indicating * insetbase.h (notifyCursorLeaves): return a bool indicating

View File

@ -16,6 +16,7 @@
#include "buffer.h" #include "buffer.h"
#include "bufferparams.h" #include "bufferparams.h"
#include "BufferView.h" #include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h" #include "dispatchresult.h"
#include "funcrequest.h" #include "funcrequest.h"
#include "LaTeXFeatures.h" #include "LaTeXFeatures.h"
@ -33,6 +34,7 @@ using lyx::support::ltrim;
using lyx::support::rtrim; using lyx::support::rtrim;
using lyx::support::split; using lyx::support::split;
using std::endl;
using std::string; using std::string;
using std::ostream; using std::ostream;
using std::vector; using std::vector;
@ -68,7 +70,10 @@ string const getNatbibLabel(Buffer const & buffer,
for (vector<string>::const_iterator it = bibfilesCache.begin(); for (vector<string>::const_iterator it = bibfilesCache.begin();
it != bibfilesCache.end(); ++ it) { it != bibfilesCache.end(); ++ it) {
string const f = *it; string const f = *it;
if (bibfileStatus[f] != fs::last_write_time(f)) { if (!fs::exists(f)) {
lyxerr << "Couldn't find bibtex file " << f << endl;
changed = true;
} else if (bibfileStatus[f] != fs::last_write_time(f)) {
changed = true; changed = true;
bibfileStatus[f] = fs::last_write_time(f); bibfileStatus[f] = fs::last_write_time(f);
} }

View File

@ -36,6 +36,8 @@ What's new
- Fix crash when importing LaTeX files with no text (bug 2667) - Fix crash when importing LaTeX files with no text (bug 2667)
- Fix crash when a used bibtex file does not exist.
- Ignore definition of lyxgreyout environment when re-importing a LyX - Ignore definition of lyxgreyout environment when re-importing a LyX
generated LaTeX file (part of bug 2420) generated LaTeX file (part of bug 2420)