mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-22 16:37:28 +00:00
* 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:
parent
7990a764dc
commit
c54a01a194
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user