mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
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:
parent
97a9667f6e
commit
c2a28fa239
@ -507,17 +507,20 @@ void GuiLayoutBox::set(docstring const & layout)
|
||||
return;
|
||||
|
||||
Layout const & lay = (*text_class_)[layout];
|
||||
QString const & name = 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;
|
||||
QString const newLayout = toqstr(lay.name());
|
||||
|
||||
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()) {
|
||||
LYXERR0("Trying to select non existent layout type " << name);
|
||||
LYXERR0("Trying to select non existent layout type " << newLayout);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user