nsISelectionDisplay cannot be GetInterfaced from nsIWebBrowser.

RESOLVED FIXED in mozilla1.0.1

Status

()

Core
Embedding: APIs
RESOLVED FIXED
16 years ago
11 years ago

People

(Reporter: mjudge, Assigned: mjudge)

Tracking

Trunk
mozilla1.0.1
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

16 years ago
This bug was fixed and checked into 9.8.  The last minute fix there did not get 
into the trunk. I am currently trying to check this fix into 9.9 and I need to 
check this into the trunk as well. This code is safe and tested in 9.8.  Simply 
a matter of the DocShell QI to look to its presshell and return the 
nsISelectionDisplay that is supports through its nsISelectionController 
interface.
(Assignee)

Comment 1

16 years ago
Created attachment 76338 [details] [diff] [review]
fix left out of trunk from 9.8 checkin.

safe fix. need to support getinterface of embedders to change the seleciton
flags. we do this through nsISelectionDisplay.	9.8 had this change to the
GetInterface.  the trunk had all code in except these 2 snippets.
Comment on attachment 76338 [details] [diff] [review]
fix left out of trunk from 9.8 checkin.

r=bryner
Attachment #76338 - Flags: review+

Comment 3

16 years ago
Comment on attachment 76338 [details] [diff] [review]
fix left out of trunk from 9.8 checkin.

sr=sfraser
Attachment #76338 - Flags: superreview+
Comment on attachment 76338 [details] [diff] [review]
fix left out of trunk from 9.8 checkin.

a=roc+moz
Attachment #76338 - Flags: approval+
Comment on attachment 76338 [details] [diff] [review]
fix left out of trunk from 9.8 checkin.

a=dbaron for trunk checkin.  However:

>+    }
>+    else if (aIID.Equals(NS_GET_IID(nsISelectionDisplay))) {
>+      nsCOMPtr<nsIPresShell> shell;
>+      nsresult rv = GetPresShell(getter_AddRefs(shell));
>+      if (NS_SUCCEEDED(rv) && shell)
>+        return shell->QueryInterface(aIID,aSink);

I think you need a |return NS_NOINTERFACE;| here -- otherwise you
risk attempting to addref and  returning NS_OK with an
**uninitialized** out param if GetPresShell fails or if the pres
shell is null.

>+  } else if (aIID.Equals(NS_GET_IID(nsISelectionDisplay))) {
>+    nsISelectionController* tmp = this;
>+    *aInstancePtr = (void*) tmp;

It seems a little more kosher to cast to |nsISelectionDisplay*|,
although this does work, since nsISelectionController derives
from nsISelectionDisplay.  (If there's multiple inheritance from
nsISelectionDisplay going on here, it might be good to make that
more explicit with a three-step cast.)

Updated

16 years ago
QA Contact: mdunn → depstein

Comment 6

16 years ago
check on dbarons comments in 1.01
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0.1

Updated

15 years ago
QA Contact: depstein → ashishbhatt

Comment 7

11 years ago
Resolving fixed, since apparently nobody got around to it.  (The code in question did in fact get checked in.)
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.