Fix list of viewable formats in view/update menu.

Also fix list in (currently unused) Export toolbar button.

Fixes: #11044
This commit is contained in:
Juergen Spitzmueller 2018-02-21 10:17:10 +01:00
parent f66fa17cac
commit ab6bd5e319
2 changed files with 8 additions and 4 deletions

View File

@ -1123,7 +1123,7 @@ void MenuDefinition::expandFormats(MenuItem::Kind const kind, Buffer const * buf
add(MenuItem(MenuItem::Command, toqstr(lbl), FuncRequest(action)));
continue;
}
// fall through
break;
case MenuItem::ExportFormats:
if (!f->inExportMenu())
continue;

View File

@ -194,9 +194,13 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
case TO_IMPORTFORMATS:
case TO_UPDATEFORMATS:
case TO_VIEWFORMATS: {
FormatList formats = (code == TO_IMPORTFORMATS) ?
theConverters().importableFormats() :
theConverters().exportableFormats(true);
FormatList formats;
if (code == TO_IMPORTFORMATS)
formats = theConverters().importableFormats();
else if (code == TO_EXPORTFORMATS)
formats = theConverters().exportableFormats(false);
else
formats = theConverters().exportableFormats(true);
sort(formats.begin(), formats.end());
for (Format const * f : formats) {
if (f->dummy())