[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Wed Jul 30 06:10:04 CEST 2003
CVS commit by staikos:
fix testcases 169,170,172,174 and put in a compiled-out solution idea for
testcases 190,191
M +2 -2 kstiface_impl.cpp 1.7
M +9 -2 kstvector.cpp 1.41
--- kdeextragear-2/kst/kst/kstiface_impl.cpp #1.6:1.7
@@ -308,7 +308,7 @@ bool KstIfaceImpl::resizeVector(const QS
KstVectorList::Iterator it = KST::vectorList.findTag(name);
- if (it != KST::vectorList.end() && newSize > 0) {
+ if (it != KST::vectorList.end()) {
(*it)->resize(newSize);
- return true;
+ return (*it)->length() == newSize;
}
--- kdeextragear-2/kst/kst/kstvector.cpp #1.40:1.41
@@ -189,7 +189,14 @@ void KstVector::zero() {
void KstVector::resize(int sz) {
//kdDebug() << "resizing to: " << sz << endl;
- if (sz > 0) {
- _size = sz;
+ if (sz > 1) {
_v = static_cast<double*>(realloc(_v, sz*sizeof(double)));
+#ifdef ZERO_MEMORY
+ if (_size < sz) {
+ for (int i = _size; i < sz; i++) {
+ _v[i] = 0.0;
+ }
+ }
+#endif
+ _size = sz;
}
}
More information about the Kst
mailing list