- 
                Notifications
    You must be signed in to change notification settings 
- Fork 185
[win32] Fetch Font#handle through SWTFontProvider #2062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[win32] Fetch Font#handle through SWTFontProvider #2062
Conversation
| Test Results   539 files   -  6     539 suites   - 6   29m 30s ⏱️ + 3m 35s For more details on these failures, see this check. Results for commit 35c3b17. ± Comparison against base commit 807b159. This pull request removes 37 tests.♻️ This comment has been updated with latest results. | 
3737757    to
    fb0f2ec      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good, just minor comments
        
          
                bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/SWTFontProvider.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      fb0f2ec    to
    55af4cd      
    Compare
  
    This commit replaces several calls to Font#handle to use the SWTFontProvider instead. This assures the most Font reusage possible.
55af4cd    to
    35c3b17      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akoch-yatta I took the liberty of doing the changes myself. Approved ✔️
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#2323
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#2323
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#2323
This PR replaces most calls to Font#handle to use the SWTFontProvider instead. This assures the most Font reusage possible.