Index: trunk/BNC/qwt/qwt_plot_zoneitem.cpp
===================================================================
--- trunk/BNC/qwt/qwt_plot_zoneitem.cpp	(revision 9383)
+++ trunk/BNC/qwt/qwt_plot_zoneitem.cpp	(revision 11158)
@@ -1,3 +1,3 @@
-/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+/******************************************************************************
  * Qwt Widget Library
  * Copyright (C) 1997   Josef Wilgen
@@ -11,12 +11,15 @@
 #include "qwt_painter.h"
 #include "qwt_scale_map.h"
+#include "qwt_text.h"
+#include "qwt_interval.h"
+
 #include <qpainter.h>
 
 class QwtPlotZoneItem::PrivateData
 {
-public:
-    PrivateData():
-        orientation( Qt::Vertical ),
-        pen( Qt::NoPen )
+  public:
+    PrivateData()
+        : orientation( Qt::Vertical )
+        , pen( Qt::NoPen )
     {
         QColor c( Qt::darkGray );
@@ -44,9 +47,9 @@
 
    \sa QwtPlotItem::setItemAttribute(), QwtPlotItem::setZ()
-*/
-QwtPlotZoneItem::QwtPlotZoneItem():
-    QwtPlotItem( QwtText( "Zone" ) )
-{
-    d_data = new PrivateData;
+ */
+QwtPlotZoneItem::QwtPlotZoneItem()
+    : QwtPlotItem( QwtText( "Zone" ) )
+{
+    m_data = new PrivateData;
 
     setItemAttribute( QwtPlotItem::AutoScale, false );
@@ -59,5 +62,5 @@
 QwtPlotZoneItem::~QwtPlotZoneItem()
 {
-    delete d_data;
+    delete m_data;
 }
 
@@ -69,17 +72,17 @@
 
 /*!
-  Build and assign a pen
-
-  In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
-  non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
-  to hide this incompatibility.
-
-  \param color Pen color
-  \param width Pen width
-  \param style Pen style
-
-  \sa pen(), brush()
- */
-void QwtPlotZoneItem::setPen( const QColor &color, qreal width, Qt::PenStyle style )
+   Build and assign a pen
+
+   In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
+   non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
+   to hide this incompatibility.
+
+   \param color Pen color
+   \param width Pen width
+   \param style Pen style
+
+   \sa pen(), brush()
+ */
+void QwtPlotZoneItem::setPen( const QColor& color, qreal width, Qt::PenStyle style )
 {
     setPen( QPen( color, width, style ) );
@@ -87,16 +90,16 @@
 
 /*!
-  \brief Assign a pen
-
-  The pen is used to draw the border lines of the zone
-
-  \param pen Pen
-  \sa pen(), setBrush()
-*/
-void QwtPlotZoneItem::setPen( const QPen &pen )
-{
-    if ( d_data->pen != pen )
-    {
-        d_data->pen = pen;
+   \brief Assign a pen
+
+   The pen is used to draw the border lines of the zone
+
+   \param pen Pen
+   \sa pen(), setBrush()
+ */
+void QwtPlotZoneItem::setPen( const QPen& pen )
+{
+    if ( m_data->pen != pen )
+    {
+        m_data->pen = pen;
         itemChanged();
     }
@@ -104,25 +107,25 @@
 
 /*!
-  \return Pen used to draw the border lines
-  \sa setPen(), brush()
-*/
-const QPen &QwtPlotZoneItem::pen() const
-{
-    return d_data->pen;
-}
-
-/*!
-  \brief Assign a brush
-
-  The brush is used to fill the zone
-
-  \param brush Brush
-  \sa pen(), setBrush()
-*/
-void QwtPlotZoneItem::setBrush( const QBrush &brush )
-{
-    if ( d_data->brush != brush )
-    {
-        d_data->brush = brush;
+   \return Pen used to draw the border lines
+   \sa setPen(), brush()
+ */
+const QPen& QwtPlotZoneItem::pen() const
+{
+    return m_data->pen;
+}
+
+/*!
+   \brief Assign a brush
+
+   The brush is used to fill the zone
+
+   \param brush Brush
+   \sa pen(), setBrush()
+ */
+void QwtPlotZoneItem::setBrush( const QBrush& brush )
+{
+    if ( m_data->brush != brush )
+    {
+        m_data->brush = brush;
         itemChanged();
     }
@@ -130,26 +133,26 @@
 
 /*!
-  \return Brush used to fill the zone
-  \sa setPen(), brush()
-*/
-const QBrush &QwtPlotZoneItem::brush() const
-{
-    return d_data->brush;
-}
-
-/*!
-  \brief Set the orientation of the zone
-
-  A horizontal zone highlights an interval of the y axis,
-  a vertical zone of the x axis. It is unbounded in the
-  opposite direction.
-
-  \sa orientation(), QwtPlotItem::setAxes()
-*/
+   \return Brush used to fill the zone
+   \sa setPen(), brush()
+ */
+const QBrush& QwtPlotZoneItem::brush() const
+{
+    return m_data->brush;
+}
+
+/*!
+   \brief Set the orientation of the zone
+
+   A horizontal zone highlights an interval of the y axis,
+   a vertical zone of the x axis. It is unbounded in the
+   opposite direction.
+
+   \sa orientation(), QwtPlotItem::setAxes()
+ */
 void QwtPlotZoneItem::setOrientation( Qt::Orientation orientation )
 {
-    if ( d_data->orientation != orientation )
-    {
-        d_data->orientation = orientation;
+    if ( m_data->orientation != orientation )
+    {
+        m_data->orientation = orientation;
         itemChanged();
     }
@@ -157,22 +160,22 @@
 
 /*!
-  \return Orientation of the zone
-  \sa setOrientation()
- */
-Qt::Orientation QwtPlotZoneItem::orientation()
-{
-    return d_data->orientation;
-}
-
-/*!
-  Set the interval of the zone
-
-  For a horizontal zone the interval is related to the y axis,
-  for a vertical zone it is related to the x axis.
-
-  \param min Minimum of the interval
-  \param max Maximum of the interval
-
-  \sa interval(), setOrientation()
+   \return Orientation of the zone
+   \sa setOrientation()
+ */
+Qt::Orientation QwtPlotZoneItem::orientation() const
+{
+    return m_data->orientation;
+}
+
+/*!
+   Set the interval of the zone
+
+   For a horizontal zone the interval is related to the y axis,
+   for a vertical zone it is related to the x axis.
+
+   \param min Minimum of the interval
+   \param max Maximum of the interval
+
+   \sa interval(), setOrientation()
  */
 void QwtPlotZoneItem::setInterval( double min, double max )
@@ -182,18 +185,18 @@
 
 /*!
-  Set the interval of the zone
-
-  For a horizontal zone the interval is related to the y axis,
-  for a vertical zone it is related to the x axis.
-
-  \param interval Zone interval
-
-  \sa interval(), setOrientation()
- */
-void QwtPlotZoneItem::setInterval( const QwtInterval &interval )
-{
-    if ( d_data->interval != interval )
-    {
-        d_data->interval = interval;
+   Set the interval of the zone
+
+   For a horizontal zone the interval is related to the y axis,
+   for a vertical zone it is related to the x axis.
+
+   \param interval Zone interval
+
+   \sa interval(), setOrientation()
+ */
+void QwtPlotZoneItem::setInterval( const QwtInterval& interval )
+{
+    if ( m_data->interval != interval )
+    {
+        m_data->interval = interval;
         itemChanged();
     }
@@ -201,37 +204,37 @@
 
 /*!
-  \return Zone interval
-  \sa setInterval(), orientation()
+   \return Zone interval
+   \sa setInterval(), orientation()
  */
 QwtInterval QwtPlotZoneItem::interval() const
 {
-    return d_data->interval;
-}
-
-/*!
-  Draw the zone
-
-  \param painter Painter
-  \param xMap x Scale Map
-  \param yMap y Scale Map
-  \param canvasRect Contents rectangle of the canvas in painter coordinates
-*/
-
-void QwtPlotZoneItem::draw( QPainter *painter,
-    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
-    const QRectF &canvasRect ) const
-{
-    if ( !d_data->interval.isValid() )
+    return m_data->interval;
+}
+
+/*!
+   Draw the zone
+
+   \param painter Painter
+   \param xMap x Scale Map
+   \param yMap y Scale Map
+   \param canvasRect Contents rectangle of the canvas in painter coordinates
+ */
+
+void QwtPlotZoneItem::draw( QPainter* painter,
+    const QwtScaleMap& xMap, const QwtScaleMap& yMap,
+    const QRectF& canvasRect ) const
+{
+    if ( !m_data->interval.isValid() )
         return;
 
-    QPen pen = d_data->pen;
+    QPen pen = m_data->pen;
     pen.setCapStyle( Qt::FlatCap );
 
     const bool doAlign = QwtPainter::roundingAlignment( painter );
 
-    if ( d_data->orientation == Qt::Horizontal )
-    {
-        double y1 = yMap.transform( d_data->interval.minValue() );
-        double y2 = yMap.transform( d_data->interval.maxValue() );
+    if ( m_data->orientation == Qt::Horizontal )
+    {
+        double y1 = yMap.transform( m_data->interval.minValue() );
+        double y2 = yMap.transform( m_data->interval.maxValue() );
 
         if ( doAlign )
@@ -244,12 +247,12 @@
         r = r.normalized();
 
-        if ( ( d_data->brush.style() != Qt::NoBrush ) && ( y1 != y2 ) )
-        {
-            QwtPainter::fillRect( painter, r, d_data->brush );
-        }
-
-        if ( d_data->pen.style() != Qt::NoPen )
-        {
-            painter->setPen( d_data->pen );
+        if ( ( m_data->brush.style() != Qt::NoBrush ) && ( y1 != y2 ) )
+        {
+            QwtPainter::fillRect( painter, r, m_data->brush );
+        }
+
+        if ( m_data->pen.style() != Qt::NoPen )
+        {
+            painter->setPen( m_data->pen );
 
             QwtPainter::drawLine( painter, r.left(), r.top(), r.right(), r.top() );
@@ -259,6 +262,6 @@
     else
     {
-        double x1 = xMap.transform( d_data->interval.minValue() );
-        double x2 = xMap.transform( d_data->interval.maxValue() );
+        double x1 = xMap.transform( m_data->interval.minValue() );
+        double x2 = xMap.transform( m_data->interval.maxValue() );
 
         if ( doAlign )
@@ -271,12 +274,12 @@
         r = r.normalized();
 
-        if ( ( d_data->brush.style() != Qt::NoBrush ) && ( x1 != x2 ) )
-        {
-            QwtPainter::fillRect( painter, r, d_data->brush );
-        }
-
-        if ( d_data->pen.style() != Qt::NoPen )
-        {
-            painter->setPen( d_data->pen );
+        if ( ( m_data->brush.style() != Qt::NoBrush ) && ( x1 != x2 ) )
+        {
+            QwtPainter::fillRect( painter, r, m_data->brush );
+        }
+
+        if ( m_data->pen.style() != Qt::NoPen )
+        {
+            painter->setPen( m_data->pen );
 
             QwtPainter::drawLine( painter, r.left(), r.top(), r.left(), r.bottom() );
@@ -287,18 +290,18 @@
 
 /*!
-  The bounding rectangle is build from the interval in one direction
-  and something invalid for the opposite direction.
-
-  \return An invalid rectangle with valid boundaries in one direction
-*/
+   The bounding rectangle is build from the interval in one direction
+   and something invalid for the opposite direction.
+
+   \return An invalid rectangle with valid boundaries in one direction
+ */
 QRectF QwtPlotZoneItem::boundingRect() const
 {
     QRectF br = QwtPlotItem::boundingRect();
 
-    const QwtInterval &intv = d_data->interval;
+    const QwtInterval& intv = m_data->interval;
 
     if ( intv.isValid() )
     {
-        if ( d_data->orientation == Qt::Horizontal )
+        if ( m_data->orientation == Qt::Horizontal )
         {
             br.setTop( intv.minValue() );
