diff options
author | wlemb <wlemb> | 2001-12-14 21:48:29 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2001-12-14 21:48:29 +0000 |
commit | ca27e549c3d738b0903c1b778aae6713a709196d (patch) | |
tree | db7fbc67afed004c691e55d7f3173f54a7405d09 | |
parent | bf92940ab65a970940ffcc47a943ebec17750c88 (diff) | |
download | groff-ca27e549c3d738b0903c1b778aae6713a709196d.tar.gz |
* src/roff/troff/input.cc (default_black): Define default color
`black' if not yet defined.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/roff/troff/input.cc | 15 |
2 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2001-12-14 Werner LEMBERG <wl@gnu.org> + + * src/roff/troff/input.cc (default_black): Define default color + `black' if not yet defined. + 2001-12-13 Werner LEMBERG <wl@gnu.org> Implement new string-valued register `.fn' to return the current diff --git a/src/roff/troff/input.cc b/src/roff/troff/input.cc index b145a218..1baeea24 100644 --- a/src/roff/troff/input.cc +++ b/src/roff/troff/input.cc @@ -1026,8 +1026,19 @@ static color *lookup_color(symbol nm) static color *default_black(color *c) { - if (c == 0) - return lookup_color(symbol("black")); + symbol b = symbol("black"); + if (c == 0) { + color *black = (color *)color_dictionary.lookup(b); + if (black == 0) { + warning(WARN_COLOR, "default color `black' not defined"); + color *tem = new color; + tem->set_cmyk((unsigned int)0, (unsigned int)0, + (unsigned int)0, (unsigned int)0); + return (color *)color_dictionary.lookup(b, tem); + } + else + return black; + } else return c; } |