1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Bug 540737: Remove false optimization

GC.getForeground / Background always create a new Color object,
so this if expression was always true.

Change-Id: Ief4ccaf1adb70967301411b012c0474608f425cb
This commit is contained in:
Jonah Graham 2020-05-01 20:33:05 -04:00
parent b3e4e60155
commit fc8ed250b1

View file

@ -157,14 +157,8 @@ public class TextLineRenderer implements ILinelRenderer {
}
private void setupGC(GC gc, Style style) {
Color c = fStyleMap.getForegrondColor(style);
if (c != gc.getForeground()) {
gc.setForeground(c);
}
c = fStyleMap.getBackgroundColor(style);
if (c != gc.getBackground()) {
gc.setBackground(c);
}
gc.setForeground(fStyleMap.getForegrondColor(style));
gc.setBackground(fStyleMap.getBackgroundColor(style));
Font f = fStyleMap.getFont(style);
if (f != gc.getFont()) {
gc.setFont(f);