From 472902f3c99c869c7d0034aeee474ba4ce2c175f Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Sat, 19 May 2007 16:48:29 +0000 Subject: [PATCH] * revert r18422. There are polylines much longer than 16 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18423 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QLPainter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/frontends/qt4/QLPainter.cpp b/src/frontends/qt4/QLPainter.cpp index 872841d09a..45f6b040ae 100644 --- a/src/frontends/qt4/QLPainter.cpp +++ b/src/frontends/qt4/QLPainter.cpp @@ -114,9 +114,8 @@ void QLPainter::lines(int const * xp, int const * yp, int np, if (!isDrawingEnabled()) return; - // increase the size if needed, but avoid mallocs by dynamic allocation - static QPoint points[16]; - BOOST_ASSERT(np < 16); + // Must use new as np is not known at compile time. + boost::scoped_array points(new QPoint[np]); bool antialias = false; for (int i = 0; i < np; ++i) { @@ -128,7 +127,7 @@ void QLPainter::lines(int const * xp, int const * yp, int np, setQPainterPen(col, ls, lw); bool const text_is_antialiased = renderHints() & TextAntialiasing; setRenderHint(Antialiasing, antialias && text_is_antialiased); - drawPolyline(points, np); + drawPolyline(points.get(), np); setRenderHint(Antialiasing, false); } -- 2.39.2