From d0827e017ec9315caf67df18816a7f7824bad3c5 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 15 Aug 2008 18:43:46 +0000 Subject: [PATCH] Fix crash when the Gui Name of a toolbar is not plain ascii. This happens for example with fr.po. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26176 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiToolbar.cpp | 2 +- src/frontends/qt4/Menus.cpp | 2 +- src/frontends/qt4/Toolbars.cpp | 4 ++-- src/frontends/qt4/Toolbars.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiToolbar.cpp b/src/frontends/qt4/GuiToolbar.cpp index cd8c889925..632f7b4979 100644 --- a/src/frontends/qt4/GuiToolbar.cpp +++ b/src/frontends/qt4/GuiToolbar.cpp @@ -679,7 +679,7 @@ void GuiLayoutBox::selected(int index) GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner) - : QToolBar(qt_(tbinfo.gui_name), &owner), visibility_(0), + : QToolBar(toqstr(tbinfo.gui_name), &owner), visibility_(0), allowauto_(false), owner_(owner), layout_(0), command_buffer_(0), tbinfo_(tbinfo), filled_(false) { diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index adf17d2428..62d694b48a 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -1010,7 +1010,7 @@ void MenuDefinition::expandToolbars() Toolbars::Infos::const_iterator cit = guiApp->toolbars().begin(); Toolbars::Infos::const_iterator end = guiApp->toolbars().end(); for (; cit != end; ++cit) { - MenuItem const item(MenuItem::Command, qt_(cit->gui_name), + MenuItem const item(MenuItem::Command, toqstr(cit->gui_name), FuncRequest(LFUN_TOOLBAR_TOGGLE, cit->name)); if (guiApp->toolbars().isMainToolbar(cit->name)) add(item); diff --git a/src/frontends/qt4/Toolbars.cpp b/src/frontends/qt4/Toolbars.cpp index 72fc4a7c88..f83b570557 100644 --- a/src/frontends/qt4/Toolbars.cpp +++ b/src/frontends/qt4/Toolbars.cpp @@ -95,7 +95,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) name = lex.getString(); lex.next(true); - gui_name = fromqstr(qt_(lex.getString())); + gui_name = _(lex.getString()); // FIXME what to do here? if (!lex) { @@ -306,7 +306,7 @@ void Toolbars::readToolbarSettings(Lexer & lex) if (visibility >= MATH) { if (ToolbarInfo const * ti = info(name)) const_cast(ti)->gui_name += - fromqstr(" (" + qt_("auto") + ")"); + " (" + _("auto") + ")"; } } } diff --git a/src/frontends/qt4/Toolbars.h b/src/frontends/qt4/Toolbars.h index 6ecc738ad9..48ca1c223c 100644 --- a/src/frontends/qt4/Toolbars.h +++ b/src/frontends/qt4/Toolbars.h @@ -77,7 +77,7 @@ public: /// toolbar name std::string name; /// toolbar GUI name - std::string gui_name; + docstring gui_name; /// toolbar contents Items items;