Closed Bug 405747 Opened 18 years ago Closed 18 years ago

implement IAccessible2::locale

Categories

(Core :: Disability Access APIs, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

Attached patch patch (obsolete) — — Splinter Review
No description provided.
Attachment #290503 - Flags: review?(aaronleventhal)
Comment on attachment 290503 [details] [diff] [review] patch Can you add some comments for each block and then request sr=neil? For example: // Format: XX-xx // We just want the XX which represents the language -- we don't need the specific country Using nsDependantSubstring is probably more efficient than nsAutoString foo(Substring(...))
Attachment #290503 - Flags: review?(aaronleventhal) → review+
Assignee: aaronleventhal → surkov.alexander
Attached patch patch2 (obsolete) — — Splinter Review
I can't use nsDependentSubstring at least because it hasn't get() method. Probably Neil has an idea.
Attachment #290503 - Attachment is obsolete: true
Attachment #290552 - Flags: superreview?(neil)
Use SysAllocStringLen?
(In reply to comment #3) > Use SysAllocStringLen? > for the first case only?
Neil isn't CC'd so he probably didn't see your question in comment 4.
(In reply to comment #4) > (In reply to comment #3) > > Use SysAllocStringLen? > for the first case only? For at least the second and fourth cases, in order to fix comment #2, but you always know the length, so you can use it for the other cases too.
(In reply to comment #6) > (In reply to comment #4) > > (In reply to comment #3) > > > Use SysAllocStringLen? > > for the first case only? > For at least the second and fourth cases, in order to fix comment #2, but you > always know the length, so you can use it for the other cases too. > Do you count cases by SysAllocString entries? Then I do get for the second case, but I didn't catch about fourth and other cases. Or am I able to get pointer on certain char by someway in order to use SysAllocStringLen?
Comment on attachment 290552 [details] [diff] [review] patch2 >+ nsAutoString country(Substring(lang, 3, 5)); >+ aLocale->country = ::SysAllocString(country.get()); For instance, ::SysAllocStringLen(lang.get() + 3, 2);
Attached patch patch3 — — Splinter Review
excellent, thanks Neil
Attachment #290552 - Attachment is obsolete: true
Attachment #290674 - Flags: superreview?(neil)
Attachment #290552 - Flags: superreview?(neil)
Comment on attachment 290674 [details] [diff] [review] patch3 >+ if (lang.Length() == 2) { >+ aLocale->language = ::SysAllocString(lang.get()); >+ return S_OK; >+ } You could change this to ::SysAllocStringLen(lang.get(), 2); >+ if (lang.Length() == 5) { >+ aLocale->country = ::SysAllocStringLen(lang.get() + 3, 2); >+ return S_OK; >+ } Or you could leave this as ::SysAllocString(lang.get() + 3);
Attachment #290674 - Flags: superreview?(neil) → superreview+
Attachment #290674 - Flags: approval1.9?
Attachment #290674 - Flags: approval1.9? → approval1.9+
checked in with Neil's comment (option 2).
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: