Fix Regression DataTable

... if a column has no data - just do not try to add the missing rows
This commit is contained in:
Joern
2017-04-20 14:47:14 +02:00
parent 46151a272f
commit be2edb82e6

View File

@@ -1160,14 +1160,17 @@ LTMWindow::dataTable(bool html)
// align the starting X values of all columns using the
// lowest xValue and highest xValue as borders
if (lowestFirstXvalue != highestFirstXvalue) {
// for columns which have data at all - and if there is something to adjust
if (!firstXvalue && lowestFirstXvalue != highestFirstXvalue) {
for (int i = 0; i< columns.count(); i++) {
double xValue = columns[i].x[0];
while (columns[i].x[0] > lowestFirstXvalue) {
xValue--;
columns[i].x.prepend(xValue);
columns[i].y.prepend(0.0);
columns[i].n++;
if (columns[i].n > 0) {
double xValue = columns[i].x[0];
while (columns[i].x[0] > lowestFirstXvalue) {
xValue--;
columns[i].x.prepend(xValue);
columns[i].y.prepend(0.0);
columns[i].n++;
}
}
}
// adjust number of visible rows in table