]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Toolbars.cpp
rename buffer parameter math_number_before to math_numbering_side
[lyx.git] / src / frontends / qt4 / Toolbars.cpp
index c9610252f3ca3c1b2ad6b43abc60c64fbdd7e0b4..2c0d2ab1a3a0a1abbc1191132cf8e53b1ff386aa 100644 (file)
@@ -23,8 +23,6 @@
 #include "support/gettext.h"
 #include "support/lstrings.h"
 
-#include "support/bind.h"
-
 #include <algorithm>
 
 using namespace std;
@@ -40,14 +38,16 @@ namespace frontend {
 //
 /////////////////////////////////////////////////////////////////////////
 
-ToolbarItem::ToolbarItem(Type type, FuncRequest const & func, docstring const & label)
-       : type_(type), func_(func), label_(label)
+ToolbarItem::ToolbarItem(Type type, FuncRequest const & func,
+                         docstring const & label)
+       : type_(type), func_(make_shared<FuncRequest>(func)), label_(label)
 {
 }
 
 
-ToolbarItem::ToolbarItem(Type type, string const & name, docstring const & label)
-       : type_(type), label_(label), name_(name)
+ToolbarItem::ToolbarItem(Type type, string const & name,
+                         docstring const & label)
+       : type_(type), func_(make_shared<FuncRequest>()), label_(label), name_(name)
 {
 }
 
@@ -55,7 +55,7 @@ ToolbarItem::ToolbarItem(Type type, string const & name, docstring const & label
 void ToolbarInfo::add(ToolbarItem const & item)
 {
        items.push_back(item);
-       items.back().func_.setOrigin(FuncRequest::TOOLBAR);
+       items.back().func_->setOrigin(FuncRequest::TOOLBAR);
 }
 
 
@@ -194,21 +194,18 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
                case TO_IMPORTFORMATS:
                case TO_UPDATEFORMATS:
                case TO_VIEWFORMATS: {
-                       vector<Format const *> formats = (code == TO_IMPORTFORMATS) ?
+                       FormatList formats = (code == TO_IMPORTFORMATS) ?
                                theConverters().importableFormats() :
-                               theConverters().exportableFormats(code != TO_EXPORTFORMATS);
+                               theConverters().exportableFormats(true);
                        sort(formats.begin(), formats.end());
-                       vector<Format const *>::const_iterator fit = formats.begin();
-                       vector<Format const *>::const_iterator end = formats.end();
-                       for (; fit != end ; ++fit) {
-                               if ((*fit)->dummy())
+                       for (Format const * f : formats) {
+                               if (f->dummy())
                                        continue;
                                if (code != TO_IMPORTFORMATS &&
-                                   !(*fit)->documentFormat())
+                                   !f->documentFormat())
                                        continue;
 
-                               docstring const prettyname =
-                                       from_utf8((*fit)->prettyname());
+                               docstring const prettyname = f->prettyname();
                                docstring tooltip;
                                FuncCode lfun = LFUN_NOACTION;
                                switch (code) {
@@ -229,7 +226,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
                                        tooltip = _("View %1$s");
                                        break;
                                }
-                               FuncRequest func(lfun, (*fit)->name(),
+                               FuncRequest func(lfun, f->name(),
                                                FuncRequest::TOOLBAR);
                                add(ToolbarItem(ToolbarItem::COMMAND, func,
                                                bformat(tooltip, prettyname)));
@@ -348,6 +345,8 @@ void Toolbars::readToolbarSettings(Lexer & lex)
                                flag = MATHMACROTEMPLATE;
                        else if (!compare_ascii_no_case(*cit, "review"))
                                flag = REVIEW;
+                       else if (!compare_ascii_no_case(*cit, "minibuffer"))
+                               flag = MINIBUFFER;
                        else if (!compare_ascii_no_case(*cit, "top"))
                                flag = TOP;
                        else if (!compare_ascii_no_case(*cit, "bottom"))