buffer().setInsetLabel(label, this);
screen_label_ = label;
- if (utype) {
+ if (utype == OutputUpdate) {
// save info on the active counter
Counters const & cnts =
buffer().masterBuffer()->params().documentClass().counters();
counter_value_ = cnts.theCounter(active_counter_, lang->code());
pretty_counter_ = cnts.prettyCounter(active_counter_, lang->code());
} else {
- counter_value_ = from_ascii("??");
- pretty_counter_ = from_ascii("??");
+ counter_value_ = from_ascii("#");
+ pretty_counter_ = from_ascii("#");
}
}
}
-void InsetLabel::addToToc(DocIterator const & cpit)
+void InsetLabel::addToToc(DocIterator const & cpit) const
{
docstring const & label = getParam("name");
Toc & toc = buffer().tocBackend().toc("label");
DocIterator const ref_pit(it->second);
if (it->first->lyxCode() == MATH_REF_CODE)
toc.push_back(TocItem(ref_pit, 1,
- it->first->asInsetMath()->asHullInset()->asRefInset()
- ->screenLabel()));
+ it->first->asInsetMath()->asRefInset()->screenLabel()));
else
toc.push_back(TocItem(ref_pit, 1,
static_cast<InsetRef *>(it->first)->screenLabel()));
cur.noScreenUpdate();
break;
}
- if (p["name"] != params()["name"])
+ if (p["name"] != params()["name"]) {
+ // undo is handled in updateCommand
updateCommand(p["name"]);
+ }
cur.forceBufferUpdate();
break;
}