mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 21:05:12 +00:00
InsetInfo: implement InsetInfo::validate
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26042 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
78bb4feba1
commit
bdfcd5f16a
@ -147,10 +147,34 @@ void InsetInfo::write(ostream & os) const
|
||||
}
|
||||
|
||||
|
||||
bool InsetInfo::validate(docstring const & /* argument */) const
|
||||
bool InsetInfo::validate(docstring const & arg) const
|
||||
{
|
||||
// FIXME!
|
||||
string type;
|
||||
string name;
|
||||
|
||||
name = trim(split(to_utf8(arg), type, ' '));
|
||||
switch (nameTranslator().find(type)) {
|
||||
case UNKNOWN_INFO:
|
||||
return false;
|
||||
case SHORTCUT_INFO:
|
||||
case SHORTCUTS_INFO:
|
||||
case MENU_INFO:
|
||||
case ICON_INFO: {
|
||||
FuncRequest func = lyxaction.lookupFunc(name);
|
||||
return func.action != LFUN_UNKNOWN_ACTION;
|
||||
}
|
||||
case LYXRC_INFO: {
|
||||
ostringstream oss;
|
||||
lyxrc.write(oss, true, name);
|
||||
return !oss.str().empty();
|
||||
}
|
||||
case PACKAGE_INFO:
|
||||
case TEXTCLASS_INFO:
|
||||
return true;
|
||||
case BUFFER_INFO:
|
||||
return name_ == "name" || name_ == "path" || name_ == "class";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user