]> git.lyx.org Git - features.git/commitdiff
Even more llvm/clang warnings
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 2 May 2013 17:22:10 +0000 (19:22 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 2 May 2013 17:22:10 +0000 (19:22 +0200)
Remove lyxview_ member of lyx::Action, fix a prototype in TexStream and comment out a Cursor function.

src/Cursor.cpp
src/TexStream.cpp
src/frontends/qt4/Action.cpp
src/frontends/qt4/Action.h
src/frontends/qt4/GuiToolbar.cpp
src/frontends/qt4/Menus.cpp

index 389a34f94f62d715556c6f78e40651e404e90ed9..7f8edc281ed0645b81ceadaee57240a145f30bc1 100644 (file)
@@ -187,7 +187,7 @@ bool bruteFind(Cursor & cursor,
 }
 */
 
-
+/*
 /// moves position closest to (x, y) in given box
 bool bruteFind3(Cursor & cur, int x, int y, bool up)
 {
@@ -249,7 +249,7 @@ bool bruteFind3(Cursor & cur, int x, int y, bool up)
        cur.setCursor(best_cursor);
        return true;
 }
-
+*/
 } // namespace anon
 
 
index 3ac285ee13b15d4f3c7c53ec0311cd7b99e49a17..dc1c43c2a9846c318147e0d24ce9d4092ebc288c 100644 (file)
@@ -34,7 +34,7 @@ public:
        int column() const { return column_; }
 
 protected:
-       int overflow(int);
+       int_type overflow(int_type);
        int sync();
 
 private:
@@ -52,7 +52,7 @@ TexStreamBuffer::TexStreamBuffer(TexStreamBase *sb, TexRow * texrow)
        setg(0, 0, 0);
 }
 
-int TexStreamBuffer::overflow(int c)
+TexStreamBuffer::int_type TexStreamBuffer::overflow(TexStreamBuffer::int_type c)
 {
        if (c == '\n') {
                ++line_;
index 3014e9a82f6a6604279c0f6aada3d071ec203d3a..115111f27fc1db944a04bce0ef47255be37c4698 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "GuiView.h"
 #include "LyX.h"
 #include "qt_helpers.h"
 
@@ -25,10 +24,10 @@ namespace lyx {
 namespace frontend {
 
 
-Action::Action(GuiView * lyxView, QIcon const & icon,
+Action::Action(QIcon const & icon,
          QString const & text, FuncRequest const & func,
          QString const & tooltip, QObject * parent)
-       : QAction(parent), func_(func), lyxView_(lyxView)
+       : QAction(parent), func_(func)
 {
        // only Qt/Mac handles that
        setMenuRole(NoRole);
index 11a862b7887f278149638a74d16dac6c5e7bf0fd..54954c690070cd6fed36058036e6f55cebdbc1a5 100644 (file)
@@ -22,8 +22,6 @@ class FuncRequest;
 
 namespace frontend {
 
-class GuiView;
-
 /**
  * Action - Qt interface with LyX' FuncRequest.
  *
@@ -34,7 +32,7 @@ class Action : public QAction
        Q_OBJECT
 
 public:
-       Action(GuiView * lyxView, QIcon const & icon, QString const & text,
+       Action(QIcon const & icon, QString const & text,
                FuncRequest const & func, QString const & tooltip, QObject * parent);
 
        void update();
@@ -48,7 +46,6 @@ private Q_SLOTS:
 
 private:
        FuncRequest const & func_ ;
-       GuiView * lyxView_;
 };
 
 
index f41fd2c76b9a3083b517b5477b242ac7d1875c27..b459c606a565f24a4519da4e57c553dc122726cd 100644 (file)
@@ -102,8 +102,8 @@ Action * GuiToolbar::addItem(ToolbarItem const & item)
        if (!bindings.empty())
                text += " [" + toqstr(bindings.begin()->print(KeySequence::ForGui)) + "]";
 
-       Action * act = new Action(&owner_, getIcon(item.func_, false),
-               text, item.func_, text, this);
+       Action * act = new Action(getIcon(item.func_, false),
+                                 text, item.func_, text, this);
        actions_.append(act);
        return act;
 }
index 06128d8fe9dda073c57bd50039ca14ed7d66a855..652bce1d4ec63cf9744202ea6c531bb329b1e253 100644 (file)
@@ -1719,7 +1719,7 @@ void Menu::Impl::populate(QMenu & qMenu, MenuDefinition const & menu)
                        subMenu->setEnabled(m->status().enabled());
                } else {
                        // we have a MenuItem::Command
-                       qMenu.addAction(new Action(view, QIcon(), label(*m),
+                       qMenu.addAction(new Action(QIcon(), label(*m),
                                m->func(), m->tooltip(), &qMenu));
                }
        }
@@ -1806,7 +1806,7 @@ struct Menus::Impl {
                BufferView const *) const;
 
        /// Initialize specific MACOS X menubar
-       void macxMenuBarInit(GuiView * view, QMenuBar * qmb);
+       void macxMenuBarInit(QMenuBar * qmb);
 
        /// Mac special menu.
        /** This defines a menu whose entries list the FuncRequests
@@ -1856,7 +1856,7 @@ MenuDefinition Menus::Impl::mac_special_menu_;
   that this menubar will be used also when one of LyX' dialogs has
   focus. (JMarc)
 */
-void Menus::Impl::macxMenuBarInit(GuiView * view, QMenuBar * qmb)
+void Menus::Impl::macxMenuBarInit(QMenuBar * qmb)
 {
        /* Since Qt 4.2, the qt/mac menu code has special code for
           specifying the role of a menu entry. However, it does not
@@ -1909,13 +1909,13 @@ void Menus::Impl::macxMenuBarInit(GuiView * view, QMenuBar * qmb)
        for (size_t i = 0 ; cit != end ; ++cit, ++i) {
 #if defined(QT_MAC_USE_COCOA) && (QT_MAC_USE_COCOA > 0)
                if (first_call || entries[i].role != QAction::ApplicationSpecificRole) {
-                       Action * action = new Action(view, QIcon(), cit->label(),
+                       Action * action = new Action(QIcon(), cit->label(),
                                 cit->func(), QString(), qMenu);
                        action->setMenuRole(entries[i].role);
                        qMenu->addAction(action);
                }
 #else
-               Action * action = new Action(view, QIcon(), cit->label(),
+               Action * action = new Action(QIcon(), cit->label(),
                        cit->func(), QString(), qMenu);
                action->setMenuRole(entries[i].role);
                qMenu->addAction(action);
@@ -2189,7 +2189,7 @@ void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial)
                // create duplicate items in the application menu. It seems
                // that Qt does not remove them when the QMenubar is cleared.
                LYXERR(Debug::GUI, "Creating Mac OS X special menu bar");
-               d->macxMenuBarInit(view, qmb);
+               d->macxMenuBarInit(qmb);
 #endif
        } else {
                // Clear all menubar contents before filling it.