[Kst] extragear/graphics/kst/src/libkstapp (silent)
George Staikos
staikos at kde.org
Fri Oct 20 15:38:57 CEST 2006
SVN commit 597480 by staikos:
Nothing functional
SVN_SILENT
M +21 -41 kst2dplot.cpp
--- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.cpp #597479:597480
@@ -716,18 +716,16 @@
bool Kst2DPlot::checkRange(double &min_in, double &max_in) {
double diff = fabs(1000.0 * min_in) * DBL_EPSILON;
- bool rc = true;
- if (isnan(min_in) || isnan(max_in) ||
- isinf(min_in) || isinf(max_in)) {
- rc = false;
+ if (isnan(min_in) || isnan(max_in) || isinf(min_in) || isinf(max_in)) {
+ return false;
}
- if (rc && max_in <= min_in + diff) {
+ if (max_in <= min_in + diff) {
max_in = min_in + diff;
}
- return rc;
+ return true;
}
@@ -757,34 +755,28 @@
bool Kst2DPlot::setXScale(double xmin_in, double xmax_in) {
- bool rc = false;
-
if (checkRange(xmin_in, xmax_in)) {
XMax = xmax_in;
XMin = xmin_in;
- rc = true;
+ return true;
}
- return rc;
+ return false;
}
bool Kst2DPlot::setYScale(double ymin_in, double ymax_in) {
- bool rc = false;
-
if (checkRange(ymin_in, ymax_in)) {
YMax = ymax_in;
YMin = ymin_in;
- rc = true;
+ return true;
}
- return rc;
+ return false;
}
bool Kst2DPlot::setLXScale(double xmin_in, double xmax_in) {
- bool rc = false;
-
if (checkLRange(xmin_in, xmax_in, _xLog, _xLogBase)) {
if (_xLog) {
if (_xLogBase == 10.0 && xmax_in - xmin_in < 1.5) {
@@ -802,16 +794,14 @@
XMax = xmax_in;
XMin = xmin_in;
}
- rc = true;
+ return true;
}
- return rc;
+ return false;
}
bool Kst2DPlot::setLYScale(double ymin_in, double ymax_in) {
- bool rc = false;
-
if (checkLRange(ymin_in, ymax_in, _yLog, _yLogBase)) {
if (_yLog) {
if (_yLogBase == 10.0 && ymax_in - ymin_in < 1.1) {
@@ -825,37 +815,28 @@
YMax = ymax_in;
YMin = ymin_in;
}
- rc = true;
+ return true;
}
- return rc;
+ return false;
}
-void Kst2DPlot::setScale(double xmin_in, double ymin_in,
- double xmax_in, double ymax_in) {
+void Kst2DPlot::setScale(double xmin_in, double ymin_in, double xmax_in, double ymax_in) {
setXScale(xmin_in, xmax_in);
setYScale(ymin_in, ymax_in);
}
-bool Kst2DPlot::setLScale(double xmin_in, double ymin_in,
- double xmax_in, double ymax_in) {
- bool rc = false;
-
- if (setLXScale(xmin_in, xmax_in)) {
- rc = true;
- }
- if (setLYScale(ymin_in, ymax_in)) {
- rc = true;
- }
-
- return rc;
+// Odd, should we be returning true if only one of these works? I think this
+// is a bit strange.
+bool Kst2DPlot::setLScale(double xmin_in, double ymin_in, double xmax_in, double ymax_in) {
+ bool rc = setLXScale(xmin_in, xmax_in);
+ return setLYScale(ymin_in, ymax_in) || rc;
}
-void Kst2DPlot::getScale(double &xmin, double &ymin,
- double &xmax, double &ymax) const {
+void Kst2DPlot::getScale(double& xmin, double& ymin, double& xmax, double& ymax) const {
xmin = XMin;
xmax = XMax;
ymin = YMin;
@@ -863,8 +844,7 @@
}
-void Kst2DPlot::getLScale(double& x_min, double& y_min,
- double& x_max, double& y_max) const {
+void Kst2DPlot::getLScale(double& x_min, double& y_min, double& x_max, double& y_max) const {
if (_xLog) {
x_min = logXLo(XMin, _xLogBase);
x_max = logXHi(XMax, _xLogBase);
@@ -3807,7 +3787,7 @@
// only makes sense to get nearest data point for vcurves
KstVCurveList vcurves = kstObjectSubList<KstBaseCurve,KstVCurve>(Curves);
- if (vcurves.count() > 0) {
+ if (!vcurves.isEmpty()) {
QRect pr = GetPlotRegion();
double near_x, near_y;
double distance;
More information about the Kst
mailing list