Skip to content

Commit

Permalink
Bug 1395080 - Part 1. Replace nsIDOMRange::GetCollapsed with nsRange:…
Browse files Browse the repository at this point in the history
…:Collapsed. r=masayuki

MozReview-Commit-ID: LefqnYBJGec

--HG--
extra : rebase_source : f85c786ee218cf6e8528be8d2d91aa9ac0e3ce97
  • Loading branch information
makotokato committed Sep 1, 2017
1 parent 2f62ea3 commit c171902
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
6 changes: 1 addition & 5 deletions editor/composer/nsEditorSpellCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,7 @@ nsEditorSpellCheck::InitSpellChecker(nsIEditor* aEditor, bool aEnableSelectionCh
RefPtr<nsRange> range = selection->GetRangeAt(0);
NS_ENSURE_STATE(range);

bool collapsed = false;
rv = range->GetCollapsed(&collapsed);
NS_ENSURE_SUCCESS(rv, rv);

if (!collapsed) {
if (!range->Collapsed()) {
// We don't want to touch the range in the selection,
// so create a new copy of it.

Expand Down
4 changes: 1 addition & 3 deletions editor/libeditor/SelectionState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ SelectionState::IsCollapsed()
}
RefPtr<nsRange> range = mArray[0]->GetRange();
NS_ENSURE_TRUE(range, false);
bool bIsCollapsed = false;
range->GetCollapsed(&bIsCollapsed);
return bIsCollapsed;
return range->Collapsed();
}

bool
Expand Down
20 changes: 2 additions & 18 deletions editor/txtsvc/nsTextServicesDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,15 +600,7 @@ nsTextServicesDocument::LastSelectedBlock(TSDBlockSelectionStatus *aSelStatus,
return rv;
}

bool isCollapsed;
rv = range->GetCollapsed(&isCollapsed);

if (NS_FAILED(rv)) {
UNLOCK_DOC(this);
return rv;
}

if (isCollapsed) {
if (range->Collapsed()) {
// If we get here, the range is collapsed because there is nothing after
// the caret! Just return NS_OK;

Expand Down Expand Up @@ -804,15 +796,7 @@ nsTextServicesDocument::LastSelectedBlock(TSDBlockSelectionStatus *aSelStatus,
return rv;
}

bool isCollapsed;
rv = range->GetCollapsed(&isCollapsed);

if (NS_FAILED(rv)) {
UNLOCK_DOC(this);
return rv;
}

if (isCollapsed) {
if (range->Collapsed()) {
// If we get here, the range is collapsed because there is nothing after
// the current selection! Just return NS_OK;

Expand Down

0 comments on commit c171902

Please sign in to comment.