[Kst] extragear/graphics/kst/kst
Andrew Walker
arwalker at sumusltd.com
Mon Nov 21 20:01:45 CET 2005
SVN commit 482102 by arwalker:
Apply fix for infinite loop when fitting polynomials
M +4 -1 kstfitdialog_i.cpp
M +5 -1 kstplugin.cpp
M +4 -4 plugin.cpp
--- trunk/extragear/graphics/kst/kst/kstfitdialog_i.cpp #482101:482102
@@ -156,8 +156,11 @@
if (plugin->outputVectors().contains("Parameters")) {
plugin->createFitScalars();
int i = 0;
+ int length = (plugin->outputVectors())["Parameters"]->length();
QString strParamName;
- for (strParamName = plugin->plugin()->parameterName(0); !strParamName.isEmpty(); strParamName = plugin->plugin()->parameterName(++i)) {
+ for (strParamName = plugin->plugin()->parameterName(0);
+ !strParamName.isEmpty() && i < length;
+ strParamName = plugin->plugin()->parameterName(++i)) {
if (plugin->outputScalars().contains(strParamName)) {
KstScalarPtr scalar = plugin->outputScalars()[strParamName];
if (scalar) {
--- trunk/extragear/graphics/kst/kst/kstplugin.cpp #482101:482102
@@ -624,7 +624,11 @@
if (vectorParam) {
QString paramName;
int i = 0;
- for (paramName = _plugin->parameterName(i); !paramName.isEmpty(); paramName = _plugin->parameterName(++i)) {
+ int length = _outputVectors["Parameters"]->length();
+
+ for (paramName = _plugin->parameterName(i);
+ !paramName.isEmpty() && i < length;
+ paramName = _plugin->parameterName(++i)) {
double scalarValue = vectorParam->value(i);
if (!_outputScalars.contains(paramName)) {
QString scalarName = i18n("%1-%2").arg(tagName()).arg(paramName);
--- trunk/extragear/graphics/kst/kst/plugin.cpp #482101:482102
@@ -128,10 +128,10 @@
}
}
-// if (parameter.isEmpty()) {
-// parameter = i18n("Param%1").arg(idx);
-// }
-
+ if (parameter.isEmpty()) {
+ parameter = i18n("Param%1").arg(idx);
+ }
+
return parameter;
}
More information about the Kst
mailing list