Closed
Bug 767705
Opened 12 years ago
Closed 12 years ago
decomtaminate GetSelectedCells() on accessible tables
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: capella, Assigned: vinceyang15)
References
Details
(Whiteboard: [good first bug][mentor=trev.saunders@gmail.com][lang=c++])
Attachments
(1 file, 1 obsolete file)
18.79 KB,
patch
|
tbsaunde
:
review+
|
Details | Diff | Splinter Review |
Last method for xpcaccessibletable to be decomtaminated. See bug 765512, bug 747227, etc.
Reporter | ||
Updated•12 years ago
|
Assignee: markcapella → nobody
Status: ASSIGNED → NEW
Reporter | ||
Updated•12 years ago
|
Assignee: nobody → vinceyang15
Status: NEW → ASSIGNED
I just got this problem. I've implemented the xpcAccessibleTable::GetSelectedCells(nsIArray**) method, and I tried to compile my code, but the compiler just saying error: 'nsIArray' has not been declared, How can I fix it?
Reporter | ||
Comment 3•12 years ago
|
||
Xi, post your patch as it is so it can be looked at, hard to tell what you did wrong otherwise.
Comment 4•12 years ago
|
||
(In reply to Xi Yang from comment #2) > I just got this problem. I've implemented the > xpcAccessibleTable::GetSelectedCells(nsIArray**) method, and I tried to > compile my code, but the compiler just saying error: 'nsIArray' has not been > declared, How can I fix it? you probably need to include nsArrayUtils.h
Attachment #637088 -
Flags: review?(trev.saunders)
Comment 6•12 years ago
|
||
Comment on attachment 637088 [details] [diff] [review] Patch(v1) >+xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCell) >+{ nit, aSelectedCells here and below. >+ nsAutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray; >+ mTable->SelectedCells(&cellsArray); >+ >+ PRUint32 aCellsArraySize = cellsArray.Length(); >+ *aSelectedCell = static_cast<nsIArray*> >+ (moz_xmalloc(aCellsArraySize * sizeof(nsIArray*))); >+ memcpy(*aSelectedCell, cellsArray.Elements(), >+ aCellsArraySize * sizeof(nsIArray*)); that isn't how you create a nsIArray... look at some of the code you remove for an example of how to do it correctly. >diff --git a/accessible/src/xpcom/xpcAccessibleTable.h b/accessible/src/xpcom/xpcAccessibleTable.h >--- a/accessible/src/xpcom/xpcAccessibleTable.h >+++ b/accessible/src/xpcom/xpcAccessibleTable.h >@@ -4,16 +4,18 @@ > * License, v. 2.0. If a copy of the MPL was not distributed with this file, > * You can obtain one at http://mozilla.org/MPL/2.0/. */ > > #ifndef MOZILLA_A11Y_XPCOM_XPACCESSIBLETABLE_H_ > #define MOZILLA_A11Y_XPCOM_XPACCESSIBLETABLE_H_ > > #include "nsAString.h" > #include "nscore.h" >+#include "nsArrayUtils.h" a forward decl of class nsIArray should be enough here. then you can include it in xpcAccessibleTable.cpp > PRUint32 selectedItemsCount = 0; >+ nsresult rv; > rv = selectedItems->GetLength(&selectedItemsCount); nit, just do nsresult rv = ... >+ if (!mDoc) >+ return; you don't need this check.
Attachment #637088 -
Flags: review?(trev.saunders)
Attachment #637088 -
Attachment is obsolete: true
Attachment #637478 -
Flags: review?(trev.saunders)
Updated•12 years ago
|
Attachment #637478 -
Flags: review?(trev.saunders) → review+
Keywords: checkin-needed
Reporter | ||
Comment 8•12 years ago
|
||
nit, a trailing space here: - { return xpcAccessibleTable::GetSelectedCells(aSelectedCells); } \ + { return xpcAccessibleTable::GetSelectedCells(aSelectedCells); } \ caused WIN7 build to fail ...
Reporter | ||
Comment 9•12 years ago
|
||
Pushing to TRY: https://tbpl.mozilla.org/?tree=Try&rev=3a22977271ae
Keywords: checkin-needed
Reporter | ||
Comment 10•12 years ago
|
||
On to inbound: https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=bdafb1929d8d
Assignee | ||
Comment 11•12 years ago
|
||
(In reply to Mark Capella [:capella] from comment #8) > nit, a trailing space here: > - { return xpcAccessibleTable::GetSelectedCells(aSelectedCells); } \ > + { return xpcAccessibleTable::GetSelectedCells(aSelectedCells); } \ > > caused WIN7 build to fail ... How to fix it?
Reporter | ||
Comment 12•12 years ago
|
||
I just removed the extra space ... mentioned it here as it was an odd compiler thing ... fyi thing ... s/b complete / production soon ...
Comment 13•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/bdafb1929d8d
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in
before you can comment on or make changes to this bug.
Description
•