|
@@ -685,14 +685,17 @@ public class Styliser implements ConfigChangeListener {
|
685
|
685
|
attribs.addAttribute(StyleConstants.FontConstants.Underline, Boolean.TRUE);
|
686
|
686
|
}
|
687
|
687
|
|
688
|
|
- final Object foreground = attribs.getAttribute(StyleConstants.FontConstants.Foreground);
|
|
688
|
+ if (colour != null) {
|
|
689
|
+ final Object foreground = attribs.getAttribute(
|
|
690
|
+ StyleConstants.FontConstants.Foreground);
|
689
|
691
|
|
690
|
|
- if (foreground != null) {
|
691
|
|
- attribs.addAttribute("restoreColour", foreground);
|
692
|
|
- attribs.removeAttribute(StyleConstants.FontConstants.Foreground);
|
693
|
|
- }
|
|
692
|
+ if (foreground != null) {
|
|
693
|
+ attribs.addAttribute("restoreColour", foreground);
|
|
694
|
+ attribs.removeAttribute(StyleConstants.FontConstants.Foreground);
|
|
695
|
+ }
|
694
|
696
|
|
695
|
|
- attribs.addAttribute(StyleConstants.FontConstants.Foreground, colour);
|
|
697
|
+ attribs.addAttribute(StyleConstants.FontConstants.Foreground, colour);
|
|
698
|
+ }
|
696
|
699
|
|
697
|
700
|
} else {
|
698
|
701
|
// Remove the hyperlink style
|
|
@@ -703,11 +706,13 @@ public class Styliser implements ConfigChangeListener {
|
703
|
706
|
attribs.removeAttribute(StyleConstants.FontConstants.Underline);
|
704
|
707
|
}
|
705
|
708
|
|
706
|
|
- attribs.removeAttribute(StyleConstants.FontConstants.Foreground);
|
707
|
|
- final Object foreground = attribs.getAttribute("restoreColour");
|
708
|
|
- if (foreground != null) {
|
709
|
|
- attribs.addAttribute(StyleConstants.FontConstants.Foreground, foreground);
|
710
|
|
- attribs.removeAttribute("restoreColour");
|
|
709
|
+ if (colour != null) {
|
|
710
|
+ attribs.removeAttribute(StyleConstants.FontConstants.Foreground);
|
|
711
|
+ final Object foreground = attribs.getAttribute("restoreColour");
|
|
712
|
+ if (foreground != null) {
|
|
713
|
+ attribs.addAttribute(StyleConstants.FontConstants.Foreground, foreground);
|
|
714
|
+ attribs.removeAttribute("restoreColour");
|
|
715
|
+ }
|
711
|
716
|
}
|
712
|
717
|
}
|
713
|
718
|
}
|