I guess I like this better.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35020 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-07-29 00:00:37 +00:00
parent 523056c092
commit 35327c0b5b

View File

@ -1239,9 +1239,11 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
}
case LFUN_TEXTCLASS_APPLY: {
bool success = LayoutFileList::get().load(argument, buffer_.temppath());
if (!success)
success = LayoutFileList::get().load(argument, buffer_.filePath());
// since this shortcircuits, the second call is made only if
// the first fails
bool const success =
LayoutFileList::get().load(argument, buffer_.temppath()) ||
LayoutFileList::get().load(argument, buffer_.filePath());
if (!success) {
docstring s = bformat(_("The document class `%1$s' "
"could not be loaded."), from_utf8(argument));
@ -1269,9 +1271,11 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
}
case LFUN_TEXTCLASS_LOAD: {
bool success = LayoutFileList::get().load(argument, buffer_.temppath());
if (!success)
success = LayoutFileList::get().load(argument, buffer_.filePath());
// since this shortcircuits, the second call is made only if
// the first fails
bool const success =
LayoutFileList::get().load(argument, buffer_.temppath()) ||
LayoutFileList::get().load(argument, buffer_.filePath());
if (!success) {
docstring s = bformat(_("The document class `%1$s' "
"could not be loaded."), from_utf8(argument));