]> git.lyx.org Git - features.git/commitdiff
Cosmetic changes:
authorAbdelrazak Younes <younes@lyx.org>
Thu, 17 Aug 2006 17:15:17 +0000 (17:15 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 17 Aug 2006 17:15:17 +0000 (17:15 +0000)
- put some spaces
- delete some comments
- reorder #include
- delete unneeded workWidth_ and workHeight_ members.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14787 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWorkArea.C
src/frontends/qt4/GuiWorkArea.h
src/frontends/qt4/QDocumentDialog.C

index bd0b165bcf71a975ef044b1a3f70d22a2fe33fae..301f139816b61356320a41cef07635561a10f0a7 100644 (file)
 
 #include "GuiWorkArea.h"
 
+#include "Application.h"
+#include "ColorCache.h"
 #include "QLPainter.h"
 #include "QLyXKeySym.h"
-
-#include "ColorCache.h"
 #include "qt_helpers.h"
-#include "Application.h"
+
 #include "BufferView.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "LColor.h"
+
 #include "support/os.h"
 
 #include <QLayout>
@@ -134,8 +135,6 @@ GuiWorkArea::GuiWorkArea(int w, int h, LyXView & lyx_view)
        viewport()->setCursor(Qt::IBeamCursor);
 
        resize(w, h);
-       workWidth_ = w;
-       workHeight_ = h;
 
        synthetic_mouse_event_.timeout.timeout.connect(
                boost::bind(&GuiWorkArea::generateSyntheticMouseEvent,
@@ -146,7 +145,7 @@ GuiWorkArea::GuiWorkArea(int w, int h, LyXView & lyx_view)
                this, SLOT(adjustViewWithScrollBar(int)));
 
        // PageStep only depends on the viewport height.
-       verticalScrollBar()->setPageStep(workHeight_);
+       verticalScrollBar()->setPageStep(viewport()->height());
 
        lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
                << "\n Area width\t" << width()
@@ -174,6 +173,7 @@ GuiWorkArea::GuiWorkArea(int w, int h, LyXView & lyx_view)
        setAttribute(Qt::WA_InputMethodEnabled, true);
 }
 
+
 GuiWorkArea::~GuiWorkArea()
 {
 }
@@ -420,36 +420,14 @@ void GuiWorkArea::mouseDoubleClickEvent(QMouseEvent * e)
 
 void GuiWorkArea::resizeEvent(QResizeEvent *)
 {
-       workWidth_ = viewport()->width();
-       workHeight_ = viewport()->height();
-
        verticalScrollBar()->setPageStep(viewport()->height());
-
-//     screen_device_ = QPixmap(viewport()->width(), viewport()->height());
-//     paint_device_ = QImage(viewport()->width(), viewport()->height(), QImage::Format_RGB32);
        paint_device_ = QPixmap(viewport()->width(), viewport()->height());
-
        resizeBufferView();
-
-       /*
-       lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
-               << "\n QWidget width\t" << this->QWidget::width()
-               << "\n QWidget height\t" << this->QWidget::height()
-               << "\n viewport width\t" << viewport()->width()
-               << "\n viewport height\t" << viewport()->height()
-               << "\n QResizeEvent rect left\t" << rect().left()
-               << "\n QResizeEvent rect right\t" << rect().right()
-               << endl;
-               */
 }
 
 
 void GuiWorkArea::update(int x, int y, int w, int h)
 {
-       //screen_device_.fromImage(paint_device_);
-       //QPainter q(&screen_device_);
-       //q.drawImage(x, y, paint_device_.copy(x, y, w, h));
-
        viewport()->update(x, y, w, h);
 }
 
@@ -600,7 +578,6 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
        e->accept();
 }
 
-
 } // namespace frontend
 } // namespace lyx
 
index a31b0cec82400ded75b043a48a10579c220b8c8d..2f96ff7a6c448a96581087c54dd23bdf85d11e34 100644 (file)
@@ -4,7 +4,6 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author unknown
  * \author John Levon
  * \author Abdelrazak Younes
  *
 #ifndef WORKAREA_H
 #define WORKAREA_H
 
-#ifdef emit
-#undef emit
-#endif
-
 #include "frontends/WorkArea.h"
 
 #include "QLPainter.h"
@@ -95,8 +90,8 @@ public:
  * Qt-specific implementation of the work area
  * (buffer view GUI)
 */
-class GuiWorkArea: public QAbstractScrollArea, public WorkArea {
-
+class GuiWorkArea: public QAbstractScrollArea, public WorkArea
+{
        Q_OBJECT
 
 public:
@@ -105,10 +100,10 @@ public:
 
        virtual ~GuiWorkArea();
        /// return the width of the content pane
-       virtual int width() const { return workWidth_; }
+       virtual int width() const { return viewport()->width(); }
 
        /// return the height of the content pane
-       virtual int height() const { return workHeight_; }
+       virtual int height() const { return viewport()->height(); }
        ///
        virtual void setScrollbarParams(int height, int pos, int line_height);
 
@@ -163,8 +158,6 @@ protected:
        void wheelEvent(QWheelEvent * e);
        /// key press
        void keyPressEvent(QKeyEvent * e);
-
-protected:
        /// IM events
        void inputMethodEvent(QInputMethodEvent * e);
 
@@ -183,11 +176,6 @@ public Q_SLOTS:
        void adjustViewWithScrollBar(int action = 0);
 
 private:
-       /// Buffer view width.
-       int workWidth_;
-
-       /// Buffer view height.
-       int workHeight_;
 
        /// Our painter.
        QLPainter painter_;
@@ -199,12 +187,8 @@ private:
        SyntheticMouseEvent synthetic_mouse_event_;
 
        /// Our client side painting device.
-       //QImage paint_device_;
        QPixmap paint_device_;
 
-       /// Our server side painting device.
-       //QPixmap screen_device_;
-
        /// \todo remove
        QTimer step_timer_;
 
index 08c298e473979deb441c46c0a537287afe4c4fa3..2fbe8417db9755b9f938a2e1ae66bc309b703aac 100644 (file)
@@ -25,7 +25,6 @@
 #include "qt_helpers.h"
 
 #include "bufferparams.h"
-#include "floatplacement.h"
 #include "gettext.h"
 #include "helper_funcs.h" // getSecond()
 #include "language.h"