break;
}
- case LFUN_BUFFER_UPDATE:
- case LFUN_BUFFER_VIEW:
case LFUN_MASTER_BUFFER_UPDATE:
- case LFUN_MASTER_BUFFER_VIEW: {
+ case LFUN_MASTER_BUFFER_VIEW:
+ if (!buf->parent()) {
+ enable = false;
+ break;
+ }
+ case LFUN_BUFFER_UPDATE:
+ case LFUN_BUFFER_VIEW: {
+ string format = to_utf8(cmd.argument());
+ if (cmd.argument().empty())
+ format = buf->getDefaultOutputFormat();
typedef vector<Format const *> Formats;
Formats formats;
formats = buf->exportableFormats(true);
Formats::const_iterator end = formats.end();
enable = false;
for (; fit != end ; ++fit) {
- if ((*fit)->name() == to_utf8(cmd.argument()))
+ if ((*fit)->name() == format)
enable = true;
}
break;
break;
}
- case LFUN_BUFFER_UPDATE:
+ case LFUN_BUFFER_UPDATE: {
LASSERT(lyx_view_ && buffer, /**/);
- buffer->doExport(argument, true);
+ string format = argument;
+ if (argument.empty())
+ format = buffer->getDefaultOutputFormat();
+ buffer->doExport(format, true);
break;
+ }
- case LFUN_BUFFER_VIEW:
+ case LFUN_BUFFER_VIEW: {
LASSERT(lyx_view_ && buffer, /**/);
- buffer->preview(argument);
+ string format = argument;
+ if (argument.empty())
+ format = buffer->getDefaultOutputFormat();
+ buffer->preview(format);
break;
+ }
- case LFUN_MASTER_BUFFER_UPDATE:
+ case LFUN_MASTER_BUFFER_UPDATE: {
LASSERT(lyx_view_ && buffer && buffer->masterBuffer(), /**/);
- buffer->masterBuffer()->doExport(argument, true);
+ string format = argument;
+ if (argument.empty())
+ format = buffer->masterBuffer()->getDefaultOutputFormat();
+ buffer->masterBuffer()->doExport(format, true);
break;
+ }
- case LFUN_MASTER_BUFFER_VIEW:
+ case LFUN_MASTER_BUFFER_VIEW: {
LASSERT(lyx_view_ && buffer && buffer->masterBuffer(), /**/);
- buffer->masterBuffer()->preview(argument);
+ string format = argument;
+ if (argument.empty())
+ format = buffer->masterBuffer()->getDefaultOutputFormat();
+ buffer->masterBuffer()->preview(format);
break;
+ }
case LFUN_BUILD_PROGRAM:
LASSERT(lyx_view_ && buffer, /**/);
case LyXRC::RC_COPIER:
case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
- case LyXRC::RC_CUSTOM_EXPORT_COMMAND:
- case LyXRC::RC_CUSTOM_EXPORT_FORMAT:
case LyXRC::RC_DATE_INSERT_FORMAT:
case LyXRC::RC_DEFAULT_LANGUAGE:
case LyXRC::RC_GUI_LANGUAGE:
case LyXRC::RC_DEFAULT_PAPERSIZE:
+ case LyXRC::RC_DEFAULT_VIEW_FORMAT:
case LyXRC::RC_DEFFILE:
case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
case LyXRC::RC_DISPLAY_GRAPHICS:
case LyXRC::RC_FORMAT:
case LyXRC::RC_GROUP_LAYOUTS:
case LyXRC::RC_INDEX_COMMAND:
+ case LyXRC::RC_JBIBTEX_COMMAND:
+ case LyXRC::RC_JINDEX_COMMAND:
case LyXRC::RC_NOMENCL_COMMAND:
case LyXRC::RC_INPUT:
case LyXRC::RC_KBMAP: