]> git.lyx.org Git - features.git/commitdiff
Fix crash when the Gui Name of a toolbar is not plain ascii. This
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Aug 2008 18:43:46 +0000 (18:43 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Aug 2008 18:43:46 +0000 (18:43 +0000)
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
src/frontends/qt4/Menus.cpp
src/frontends/qt4/Toolbars.cpp
src/frontends/qt4/Toolbars.h

index cd8c889925ad5eb9655bd4f7a6d6da16121d53b2..632f7b49793df7f84e2d270e60a5a14374aa52cd 100644 (file)
@@ -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)
 {
index adf17d24288519f952d08aa2d8df15de6c3f2d93..62d694b48a507c6c31d59c365bc443ad10486ca6 100644 (file)
@@ -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);
index 72fc4a7c8837e2a8627ac1e8df2ab427660fd07d..f83b57055756aada01822e9b1c18951ee539e0f3 100644 (file)
@@ -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<ToolbarInfo *>(ti)->gui_name +=
-                                       fromqstr(" (" + qt_("auto") + ")");
+                                       " (" + _("auto") + ")";
                }
        }
 }
index 6ecc738ad9b7ffecd5ca1aff2739780dd32362b1..48ca1c223c5eddfdfef283cd6fc16f9252fde915 100644 (file)
@@ -77,7 +77,7 @@ public:
        /// toolbar name
        std::string name;
        /// toolbar GUI name
-       std::string gui_name;
+       docstring gui_name;
        /// toolbar contents
        Items items;