[Webkit-unassigned] [Bug 78856] visual word movement: Using ICU break iterator to simplify implementation
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 15 12:46:18 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=78856
--- Comment #20 from Ryosuke Niwa <rniwa at webkit.org> 2012-03-15 12:46:18 PST ---
(From update of attachment 132101)
View in context: https://bugs.webkit.org/attachment.cgi?id=132101&action=review
> Source/WebCore/editing/visible_units.cpp:177
> + int previousBoxIndex = leafBoxesInLogicalOrder.size() - 1;
> + if (box) {
> + for (size_t i = 0; i < leafBoxesInLogicalOrder.size(); ++i) {
> + if (box == leafBoxesInLogicalOrder[i]) {
> + previousBoxIndex = i - 1;
> + break;
> + }
> + }
> + }
Maybe you can extract a function here (e.g. boxIndexInVector) and use it in nextBoxInLine as well? You can subtract/add 1 outside of the function, right?
> Source/WebCore/editing/visible_units.cpp:214
> + if (leafBoxesInLogicalOrder.size())
> + startBox = leafBoxesInLogicalOrder[0];
> + else
> + break;
I think it's better to do:
if (!leafBoxesInLogicalOrder.size())
break;
startBox = leafBoxesInLogicalOrder[0];
> Source/WebCore/editing/visible_units.cpp:274
> + if (leafBoxesInLogicalOrder.size())
> + startBox = leafBoxesInLogicalOrder[0];
> + else
> + break;
Ditto.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list