Closed
Bug 116329
Opened 23 years ago
Closed 23 years ago
XUL sort service should grok nsIRDFBlobs for collation keys
Categories
(Core :: XUL, defect, P1)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla0.9.9
People
(Reporter: waterson, Assigned: naving)
References
Details
Attachments
(1 file, 1 obsolete file)
7.16 KB,
patch
|
mozilla
:
review+
|
Details | Diff | Splinter Review |
The XUL sort service should handle nsIRDFBlob objects for collation keys.
Reporter | ||
Updated•23 years ago
|
Comment 1•23 years ago
|
||
waterson, i'll take this bug if you don't object.
random note:
Presumably, if we encounter blob targets for property arcs that don't have
"?collation=true" on them, we should still treat them as binary blobs and use
CompareRawSortKey() (the alternative is attempting to do a collation compare on
arbitrary binary data...).
This means that theoretically the dependence on "?collation=true" for fast
sorting is lessened.
Reporter | ||
Comment 2•23 years ago
|
||
All yours...thanks a ton!
Assignee: waterson → tingley
Status: ASSIGNED → NEW
Updated•23 years ago
|
Status: NEW → ASSIGNED
Comment 3•23 years ago
|
||
Updates nsXULSortService::CompareNodes() so that it will use a raw compare for
Blobs. It preserves the old (broken) behavior of doing a raw comparison on
literals for which "?collation=true" was specified for the time being so as not
to break existing uses.
A couple notes about this patch.
1) It deviates slightly from the current code in behavior during type
mismatches -- when node 1 is an integer but node 2 is a string. The current
code will assign a preferred sortOrder based on which node is of the correct
type. When rewriting this, I opted instead for the behavior that the
nsXULOutlinerBuilder uses -- just return a sortOrder of 0 in the case of the
mismatch. This will cause a mismatch on the first property to fall through to
a comparison based on the values of the second property (assuming it exists).
2) It's sort of a shame that the Blob GetValue() doesn't return a const.
Should I fix this, or is there some reason it should return a raw |PRUint8 *|?
Comment 4•23 years ago
|
||
pushing out.
Reporter | ||
Comment 5•23 years ago
|
||
Comment on attachment 65842 [details] [diff] [review]
patch
sr=waterson
Attachment #65842 -
Flags: superreview+
Assignee | ||
Comment 7•23 years ago
|
||
I had to make minor change to compile this patch but sorting in menus is
still wrong, doesn't sort the same way as in folder-pane. surely,
something else is broken because both OutlinerBuilder and SortService
are doing the same thing. Note I have a patch for the client (mail folders)
to use RDFBlob.
+const PRUint8 *lkey, *rkey;
-PRUint8 *lkey, *rkey;
Comment 8•23 years ago
|
||
Comment on attachment 65842 [details] [diff] [review]
patch
Argh, I forgot to fix that -- this patch has been stale since waterson changed
nsIRDFBlob::GetValue to use const.
Attachment #65842 -
Attachment is obsolete: true
Assignee | ||
Comment 9•23 years ago
|
||
The problem was we were comparing cellNode1 w/ cellNode1 instead of comparing
cellNode1 w/ cellNode2. this patch works but do we still need isCollationKey1,
isCollationKey2. It seems to me QI for blob would do that.
Assignee | ||
Comment 10•23 years ago
|
||
We need to check in this one also.
Comment 11•23 years ago
|
||
nice catch on the cellnode1 stuff. this patch still needs review from someone
other than me, though. (rjc?)
You're right, the blob QI should make isCollationKey obsolete (and remove a
bunch of other logic from the file, including a lot of RDF queries). My plan
was to wait until I was sure that "?collation=true" wasn't being used anywhere
else in the tree, and then rip all that stuff out (see related thread waterson
started on n.p.m.rdf). If this already the case (i.e. we won't cause any
regressions by removing functionality people depend on), then we could do that now.
Comment 12•23 years ago
|
||
Comment on attachment 66483 [details] [diff] [review]
same patch w/ minor changes
Not that it matters much, but might want to bound this calculation:
sortOrder = (lint - rint);
to [-1,1]
r=rjc
Attachment #66483 -
Flags: review+
Comment 13•23 years ago
|
||
Over to Navin for final cleanup (rjc's comment, indentation) and checkin.
Assignee: tingley → naving
Status: ASSIGNED → NEW
Assignee | ||
Comment 14•23 years ago
|
||
fix checked in ( as per tingley's last comment)
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•