mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
Disable lists of floats we don't know how to generate.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33635 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
99bbf5b42a
commit
75454ca8c5
@ -2275,11 +2275,24 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
// not allowed in description items
|
// not allowed in description items
|
||||||
enable = !inDescriptionItem(cur);
|
enable = !inDescriptionItem(cur);
|
||||||
break;
|
break;
|
||||||
case LFUN_FLOAT_LIST_INSERT:
|
case LFUN_FLOAT_LIST_INSERT: {
|
||||||
code = FLOAT_LIST_CODE;
|
code = FLOAT_LIST_CODE;
|
||||||
// not allowed in description items
|
// not allowed in description items
|
||||||
enable = !inDescriptionItem(cur);
|
enable = !inDescriptionItem(cur);
|
||||||
|
if (enable) {
|
||||||
|
FloatList const & floats = cur.buffer()->params().documentClass().floats();
|
||||||
|
FloatList::const_iterator cit = floats[to_ascii(cmd.argument())];
|
||||||
|
// make sure we know about such floats
|
||||||
|
if (cit == floats.end() ||
|
||||||
|
// and that we know how to generate a list of them
|
||||||
|
(!cit->second.needsFloatPkg() && cit->second.listCommand().empty())) {
|
||||||
|
flag.unknown(true);
|
||||||
|
// probably not necessary, but...
|
||||||
|
enable = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case LFUN_CAPTION_INSERT:
|
case LFUN_CAPTION_INSERT:
|
||||||
code = CAPTION_CODE;
|
code = CAPTION_CODE;
|
||||||
// not allowed in description items
|
// not allowed in description items
|
||||||
|
@ -124,8 +124,14 @@ int InsetFloatList::latex(odocstream & os, OutputParams const &) const
|
|||||||
if (fl.needsFloatPkg())
|
if (fl.needsFloatPkg())
|
||||||
os << "\\listof{" << getParam("type") << "}{"
|
os << "\\listof{" << getParam("type") << "}{"
|
||||||
<< buffer().B_(fl.listName()) << "}\n";
|
<< buffer().B_(fl.listName()) << "}\n";
|
||||||
else
|
else {
|
||||||
|
if (!fl.listCommand().empty())
|
||||||
os << "\\" << from_ascii(fl.listCommand()) << "\n";
|
os << "\\" << from_ascii(fl.listCommand()) << "\n";
|
||||||
|
else
|
||||||
|
os << "%% "
|
||||||
|
<< bformat(_("LyX cannot generate a list of %1$s"), getParam("type"))
|
||||||
|
<< "\n";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
os << "%%\\listof{" << getParam("type") << "}{"
|
os << "%%\\listof{" << getParam("type") << "}{"
|
||||||
<< bformat(_("List of %1$s"), getParam("type"))
|
<< bformat(_("List of %1$s"), getParam("type"))
|
||||||
|
Loading…
Reference in New Issue
Block a user