+docstring InsetRef::layoutName() const
+{
+ return from_ascii("Ref");
+}
+
+
+void InsetRef::changeTarget(docstring const & new_label)
+{
+ // With change tracking, we insert a new ref
+ // and delete the old one
+ if (buffer().masterParams().track_changes) {
+ InsetCommandParams icp(REF_CODE, "ref");
+ icp["reference"] = new_label;
+ string const data = InsetCommand::params2string(icp);
+ lyx::dispatch(FuncRequest(LFUN_INSET_INSERT, data));
+ lyx::dispatch(FuncRequest(LFUN_CHAR_DELETE_FORWARD));
+ } else
+ setParam("reference", new_label);
+}
+
+
+