Skip to content

Commit 2a6fe0e

Browse files
committed
Fix Javadoc view not starting
Null values passed are preserved and sent to HTMLBuilder which sets them to default colors if needed. Enhance HTMLBuilder constructor to never allow null colors in it.
1 parent 6e19205 commit 2a6fe0e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

bundles/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ private static void installColorUpdater(final Display display) {
6363
}
6464

6565
private static org.eclipse.text.html.RGB fromRGB(RGB val) {
66+
// Preserve null RGB as HTMLBuilder contains the default colors and sets them accordingly
67+
// in case of null parameter passed
68+
if (val == null) {
69+
return null;
70+
}
6671
return new org.eclipse.text.html.RGB(val.red, val.green, val.blue);
6772
}
6873
private static void cacheColors(Display display) {

bundles/org.eclipse.text/src/org/eclipse/text/html/HTMLBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2018 IBM Corporation and others.
2+
* Copyright (c) 2000, 2024 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -53,10 +53,10 @@ public HTMLBuilder(RGB bg, RGB fg, RGB link, RGB alink) {
5353
}
5454

5555
public void setColors(RGB bg, RGB fg, RGB link, RGB alink) {
56-
this.bgColor = bg;
57-
this.fgColor = fg;
58-
this.linkColor = link;
59-
this.alinkColor = alink;
56+
this.bgColor = bg != null ? bg : DEFAULT_BG_COLOR_RGB;
57+
this.fgColor = fg != null ? fg : DEFAULT_FG_COLOR_RGB;
58+
this.linkColor = link != null ? link : DEFAULT_LINK_COLOR_RGB;
59+
this.alinkColor = alink != null ? alink : DEFAULT_ACTIVE_LINK_COLOR_RGB;
6060
}
6161

6262
private static String replace(String text, char c, String s) {

0 commit comments

Comments
 (0)