[Kst] [Bug 125873] Improvements to the "ordered" datawizard

George Staikos staikos at kde.org
Wed May 3 22:03:19 CEST 2006


------- 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=125873         
staikos kde org changed:

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



------- Additional Comments From staikos kde org  2006-05-03 22:03 -------
SVN commit 537055 by staikos:

fix the order-by-column code.  I still don't really like it but I guess it
works as well as it can without reworking the plot layouting code yet again.
BUG: 125873


 M  +10 -4     datawizard.ui.h  


--- trunk/extragear/graphics/kst/src/libkstapp/datawizard.ui.h #537054:537055
 @ -730,17 +730,23  @
     }
 
     // Reorder the vectors if the user wants it
-    if (_orderInColumns) {
+    if (_orderInColumns->isChecked()) {
 	const KstVectorList lOld = l;
 	const int count = lOld.count();
 	const int cols = signed(sqrt(plots.count()));
+	const int rows = cols + (count - cols * cols) / cols;
+	int overflow = count % cols;
 	int row = 0, col = 0;
 	for (int i = 0; i < count; ++i) {
 	    l[row * cols + col] = lOld[i];
 	    ++row;
-	    if (row >= cols) {
-		++col;
-		row = 0;
+	    if (row >= rows) {
+		if (overflow > 0) {
+		    --overflow;
+		} else {
+		    ++col;
+		    row = 0;
+		}
 	    }
 	}
     }


More information about the Kst mailing list