| Summary: | CTabFolder's getWrappedHeight(Point) method creates a GC for no reason | ||
|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Remy Suen <remy.suen> |
| Component: | UI | Assignee: | Project Inbox <e4.ui-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | gheorghe |
| Version: | 1.0 | ||
| Target Milestone: | 4.1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Fixed in HEAD > 20110426 |
It's not clear to me why a GC is created and then disposed. int getWrappedHeight (Point size) { boolean[][] positions = new boolean[1][]; GC gc = new GC(this); Rectangle[] rects = computeControlBounds(size, positions); gc.dispose(); int minY = Integer.MAX_VALUE, maxY = 0, wrapHeight = 0; for (int i = 0; i < rects.length; i++) { if (positions[0][i]) { minY = Math.min(minY, rects[i].y); maxY = Math.max(maxY, rects[i].y + rects[i].height); wrapHeight = maxY - minY; } } return wrapHeight; }