+ return InsetCommand::params2string(icp);
+}
+
+
+docstring const InsetMathRef::getTarget() const
+{
+ return asString(cell(0));
+}
+
+
+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 ar;
+ Buffer & buf = buffer();
+ if (createInsetMath_fromDialogStr(
+ from_utf8(InsetCommand::params2string(icp)), ar)) {
+ *this = *ar[0].nucleus()->asRefInset();
+ // FIXME audit setBuffer calls
+ setBuffer(buf);
+ }