* 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
This commit is contained in:
Jean-Marc Lasgouttes 2007-06-04 13:27:27 +00:00
parent 7990a764dc
commit c54a01a194
3 changed files with 5 additions and 6 deletions

View File

@ -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);
}

View File

@ -44,9 +44,6 @@ public:
std::vector<docstring> 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<std::string> types_;
std::vector<docstring> 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

View File

@ -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;