From c54a01a194238114c72b3551e4298ee29d82f849 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 4 Jun 2007 13:27:27 +0000 Subject: [PATCH] * src/frontends/qt4/TocWidget.cpp (updateGui): do not call getGUIName, since this is already what we have; fixes a crash (bug 3793) * src/frontends/controllers/ControlToc.h: make getGUIName private * src/frontends/controllers/ControlToc.cpp (getGUIName): handle correctly the lists of floats. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18648 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/ControlToc.cpp | 2 +- src/frontends/controllers/ControlToc.h | 6 +++--- src/frontends/qt4/TocWidget.cpp | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/frontends/controllers/ControlToc.cpp b/src/frontends/controllers/ControlToc.cpp index ad3c8d3c64..c2db5ac5e7 100644 --- a/src/frontends/controllers/ControlToc.cpp +++ b/src/frontends/controllers/ControlToc.cpp @@ -139,7 +139,7 @@ docstring const ControlToc::getGuiName(string const & type) const FloatList const & floats = kernel().buffer().params().getTextClass().floats(); if (floats.typeExist(type)) - return from_utf8(floats.getType(type).name()); + return _(floats.getType(type).listName()); else return _(type); } diff --git a/src/frontends/controllers/ControlToc.h b/src/frontends/controllers/ControlToc.h index e71c18c830..36d306179f 100644 --- a/src/frontends/controllers/ControlToc.h +++ b/src/frontends/controllers/ControlToc.h @@ -44,9 +44,6 @@ public: std::vector const & typeNames() const { return type_names_; } - /// Return the guiname from a given cmdName of the TOC param - docstring const getGuiName(std::string const & type) const; - /// int selectedType() { return selected_type_; } @@ -70,6 +67,9 @@ private: std::vector types_; std::vector type_names_; int selected_type_; + + /// Return the guiname from a given cmdName of the TOC param + docstring const getGuiName(std::string const & type) const; }; } // namespace frontend diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp index 778e304ff2..4363d09109 100644 --- a/src/frontends/qt4/TocWidget.cpp +++ b/src/frontends/qt4/TocWidget.cpp @@ -254,8 +254,7 @@ void TocWidget::updateGui() typeCO->clear(); int current_type = -1; for (size_t i = 0; i != type_names.size(); ++i) { - QString item = - toqstr(form_->getGuiName(to_utf8(type_names[i]))); + QString item = toqstr(type_names[i]); typeCO->addItem(item); if (item == current_text) current_type = i;