OS/2 crash prevention, make sure that a division by zero can not occure, bug 221975, r/sr=bzbarsky

This commit is contained in:
bmlk%gmx.de 2003-11-13 17:34:46 +00:00
Родитель fca1a4fa2c
Коммит c7db39de02
2 изменённых файлов: 8 добавлений и 0 удалений

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

@ -490,6 +490,10 @@ void BasicTableLayoutStrategy::AllocateUnconstrained(PRInt32 aAllocAmount,
numColsAllocated++;
}
}
if (!numColsAllocated) {
// redistribute the space to all columns and prevent a division by zero
numColsAllocated = numCols;
}
for (colX = 0; colX < numCols; colX++) {
if (FINISHED != aAllocTypes[colX]) {
if (aExclude0Pro) {

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

@ -490,6 +490,10 @@ void BasicTableLayoutStrategy::AllocateUnconstrained(PRInt32 aAllocAmount,
numColsAllocated++;
}
}
if (!numColsAllocated) {
// redistribute the space to all columns and prevent a division by zero
numColsAllocated = numCols;
}
for (colX = 0; colX < numCols; colX++) {
if (FINISHED != aAllocTypes[colX]) {
if (aExclude0Pro) {