adjusting how we get nsIFrameSelection. maybe we can QI from SelectionController

git-svn-id: svn://10.0.0.236/trunk@68626 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mjudge%netscape.com
2000-05-08 03:59:53 +00:00
parent 4bda86b3f7
commit ef3e852f95
10 changed files with 274 additions and 34 deletions

View File

@@ -6146,8 +6146,17 @@ nsBlockFrame::HandleEvent(nsIPresContext* aPresContext,
nsCOMPtr<nsIPresShell> shell;
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv)){
nsCOMPtr<nsISelectionController> selCon;
rv = GetSelectionController(aPresContext, getter_AddRefs(selCon));
nsCOMPtr<nsIFrameSelection> frameselection;
if (NS_SUCCEEDED(shell->GetFrameSelection(getter_AddRefs(frameselection))) && frameselection){
if (NS_SUCCEEDED(rv) && selCon)
{
frameselection = do_QueryInterface(selCon); //this MAY implement
}
if (!frameselection)
shell->GetFrameSelection(getter_AddRefs(frameselection));
if (frameselection)
{
PRBool mouseDown = PR_FALSE;
if (NS_FAILED(frameselection->GetMouseDownState(&mouseDown)) || !mouseDown)
return NS_OK;//do not handle