summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlemb <wlemb>2001-02-08 08:41:35 +0000
committerwlemb <wlemb>2001-02-08 08:41:35 +0000
commit96dd0a6be58191247021ca6a046ed2b14b22d30f (patch)
tree51ca607a668e279ec7eb1358aad1b3dd41870e0e
parente0793ee992159af14e4399b16240befb5ef84e51 (diff)
downloadgroff-96dd0a6be58191247021ca6a046ed2b14b22d30f.tar.gz
* src/roff/troff/node.h (unbreakable_space_node, hmotion_node,
space_char_hmotion_node, overstrike_node): Add `get_hyphen_list()' and `add_self()' methods to avoid hyphenation. For example, the hyphen list for `foo00bar' was `foobar', causing insertion of a soft hyphen after `foo'. Now the hyphen list is correctly `foo<ignore><ignore>bar'.
-rw-r--r--ChangeLog9
-rw-r--r--src/roff/troff/env.cc2
-rw-r--r--src/roff/troff/node.cc57
-rw-r--r--src/roff/troff/node.h8
4 files changed, 74 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b8a66bb..21997571 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-02-08 Werner LEMBERG <wl@gnu.org>
+
+ * src/roff/troff/node.h (unbreakable_space_node, hmotion_node,
+ space_char_hmotion_node, overstrike_node): Add `get_hyphen_list()'
+ and `add_self()' methods to avoid hyphenation. For example, the
+ hyphen list for `foo\0\0bar' was `foobar', causing insertion of a
+ soft hyphen after `foo'. Now the hyphen list is correctly
+ `foo<ignore><ignore>bar'.
+
2001-02-05 Yoshiteru Kageyama <yt-kage@cb3.so-net.ne.jp>
* tmac/groff_tmac.man: Fix `BIR' macro.
diff --git a/src/roff/troff/env.cc b/src/roff/troff/env.cc
index 74f50df6..ffd692f9 100644
--- a/src/roff/troff/env.cc
+++ b/src/roff/troff/env.cc
@@ -3230,7 +3230,7 @@ void hyphen_trie::insert_pattern(const char *pat, int patlen, int *num)
void hyphen_trie::hyphenate(const char *word, int len, int *hyphens)
{
int j;
- for (j = 0; j < len+1; j++)
+ for (j = 0; j < len + 1; j++)
hyphens[j] = 0;
for (j = 0; j < len - 1; j++) {
h = hyphens + j;
diff --git a/src/roff/troff/node.cc b/src/roff/troff/node.cc
index a5cef413..89fc3679 100644
--- a/src/roff/troff/node.cc
+++ b/src/roff/troff/node.cc
@@ -3656,7 +3656,6 @@ void composite_node::ascii_print(ascii_output_file *ascii)
hyphen_list *composite_node::get_hyphen_list(hyphen_list *tail)
{
return new hyphen_list(ci->get_hyphenation_code(), tail);
-
}
node *composite_node::add_self(node *nn, hyphen_list **p)
@@ -4385,6 +4384,20 @@ int hmotion_node::force_tprint()
return 0;
}
+node *hmotion_node::add_self(node *n, hyphen_list **p)
+{
+ next = n;
+ hyphen_list *pp = *p;
+ *p = (*p)->next;
+ delete pp;
+ return this;
+}
+
+hyphen_list *hmotion_node::get_hyphen_list(hyphen_list *tail)
+{
+ return new hyphen_list(0, tail);
+}
+
int space_char_hmotion_node::same(node *nd)
{
return n == ((space_char_hmotion_node *)nd)->n;
@@ -4400,6 +4413,20 @@ int space_char_hmotion_node::force_tprint()
return 0;
}
+node *space_char_hmotion_node::add_self(node *n, hyphen_list **p)
+{
+ next = n;
+ hyphen_list *pp = *p;
+ *p = (*p)->next;
+ delete pp;
+ return this;
+}
+
+hyphen_list *space_char_hmotion_node::get_hyphen_list(hyphen_list *tail)
+{
+ return new hyphen_list(0, tail);
+}
+
int vmotion_node::same(node *nd)
{
return n == ((vmotion_node *)nd)->n;
@@ -4679,6 +4706,20 @@ int overstrike_node::force_tprint()
return 0;
}
+node *overstrike_node::add_self(node *n, hyphen_list **p)
+{
+ next = n;
+ hyphen_list *pp = *p;
+ *p = (*p)->next;
+ delete pp;
+ return this;
+}
+
+hyphen_list *overstrike_node::get_hyphen_list(hyphen_list *tail)
+{
+ return new hyphen_list(0, tail);
+}
+
int bracket_node::same(node *nd)
{
return same_node_list(list, ((bracket_node *)nd)->list);
@@ -4844,6 +4885,20 @@ const char *unbreakable_space_node::type()
return "unbreakable_space_node";
}
+node *unbreakable_space_node::add_self(node *n, hyphen_list **p)
+{
+ next = n;
+ hyphen_list *pp = *p;
+ *p = (*p)->next;
+ delete pp;
+ return this;
+}
+
+hyphen_list *unbreakable_space_node::get_hyphen_list(hyphen_list *tail)
+{
+ return new hyphen_list(0, tail);
+}
+
int diverted_space_node::same(node *nd)
{
return n == ((diverted_space_node *)nd)->n;
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index f8e99650..ebb53690 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -207,6 +207,8 @@ public:
int nbreaks();
void split(int, node **, node **);
int merge_space(hunits);
+ node *add_self(node *, hyphen_list **);
+ hyphen_list *get_hyphen_list(hyphen_list *ss = 0);
hyphenation_type get_hyphenation_type();
};
@@ -272,6 +274,8 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ node *add_self(node *, hyphen_list **);
+ hyphen_list *get_hyphen_list(hyphen_list *ss = 0);
hyphenation_type get_hyphenation_type();
};
@@ -284,6 +288,8 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ node *add_self(node *, hyphen_list **);
+ hyphen_list *get_hyphen_list(hyphen_list *ss = 0);
hyphenation_type get_hyphenation_type();
};
@@ -409,6 +415,8 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ node *add_self(node *, hyphen_list **);
+ hyphen_list *get_hyphen_list(hyphen_list *ss = 0);
hyphenation_type get_hyphenation_type();
};