--- lyx-devel/trunk/src/BufferView.cpp Mon Dec 5 13:40:22 2011
(r40376)
+++ lyx-devel/trunk/src/BufferView.cpp Mon Dec 5 14:12:57 2011
(r40377)
+ case LFUN_FILE_INSERT_PLAINTEXT: {
+ bool enabled = true;
This variable is not changed afterwards. What is it good for?
Hmm. it shouldn't be there.
+ case LFUN_FILE_INSERT_PLAINTEXT_PARA:
+ case LFUN_FILE_INSERT_PLAINTEXT: {
+ bool const as_paragraph = (act ==
LFUN_FILE_INSERT_PLAINTEXT_PARA);
+ string const fname = to_utf8(cmd.argument());
+ if (!FileName::isAbsolute(fname))
+ dr.setMessage(_("Absolute filename expected."));
Why not assert directly? This is not supposed to happen at all.
I don't want to put an assertion there, because the user is of course
free to enter a command in the command buffer with a relative filename.
An assertion seems a bit too much of a punishment.
Why not:
enable = documentBufferView() &&
documentBufferView()->cursor().inTexted();
?
Actually I think it is the same ;).
JMarc
Vincent