mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
this feels more natural...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24008 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
621af49f78
commit
640ac2650b
@ -240,9 +240,8 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
|
||||
}
|
||||
|
||||
case ERT_CODE: {
|
||||
InsetCollapsable::CollapseStatus st;
|
||||
InsetERT::string2params(to_utf8(cmd.argument()), st);
|
||||
return new InsetERT(buf, st);
|
||||
return new InsetERT(buf,
|
||||
InsetERT::string2params(to_utf8(cmd.argument())));
|
||||
}
|
||||
|
||||
case LISTINGS_CODE: {
|
||||
|
@ -67,7 +67,7 @@ void GuiERT::updateContents()
|
||||
|
||||
bool GuiERT::initialiseParams(string const & data)
|
||||
{
|
||||
InsetERT::string2params(data, status_);
|
||||
status_ = InsetERT::string2params(data);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -114,9 +114,7 @@ void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
break;
|
||||
}
|
||||
case LFUN_INSET_MODIFY: {
|
||||
InsetCollapsable::CollapseStatus st;
|
||||
InsetERT::string2params(to_utf8(cmd.argument()), st);
|
||||
setStatus(cur, st);
|
||||
setStatus(cur, string2params(to_utf8(cmd.argument())));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -192,11 +190,11 @@ bool InsetERT::showInsetDialog(BufferView * bv) const
|
||||
}
|
||||
|
||||
|
||||
void InsetERT::string2params(string const & in, CollapseStatus & status)
|
||||
InsetCollapsable::CollapseStatus InsetERT::string2params(string const & in)
|
||||
{
|
||||
status = InsetCollapsable::Collapsed;
|
||||
CollapseStatus status = Collapsed;
|
||||
if (in.empty())
|
||||
return;
|
||||
return status;
|
||||
|
||||
istringstream data(in);
|
||||
Lexer lex(0,0);
|
||||
@ -205,15 +203,15 @@ void InsetERT::string2params(string const & in, CollapseStatus & status)
|
||||
string name;
|
||||
lex >> name;
|
||||
if (name != "ert") {
|
||||
LYXERR0("InsetERT::string2params(" << in << ")\n"
|
||||
"Expected arg 1 to be \"ert\"\n");
|
||||
return;
|
||||
LYXERR0("Expected arg 1 to be \"ert\" in " << in);
|
||||
return status;
|
||||
}
|
||||
|
||||
int s;
|
||||
lex >> s;
|
||||
if (lex)
|
||||
status = static_cast<InsetCollapsable::CollapseStatus>(s);
|
||||
status = static_cast<CollapseStatus>(s);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
///
|
||||
~InsetERT();
|
||||
///
|
||||
static void string2params(std::string const &, CollapseStatus &);
|
||||
static CollapseStatus string2params(std::string const &);
|
||||
///
|
||||
static std::string params2string(CollapseStatus);
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user