Commit d440697
committed
Do not set IME font if the font is disposed
Prior to PR eclipse-platform#2062, the hFont variable in Caret::setIMEFont was
retrieved directly from the font object (using font.handle). Since eclipse-platform#2602, hFont is
fetched via SWTFontProvider, which throws an exception if the font is disposed.
Previously, when the font was disposed, hFont (font.handle) would be zero, and the
method would fall back to using defaultFont for setting the IME font.
After eclipse-platform#2602, this fallback no longer works because the exception is
thrown before the fallback can occur.
This commit restores the intended behavior by setting hfont as zero if
the font is disposed, preventing the exception.
Fixes eclipse-platform#23231 parent 13934ee commit d440697
File tree
2 files changed
+19
-1
lines changed- bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets
- tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit
2 files changed
+19
-1
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
513 | 516 | | |
514 | 517 | | |
515 | 518 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
111 | 126 | | |
112 | 127 | | |
113 | 128 | | |
| |||
0 commit comments