Georg Baum <[EMAIL PROTECTED]> writes:
| Am Sonntag, 16. Juli 2006 16:49 schrieb Lars Gullik Bjønnes:
| > Georg Baum <[EMAIL PROTECTED]> writes:
| >
| > | Another short fix that goes in tomorrow if nobody objects. See
| > | http://bugzilla.lyx.org/show_bug.cgi?id=2404 for details.
| >
| > Why is this the correct fix?
| >
| > I would have thought a message that "this is not a template" and doing
| > nothing (not loading a buffer at all) would be a more proper solution.
|
| Good question. A message "this is not a LyX file" appears already, followed
| by "The specified document template %s could not be read".
| The only reason for loading the buffer nevertheless was apparently the fact
| that newFile was expected to always return a valid buffer.
|
| What about the attached patch? It does not open a new buffer if the
| temnplate could not be read, and checks the return value of newFile and
| acts accordingly at all places where it is called.
I do like this better.
Would anything change if you used exceptions to handle the case?
No need to return 0 from newFile? would it make anything simpler, or
just more complicated?
--
Lgb