Index: trunk/BNC/qwt/qwt_plot_magnifier.cpp
===================================================================
--- trunk/BNC/qwt/qwt_plot_magnifier.cpp	(revision 8127)
+++ trunk/BNC/qwt/qwt_plot_magnifier.cpp	(revision 11158)
@@ -1,3 +1,3 @@
-/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+/******************************************************************************
  * Qwt Widget Library
  * Copyright (C) 1997   Josef Wilgen
@@ -9,18 +9,17 @@
 
 #include "qwt_plot.h"
-#include "qwt_scale_div.h"
+#include "qwt_scale_map.h"
 #include "qwt_plot_magnifier.h"
-#include <qevent.h>
 
 class QwtPlotMagnifier::PrivateData
 {
-public:
+  public:
     PrivateData()
     {
-        for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
+        for ( int axis = 0; axis < QwtAxis::AxisPositions; axis++ )
             isAxisEnabled[axis] = true;
     }
 
-    bool isAxisEnabled[QwtPlot::axisCnt];
+    bool isAxisEnabled[QwtAxis::AxisPositions];
 };
 
@@ -28,9 +27,9 @@
    Constructor
    \param canvas Plot canvas to be magnified
-*/
-QwtPlotMagnifier::QwtPlotMagnifier( QWidget *canvas ):
-    QwtMagnifier( canvas )
+ */
+QwtPlotMagnifier::QwtPlotMagnifier( QWidget* canvas )
+    : QwtMagnifier( canvas )
 {
-    d_data = new PrivateData();
+    m_data = new PrivateData();
 }
 
@@ -38,5 +37,5 @@
 QwtPlotMagnifier::~QwtPlotMagnifier()
 {
-    delete d_data;
+    delete m_data;
 }
 
@@ -47,13 +46,13 @@
    All other axes will remain unchanged.
 
-   \param axis Axis, see QwtPlot::Axis
+   \param axisId Axis
    \param on On/Off
 
    \sa isAxisEnabled()
-*/
-void QwtPlotMagnifier::setAxisEnabled( int axis, bool on )
+ */
+void QwtPlotMagnifier::setAxisEnabled( QwtAxisId axisId, bool on )
 {
-    if ( axis >= 0 && axis < QwtPlot::axisCnt )
-        d_data->isAxisEnabled[axis] = on;
+    if ( QwtAxis::isValid( axisId ) )
+        m_data->isAxisEnabled[axisId] = on;
 }
 
@@ -61,13 +60,13 @@
    Test if an axis is enabled
 
-   \param axis Axis, see QwtPlot::Axis
+   \param axisId Axis
    \return True, if the axis is enabled
 
    \sa setAxisEnabled()
-*/
-bool QwtPlotMagnifier::isAxisEnabled( int axis ) const
+ */
+bool QwtPlotMagnifier::isAxisEnabled( QwtAxisId axisId ) const
 {
-    if ( axis >= 0 && axis < QwtPlot::axisCnt )
-        return d_data->isAxisEnabled[axis];
+    if ( QwtAxis::isValid( axisId ) )
+        return m_data->isAxisEnabled[axisId];
 
     return true;
@@ -75,5 +74,5 @@
 
 //! Return observed plot canvas
-QWidget *QwtPlotMagnifier::canvas()
+QWidget* QwtPlotMagnifier::canvas()
 {
     return parentWidget();
@@ -81,5 +80,5 @@
 
 //! Return Observed plot canvas
-const QWidget *QwtPlotMagnifier::canvas() const
+const QWidget* QwtPlotMagnifier::canvas() const
 {
     return parentWidget();
@@ -87,21 +86,21 @@
 
 //! Return plot widget, containing the observed plot canvas
-QwtPlot *QwtPlotMagnifier::plot()
+QwtPlot* QwtPlotMagnifier::plot()
 {
-    QWidget *w = canvas();
+    QWidget* w = canvas();
     if ( w )
         w = w->parentWidget();
 
-    return qobject_cast<QwtPlot *>( w );
+    return qobject_cast< QwtPlot* >( w );
 }
 
 //! Return plot widget, containing the observed plot canvas
-const QwtPlot *QwtPlotMagnifier::plot() const
+const QwtPlot* QwtPlotMagnifier::plot() const
 {
-    const QWidget *w = canvas();
+    const QWidget* w = canvas();
     if ( w )
         w = w->parentWidget();
 
-    return qobject_cast<const QwtPlot *>( w );
+    return qobject_cast< const QwtPlot* >( w );
 }
 
@@ -109,5 +108,5 @@
    Zoom in/out the axes scales
    \param factor A value < 1.0 zooms in, a value > 1.0 zooms out.
-*/
+ */
 void QwtPlotMagnifier::rescale( double factor )
 {
@@ -125,35 +124,39 @@
     plt->setAutoReplot( false );
 
-    for ( int axisId = 0; axisId < QwtPlot::axisCnt; axisId++ )
+    for ( int axisPos = 0; axisPos < QwtAxis::AxisPositions; axisPos++ )
     {
-        if ( isAxisEnabled( axisId ) )
         {
-            const QwtScaleMap scaleMap = plt->canvasMap( axisId );
+            const QwtAxisId axisId( axisPos );
 
-            double v1 = scaleMap.s1();
-            double v2 = scaleMap.s2();
+            if ( isAxisEnabled( axisId ) )
+            {
+                const QwtScaleMap scaleMap = plt->canvasMap( axisId );
 
-            if ( scaleMap.transformation() )
-            {
-                // the coordinate system of the paint device is always linear
+                double v1 = scaleMap.s1();
+                double v2 = scaleMap.s2();
 
-                v1 = scaleMap.transform( v1 ); // scaleMap.p1()
-                v2 = scaleMap.transform( v2 ); // scaleMap.p2()
+                if ( scaleMap.transformation() )
+                {
+                    // the coordinate system of the paint device is always linear
+
+                    v1 = scaleMap.transform( v1 ); // scaleMap.p1()
+                    v2 = scaleMap.transform( v2 ); // scaleMap.p2()
+                }
+
+                const double center = 0.5 * ( v1 + v2 );
+                const double width_2 = 0.5 * ( v2 - v1 ) * factor;
+
+                v1 = center - width_2;
+                v2 = center + width_2;
+
+                if ( scaleMap.transformation() )
+                {
+                    v1 = scaleMap.invTransform( v1 );
+                    v2 = scaleMap.invTransform( v2 );
+                }
+
+                plt->setAxisScale( axisId, v1, v2 );
+                doReplot = true;
             }
-
-            const double center = 0.5 * ( v1 + v2 );
-            const double width_2 = 0.5 * ( v2 - v1 ) * factor;
-
-            v1 = center - width_2;
-            v2 = center + width_2;
-
-            if ( scaleMap.transformation() )
-            {
-                v1 = scaleMap.invTransform( v1 );
-                v2 = scaleMap.invTransform( v2 );
-            }
-
-            plt->setAxisScale( axisId, v1, v2 );
-            doReplot = true;
         }
     }
@@ -164,2 +167,4 @@
         plt->replot();
 }
+
+#include "moc_qwt_plot_magnifier.cpp"
