]> git.lyx.org Git - lyx.git/commitdiff
remove paperHeight() and paperWidth() in Painter and inherited classes.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 28 Oct 2006 09:36:22 +0000 (09:36 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 28 Oct 2006 09:36:22 +0000 (09:36 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15589 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/scons_manifest.py
src/frontends/Makefile.am
src/frontends/Painter.h
src/frontends/nullpainter.C [deleted file]
src/frontends/nullpainter.h
src/frontends/qt4/QLPainter.C
src/frontends/qt4/QLPainter.h
src/mathed/MathData.C

index 1332ee7dc5e4671568023b3c083f88569f445fde..b3db3ac34675c9a95523eb542873ceb87eebba4c 100644 (file)
@@ -463,7 +463,6 @@ src_frontends_files = Split('''
     Toolbars.C
     WorkArea.C
     guiapi.C
-    nullpainter.C
 ''')
 
 
index 9c9f417f4f5a4956dfa7eae75c7afa4b553f0b4e..7678c7bcd0e46f8b53fa13b2fa7586c770833f02 100644 (file)
@@ -45,5 +45,4 @@ libfrontends_la_SOURCES = \
        guiapi.C \
        key_state.h \
        mouse_state.h \
-       nullpainter.C \
        nullpainter.h
index df9e5dbd65f4f64dda84efd3649d7d21c9743059..5f8e2250b763856ff8c10e06ef7d2ea2a93f2de7 100644 (file)
@@ -68,11 +68,6 @@ public:
        /// end painting
        ////virtual void end() {}
 
-       /// return the width of the work area in pixels
-       virtual int paperWidth() const = 0;
-       /// return the height of the work area in pixels
-       virtual int paperHeight() const = 0;
-
        /// draw a line from point to point
        virtual void line(
                int x1, int y1,
diff --git a/src/frontends/nullpainter.C b/src/frontends/nullpainter.C
deleted file mode 100644 (file)
index 085cd82..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * \file nullpainter.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Alfredo Braunstein
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "nullpainter.h"
-
-#include "LColor.h"
-
-#include <limits>
-
-
-namespace lyx {
-namespace frontend {
-
-int NullPainter::paperHeight() const
-{
-       return std::numeric_limits<int>::max();
-}
-
-} // namespace frontend
-} // namespace lyx
index da563bf92f6487ba98dd160e9c4a0f2adcb91aa4..f2449a93184c548d60c251e763404b49e2d0ab47 100644 (file)
@@ -31,11 +31,6 @@ public:
        /// end painting
        void end() {}
 
-       ///
-       int paperWidth() const { return 0; }
-       ///
-       int paperHeight() const;
-
        ///
        void line(int, int, int, int, LColor_color,
                       line_style = line_solid, line_width = line_thin) {}
index 72a5ce59031121b38b5e4c2838cd6881ee48d033..ddfcb9f9a97ba1ed46ba904acbf94c4f9fe4c310 100644 (file)
@@ -52,18 +52,6 @@ QLPainter::~QLPainter()
 }
 
 
-int QLPainter::paperWidth() const
-{
-       return qwa_->width();
-}
-
-
-int QLPainter::paperHeight() const
-{
-       return qwa_->height();
-}
-
-
 void QLPainter::setQPainterPen(LColor_color col,
        Painter::line_style ls, Painter::line_width lw)
 {
index 8961fc29c03a72448cc58994406a89ec35fdacf5..06d0b59676b85b11c80fe81a85bc5ebc048d005a 100644 (file)
@@ -32,11 +32,6 @@ class GuiWorkArea;
  */
 class QLPainter : public QPainter, public Painter {
 public:
-       /// return the width of the work area in pixels
-       virtual int paperWidth() const;
-       /// return the height of the work area in pixels
-       virtual int paperHeight() const;
-
        /// draw a line from point to point
        virtual void line(
                int x1, int y1,
index 41cb2458b47b0f41ac221c3ddd3b7bb37c0a74da..a8b31f9b6eba3b3e18dfe68bf445fa543000f72b 100644 (file)
@@ -278,7 +278,8 @@ void MathArray::metrics(MetricsInfo & mi) const
 void MathArray::draw(PainterInfo & pi, int x, int y) const
 {
        //lyxerr << "MathArray::draw: x: " << x << " y: " << y << endl;
-       setXY(*pi.base.bv, x, y);
+       BufferView & bv  = *pi.base.bv;
+       setXY(bv, x, y);
 
        if (empty()) {
                pi.pain.rectangle(x, y - ascent(), width(), height(), LColor::mathline);
@@ -287,16 +288,15 @@ void MathArray::draw(PainterInfo & pi, int x, int y) const
 
        // don't draw outside the workarea
        if (y + descent() <= 0
-               || y - ascent() >= pi.pain.paperHeight()
+               || y - ascent() >= bv.workHeight()
                || x + width() <= 0
-               || x >= pi.pain.paperWidth())
+               || x >= bv. workWidth())
                return;
 
-       //BufferView & bv  = *pi.base.bv;
        for (size_t i = 0, n = size(); i != n; ++i) {
                MathAtom const & at = operator[](i);
 #if 0
-       Buffer const & buf = *bv.buffer();
+       Buffer const & buf = bv.buffer();
                // special macro handling
                MathMacro const * mac = at->asMacro();
                if (mac && buf.hasMacro(mac->name())) {
@@ -312,8 +312,7 @@ void MathArray::draw(PainterInfo & pi, int x, int y) const
                        }
                }
 #endif
-               //BufferView & bv  = *pi.base.bv;
-               pi.base.bv->coordCache().insets().add(at.nucleus(), x, y);
+               bv.coordCache().insets().add(at.nucleus(), x, y);
                at->drawSelection(pi, x, y);
                at->draw(pi, x, y);
                x += at->width();