From 8be59017cf1e7084ff79c5f86e556e6abccaba42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Sat, 8 Mar 2008 08:20:36 +0000 Subject: [PATCH] cosmetics git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23553 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiGraphics.cpp | 28 ++++++++++++++-------------- src/frontends/qt4/Menus.cpp | 20 +++++++++----------- src/frontends/qt4/Menus.h | 2 +- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/frontends/qt4/GuiGraphics.cpp b/src/frontends/qt4/GuiGraphics.cpp index f9bd9e5d5b..2f795ae6f8 100644 --- a/src/frontends/qt4/GuiGraphics.cpp +++ b/src/frontends/qt4/GuiGraphics.cpp @@ -40,15 +40,12 @@ #include "support/Package.h" #include "support/types.h" -#include - #include #include #include #include #include -#include #include #include @@ -84,27 +81,30 @@ static void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit, lengthCombo->currentLengthItem()); } + template -vector const -getFirst(vector const & pr) +vector getFirst(vector const & pr) { - vector tmp(pr.size()); - transform(pr.begin(), pr.end(), tmp.begin(), - boost::bind(&Pair::first, _1)); + size_t const n = pr.size(); + vector tmp(n); + for (size_t i = 0; i != n; ++i) + tmp[i] = pr[i].first; return tmp; } + /// template -vector const -getSecond(vector const & pr) +vector getSecond(vector const & pr) { - vector tmp(pr.size()); - transform(pr.begin(), pr.end(), tmp.begin(), - boost::bind(&Pair::second, _1)); - return tmp; + size_t const n = pr.size(); + vector tmp(n); + for (size_t i = 0; i != n; ++i) + tmp[i] = pr[i].second; + return tmp; } + /// The (tranlated) GUI string and it's LaTeX equivalent. typedef pair RotationOriginPair; /// diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index 00114bfe88..2324718f28 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -51,8 +51,6 @@ #include "support/gettext.h" #include "support/lstrings.h" -#include - #include "qt_helpers.h" #include @@ -62,7 +60,6 @@ #include using namespace std; -using boost::bind; using namespace lyx::support; @@ -263,7 +260,7 @@ MenuItem::~MenuItem() {} -void MenuItem::submenu(Menu * menu) +void MenuItem::setSubmenu(Menu * menu) { submenu_.reset(menu); } @@ -526,12 +523,13 @@ MenuItem const & Menu::operator[](size_type i) const bool Menu::hasFunc(FuncRequest const & func) const { - return find_if(begin(), end(), - bind(equal_to(), - bind(&MenuItem::func, _1), - func)) != end(); + for (const_iterator it = begin(), et = end(); it != et; ++it) + if (it->func() == func) + return true; + return false; } + void Menu::checkShortcuts() const { // This is a quadratic algorithm, but we do not care because @@ -843,7 +841,7 @@ void expandToc2(Menu & tomenu, Toc const & toc_list, label, FuncRequest(toc_list[pos].action()))); } else { MenuItem item(MenuItem::Submenu, label); - item.submenu(new Menu); + item.setSubmenu(new Menu); expandToc2(*item.submenu(), toc_list, pos, new_pos, depth + 1); tomenu.add(item); @@ -925,7 +923,7 @@ void expandToc(Menu & tomenu, Buffer const * buf) else label = qt_("Other floats"); MenuItem item(MenuItem::Submenu, label); - item.submenu(menu.release()); + item.setSubmenu(menu.release()); tomenu.add(item); } @@ -1082,7 +1080,7 @@ void Menus::expand(Menu const & frommenu, Menu & tomenu, case MenuItem::Submenu: { MenuItem item(*cit); - item.submenu(new Menu(cit->submenuname())); + item.setSubmenu(new Menu(cit->submenuname())); expand(getMenu(cit->submenuname()), *item.submenu(), buf); tomenu.addWithStatusCheck(item); diff --git a/src/frontends/qt4/Menus.h b/src/frontends/qt4/Menus.h index 0b7d1a92f6..9e613943b1 100644 --- a/src/frontends/qt4/Menus.h +++ b/src/frontends/qt4/Menus.h @@ -135,7 +135,7 @@ public: /// Menu * submenu() const { return submenu_.get(); } /// - void submenu(Menu * menu); + void setSubmenu(Menu * menu); private: ///