Reinstate the commented out check, now that I've figured out how to do it.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25673 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-07-16 16:05:35 +00:00
parent 97a9667f6e
commit c2a28fa239

View File

@ -507,17 +507,20 @@ void GuiLayoutBox::set(docstring const & layout)
return; return;
Layout const & lay = (*text_class_)[layout]; Layout const & lay = (*text_class_)[layout];
QString const & name = toqstr(lay.name()); QString const newLayout = toqstr(lay.name());
// FIXME
// Commenting this out for now. Not sure exactly how to do this test,
// with all the different models that are flying around. As it is, it
// won't work with translated or unknown layouts.
// if (name == currentText())
// return;
QList<QStandardItem *> r = model_->findItems(name, Qt::MatchExactly, 1); int const curItem = currentIndex();
QModelIndex const mindex =
filterModel_->mapToSource(filterModel_->index(curItem, 1));
QString const & currentLayout = model_->itemFromIndex(mindex)->text();
if (newLayout == currentLayout) {
LYXERR(Debug::GUI, "Already had " << newLayout << " selected.");
return;
}
QList<QStandardItem *> r = model_->findItems(newLayout, Qt::MatchExactly, 1);
if (r.empty()) { if (r.empty()) {
LYXERR0("Trying to select non existent layout type " << name); LYXERR0("Trying to select non existent layout type " << newLayout);
return; return;
} }