Closed Bug 740750 Opened 12 years ago Closed 12 years ago

Use nsITreeView* instead of nsCOMPtr<nsITreeView> as followup to bug#739524

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: capella, Assigned: Infinity)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [good first bug][mentor=surkov.alexander@gmail.com][lang=c++])

Attachments

(1 file, 1 obsolete file)

Change pointers in affected files, and remove cycle collection macros related to mTreeView.

Foolow-up to https://bugzilla.mozilla.org/show_bug.cgi?id=739524
Summary: Use nsITreeView* instead of nsRefPtr<nsITreeView> as followup to bug#739524 → Use nsITreeView* instead of nsCOMPtr<nsITreeView> as followup to bug#739524
Depends on: 739524
Assignee: nobody → junky.argonaut
Status: NEW → ASSIGNED
Attached patch Patchv0 (obsolete) — Splinter Review
I have made a patch based on what I hae understood so far about the bug. But the build fails with this. Could I get some help on what I have done wrong or what I should further do for this bug to get it fixed.
Attachment #618682 - Flags: feedback?(trev.saunders)
Attachment #618682 - Flags: feedback?(surkov.alexander)
Comment on attachment 618682 [details] [diff] [review]
Patchv0

Review of attachment 618682 [details] [diff] [review]:
-----------------------------------------------------------------

it looks ok, I'll do review later (Trevor is busy until Friday iirc)
Attachment #618682 - Flags: review?(surkov.alexander)
Attachment #618682 - Flags: feedback?(trev.saunders)
Attachment #618682 - Flags: feedback?(surkov.alexander)
I have also pastebin it on http://pastebin.mozilla.org/1599146. My build error is as shown below:

../../../dist/include/nsIDOMXULSelectCntrlEl.h:33:60: warning: ‘virtual nsresult nsIDOMXULSelectControlElement::GetSelectedItem(nsIDOMXULSelectControlItemElement**)’ was hidden
../../../dist/include/nsIDOMXULMultSelectCntrlEl.h:73:60: warning:   by ‘virtual nsresult nsIDOMXULMultiSelectControlElement::GetSelectedItem(PRInt32, nsIDOMXULSelectControlItemElement**)’
/home/arjun/src/accessible/src/xul/nsXULTreeAccessible.cpp: In constructor ‘nsXULTreeAccessible::nsXULTreeAccessible(nsIContent*, nsDocAccessible*)’:
/home/arjun/src/accessible/src/xul/nsXULTreeAccessible.cpp:75:45: error: no matching function for call to ‘nsITreeBoxObject::GetView(const already_AddRefed<nsITreeView>)’
../../../dist/include/nsITreeBoxObject.h:48:60: note: candidate is: virtual nsresult nsITreeBoxObject::GetView(nsITreeView**)
/home/arjun/src/accessible/src/xul/nsXULTreeAccessible.cpp: In constructor ‘nsXULTreeAccessible::nsXULTreeAccessible(nsIContent*, nsDocAccessible*)’:
/home/arjun/src/accessible/src/xul/nsXULTreeAccessible.cpp:75:45: error: no matching function for call to ‘nsITreeBoxObject::GetView(const already_AddRefed<nsITreeView>)’
../../../dist/include/nsITreeBoxObject.h:48:60: note: candidate is: virtual nsresult nsITreeBoxObject::GetView(nsITreeView**)

so you need to do something like

if (mTree) {
  nsCOMPtr<nsITreeView> treeView;
  mTree->GetView(getter_AddRefs(treeView));
  mTreeView = treeView;
}
Attached patch Patchv1Splinter Review
Functional Patch with required changes incorporated in it.
Attachment #618682 - Attachment is obsolete: true
Attachment #618682 - Flags: review?(surkov.alexander)
Attachment #618724 - Flags: review?(surkov.alexander)
Comment on attachment 618724 [details] [diff] [review]
Patchv1

Review of attachment 618724 [details] [diff] [review]:
-----------------------------------------------------------------

r=me, I'll fix nits before landing. In general please take care about code style.

::: accessible/src/xul/nsXULTreeAccessible.cpp
@@ +74,5 @@
> +  if (mTree) {
> +  nsCOMPtr<nsITreeView> treeView;
> +  mTree->GetView(getter_AddRefs(treeView));
> +  mTreeView = treeView;
> +}

wrong indentation, use two spaces for indent
Attachment #618724 - Flags: review?(surkov.alexander) → review+
Whiteboard: [lang=c++] → [good first bug][mentor=surkov.alexander@gmail.com][lang=c++]
and please make sure you keep sources up to dated, i.e. the patch is against trunk
http://hg.mozilla.org/mozilla-central/rev/103044663fd3
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Sure surkov, won't make the same mistakes again.
Had a good time working with you on the bug. Thanks for all the help with it.
(In reply to Arjun from comment #10)
> Sure surkov, won't make the same mistakes again.
> Had a good time working with you on the bug. Thanks for all the help with it.

ok, cool. thanks.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: