gbranden pushed a commit to branch master
in repository groff.
commit 961191d3d1a6619536b2bcfad8156b22b2aa79ba
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Sep 10 07:13:36 2025 -0500
src/roff/troff/node.cpp: Slightly refactor.
* src/roff/troff/node.cpp (class charinfo_node): Make class more
obviously abstract--the obvious intention of the hierarchy--by
annotating it and marking member functions (apart from the
constructor) as `virtual`.
---
ChangeLog | 7 +++++++
src/roff/troff/node.cpp | 9 +++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f1a24324a..e7d2cf008 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-09-09 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/node.cpp (class charinfo_node): Make class more
+ obviously abstract--the obvious intention of the hierarchy--by
+ annotating it and marking member functions (apart from the
+ constructor) as `virtual`.
+
2025-09-07 G. Branden Robinson <[email protected]>
* src/roff/groff/tests/asciify-request-works.sh: Add test cases
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index ad7613e24..e5bdb6100 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -1913,15 +1913,16 @@ void
suppress_output_file::really_transparent_char(unsigned char)
/* glyphs, ligatures, kerns, discretionary breaks */
+// abstract
class charinfo_node : public node {
protected:
charinfo *ci;
public:
charinfo_node(charinfo *, statem *, int, node * = 0 /* nullptr */);
- int ends_sentence();
- bool overlaps_vertically();
- bool overlaps_horizontally();
- void dump_properties();
+ virtual int ends_sentence();
+ virtual bool overlaps_vertically();
+ virtual bool overlaps_horizontally();
+ virtual void dump_properties();
};
charinfo_node::charinfo_node(charinfo *c, statem *s, int divlevel,
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit