void GuiInfo::applyView()
{
- InsetInfo const * ii = static_cast<InsetInfo const *>(inset(INFO_CODE));
- if (!ii) {
+ InsetInfo const * ii = dynamic_cast<InsetInfo const *>(inset(INFO_CODE));
+ if (!ii)
return;
- }
dialogToParams();
docstring const argument = qstring_to_ucs4(type_ + ' ' + name_);
if (!ii->validate(argument))
return;
- dispatch(FuncRequest(LFUN_INSET_MODIFY, argument));
+ dispatch(FuncRequest(LFUN_NEXT_INSET_MODIFY, argument));
// FIXME: update the inset contents
- updateLabels(bufferview()->buffer());
- bufferview()->updateMetrics();
- bufferview()->buffer().changed();
+ bufferview()->buffer().updateLabels();
+ BufferView * bv = const_cast<BufferView *>(bufferview());
+ bv->updateMetrics();
+ bv->buffer().changed();
+ bv->buffer().markDirty();
}
void GuiInfo::updateView()
{
- InsetInfo const * ii = static_cast<InsetInfo const *>(inset(INFO_CODE));
+ InsetInfo const * ii = dynamic_cast<InsetInfo const *>(inset(INFO_CODE));
if (!ii) {
enableView(false);
return;
nameLE->blockSignals(true);
int type = findToken(info_types, fromqstr(type_));
typeCO->setCurrentIndex(type >= 0 ? type : 0);
- nameLE->setText(name_);
+ // Without this test, 'math-insert' (name_) will replace 'math-insert '
+ // in nameLE and effectively disallow the input of spaces after a LFUN.
+ if (nameLE->text().trimmed() != name_)
+ nameLE->setText(name_);
typeCO->blockSignals(false);
nameLE->blockSignals(false);
}
} // namespace frontend
} // namespace lyx
-#include "GuiInfo_moc.cpp"
+#include "moc_GuiInfo.cpp"