From: Yuriy Skalko Date: Sun, 10 Jan 2021 09:05:58 +0000 (+0200) Subject: Refactor decodeInsetParam X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c8085f7472a8c41f4b14070dc88a41a3629d9aa7;p=features.git Refactor decodeInsetParam --- diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 2365874780..ec632d86e6 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -306,6 +306,7 @@ bool decodeInsetParam(string const & name, string & data, switch (code) { case BIBITEM_CODE: case BIBTEX_CODE: + case CITE_CODE: case INDEX_PRINT_CODE: case LABEL_CODE: case LINE_CODE: @@ -319,11 +320,6 @@ bool decodeInsetParam(string const & name, string & data, break; } case INCLUDE_CODE: { - // data is the include type: one of "include", - // "input", "verbatiminput" or "verbatiminput*" - if (data.empty()) - // default type is requested - data = "include"; data = InsetCommandParams(INCLUDE_CODE, data).toString(); break; } @@ -336,10 +332,6 @@ bool decodeInsetParam(string const & name, string & data, data = InsetBranchParams().toString(); break; } - case CITE_CODE: { - data = InsetCommandParams(CITE_CODE).toString(); - break; - } case ERT_CODE: { data = InsetERTParams().toString(); break; diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 35b87e327e..de5092ab82 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -184,6 +184,8 @@ InsetCommandParams::InsetCommandParams(InsetCode code, string const & cmdName) : insetCode_(code), cmdName_(cmdName), preview_(false) { + if (cmdName_.empty()) + cmdName_ = getDefaultCmd(code); info_ = findInfo(code, cmdName); }