void SelectionManager::RemoveDocSelectionListener(nsIPresShell* aPresShell) { const nsFrameSelection* frameSel = aPresShell->ConstFrameSelection(); // Remove 'this' registered as selection listener for the normal selection. Selection* normalSel = frameSel->GetSelection(SelectionType::eNormal); normalSel->RemoveSelectionListener(this); // Remove 'this' registered as selection listener for the spellcheck // selection. Selection* spellSel = frameSel->GetSelection(SelectionType::eSpellCheck); spellSel->RemoveSelectionListener(this); }
void SelectionManager::RemoveDocSelectionListener(nsIPresShell* aPresShell) { const nsFrameSelection* frameSel = aPresShell->ConstFrameSelection(); // Remove 'this' registered as selection listener for the normal selection. Selection* normalSel = frameSel->GetSelection(nsISelectionController::SELECTION_NORMAL); normalSel->RemoveSelectionListener(this); // Remove 'this' registered as selection listener for the spellcheck // selection. Selection* spellSel = frameSel->GetSelection(nsISelectionController::SELECTION_SPELLCHECK); spellSel->RemoveSelectionListener(this); }
void SelectionManager::ClearControlSelectionListener() { if (!mCurrCtrlFrame) return; const nsFrameSelection* frameSel = mCurrCtrlFrame->GetConstFrameSelection(); NS_ASSERTION(frameSel, "No frame selection for the element!"); mCurrCtrlFrame = nullptr; if (!frameSel) return; // Remove 'this' registered as selection listener for the normal selection. Selection* normalSel = frameSel->GetSelection(nsISelectionController::SELECTION_NORMAL); normalSel->RemoveSelectionListener(this); // Remove 'this' registered as selection listener for the spellcheck // selection. Selection* spellSel = frameSel->GetSelection(nsISelectionController::SELECTION_SPELLCHECK); spellSel->RemoveSelectionListener(this); }