Community
Participate
Working Groups
When two font data objects are being compared, the FontData.getStyle() method compares only on BOLD and ITALIC. Therefore, if two font data objects are the same except one has underline (or strikeout) turned on and the other has it turned off, then the #getStyle won't be able to make the difference. In this case, the method #equals should then be used. I found a bug while I was playing with the font chooser in the debug>console preference page: 1- click on "change..." and modify the font by setting "underline" on 2- click "ok" in the font chooser and save the preference by clicking on "OK" 3- then come again to the preference page, click again on "change..." and set "underline" off 4- click "ok" in the font chooser and save the preference by clicking on "OK" 5- if you come again to the preference page and check the state of the font in the file chooser, you will notice that "underline" is still on... Actually, the PreferenceConverter.setValue(IPreferenceStore store, String name, FontData value) checks if the new and the old fonts are different, and if they are different, then it sets the new values. However, PreferenceConverter is using #getStyle to compare the 2 FontData, whereas it should use #equals to see that there is actually a difference. NOTES: KH (9/17/2001 12:45:35 PM) Moving to SWT for comment.
PRODUCT VERSION: Eclipse 0.125
getStyle is performing as expected.
It looks to me like this bug has disappeared. I'm running build 20020115 and I can't reproduce it. Any comments?
Changed code to use FontData.equals