Skip to content

Commit

Permalink
Bug 1395080 - Part 4. Remove unused nsIDOMRange parameter. r=masayuki
Browse files Browse the repository at this point in the history
GetFirstSelectedCell and GetNextSelectedCell allow that 1st parameter is nullptr when current range is unnecessary.  So we should use nullptr when it is unused.

MozReview-Commit-ID: BuI7ds47h0U

--HG--
extra : rebase_source : 4cb67aa15c5b5a7692c7e5eb43976c8e7a7884e4
  • Loading branch information
makotokato committed Sep 1, 2017
1 parent cc0f4f0 commit 2f39643
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions editor/libeditor/HTMLTableEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,7 @@ HTMLEditor::DeleteTableCell(int32_t aNumber)
AutoRules beginRulesSniffing(this, EditAction::deleteNode, nsIEditor::eNext);

nsCOMPtr<nsIDOMElement> firstCell;
nsCOMPtr<nsIDOMRange> range;
rv = GetFirstSelectedCell(getter_AddRefs(range), getter_AddRefs(firstCell));
rv = GetFirstSelectedCell(nullptr, getter_AddRefs(firstCell));
NS_ENSURE_SUCCESS(rv, rv);

if (firstCell && selection->RangeCount() > 1) {
Expand Down Expand Up @@ -855,8 +854,7 @@ HTMLEditor::DeleteTableCell(int32_t aNumber)
if (!deleteCol) {
// First get the next cell to delete
nsCOMPtr<nsIDOMElement> nextCell;
rv = GetNextSelectedCell(getter_AddRefs(range),
getter_AddRefs(nextCell));
rv = GetNextSelectedCell(nullptr, getter_AddRefs(nextCell));
NS_ENSURE_SUCCESS(rv, rv);

// Then delete the cell
Expand Down Expand Up @@ -948,8 +946,7 @@ HTMLEditor::DeleteTableCellContents()


nsCOMPtr<nsIDOMElement> firstCell;
nsCOMPtr<nsIDOMRange> range;
rv = GetFirstSelectedCell(getter_AddRefs(range), getter_AddRefs(firstCell));
rv = GetFirstSelectedCell(nullptr, getter_AddRefs(firstCell));
NS_ENSURE_SUCCESS(rv, rv);


Expand Down Expand Up @@ -1030,8 +1027,7 @@ HTMLEditor::DeleteTableColumn(int32_t aNumber)

// Test if deletion is controlled by selected cells
nsCOMPtr<nsIDOMElement> firstCell;
nsCOMPtr<nsIDOMRange> range;
rv = GetFirstSelectedCell(getter_AddRefs(range), getter_AddRefs(firstCell));
rv = GetFirstSelectedCell(nullptr, getter_AddRefs(firstCell));
NS_ENSURE_SUCCESS(rv, rv);

uint32_t rangeCount = selection->RangeCount();
Expand Down Expand Up @@ -1059,7 +1055,7 @@ HTMLEditor::DeleteTableColumn(int32_t aNumber)
// to continue after we delete this column
int32_t nextCol = startColIndex;
while (nextCol == startColIndex) {
rv = GetNextSelectedCell(getter_AddRefs(range), getter_AddRefs(cell));
rv = GetNextSelectedCell(nullptr, getter_AddRefs(cell));
NS_ENSURE_SUCCESS(rv, rv);
if (!cell) {
break;
Expand Down Expand Up @@ -1193,8 +1189,7 @@ HTMLEditor::DeleteTableRow(int32_t aNumber)
AutoRules beginRulesSniffing(this, EditAction::deleteNode, nsIEditor::eNext);

nsCOMPtr<nsIDOMElement> firstCell;
nsCOMPtr<nsIDOMRange> range;
rv = GetFirstSelectedCell(getter_AddRefs(range), getter_AddRefs(firstCell));
rv = GetFirstSelectedCell(nullptr, getter_AddRefs(firstCell));
NS_ENSURE_SUCCESS(rv, rv);

uint32_t rangeCount = selection->RangeCount();
Expand Down Expand Up @@ -1225,7 +1220,7 @@ HTMLEditor::DeleteTableRow(int32_t aNumber)
// to continue after we delete this row
int32_t nextRow = startRowIndex;
while (nextRow == startRowIndex) {
rv = GetNextSelectedCell(getter_AddRefs(range), getter_AddRefs(cell));
rv = GetNextSelectedCell(nullptr, getter_AddRefs(cell));
NS_ENSURE_SUCCESS(rv, rv);
if (!cell) break;
rv = GetCellIndexes(cell, &nextRow, &startColIndex);
Expand Down

0 comments on commit 2f39643

Please sign in to comment.