If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Should not use NS_ENSURE_TRUE in nsEventStateManager::GetKBStateControl #5557

RESOLVED FIXED in mozilla1.9alpha1

Status

()

Core
Event Handling
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

({regression})

Trunk
mozilla1.9alpha1
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

> 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.
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.9alpha
(Assignee)

Updated

12 years ago
OS: Windows 2000 → All
Hardware: PC → All
Created attachment 203338 [details] [diff] [review]
Patch rv1.0

Sorry. It's my easy mistake.
Attachment #203338 - Flags: superreview?(roc)
Attachment #203338 - Flags: review?(roc)
Created attachment 203339 [details] [diff] [review]
Patch rv1.1
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)
Created attachment 203340 [details] [diff] [review]
Patch rv1.2

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
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.