Bug 1484126 - part 14: Replace |CellData::mEffectiveRowSpan - 1| with CellData::NumberOfFollowingRows() r=m_kato

Differential Revision: https://phabricator.services.mozilla.com/D8351

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Masayuki Nakano 2018-10-15 11:15:15 +00:00
Родитель 5c8e2f568e
Коммит ff86516630
1 изменённых файлов: 4 добавлений и 5 удалений

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

@ -1409,7 +1409,7 @@ HTMLEditor::DeleteTableColumnWithTransaction(Element& aTableElement,
"Failed to remove all children of the cell element");
}
// Skip rows which the removed cell spanned.
rowIndex += cellData.mEffectiveRowSpan - 1;
rowIndex += cellData.NumberOfFollowingRows();
continue;
}
@ -1426,7 +1426,7 @@ HTMLEditor::DeleteTableColumnWithTransaction(Element& aTableElement,
return rv;
}
// Skip rows which the removed cell spanned.
rowIndex += cellData.mEffectiveRowSpan - 1;
rowIndex += cellData.NumberOfFollowingRows();
continue;
}
@ -1677,7 +1677,7 @@ HTMLEditor::DeleteTableRowWithTransaction(Element& aTableElement,
// it upsets cell map, so we will do it after deleting the row.
int32_t newRowSpanValue =
std::max(cellData.NumberOfPrecedingRows(),
cellData.mEffectiveRowSpan - 1);
cellData.NumberOfFollowingRows());
spanCellArray.AppendElement(
SpanCell(cellData.mElement, newRowSpanValue));
}
@ -1688,12 +1688,11 @@ HTMLEditor::DeleteTableRowWithTransaction(Element& aTableElement,
// if rowSpan = 0 (automatic readjustment).
int32_t aboveRowToInsertNewCellInto =
cellData.NumberOfPrecedingRows() + 1;
int32_t numOfRawSpanRemainingBelow = cellData.mEffectiveRowSpan - 1;
nsresult rv =
SplitCellIntoRows(&aTableElement,
cellData.mFirst.mRow, cellData.mFirst.mColumn,
aboveRowToInsertNewCellInto,
numOfRawSpanRemainingBelow, nullptr);
cellData.NumberOfFollowingRows(), nullptr);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}