From b4e8957abbca9bacc5340572f77c62fc6ccfbdbd Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Fri, 21 Jun 2002 16:40:54 +0000 Subject: [PATCH] Yet more (minor) compilation fixes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4459 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 18 ++++++++++++++++++ src/frontends/qt2/Menubar_pimpl.C | 4 ++-- src/frontends/qt2/QContentPane.C | 3 ++- src/frontends/qt2/QLPainter.C | 20 ++++++++++++++------ src/frontends/qt2/Toolbar_pimpl.h | 2 +- src/frontends/qt2/qfont_loader.h | 1 - src/frontends/qt2/qfont_metrics.C | 2 +- src/frontends/qt2/qscreen.C | 1 + 8 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 3e786935fc..506046a1e3 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,21 @@ +2002-06-21 Angus Leeming + + * Menubar_pimpl.C (c-tor): rename MenuBackend const & mb argument to + avoid name clash with MenuBackend::const_iterator mb. + + * QContentPane.C: + * QLPainter.C: + * qscreen.C: add using std::endl directive. + + * QLPainter.C (lines, fillPolygon) : wrap QCOORD points inside a + scoped_array as np is not known at compile time and my compiler barfs. + + * Toolbar_pimpl.h: forward declare class ToolbarProxy. + + * qfont_loader.h: don't #include "font_loader.h". + + * qfont_metrics.C: remove trailing ';' from namespace anon scope. + 2002-06-21 John Levon * qfont_metrics.C: fix variable names diff --git a/src/frontends/qt2/Menubar_pimpl.C b/src/frontends/qt2/Menubar_pimpl.C index 666a776e91..fb12ea6551 100644 --- a/src/frontends/qt2/Menubar_pimpl.C +++ b/src/frontends/qt2/Menubar_pimpl.C @@ -44,8 +44,8 @@ extern boost::scoped_ptr toplevel_keymap; extern LyXAction lyxaction; -Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb) - : owner_(static_cast(view)), menubackend_(mb) +Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mbe) + : owner_(static_cast(view)), menubackend_(mbe) { MenuBackend::const_iterator mb = menubackend_.begin(); MenuBackend::const_iterator mbend = menubackend_.end(); diff --git a/src/frontends/qt2/QContentPane.C b/src/frontends/qt2/QContentPane.C index 63642c8054..c75df31380 100644 --- a/src/frontends/qt2/QContentPane.C +++ b/src/frontends/qt2/QContentPane.C @@ -20,7 +20,8 @@ #include #include - +using std::endl; + namespace { /// return the LyX key state from Qt's diff --git a/src/frontends/qt2/QLPainter.C b/src/frontends/qt2/QLPainter.C index e17ae0f130..7baf657f8e 100644 --- a/src/frontends/qt2/QLPainter.C +++ b/src/frontends/qt2/QLPainter.C @@ -28,7 +28,11 @@ #include #include #include - + +#include + +using std::endl; + QLPainter::QLPainter(QWorkArea & qwa) : Painter(), owner_(qwa), paint_check_(0) { @@ -112,8 +116,9 @@ Painter & QLPainter::lines(int const * xp, int const * yp, line_width lw) { // FIXME ? - - QCOORD points[np * 2]; + + // Must use new as np is not known at compile time. + boost::scoped_array points(new QCOORD [np * 2]); int j = 0; @@ -122,7 +127,8 @@ Painter & QLPainter::lines(int const * xp, int const * yp, points[j++] = yp[i]; } - setPen(col, ls, lw).drawPolyline(QPointArray(np, points)); + setPen(col, ls, lw).drawPolyline(QPointArray(np, points.get())); + return *this; } @@ -152,7 +158,8 @@ Painter & QLPainter::fillPolygon(int const * xp, int const * yp, { // FIXME ? - QCOORD points[np * 2]; + // Must use new as np is not known at compile time. + boost::scoped_array points(new QCOORD [np * 2]); int j = 0; @@ -161,7 +168,8 @@ Painter & QLPainter::fillPolygon(int const * xp, int const * yp, points[j++] = yp[i]; } - setPen(col).drawPolygon(QPointArray(np, points)); + setPen(col).drawPolygon(QPointArray(np, points.get())); + return *this; } diff --git a/src/frontends/qt2/Toolbar_pimpl.h b/src/frontends/qt2/Toolbar_pimpl.h index 1d920b9cb6..1e760da3b8 100644 --- a/src/frontends/qt2/Toolbar_pimpl.h +++ b/src/frontends/qt2/Toolbar_pimpl.h @@ -29,7 +29,7 @@ class QtView; class QToolBar; class QComboBox; - +class ToolbarProxy; struct Toolbar::Pimpl { diff --git a/src/frontends/qt2/qfont_loader.h b/src/frontends/qt2/qfont_loader.h index 42c508e181..aea8ff88c5 100644 --- a/src/frontends/qt2/qfont_loader.h +++ b/src/frontends/qt2/qfont_loader.h @@ -19,7 +19,6 @@ #include "lyxfont.h" -#include "font_loader.h" #include "LString.h" #include diff --git a/src/frontends/qt2/qfont_metrics.C b/src/frontends/qt2/qfont_metrics.C index 721f14a1bc..60c5b95914 100644 --- a/src/frontends/qt2/qfont_metrics.C +++ b/src/frontends/qt2/qfont_metrics.C @@ -26,7 +26,7 @@ namespace { QFontMetrics const & metrics(LyXFont const & f) { return fontloader.metrics(f); } -}; +} namespace font_metrics { diff --git a/src/frontends/qt2/qscreen.C b/src/frontends/qt2/qscreen.C index 116d66c4de..3e9dbc32be 100644 --- a/src/frontends/qt2/qscreen.C +++ b/src/frontends/qt2/qscreen.C @@ -24,6 +24,7 @@ #include "insets/insettext.h" #include "debug.h" +using std::endl; using std::max; using std::min;