[Kst] branches/work/kst/1.1/kst/kst
George Staikos
staikos at kde.org
Wed Sep 14 22:00:40 CEST 2005
SVN commit 460698 by staikos:
backport fix for updates of objects depending on plugins
M +3 -0 kstplugin.cpp
M +5 -1 kstvector.cpp
--- branches/work/kst/1.1/kst/kst/kstplugin.cpp #460697:460698
@@ -377,6 +377,9 @@
KstVectorPtr vp = _outputVectors[(*it)._name];
vectorRealloced(vp, _outVectors[vitcnt], _outArrayLens[vitcnt]);
vp->setDirty();
+ // Inefficient, but do we have any other choice? We don't really know
+ // from the plugin how much of this vector is "new" or "shifted"
+ vp->setNewAndShift(vp->length(), vp->numShift());
vp->update(update_counter);
vitcnt++;
} else if ((*it)._type == Plugin::Data::IOValue::FloatType) {
--- branches/work/kst/1.1/kst/kst/kstvector.cpp #460697:460698
@@ -226,7 +226,11 @@
double* KstVector::realloced(double *memptr, int newSize) {
double *old = _v;
_v = memptr;
- NumNew = newSize - _size;
+ if (newSize < _size) {
+ NumNew = newSize; // all new if we shrunk the vector
+ } else {
+ NumNew = newSize - _size;
+ }
_size = newSize;
updateScalars();
return old;
More information about the Kst
mailing list