Commit 7f19dc5
[Win32] Do not set IME font if the font is disposed #2323
Prior to recent changes that ensure that a font handle is always
retrieved via the SWTFontProvider, the hFont variable in
Caret::setIMEFont was retrieved directly from the font object (using
font.handle). Since those recent changes, 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. Now, 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 #23231 parent e8aadbb commit 7f19dc5
File tree
2 files changed
+14
-0
lines changed- bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal
- tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit
2 files changed
+14
-0
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
Lines changed: 11 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 | + | |
111 | 122 | | |
112 | 123 | | |
113 | 124 | | |
| |||
0 commit comments