Skip to content

Commit ad690e7

Browse files
committed
Fix bug: adjust rows to contents not affecting first row
See issue #3767
1 parent 40554cf commit ad690e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/TableBrowser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ void TableBrowser::modifyFormat(std::function<void(CondFormat&)> changeFunction)
733733
void TableBrowser::updateRecordsetLabel()
734734
{
735735
// Get all the numbers, i.e. the number of the first row and the last row as well as the total number of rows
736+
// Internal row numbers start at 0, but we want to show them starting at 1.
736737
int from = ui->dataTable->verticalHeader()->visualIndexAt(0) + 1;
737738
int total = m_model->rowCount();
738739
int real_total = m_model->realRowCount();
@@ -742,7 +743,7 @@ void TableBrowser::updateRecordsetLabel()
742743

743744
// Adjust visible rows to contents if necessary, and then take the new visible rows, which might have changed.
744745
if(m_adjustRows) {
745-
for(int i=from; i<=to; i++)
746+
for(int i=from-1; i<=to-1; i++)
746747
ui->dataTable->resizeRowToContents(i);
747748
from = ui->dataTable->verticalHeader()->visualIndexAt(0) + 1;
748749
to = from + ui->dataTable->numVisibleRows() - 1;

0 commit comments

Comments
 (0)