RFR: 8369085: RichTextArea SELECT_PARAGRAPH to include line separator
Kevin Rushforth
kcr at openjdk.org
Mon Oct 20 23:03:15 UTC 2025
On Mon, 20 Oct 2025 21:28:48 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> RichTextArea.Tag.SELECT_PARAGRAPH or RichTextArea.selectParagraph() must include the trailing line separator (if present).
>
> This is a behavioral change, but a simple one (an obvious bug) - maybe one reviewer is sufficient. I don't think this needs a CSR.
I agree that this doesn't need a CSR. It seems a simple enough fix, but if @Ziad-Mid could test it that would help (or you can wait for me or @arapte to do it).
modules/jfx.incubator.richtext/src/main/java/com/sun/jfx/incubator/scene/control/richtext/RichTextAreaBehavior.java line 913:
> 911: int ix = p.index();
> 912: TextPos an = TextPos.ofLeading(ix, 0);
> 913: TextPos ca = TextPos.ofLeading(ix + 1, 0);
~~Will this work if you select the last paragraph in the RTA? You'll be calling `TextPos.ofLeading` with a paragraph index that is out of range, but maybe it handles it?~~
I see you added a test for just this case. Good.
-------------
PR Review: https://git.openjdk.org/jfx/pull/1940#pullrequestreview-3358169202
PR Review Comment: https://git.openjdk.org/jfx/pull/1940#discussion_r2446309517
More information about the openjfx-dev
mailing list