gbranden pushed a commit to branch master
in repository groff.

commit 6ed1ca26119252600339d5c13f2714a3770b8982
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu May 15 15:00:02 2025 -0500

    [troff]: Boolify and rename `is_printing()`.
    
    Boolify member function of `output_file` class that indicates whether
    the current page is selected for printing (as with troff's `-o` option.
    
    * src/roff/troff/node.h (class output_put): Demote member function
      `is_printing` from `int` to `bool`, and rename it to
      `is_selected_for_printing`.
    
    * src/roff/troff/node.cpp (class real_output_file): Update declaration
      and definition accordingly in derived class.
---
 ChangeLog               | 12 ++++++++++++
 src/roff/troff/node.cpp |  6 +++---
 src/roff/troff/node.h   |  2 +-
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 307007e01..9111bb513 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2025-05-15  G. Branden Robinson <[email protected]>
+
+       [troff]: Boolify member function of `output_file` class that
+       indicates whether the current page is selected for printing (as
+       with troff's `-o` option.
+
+       * src/roff/troff/node.h (class output_put): Demote
+       member function `is_printing` from `int` to `bool`, and rename
+       it to `is_selected_for_printing`.
+       * src/roff/troff/node.cpp (class real_output_file): Update
+       declaration and definition accordingly in derived class.
+
 2025-05-16  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/node.cpp (real_output_file::on): Comment out
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 79996071e..f5051949a 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -769,7 +769,7 @@ public:
   void on();
   void off();
   bool is_on();
-  int is_printing();
+  bool is_selected_for_printing();
   void copy_file(hunits x, vunits y, const char *filename);
 };
 
@@ -1778,7 +1778,7 @@ void real_output_file::flush()
   }
 }
 
-int real_output_file::is_printing()
+bool real_output_file::is_selected_for_printing()
 {
   return printing;
 }
@@ -7348,7 +7348,7 @@ public:
 const char *printing_reg::get_string()
 {
   if (the_output)
-    return the_output->is_printing() ? "1" : "0";
+    return the_output->is_selected_for_printing() ? "1" : "0";
   else
     return "0";
 }
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index 8f18319d4..a22c2084d 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -709,7 +709,7 @@ public:
                          hunits width) = 0;
   virtual void begin_page(int pageno, vunits page_length) = 0;
   virtual void copy_file(hunits x, vunits y, const char *filename) = 0;
-  virtual int is_printing() = 0;
+  virtual bool is_selected_for_printing() = 0;
   virtual void put_filename(const char *, int);
   virtual void on();
   virtual void off();

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to