]> git.lyx.org Git - features.git/commitdiff
* fix sorting of layout names
authorStefan Schimanski <sts@lyx.org>
Tue, 4 Mar 2008 09:47:11 +0000 (09:47 +0000)
committerStefan Schimanski <sts@lyx.org>
Tue, 4 Mar 2008 09:47:11 +0000 (09:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23428 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiToolbar.cpp

index 72f090b22084af2722cbac8ac61fd5e16abba7cd..76cdefe45b347c2105c42c533b52928fdb1c586d 100644 (file)
@@ -421,8 +421,10 @@ void GuiLayoutBox::set(docstring const & layout)
 void GuiLayoutBox::addItemSort(docstring const & item, bool sorted)
 {
        QString qitem = toqstr(item);
+       QString titem = toqstr(translateIfPossible(item));
+
        QList<QStandardItem *> row;
-       row.append(new QStandardItem(toqstr(translateIfPossible(item))));
+       row.append(new QStandardItem(titem));
        row.append(new QStandardItem(qitem));
 
        // the simple unsorted case
@@ -435,14 +437,14 @@ void GuiLayoutBox::addItemSort(docstring const & item, bool sorted)
        // find row to insert the item
        int i = 1; // skip the Standard layout
        QString is = model_->item(i, 1)->text();
-       while (is.compare(qitem) < 0) {
+       while (is.compare(titem) < 0) {
                // e.g. --Separator--
                if (is[0].category() != QChar::Letter_Uppercase)
                        break;
                ++i;
                if (i == end)
                        break;
-               QString is = model_->item(i, 1)->text();
+               is = model_->item(i, 1)->text();
        }
 
        model_->insertRow(i, row);