]> git.lyx.org Git - features.git/commitdiff
Make code a bit easier to read
authorRichard Kimberly Heck <rikiheck@lyx.org>
Wed, 16 Aug 2023 22:52:04 +0000 (18:52 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Wed, 16 Aug 2023 22:52:04 +0000 (18:52 -0400)
src/frontends/qt/LayoutBox.cpp

index a4ad9ba2bfba5e882b3bad4fdbe3064f0680a4d1..1cc6476a30fd8c91b88f049779cea8f761a60ca6 100644 (file)
@@ -626,10 +626,11 @@ void LayoutBox::selected(int index)
        }
 
        // get selection
-       QModelIndex mindex = d->filterModel_->mapToSource(
-               d->filterModel_->index(index, 1));
-       docstring const layoutName = qstring_to_ucs4(
-               d->model_->itemFromIndex(mindex)->text());
+       // get the index of the untranslated layout name (which is in column 1)
+       QModelIndex const lindex = d->filterModel_->index(index, 1);
+       QModelIndex const mindex = d->filterModel_->mapToSource(lindex);
+       QString const qlayout = d->model_->itemFromIndex(mindex)->text();
+       docstring const layoutName = qstring_to_ucs4(qlayout);
 
        // find corresponding text class
        if (d->text_class_->hasLayout(layoutName)) {