mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +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:
parent
b3e4e60155
commit
fc8ed250b1
1 changed files with 2 additions and 8 deletions
|
@ -157,14 +157,8 @@ public class TextLineRenderer implements ILinelRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupGC(GC gc, Style style) {
|
private void setupGC(GC gc, Style style) {
|
||||||
Color c = fStyleMap.getForegrondColor(style);
|
gc.setForeground(fStyleMap.getForegrondColor(style));
|
||||||
if (c != gc.getForeground()) {
|
gc.setBackground(fStyleMap.getBackgroundColor(style));
|
||||||
gc.setForeground(c);
|
|
||||||
}
|
|
||||||
c = fStyleMap.getBackgroundColor(style);
|
|
||||||
if (c != gc.getBackground()) {
|
|
||||||
gc.setBackground(c);
|
|
||||||
}
|
|
||||||
Font f = fStyleMap.getFont(style);
|
Font f = fStyleMap.getFont(style);
|
||||||
if (f != gc.getFont()) {
|
if (f != gc.getFont()) {
|
||||||
gc.setFont(f);
|
gc.setFont(f);
|
||||||
|
|
Loading…
Add table
Reference in a new issue