commit 1e76de5803b011ce9ef75c50bef78b8598f74818
Author: Juergen Spitzmueller <[email protected]>
Date: Thu Sep 4 16:11:51 2025 +0200
Remove most traces of "name" InsetRef parameter
The param has effectively been removed in 2020 (fd6e14414f272),
but DocBook was forgotten.
I will remove the param itself early in 2.6.x cycle. We cannot
remove it now, as old files might still have it set and
InsetCommandParams asserts on unknown params.
---
src/insets/InsetRef.cpp | 32 +++++---------------------------
src/mathed/InsetMathRef.cpp | 4 ----
2 files changed, 5 insertions(+), 31 deletions(-)
diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index a96b7b58da..0902e193a4 100644
--- a/src/insets/InsetRef.cpp
+++ b/src/insets/InsetRef.cpp
@@ -78,16 +78,19 @@ ParamInfo const & InsetRef::findInfo(string const & /*
cmdName */)
{
static ParamInfo param_info_;
if (param_info_.empty()) {
- param_info_.add("name", ParamInfo::LATEX_OPTIONAL);
param_info_.add("reference", ParamInfo::LATEX_REQUIRED,
ParamInfo::HANDLING_ESCAPE);
+ param_info_.add("options", ParamInfo::LATEX_OPTIONAL);
param_info_.add("plural", ParamInfo::LYX_INTERNAL);
param_info_.add("caps", ParamInfo::LYX_INTERNAL);
param_info_.add("noprefix", ParamInfo::LYX_INTERNAL);
param_info_.add("nolink", ParamInfo::LYX_INTERNAL);
- param_info_.add("options", ParamInfo::LYX_INTERNAL);
param_info_.add("tuple", ParamInfo::LYX_INTERNAL);
param_info_.add("filenames", ParamInfo::LYX_INTERNAL);
+ // FIXME: This is unused as of 2020 (fd6e14414f272)
+ // remove param later (needs file format change,
+ // since InsetCommandParams would assert otherwise)
+ param_info_.add("name", ParamInfo::LYX_INTERNAL);
}
return param_info_;
}
@@ -650,26 +653,6 @@ void InsetRef::docbook(XMLStream & xs, OutputParams const
&) const
vector<docstring> labels = getVectorFromString(getParam("reference"));
string const & cmd = params().getCmdName();
- // A name is provided, LyX will provide it. This is supposed to be a
very rare case.
- // Link with linkend, as is it within the document (not outside, in
which case xlink:href is better suited).
- docstring const & name = getParam("name");
- if (!name.empty()) {
- bool first_iteration = true;
- for (const docstring & label : labels) {
- if (!first_iteration) {
- xs << ", ";
- }
- first_iteration = false;
-
- docstring attr = from_utf8("linkend=\"") +
xml::cleanID(label) + from_utf8("\"");
-
- xs << xml::StartTag("link", to_utf8(attr));
- xs << name;
- xs << xml::EndTag("link");
- }
- return;
- }
-
// The DocBook processor will generate the name when required.
//
// The DocBook processor deals with generating the right text,
@@ -922,11 +905,6 @@ void InsetRef::updateBuffer(ParIterator const & it,
UpdateType, bool const /*del
}
}
- if (!buffer().params().isLatex() && !getParam("name").empty()) {
- label += "||";
- label += getParam("name");
- }
-
// The tooltip will be over-written later, in addToToc, if need be.
tooltip_ = label;
toc_string_ = label;
diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp
index b2262937e0..381e243c0c 100644
--- a/src/mathed/InsetMathRef.cpp
+++ b/src/mathed/InsetMathRef.cpp
@@ -274,8 +274,6 @@ string const InsetMathRef::createDialogStr(string const &
type) const
InsetCommandParams icp(REF_CODE, (type.empty()
? to_ascii(commandname()) : type));
icp["reference"] = asString(cell(0));
- if (!cell(1).empty())
- icp["name"] = asString(cell(1));
return InsetCommand::params2string(icp);
}
@@ -290,8 +288,6 @@ void InsetMathRef::changeTarget(docstring const & target)
{
InsetCommandParams icp(REF_CODE, to_ascii(commandname()));
icp["reference"] = target;
- if (!cell(1).empty())
- icp["name"] = asString(cell(1));
MathData md(buffer_);
Buffer & buf = buffer();
if (createInsetMath_fromDialogStr(
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs