]> git.lyx.org Git - lyx.git/commitdiff
GuiToc::initialiseParams(): Fix list type parsing
authorAbdelrazak Younes <younes@lyx.org>
Tue, 12 Feb 2008 09:32:40 +0000 (09:32 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 12 Feb 2008 09:32:40 +0000 (09:32 +0000)
TocWidget::updateGui(): Fix for non existent list.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22957 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiToc.cpp
src/frontends/qt4/TocWidget.cpp

index 2e94eb4f6eab6300ada29d5d909214c87a492a07..2c041e9a86168c12596d3388ded818a3d2dd2025 100644 (file)
@@ -140,14 +140,15 @@ TocList const & GuiToc::tocs() const
 bool GuiToc::initialiseParams(string const & data)
 {
        LYXERR(Debug::GUI, data);
+       LYXERR0(data);
        QString str = QString::fromUtf8(data.c_str());
        string new_type = "tableofcontents";
        if (str.contains("floatlist")) {
-               if (str.contains("figure"))
+               if (str.contains("\"figure"))
                        new_type = "figure";
-               else if (str.contains("table"))
+               else if (str.contains("\"table"))
                        new_type = "table";
-               else if (str.contains("algorithm"))
+               else if (str.contains("\"algorithm"))
                        new_type = "algorithm";
        }
 
@@ -170,7 +171,6 @@ bool GuiToc::initialiseParams(string const & data)
                        break;
                }
        }
-
        widget_->updateGui(selected_type);
 
        return true;
index bdc968670b084cb9397bdbffd59b4a706ee65f7d..0a1131469b0de9dd7b634b6e2c04b06c77e2c17d 100644 (file)
@@ -228,7 +228,8 @@ void TocWidget::updateGui(int selected_type)
                QString item = toqstr(type_names[i]);
                typeCO->addItem(item);
        }
-       typeCO->setCurrentIndex(selected_type);
+       if (selected_type != -1)
+               typeCO->setCurrentIndex(selected_type);
        typeCO->blockSignals(false);
 
        setTocModel(typeCO->currentIndex());