insertRows(aOldNb - 1, aNewNb - aOldNb, aFirstIdx);
}
else if (aNewNb < aOldNb) {
- removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
+ if (aNewNb)
+ removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
+ else if (aOldNb)
+ removeRows(0, aOldNb, aFirstIdx);
}
dataChanged(aFirstIdx, aLastIdx);
}
insertRows(aOldNb - 1, aNewNb - aOldNb, aFirstIdx);
}
else if (aNewNb < aOldNb) {
- removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
+ if (aNewNb)
+ removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
+ else if (aOldNb)
+ removeRows(0, aOldNb, aFirstIdx);
}
dataChanged(aFirstIdx, aLastIdx);
}