Skip to content

Fix ArrayIndexOutOfBoundsException in TreeItem.getBounds() on Cocoa - #3628

Open
ravnskjaer wants to merge 1 commit into
eclipse-platform:masterfrom
ravnskjaer:bug2749-treeitem-getbounds-cocoa
Open

ravnskjaer wants to merge 1 commit into
eclipse-platform:masterfrom
ravnskjaer:bug2749-treeitem-getbounds-cocoa

Conversation

@ravnskjaer

Copy link
Copy Markdown

getBounds() indexed cellFont with the physical NSOutlineView column, which shifts by 1 when SWT.CHECK adds a checkColumn. cellFont is sized by logical column count, causing an out-of-bounds read. getBounds() only reports the item's primary text, so read cellFont[0] unconditionally, matching existing methods
getImageBounds(int)/getTextBounds(int)/redraw(int).

Fixes #2749

A follow-up in eclipse.platform is needed to remove the now-unnecessary try/catch workaround in
BreakpointLabelAction.computeInlineEditorBounds().

getBounds() indexed cellFont with the physical NSOutlineView column,
which shifts by 1 when SWT.CHECK adds a checkColumn. cellFont is
sized by logical column count, causing an out-of-bounds read.
getBounds() only reports the item's primary text, so read cellFont[0]
unconditionally, matching existing methods
getImageBounds(int)/getTextBounds(int)/redraw(int).

Fixes eclipse-platform#2749

A follow-up in eclipse.platform is needed to remove the now-unnecessary
try/catch workaround in
BreakpointLabelAction.computeInlineEditorBounds().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mac] TreeItem.getBounds() throws ArrayIndexOutOfBoundsException for labelled breakpoints with custom fonts

1 participant