Closed Bug 316805 Opened 15 years ago Closed 15 years ago

Should not use NS_ENSURE_TRUE in nsEventStateManager::GetKBStateControl #5557

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

> 5543 nsEventStateManager::GetKBStateControl(nsPresContext* aPresContext,
> 5544                                        nsIKBStateControl** aResult)
> 5545 {
> 5546   NS_ENSURE_ARG_POINTER(aPresContext);
> 5547   NS_ENSURE_ARG_POINTER(aResult);
> 5548 
> 5549   *aResult = nsnull;
> 5550   nsIViewManager* vm = aPresContext->GetViewManager();
> 5551   NS_ENSURE_TRUE(vm, NS_ERROR_FAILURE);
> 5552   nsCOMPtr<nsIWidget> widget = nsnull;
> 5553   nsresult rv = vm->GetWidget(getter_AddRefs(widget));
> 5554   NS_ENSURE_SUCCESS(rv, rv);
> 5555   NS_ENSURE_TRUE(widget, NS_ERROR_FAILURE);
> 5556   nsCOMPtr<nsIKBStateControl> kb = do_QueryInterface(widget);
> 5557   NS_ENSURE_TRUE(kb, NS_ERROR_FAILURE);
> 5558   NS_ADDREF(*aResult = kb);
> 5559   return NS_OK;
> 5560 }

nsIWidget is not always having nsIKBStateControl. e.g., on GTK2, BeOS, OS/2.
We should not use this in this case.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.9alpha
OS: Windows 2000 → All
Hardware: PC → All
Attached patch Patch rv1.0 (obsolete) — Splinter Review
Sorry. It's my easy mistake.
Attachment #203338 - Flags: superreview?(roc)
Attachment #203338 - Flags: review?(roc)
Attached patch Patch rv1.1 (obsolete) — Splinter Review
Attachment #203338 - Attachment is obsolete: true
Attachment #203339 - Flags: superreview?(roc)
Attachment #203339 - Flags: review?(roc)
Attachment #203338 - Flags: superreview?(roc)
Attachment #203338 - Flags: review?(roc)
Attached patch Patch rv1.2Splinter Review
Sorry for the spam.
Attachment #203339 - Attachment is obsolete: true
Attachment #203340 - Flags: superreview?(roc)
Attachment #203340 - Flags: review?(roc)
Attachment #203339 - Flags: superreview?(roc)
Attachment #203339 - Flags: review?(roc)
Attachment #203340 - Flags: superreview?(roc)
Attachment #203340 - Flags: superreview+
Attachment #203340 - Flags: review?(roc)
Attachment #203340 - Flags: review+
checked-in.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.