Handle name prefix (aka "von" part) as a separate entity, just like
BibTeX and Biblatex do. This allows to omit or reposition it in
accordance to the current style ("Goethe, Johann Wolfgang" or
"von Goethe, Johann Wolfgang" or "Goethe, Johann Wolfgang von" are all
valid and used).
LyX's name parser should now be on par with BibTeX's.
This patch removes explicit calls to stat() in the DepTable code. The
original motivation was to get read of a stat() invokation where the
error condition was not checked (spotted by coverity).
It is not clear that the optimization is a gain, but it is clear that
it has a cost: some elements of formulas will not be present in the
position cache.
Fixes bug #10520.
Using this global variable in the class is clearly a bug. If we wanted
to avoid doing it by mistake, the variable should be moved to the LyX
singleton.
Also add an underscore to the private variable formatlist_.
When we have a name with more than two parts, but no "von",
it was coming out as, e.g.:
Obama, Barack Hussain Obama
i.e., with the last name appearing twice.
Also adds a check for names without spaces, which would have given:
Pele, Pele
This was not the original issue at #10582, so that bug is still
open (though I cannot reproduce it).
The error is reported in the GUI, but for the terminal we must write
explicitly to STDERR.
For a specific example of this type of exception, see the previous
commit, 72c3dbd.
If an included file is not found, it seems impossible that the final
output would be correct. Before this commit, when exporting on the
command line, LyX would create the PDF and exit with a zero error
code so unless the user was monitoring the terminal output, they
would not know there is a problem.
This change is consistent with 1a374a93.
Introduce a distinction between being read-only and having the read-only flag. A
buffer is read-only if either it has been externally modified or if it has the
read-only flag.
Coverity complains that we might read strings that are arbitrary
large, and that this can be a security issue. This is a problem in
particular, when we feed these strings to from_utf8(), which coverity
flags as dangerous for some reason.
The best solution would be IMO to model from_utf8() properly, but I do
not know how to do that. Here I try a different solution, where I
cannot read a string larger than 64k from the file.
Let's see whether this removes part of coverity warnings.
Coverity does not find it obvious that p is never negative. Normally
it is the case (because the items have been filtered), but it is
better to play safe.