Project: Eclipse_Platform_UI
Bug 4729 PreferenceConverter#setValue does not check for "underline" or "strikeout" (1GFJ5UF)
Reported: 2001-10-11 14:22:00 | Status: resolved fixed

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.

Files changed in fix:
bundles/org.eclipse.ui/Eclipse JFace/org/eclipse/jface/preference/PreferenceConverter.java