Index: trunk/BNC/qwt/qwt_plot_directpainter.cpp
===================================================================
--- trunk/BNC/qwt/qwt_plot_directpainter.cpp	(revision 9383)
+++ trunk/BNC/qwt/qwt_plot_directpainter.cpp	(revision 11158)
@@ -1,3 +1,3 @@
-/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+/******************************************************************************
  * Qwt Widget Library
  * Copyright (C) 1997   Josef Wilgen
@@ -13,17 +13,17 @@
 #include "qwt_plot_canvas.h"
 #include "qwt_plot_seriesitem.h"
+
 #include <qpainter.h>
 #include <qevent.h>
-#include <qapplication.h>
 #include <qpixmap.h>
 
 static inline void qwtRenderItem(
-    QPainter *painter, const QRect &canvasRect,
-    QwtPlotSeriesItem *seriesItem, int from, int to )
+    QPainter* painter, const QRect& canvasRect,
+    QwtPlotSeriesItem* seriesItem, int from, int to )
 {
     // A minor performance improvement is possible
     // with caching the maps. TODO ...
 
-    QwtPlot *plot = seriesItem->plot();
+    QwtPlot* plot = seriesItem->plot();
     const QwtScaleMap xMap = plot->canvasMap( seriesItem->xAxis() );
     const QwtScaleMap yMap = plot->canvasMap( seriesItem->yAxis() );
@@ -34,19 +34,18 @@
 }
 
-static inline bool qwtHasBackingStore( const QwtPlotCanvas *canvas )
+static inline bool qwtHasBackingStore( const QwtPlotCanvas* canvas )
 {
     return canvas->testPaintAttribute( QwtPlotCanvas::BackingStore )
-        && canvas->backingStore() && !canvas->backingStore()->isNull();
+           && canvas->backingStore() && !canvas->backingStore()->isNull();
 }
 
 class QwtPlotDirectPainter::PrivateData
 {
-public:
-    PrivateData():
-        attributes( 0 ),
-        hasClipping(false),
-        seriesItem( NULL ),
-        from( 0 ),
-        to( 0 )
+  public:
+    PrivateData()
+        : hasClipping( false )
+        , seriesItem( NULL )
+        , from( 0 )
+        , to( 0 )
     {
     }
@@ -59,5 +58,5 @@
     QPainter painter;
 
-    QwtPlotSeriesItem *seriesItem;
+    QwtPlotSeriesItem* seriesItem;
     int from;
     int to;
@@ -65,8 +64,8 @@
 
 //! Constructor
-QwtPlotDirectPainter::QwtPlotDirectPainter( QObject *parent ):
-    QObject( parent )
-{
-    d_data = new PrivateData;
+QwtPlotDirectPainter::QwtPlotDirectPainter( QObject* parent )
+    : QObject( parent )
+{
+    m_data = new PrivateData;
 }
 
@@ -74,23 +73,23 @@
 QwtPlotDirectPainter::~QwtPlotDirectPainter()
 {
-    delete d_data;
-}
-
-/*!
-  Change an attribute
-
-  \param attribute Attribute to change
-  \param on On/Off
-
-  \sa Attribute, testAttribute()
-*/
+    delete m_data;
+}
+
+/*!
+   Change an attribute
+
+   \param attribute Attribute to change
+   \param on On/Off
+
+   \sa Attribute, testAttribute()
+ */
 void QwtPlotDirectPainter::setAttribute( Attribute attribute, bool on )
 {
-    if ( bool( d_data->attributes & attribute ) != on )
+    if ( bool( m_data->attributes & attribute ) != on )
     {
         if ( on )
-            d_data->attributes |= attribute;
+            m_data->attributes |= attribute;
         else
-            d_data->attributes &= ~attribute;
+            m_data->attributes &= ~attribute;
 
         if ( ( attribute == AtomicPainter ) && on )
@@ -100,31 +99,31 @@
 
 /*!
-  \return True, when attribute is enabled
-  \param attribute Attribute to be tested
-  \sa Attribute, setAttribute()
-*/
+   \return True, when attribute is enabled
+   \param attribute Attribute to be tested
+   \sa Attribute, setAttribute()
+ */
 bool QwtPlotDirectPainter::testAttribute( Attribute attribute ) const
 {
-    return d_data->attributes & attribute;
-}
-
-/*!
-  En/Disables clipping
-
-  \param enable Enables clipping is true, disable it otherwise
-  \sa hasClipping(), clipRegion(), setClipRegion()
-*/
+    return m_data->attributes & attribute;
+}
+
+/*!
+   En/Disables clipping
+
+   \param enable Enables clipping is true, disable it otherwise
+   \sa hasClipping(), clipRegion(), setClipRegion()
+ */
 void QwtPlotDirectPainter::setClipping( bool enable )
 {
-    d_data->hasClipping = enable;
-}
-
-/*!
-  \return true, when clipping is enabled
-  \sa setClipping(), clipRegion(), setClipRegion()
-*/
+    m_data->hasClipping = enable;
+}
+
+/*!
+   \return true, when clipping is enabled
+   \sa setClipping(), clipRegion(), setClipRegion()
+ */
 bool QwtPlotDirectPainter::hasClipping() const
 {
-    return d_data->hasClipping;
+    return m_data->hasClipping;
 }
 
@@ -139,9 +138,9 @@
    \param region Clip region
    \sa clipRegion(), hasClipping(), setClipping()
-*/
-void QwtPlotDirectPainter::setClipRegion( const QRegion &region )
-{
-    d_data->clipRegion = region;
-    d_data->hasClipping = true;
+ */
+void QwtPlotDirectPainter::setClipRegion( const QRegion& region )
+{
+    m_data->clipRegion = region;
+    m_data->hasClipping = true;
 }
 
@@ -149,43 +148,43 @@
    \return Currently set clip region.
    \sa setClipRegion(), setClipping(), hasClipping()
-*/
+ */
 QRegion QwtPlotDirectPainter::clipRegion() const
 {
-    return d_data->clipRegion;
-}
-
-/*!
-  \brief Draw a set of points of a seriesItem.
-
-  When observing an measurement while it is running, new points have to be
-  added to an existing seriesItem. drawSeries() can be used to display them avoiding
-  a complete redraw of the canvas.
-
-  Setting plot()->canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, true);
-  will result in faster painting, if the paint engine of the canvas widget
-  supports this feature.
-
-  \param seriesItem Item to be painted
-  \param from Index of the first point to be painted
-  \param to Index of the last point to be painted. If to < 0 the
+    return m_data->clipRegion;
+}
+
+/*!
+   \brief Draw a set of points of a seriesItem.
+
+   When observing an measurement while it is running, new points have to be
+   added to an existing seriesItem. drawSeries() can be used to display them avoiding
+   a complete redraw of the canvas.
+
+   Setting plot()->canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, true);
+   will result in faster painting, if the paint engine of the canvas widget
+   supports this feature.
+
+   \param seriesItem Item to be painted
+   \param from Index of the first point to be painted
+   \param to Index of the last point to be painted. If to < 0 the
          series will be painted to its last point.
-*/
+ */
 void QwtPlotDirectPainter::drawSeries(
-    QwtPlotSeriesItem *seriesItem, int from, int to )
+    QwtPlotSeriesItem* seriesItem, int from, int to )
 {
     if ( seriesItem == NULL || seriesItem->plot() == NULL )
         return;
 
-    QWidget *canvas = seriesItem->plot()->canvas();
+    QWidget* canvas = seriesItem->plot()->canvas();
     const QRect canvasRect = canvas->contentsRect();
 
-    QwtPlotCanvas *plotCanvas = qobject_cast<QwtPlotCanvas *>( canvas );
+    QwtPlotCanvas* plotCanvas = qobject_cast< QwtPlotCanvas* >( canvas );
 
     if ( plotCanvas && qwtHasBackingStore( plotCanvas ) )
     {
-        QPainter painter( const_cast<QPixmap *>( plotCanvas->backingStore() ) );
-
-        if ( d_data->hasClipping )
-            painter.setClipRegion( d_data->clipRegion );
+        QPainter painter( const_cast< QPixmap* >( plotCanvas->backingStore() ) );
+
+        if ( m_data->hasClipping )
+            painter.setClipRegion( m_data->clipRegion );
 
         qwtRenderItem( &painter, canvasRect, seriesItem, from, to );
@@ -206,31 +205,31 @@
         if ( !canvas->testAttribute( Qt::WA_PaintOutsidePaintEvent ) )
 #endif
-            immediatePaint = false;
+        immediatePaint = false;
     }
 
     if ( immediatePaint )
     {
-        if ( !d_data->painter.isActive() )
+        if ( !m_data->painter.isActive() )
         {
             reset();
 
-            d_data->painter.begin( canvas );
+            m_data->painter.begin( canvas );
             canvas->installEventFilter( this );
         }
 
-        if ( d_data->hasClipping )
-        {
-            d_data->painter.setClipRegion(
-                QRegion( canvasRect ) & d_data->clipRegion );
+        if ( m_data->hasClipping )
+        {
+            m_data->painter.setClipRegion(
+                QRegion( canvasRect ) & m_data->clipRegion );
         }
         else
         {
-            if ( !d_data->painter.hasClipping() )
-                d_data->painter.setClipRect( canvasRect );
-        }
-
-        qwtRenderItem( &d_data->painter, canvasRect, seriesItem, from, to );
-
-        if ( d_data->attributes & QwtPlotDirectPainter::AtomicPainter )
+            if ( !m_data->painter.hasClipping() )
+                m_data->painter.setClipRect( canvasRect );
+        }
+
+        qwtRenderItem( &m_data->painter, canvasRect, seriesItem, from, to );
+
+        if ( m_data->attributes & QwtPlotDirectPainter::AtomicPainter )
         {
             reset();
@@ -238,6 +237,6 @@
         else
         {
-            if ( d_data->hasClipping )
-                d_data->painter.setClipping( false );
+            if ( m_data->hasClipping )
+                m_data->painter.setClipping( false );
         }
     }
@@ -246,11 +245,11 @@
         reset();
 
-        d_data->seriesItem = seriesItem;
-        d_data->from = from;
-        d_data->to = to;
+        m_data->seriesItem = seriesItem;
+        m_data->from = from;
+        m_data->to = to;
 
         QRegion clipRegion = canvasRect;
-        if ( d_data->hasClipping )
-            clipRegion &= d_data->clipRegion;
+        if ( m_data->hasClipping )
+            clipRegion &= m_data->clipRegion;
 
         canvas->installEventFilter( this );
@@ -258,5 +257,5 @@
         canvas->removeEventFilter( this );
 
-        d_data->seriesItem = NULL;
+        m_data->seriesItem = NULL;
     }
 }
@@ -265,16 +264,16 @@
 void QwtPlotDirectPainter::reset()
 {
-    if ( d_data->painter.isActive() )
-    {
-        QWidget *w = static_cast<QWidget *>( d_data->painter.device() );
+    if ( m_data->painter.isActive() )
+    {
+        QWidget* w = static_cast< QWidget* >( m_data->painter.device() );
         if ( w )
             w->removeEventFilter( this );
 
-        d_data->painter.end();
+        m_data->painter.end();
     }
 }
 
 //! Event filter
-bool QwtPlotDirectPainter::eventFilter( QObject *, QEvent *event )
+bool QwtPlotDirectPainter::eventFilter( QObject*, QEvent* event )
 {
     if ( event->type() == QEvent::Paint )
@@ -282,9 +281,9 @@
         reset();
 
-        if ( d_data->seriesItem )
-        {
-            const QPaintEvent *pe = static_cast< QPaintEvent *>( event );
-
-            QWidget *canvas = d_data->seriesItem->plot()->canvas();
+        if ( m_data->seriesItem )
+        {
+            const QPaintEvent* pe = static_cast< QPaintEvent* >( event );
+
+            QWidget* canvas = m_data->seriesItem->plot()->canvas();
 
             QPainter painter( canvas );
@@ -295,6 +294,6 @@
             if ( doCopyCache )
             {
-                QwtPlotCanvas *plotCanvas =
-                    qobject_cast<QwtPlotCanvas *>( canvas );
+                QwtPlotCanvas* plotCanvas =
+                    qobject_cast< QwtPlotCanvas* >( canvas );
                 if ( plotCanvas )
                 {
@@ -311,5 +310,5 @@
             {
                 qwtRenderItem( &painter, canvas->contentsRect(),
-                    d_data->seriesItem, d_data->from, d_data->to );
+                    m_data->seriesItem, m_data->from, m_data->to );
             }
 
