Index: trunk/BNC/qwt/qwt_date_scale_engine.cpp
===================================================================
--- trunk/BNC/qwt/qwt_date_scale_engine.cpp	(revision 8127)
+++ trunk/BNC/qwt/qwt_date_scale_engine.cpp	(revision 9383)
@@ -14,5 +14,5 @@
 #include <limits.h>
 
-static inline double qwtMsecsForType( QwtDate::IntervalType type )
+static inline double qwtMsecsForType( int type )
 {
     static const double msecs[] =
@@ -44,5 +44,5 @@
 
 static double qwtIntervalWidth( const QDateTime &minDate,
-    const QDateTime &maxDate, QwtDate::IntervalType intervalType ) 
+    const QDateTime &maxDate, QwtDate::IntervalType intervalType )
 {
     switch( intervalType )
@@ -80,5 +80,5 @@
         case QwtDate::Month:
         {
-            const double years = 
+            const double years =
                 double( maxDate.date().year() ) - minDate.date().year();
 
@@ -91,5 +91,5 @@
         case QwtDate::Year:
         {
-            double years = 
+            double years =
                 double( maxDate.date().year() ) - minDate.date().year();
 
@@ -104,7 +104,7 @@
 }
 
-static double qwtRoundedIntervalWidth( 
-    const QDateTime &minDate, const QDateTime &maxDate, 
-    QwtDate::IntervalType intervalType ) 
+static double qwtRoundedIntervalWidth(
+    const QDateTime &minDate, const QDateTime &maxDate,
+    QwtDate::IntervalType intervalType )
 {
     const QDateTime minD = QwtDate::floor( minDate, intervalType );
@@ -131,5 +131,5 @@
 }
 
-static int qwtStepSize( int intervalSize, int maxSteps, uint base ) 
+static int qwtStepSize( int intervalSize, int maxSteps, uint base )
 {
     if ( maxSteps <= 0 )
@@ -162,5 +162,5 @@
 }
 
-static int qwtDivideInterval( double intervalSize, int numSteps, 
+static int qwtDivideInterval( double intervalSize, int numSteps,
     const int limits[], size_t numLimits )
 {
@@ -181,5 +181,5 @@
     if ( intervalType != QwtDate::Day )
     {
-        if ( ( intervalSize > numSteps ) && 
+        if ( ( intervalSize > numSteps ) &&
             ( intervalSize <= 2 * numSteps ) )
         {
@@ -196,5 +196,5 @@
         {
             static int limits[] = { 1, 2, 5, 10, 15, 20, 30, 60 };
-    
+
             stepSize = qwtDivideInterval( intervalSize, numSteps,
                 limits, sizeof( limits ) / sizeof( int ) );
@@ -205,5 +205,5 @@
         {
             static int limits[] = { 1, 2, 3, 4, 6, 12, 24 };
-    
+
             stepSize = qwtDivideInterval( intervalSize, numSteps,
                 limits, sizeof( limits ) / sizeof( int ) );
@@ -274,5 +274,5 @@
             if ( stepSize > maxMinSteps )
             {
-                numSteps = qwtStepCount( stepSize, maxMinSteps, 
+                numSteps = qwtStepCount( stepSize, maxMinSteps,
                     limits, sizeof( limits ) / sizeof( int ) );
 
@@ -280,5 +280,5 @@
             else
             {
-                numSteps = qwtStepCount( stepSize * 60, maxMinSteps, 
+                numSteps = qwtStepCount( stepSize * 60, maxMinSteps,
                     limits, sizeof( limits ) / sizeof( int ) );
             }
@@ -359,5 +359,5 @@
                 else
                 {
-                    minStepSize = QwtScaleArithmetic::divideInterval( 
+                    minStepSize = QwtScaleArithmetic::divideInterval(
                         stepSizeInWeeks, maxMinSteps, 10 );
                 }
@@ -401,5 +401,5 @@
                     minStepSize = double( stepSize ) / numSteps;
             }
-                
+
             break;
         }
@@ -445,15 +445,15 @@
 }
 
-static QwtScaleDiv qwtDivideToSeconds( 
+static QwtScaleDiv qwtDivideToSeconds(
     const QDateTime &minDate, const QDateTime &maxDate,
     double stepSize, int maxMinSteps,
-    QwtDate::IntervalType intervalType ) 
+    QwtDate::IntervalType intervalType )
 {
     // calculate the min step size
     double minStepSize = 0;
 
-    if ( maxMinSteps > 1 ) 
-    {
-        minStepSize = qwtDivideMajorStep( stepSize, 
+    if ( maxMinSteps > 1 )
+    {
+        minStepSize = qwtDivideMajorStep( stepSize,
             maxMinSteps, intervalType );
     }
@@ -472,5 +472,5 @@
     const int secondsMajor = static_cast<int>( stepSize * s );
     const double secondsMinor = minStepSize * s;
-    
+
     // UTC excludes daylight savings. So from the difference
     // of a date and its UTC counterpart we can find out
@@ -484,5 +484,5 @@
     QList<double> minorTicks;
 
-    for ( QDateTime dt = minDate; dt <= maxDate; 
+    for ( QDateTime dt = minDate; dt <= maxDate;
         dt = dt.addSecs( secondsMajor ) )
     {
@@ -501,5 +501,5 @@
                 // we add some minor ticks for the DST hour,
                 // otherwise the ticks will be unaligned: 0, 2, 3, 5 ...
-                minorTicks += qwtDstTicks( 
+                minorTicks += qwtDstTicks(
                     dt, secondsMajor, qRound( secondsMinor ) );
             }
@@ -517,5 +517,5 @@
             for ( int i = 1; i < numMinorSteps; i++ )
             {
-                const QDateTime mt = dt.addMSecs( 
+                const QDateTime mt = dt.addMSecs(
                     qRound64( i * secondsMinor * 1000 ) );
 
@@ -529,5 +529,5 @@
                 if ( minorTicks.isEmpty() || minorTicks.last() != minorValue )
                 {
-                    const bool isMedium = ( numMinorSteps % 2 == 0 ) 
+                    const bool isMedium = ( numMinorSteps % 2 == 0 )
                         && ( i != 1 ) && ( i == numMinorSteps / 2 );
 
@@ -553,14 +553,14 @@
 }
 
-static QwtScaleDiv qwtDivideToMonths( 
+static QwtScaleDiv qwtDivideToMonths(
     QDateTime &minDate, const QDateTime &maxDate,
-    double stepSize, int maxMinSteps ) 
-{
-    // months are intervals with non 
-    // equidistant ( in ms ) steps: we have to build the 
+    double stepSize, int maxMinSteps )
+{
+    // months are intervals with non
+    // equidistant ( in ms ) steps: we have to build the
     // scale division manually
 
     int minStepDays = 0;
-    int minStepSize = 0.0; 
+    int minStepSize = 0.0;
 
     if ( maxMinSteps > 1 )
@@ -579,5 +579,5 @@
         else
         {
-            minStepSize = qwtDivideMajorStep( 
+            minStepSize = qwtDivideMajorStep(
                 stepSize, maxMinSteps, QwtDate::Month );
         }
@@ -588,5 +588,5 @@
     QList<double> minorTicks;
 
-    for ( QDateTime dt = minDate; 
+    for ( QDateTime dt = minDate;
         dt <= maxDate; dt = dt.addMonths( stepSize ) )
     {
@@ -598,5 +598,5 @@
         if ( minStepDays > 0 )
         {
-            for ( int days = minStepDays; 
+            for ( int days = minStepDays;
                 days < 30; days += minStepDays )
             {
@@ -637,7 +637,7 @@
 }
 
-static QwtScaleDiv qwtDivideToYears( 
+static QwtScaleDiv qwtDivideToYears(
     const QDateTime &minDate, const QDateTime &maxDate,
-    double stepSize, int maxMinSteps ) 
+    double stepSize, int maxMinSteps )
 {
     QList<double> majorTicks;
@@ -649,5 +649,5 @@
     if ( maxMinSteps > 1 )
     {
-        minStepSize = qwtDivideMajorStep( 
+        minStepSize = qwtDivideMajorStep(
             stepSize, maxMinSteps, QwtDate::Year );
     }
@@ -702,5 +702,5 @@
             break;
         }
-    }   
+    }
 
     QwtScaleDiv scaleDiv;
@@ -730,5 +730,5 @@
     QwtDate::Week0Type week0Type;
     int maxWeeks;
-};      
+};
 
 
@@ -736,5 +736,5 @@
   \brief Constructor
 
-  The engine is initialized to build scales for the 
+  The engine is initialized to build scales for the
   given time specification. It classifies intervals > 4 weeks
   as >= Qt::Month. The first week of a year is defined like
@@ -811,5 +811,5 @@
   \sa week0Type(), setMaxWeeks()
   \note week0Type has no effect beside for intervals classified as
-        QwtDate::Week. 
+        QwtDate::Week.
  */
 void QwtDateScaleEngine::setWeek0Type( QwtDate::Week0Type week0Type )
@@ -819,5 +819,5 @@
 
 /*!
-  \return Setting how to identify the first week of a year. 
+  \return Setting how to identify the first week of a year.
   \sa setWeek0Type(), maxWeeks()
  */
@@ -835,7 +835,7 @@
   \param weeks Upper limit for the number of weeks
 
-  \note In business charts a year is often devided
+  \note In business charts a year is often divided
         into weeks [1-52]
-  \sa maxWeeks(), setWeek0Type() 
+  \sa maxWeeks(), setWeek0Type()
  */
 void QwtDateScaleEngine::setMaxWeeks( int weeks )
@@ -863,6 +863,6 @@
   \return Interval classification
  */
-QwtDate::IntervalType QwtDateScaleEngine::intervalType( 
-    const QDateTime &minDate, const QDateTime &maxDate, 
+QwtDate::IntervalType QwtDateScaleEngine::intervalType(
+    const QDateTime &minDate, const QDateTime &maxDate,
     int maxSteps ) const
 {
@@ -910,9 +910,9 @@
   Align and divide an interval
 
-  The algorithm aligns and divides the interval into steps. 
+  The algorithm aligns and divides the interval into steps.
 
   Datetime interval divisions are usually not equidistant and the
   calculated stepSize can only be used as an approximation
-  for the steps calculated by divideScale(). 
+  for the steps calculated by divideScale().
 
   \param maxNumSteps Max. number of steps
@@ -951,5 +951,5 @@
             maxNumSteps = 1;
 
-        const QwtDate::IntervalType intvType = 
+        const QwtDate::IntervalType intvType =
             intervalType( from, to, maxNumSteps );
 
@@ -1015,5 +1015,5 @@
     }
 
-    const QwtDate::IntervalType intvType = 
+    const QwtDate::IntervalType intvType =
         intervalType( from, to, maxMajorSteps );
 
@@ -1031,5 +1031,5 @@
         const QDateTime maxDate = QwtDate::ceil( to, intvType );
 
-        scaleDiv = buildScaleDiv( minDate, maxDate, 
+        scaleDiv = buildScaleDiv( minDate, maxDate,
             maxMajorSteps, maxMinorSteps, intvType );
 
@@ -1046,5 +1046,5 @@
 }
 
-QwtScaleDiv QwtDateScaleEngine::buildScaleDiv( 
+QwtScaleDiv QwtDateScaleEngine::buildScaleDiv(
     const QDateTime &minDate, const QDateTime &maxDate,
     int maxMajorSteps, int maxMinorSteps,
@@ -1052,6 +1052,6 @@
 {
     // calculate the step size
-    const double stepSize = qwtDivideScale( 
-        qwtIntervalWidth( minDate, maxDate, intervalType ), 
+    const double stepSize = qwtDivideScale(
+        qwtIntervalWidth( minDate, maxDate, intervalType ),
         maxMajorSteps, intervalType );
 
@@ -1060,5 +1060,5 @@
     if ( !dt0.isValid() )
     {
-        // the floored date is out of the range of a 
+        // the floored date is out of the range of a
         // QDateTime - we ceil instead.
         dt0 = alignDate( minDate, stepSize, intervalType, true );
@@ -1069,5 +1069,5 @@
     if ( intervalType <= QwtDate::Week )
     {
-        scaleDiv = qwtDivideToSeconds( dt0, maxDate, 
+        scaleDiv = qwtDivideToSeconds( dt0, maxDate,
             stepSize, maxMinorSteps, intervalType );
     }
@@ -1094,5 +1094,5 @@
 
   For Qt::Day alignments there is no "natural day 0" -
-  instead the first day of the year is used to avoid jumping 
+  instead the first day of the year is used to avoid jumping
   major ticks positions when panning a scale. For other alignments
   ( f.e according to the first day of the month ) alignDate()
@@ -1106,6 +1106,6 @@
   \return Aligned date/time value
  */
-QDateTime QwtDateScaleEngine::alignDate( 
-    const QDateTime &dateTime, double stepSize, 
+QDateTime QwtDateScaleEngine::alignDate(
+    const QDateTime &dateTime, double stepSize,
     QwtDate::IntervalType intervalType, bool up ) const
 {
@@ -1123,5 +1123,5 @@
         case QwtDate::Millisecond:
         {
-            const int ms = qwtAlignValue( 
+            const int ms = qwtAlignValue(
                 dt.time().msec(), stepSize, up ) ;
 
@@ -1293,5 +1293,5 @@
     if ( !dt.isValid() )
     {
-        const QDate date = ( value <= 0.0 ) 
+        const QDate date = ( value <= 0.0 )
             ? QwtDate::minDate() : QwtDate::maxDate();
 
