Commit 78796248 authored by David Saxton's avatar David Saxton

(Hopefully) fixed all issues reported on EBN for kmplot.

svn path=/trunk/KDE/kdeedu/kmplot/; revision=528601
parent 907cbb82
......@@ -123,3 +123,7 @@ kmplot/equationedit.h
/plotter.cpp
kmplot/plotter.cpp
kmplot/plotter.h
kmplot/kmplotIface.h
kmplot/MainDlgIface.h
kmplot/parseriface.h
kmplot/Viewiface.h
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter M�ler
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......@@ -107,7 +106,7 @@ View::View( bool readOnly, bool & modified, KMenu * functionPopup, QWidget* pare
init();
getSettings();
setMouseTracking(TRUE);
setMouseTracking( true );
m_sliderWindow = 0;
updateSliders();
......@@ -394,9 +393,6 @@ void View::plotfkt(Function *ufkt, QPainter *pDC)
if ( p_mode == Function::Derivative0 && !ufkt->f0.visible )
break; // skip to the next one as function is hidden
if ( p_mode == Function::Integral && stop_calculating)
break;
if( ufkt->use_slider == -1 )
{
if ( !ufkt->parameters.isEmpty() )
......@@ -668,7 +664,7 @@ void View::setpi(QString *s)
bool View::root(double *x0, Equation *it)
{
if(rootflg)
return FALSE;
return false;
int k = 0; // iteration count
int max_k = 50; // maximum number of iterations
......@@ -834,6 +830,9 @@ void View::mousePressEvent(QMouseEvent *e)
{
m_mousePressTimer->start();
// In general, we want to update the view
update();
if ( m_popupmenushown>0)
return;
......@@ -850,9 +849,8 @@ void View::mousePressEvent(QMouseEvent *e)
(m_zoomMode == ZoomOutDrawing) )
{
m_zoomMode = Normal;
updateCursor();
update();
}
updateCursor();
return;
}
......@@ -872,7 +870,7 @@ void View::mousePressEvent(QMouseEvent *e)
if ( function->type() == Function::Parametric )
{
popupTitle = function->eq[0]->fstr() + ";" + function->eq[1]->fstr();
popupTitle = function->eq[0]->fstr() + ';' + function->eq[1]->fstr();
}
else switch ( m_currentFunctionPlot )
{
......@@ -881,7 +879,7 @@ void View::mousePressEvent(QMouseEvent *e)
break;
case Function::Derivative1:
popupTitle = function->eq[0]->fname() + "\'";
popupTitle = function->eq[0]->fname() + '\'';
break;
case Function::Derivative2:
......@@ -913,7 +911,7 @@ void View::mousePressEvent(QMouseEvent *e)
setStatusBar("",3);
setStatusBar("",4);
mouseMoveEvent(e);
return ;
return;
}
getPlotUnderMouse();
......@@ -947,8 +945,8 @@ void View::mousePressEvent(QMouseEvent *e)
break;
case Function::Integral:
// can't trace integral
return;
setStatusBar( function->eq[0]->fname().toUpper(), 4 );
break;
}
}
......@@ -956,6 +954,7 @@ void View::mousePressEvent(QMouseEvent *e)
QPointF ptd( dgr.toPixel( m_crosshairPosition ) );
QPoint globalPos = mapToGlobal( (ptd * wm).toPoint() );
QCursor::setPos( globalPos );
return;
}
......@@ -1701,12 +1700,6 @@ QPointF View::findMinMaxValue(Function *ufkt, Function::PMode p_mode, ExtremaTyp
while ( (x>=dmin && x<=dmax) )
{
if ( p_mode == Function::Integral && stop_calculating)
{
p_mode = Function::Derivative1;
x=dmax+1;
continue;
}
y = value( ufkt->eq[0], p_mode, x );
if ( !isnan(x) && !isnan(y) )
......@@ -1857,6 +1850,8 @@ void View::keyPressEvent( QKeyEvent * e )
found=true;
break;
case Function::Integral:
if ( (*it)->integral.visible )
found = true;
break;
}
if (found)
......@@ -2038,6 +2033,7 @@ void View::mnuHide_clicked()
ufkt->f2.visible=0;
break;
case Function::Integral:
ufkt->integral.visible=0;
break;
}
MainDlg::self()->functionEditor()->functionsChanged();
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter M�ler
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......@@ -409,7 +408,7 @@ void CDiagr::drawGrid( QPainter* pDC )
y2=(oy+c*sin(w));
pDC->Line( QPointF( x1, y1 ), QPointF( x2, y2 ) );
}
pDC->setClipping(FALSE);
pDC->setClipping( false );
}
}
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter M�ler
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter M�ler
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter M�ler <kd.moeller@t-online.de>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
......@@ -755,10 +755,10 @@ void FunctionEditor::saveParametric()
tempFunction.f0.color = m_editor->parametricLineColor->color();
tempFunction.f1.color = tempFunction.f2.color = tempFunction.integral.color = tempFunction.f0.color;
if ( !tempFunction.eq[0]->setFstr( "x" + m_editor->parametricName->text() + "(t)=" + m_editor->parametricX->text() ) )
if ( !tempFunction.eq[0]->setFstr( 'x' + m_editor->parametricName->text() + "(t)=" + m_editor->parametricX->text() ) )
return;
if ( !tempFunction.eq[1]->setFstr( "y" + m_editor->parametricName->text() + "(t)=" + m_editor->parametricY->text() ) )
if ( !tempFunction.eq[1]->setFstr( 'y' + m_editor->parametricName->text() + "(t)=" + m_editor->parametricY->text() ) )
return;
//save all settings in the function now when we know no errors have appeared
......@@ -876,7 +876,7 @@ void FunctionListItem::update()
QString text = f->eq[0]->fstr();
if ( f->eq[1] )
text += ";" + f->eq[1]->fstr();
text += ';' + f->eq[1]->fstr();
// text += QString(" id=%1").arg(m_function );
setText( text );
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möler
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter M�ler
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2005 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2005 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2005 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2005 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter M�ler
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......@@ -921,7 +920,7 @@ Parser::Error Parser::parserError(bool showMessageBox)
QString Parser::evalRemaining() const
{
QString current( m_eval );
return current.right( QMAX( 0, current.length() - m_evalPos ) );
return current.right( qMax( 0, current.length() - m_evalPos ) );
}
......@@ -1269,7 +1268,7 @@ void ExpressionSanitizer::fixExpression( QString * str, int pos )
m_map.insert( 0, 0 );
m_map.insert( m_map.size(), m_map[ m_map.size()-1 ] );
*str=" "+*str+" ";
*str = ' ' + *str + ' ';
// make sure all minus-like signs (including the actual unicode minus sign)
// are represented by a dash (unicode 0x002d)
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter M�ler
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* Copyright (C) 2004 Fredrik Edemar <f_edemar@linux.se>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
* Copyright (C) 1998, 1999, 2000, 2002 Klaus-Dieter Möller <kd.moeller@t-online.de>
*
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment