[Kst] [Bug 102382] Crash when changing number of bins in histogram

George Staikos staikos at kde.org
Fri Mar 25 18:57:24 CET 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=102382         
staikos kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From staikos kde org  2005-03-25 18:57 -------
CVS commit by staikos: 

Finish the code here
BUG: 102382
BUG: 102386


  M +8 -8      ksthistogram.cpp   1.56


--- kdeextragear-2/kst/kst/ksthistogram.cpp  #1.55:1.56
 @ -138,4 +138,6  @ void KstHistogram::commonConstructor(con
   v->setProvider(this);
   _hVector = _outputVectors.insert(HIST, v);
+
+  setDirty();
 }
 
 @ -187,7 +189,5  @ KstObject::UpdateType KstHistogram::upda
   _W = (_MaxX - _MinX)/double(_NBins);
 
-  for (i_bin = 0; i_bin < _NBins; i_bin++) {
-    Bins[i_bin] = 0;
-  }
+  memset(Bins, 0, _NBins*sizeof(*Bins));
 
   ns = _inputVectors[RAWVECTOR]->length();
 @ -292,5 +293,6  @ void KstHistogram::internalSetNBins(int 
   }
   Bins = new unsigned long[_NBins];
-  _W = (_MaxX - _MinX)/(double)_NBins;
+  memset(Bins, 0, _NBins*sizeof(*Bins));
+  _W = (_MaxX - _MinX)/double(_NBins);
   _NS = 3 * _NBins + 1;
 
 @ -304,6 +306,4  @ void KstHistogram::setNBins(int in_n_bin
   internalSetNBins(in_n_bins);
   setDirty();
-  abort(); // FIXME
-  update(); // Have to update here otherwise Bins[] is invalid!
 }


More information about the Kst mailing list