bug 803330 - fix row count assertion failure in page info dialog r=florian

When calling rowCountChanged on an nsITreeBoxObject, the implementation assumes
that the row count has actually changed. pageInfoTreeView violated this
assumption in addRows by first calling rowCountChanged and then updating its row
count. This patch fixes the issue by using the power of decomposition. That is,
there's already a perfectly fine function called 'addRow' that can be called
once for each row being added.

MozReview-Commit-ID: HP6LkP4ICLf

--HG--
extra : rebase_source : 574afa9a8bdaf6eea027144de96c55a2a24ea241
This commit is contained in:
David Keeler 2016-07-14 17:21:14 -07:00
Родитель e1a20915fc
Коммит 100044aea9
1 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -58,11 +58,8 @@ pageInfoTreeView.prototype = {
addRows: function(rows)
{
this.data = this.data.concat(rows);
this.rowCountChanged(this.rows, rows.length);
this.rows = this.data.length;
if (this.selection.count == 0 && this.rowCount && !gImageElement) {
this.selection.select(0);
for (let row of rows) {
this.addRow(row);
}
},