texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/convert/convert_html.c (add_tree_


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/convert/convert_html.c (add_tree_to_build) (remove_tree_to_build): add functions to add/remove an element to self->tree_to_build. add/remove to tree_to_build only if self->external_references_number > 0.
Date: Wed, 13 Mar 2024 17:47:57 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 7ccc356550 * tp/Texinfo/XS/convert/convert_html.c (add_tree_to_build) 
(remove_tree_to_build): add functions to add/remove an element to 
self->tree_to_build.  add/remove to tree_to_build only if 
self->external_references_number > 0.
7ccc356550 is described below

commit 7ccc356550b3afffacbe5f58264a361dfad66151
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Mar 13 22:48:01 2024 +0100

    * tp/Texinfo/XS/convert/convert_html.c (add_tree_to_build)
    (remove_tree_to_build): add functions to add/remove an element to
    self->tree_to_build.  add/remove to tree_to_build only if
    self->external_references_number > 0.
---
 ChangeLog                            |   7 ++
 tp/Texinfo/XS/convert/convert_html.c | 196 ++++++++++++++++++-----------------
 2 files changed, 106 insertions(+), 97 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d860242a7d..3e3e16c067 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-03-13  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/convert/convert_html.c (add_tree_to_build)
+       (remove_tree_to_build): add functions to add/remove an element to
+       self->tree_to_build.  add/remove to tree_to_build only if
+       self->external_references_number > 0.
+
 2024-03-13  Patrice Dumas  <pertusus@free.fr>
 
        * po/Makevars (XGETTEXT_OPTIONS): fix message_list_document_* options.
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index d07dcede68..fa8eb62ab5 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -672,6 +672,20 @@ html_pcdt_tree (const char *translation_context, const 
char *string,
                         translation_context);
 }
 
+static void
+add_tree_to_build (CONVERTER *self, ELEMENT *e)
+{
+  if (self->external_references_number > 0)
+    add_to_element_list (&self->tree_to_build, e);
+}
+
+static void
+remove_tree_to_build (CONVERTER *self, ELEMENT *e)
+{
+  if (self->external_references_number > 0)
+    remove_element_from_list (&self->tree_to_build, e);
+}
+
 static void
 translate_convert_to_html_internal (const char *string,
                CONVERTER *self,
@@ -682,9 +696,9 @@ translate_convert_to_html_internal (const char *string,
   ELEMENT *translation_tree = html_cdt_tree (string, self,
                            replaced_substrings, translation_context);
 
-  add_to_element_list (&self->tree_to_build, translation_tree);
+  add_tree_to_build (self, translation_tree);
   convert_to_html_internal (self, translation_tree, result, explanation);
-  remove_element_from_list (&self->tree_to_build, translation_tree);
+  remove_tree_to_build (self, translation_tree);
 
   destroy_element_and_children (translation_tree);
 }
@@ -1026,8 +1040,7 @@ special_unit_info_tree (CONVERTER *self, const enum 
special_unit_info_tree type,
             = html_pcdt_tree (translation_context, special_unit_info_string,
                               self, 0);
           free (translation_context);
-          add_to_element_list (&self->tree_to_build,
-                               self->special_unit_info_tree[type][i]);
+          add_tree_to_build (self, self->special_unit_info_tree[type][i]);
           return self->special_unit_info_tree[type][i];
         }
     }
@@ -2908,13 +2921,12 @@ direction_string (CONVERTER *self, int direction,
                     direction_string_type_names[string_type],
                     direction_string_context_names[context], direction_name);
 
-          add_to_element_list (&self->tree_to_build, converted_tree);
-
+          add_tree_to_build (self, converted_tree);
           result_string
             = convert_tree_new_formatting_context (self, converted_tree,
                                   context_str, 0, context_str, 0);
 
-          remove_element_from_list (&self->tree_to_build, converted_tree);
+          remove_tree_to_build (self, converted_tree);
           free (context_str);
 
           if (context == TDS_context_string)
@@ -3793,13 +3805,13 @@ html_internal_command_tree (CONVERTER *self, const 
ELEMENT *command,
               ELEMENT *root_code = new_element_added (tree, ET__code);
               add_to_contents_as_array (root_code, command->args.list[0]);
               tree->tree = root_code;
-              add_to_element_list (&self->tree_to_build, tree->tree);
+              add_tree_to_build (self, tree->tree);
             }
           else if (command->cmd == CM_float)
             {
               tree->tree = float_type_number (self, command);
               tree->status = tree_added_status_new_tree;
-              add_to_element_list (&self->tree_to_build, tree->tree);
+              add_tree_to_build (self, tree->tree);
             }
           else if (command->args.number <= 0
                    || command->args.list[0]->contents.number <= 0)
@@ -3845,7 +3857,7 @@ html_internal_command_tree (CONVERTER *self, const 
ELEMENT *command,
 
                   destroy_named_string_element_list (replaced_substrings);
                   tree->status = tree_added_status_new_tree;
-                  add_to_element_list (&self->tree_to_build, tree->tree);
+                  add_tree_to_build (self, tree->tree);
                 }
               else
                 {
@@ -3896,7 +3908,7 @@ html_external_command_tree (CONVERTER *self, const 
ELEMENT *command,
     add_to_contents_as_array (root_code, node_content);
 
   tree->tree = root_code;
-  add_to_element_list (&self->tree_to_build, root_code);
+  add_tree_to_build (self, tree->tree);
   return tree;
 }
 
@@ -3968,7 +3980,7 @@ html_internal_command_text (CONVERTER *self, const 
ELEMENT *command,
             {
               tree_root = new_element (ET__string);
               add_to_contents_as_array (tree_root, selected_tree);
-              add_to_element_list (&self->tree_to_build, tree_root);
+              add_tree_to_build (self, tree_root);
             }
           else
             tree_root = selected_tree;
@@ -3988,7 +4000,7 @@ html_internal_command_text (CONVERTER *self, const 
ELEMENT *command,
 
           if (type == HTT_string)
             {
-              remove_element_from_list (&self->tree_to_build, tree_root);
+              remove_tree_to_build (self, tree_root);
               destroy_element (tree_root);
             }
           return strdup (target_info->command_text[type]);
@@ -4027,7 +4039,7 @@ html_command_text (CONVERTER *self, const ELEMENT 
*command,
         {
           tree_root = new_element (ET__string);
           add_to_contents_as_array (tree_root, command_tree->tree);
-          add_to_element_list (&self->tree_to_build, tree_root);
+          add_tree_to_build (self, tree_root);
         }
       else
         tree_root = command_tree->tree;
@@ -4055,7 +4067,7 @@ html_command_text (CONVERTER *self, const ELEMENT 
*command,
 
       if (type == HTT_string)
         {
-          remove_element_from_list (&self->tree_to_build, tree_root);
+          remove_tree_to_build (self, tree_root);
           destroy_element (tree_root);
         }
       destroy_tree_added_elements (self, command_tree);
@@ -6568,9 +6580,9 @@ html_default_format_program_string (CONVERTER *self, TEXT 
*result)
       tree = html_cdt_tree ("This document was generated on @emph{@today{}}.",
                             self, 0, 0);
     }
-  add_to_element_list (&self->tree_to_build, tree);
+  add_tree_to_build (self, tree);
   convert_to_html_internal (self, tree, result, 0);
-  remove_element_from_list (&self->tree_to_build, tree);
+  remove_tree_to_build (self, tree);
   destroy_element_and_children (tree);
 }
 
@@ -6670,9 +6682,9 @@ html_default_format_end_file (CONVERTER *self, const char 
*filename,
 
               tree = html_cdt_tree ("JavaScript license information",
                                      self, 0, 0);
-              add_to_element_list (&self->tree_to_build, tree);
+              add_tree_to_build (self, tree);
               convert_to_html_internal (self, tree, &result, 0);
-              remove_element_from_list (&self->tree_to_build, tree);
+              remove_tree_to_build (self, tree);
 
               destroy_element_and_children (tree);
 
@@ -6738,12 +6750,12 @@ convert_string_tree_new_formatting_context (CONVERTER 
*self, ELEMENT *tree,
 
   add_to_contents_as_array (tree_root_string, tree);
 
-  add_to_element_list (&self->tree_to_build, tree_root_string);
+  add_tree_to_build (self, tree_root_string);
 
   result = convert_tree_new_formatting_context (self, tree_root_string,
                                        context_string, multiple_pass, 0, 0);
 
-  remove_element_from_list (&self->tree_to_build, tree_root_string);
+  remove_tree_to_build (self, tree_root_string);
   destroy_element (tree_root_string);
   return result;
 }
@@ -6932,7 +6944,7 @@ file_header_information (CONVERTER *self, const ELEMENT 
*command,
 
           destroy_named_string_element_list (substrings);
 
-          add_to_element_list (&self->tree_to_build, title_tree);
+          add_tree_to_build (self, title_tree);
 
           if (command->cmd)
             xasprintf (&context_str, "file_header_title-element-@%s",
@@ -6949,7 +6961,7 @@ file_header_information (CONVERTER *self, const ELEMENT 
*command,
                           "element_title");
 
           free (context_str);
-          remove_element_from_list (&self->tree_to_build, title_tree);
+          remove_tree_to_build (self, title_tree);
           destroy_element_and_children (title_tree);
         }
       free (command_string);
@@ -8445,11 +8457,11 @@ convert_today_command (CONVERTER *self, const enum 
command_id cmd,
 {
   ELEMENT *today_element = expand_today (self->conf);
 
-  add_to_element_list (&self->tree_to_build, today_element);
+  add_tree_to_build (self, today_element);
 
   convert_to_html_internal (self, today_element, result, "convert today");
 
-  remove_element_from_list (&self->tree_to_build, today_element);
+  remove_tree_to_build (self, today_element);
   destroy_element_and_children (today_element);
 }
 
@@ -8575,9 +8587,9 @@ convert_value_command (CONVERTER *self, const enum 
command_id cmd,
   tree = html_cdt_tree ("@{No value for `{value}'@}",
                         self, substrings, 0);
 
-  add_to_element_list (&self->tree_to_build, tree);
+  add_tree_to_build (self, tree);
   convert_to_html_internal (self, tree, result, 0);
-  remove_element_from_list (&self->tree_to_build, tree);
+  remove_tree_to_build (self, tree);
 
   destroy_element_and_children (tree);
 
@@ -8804,9 +8816,9 @@ convert_explained_command (CONVERTER *self, const enum 
command_id cmd,
 
       xasprintf (&context_str, "convert explained  %s",
                  builtin_command_name (cmd));
-      add_to_element_list (&self->tree_to_build, tree);
+      add_tree_to_build (self, tree);
       convert_to_html_internal (self, tree, result, context_str);
-      remove_element_from_list (&self->tree_to_build, tree);
+      remove_tree_to_build (self, tree);
       free (context_str);
       /* should destroy explained_*_element */
       destroy_element_and_children (tree);
@@ -9959,11 +9971,10 @@ convert_heading_command (CONVERTER *self, const enum 
command_id cmd,
 
                   if (menu_node)
                     {
-                      add_to_element_list (&self->tree_to_build, menu_node);
+                      add_tree_to_build (self, menu_node);
                       convert_to_html_internal (self, menu_node,
                                                 &mini_toc_or_auto_menu, 0);
-                      remove_element_from_list (&self->tree_to_build,
-                                                menu_node);
+                      remove_tree_to_build (self, menu_node);
                       /* there are only new or copied elements in the menu */
                       destroy_element_and_children (menu_node);
                     }
@@ -10600,11 +10611,10 @@ convert_verbatiminclude_command (CONVERTER *self, 
const enum command_id cmd,
 
   if (verbatim_include_verbatim)
     {
-      add_to_element_list (&self->tree_to_build, verbatim_include_verbatim);
+      add_tree_to_build (self, verbatim_include_verbatim);
       convert_to_html_internal (self, verbatim_include_verbatim,
                                 result, "convert verbatiminclude");
-      remove_element_from_list (&self->tree_to_build,
-                                verbatim_include_verbatim);
+      remove_tree_to_build (self, verbatim_include_verbatim);
       destroy_element_and_children (verbatim_include_verbatim);
     }
 }
@@ -11098,11 +11108,12 @@ convert_float_command (CONVERTER *self, const enum 
command_id cmd,
       if (prepended)
         {
           char *prepended_text;
-          add_to_element_list (&self->tree_to_build, prepended);
+          add_tree_to_build (self, prepended);
           prepended_text
             = convert_tree_new_formatting_context (self, prepended,
                                             "float prepended", 0, 0, 0);
-          remove_element_from_list (&self->tree_to_build, prepended);
+
+          remove_tree_to_build (self, prepended);
           destroy_element_and_children (prepended);
           if (prepended_text)
             {
@@ -11155,10 +11166,10 @@ convert_float_command (CONVERTER *self, const enum 
command_id cmd,
       add_to_element_args (strong_element, args);
       add_to_element_contents (args, prepended);
 
-      add_to_element_list (&self->tree_to_build, strong_element);
+      add_tree_to_build (self, strong_element);
       prepended_text = convert_tree_new_formatting_context (self,
                         strong_element, "float number type", 0, 0, 0);
-      remove_element_from_list (&self->tree_to_build, strong_element);
+      remove_tree_to_build (self, strong_element);
 
       destroy_element_and_children (strong_element);
 
@@ -11780,7 +11791,7 @@ convert_item_command (CONVERTER *self, const enum 
command_id cmd,
           tree = table_item_content_tree (self, element);
           if (tree)
             {
-              add_to_element_list (&self->tree_to_build, tree->tree);
+              add_tree_to_build (self, tree->tree);
               converted_e = tree->tree;
             }
           else
@@ -12134,9 +12145,9 @@ convert_xref_commands (CONVERTER *self, const enum 
command_id cmd,
 
           add_to_contents_as_array (root_code, manual_content);
 
-          add_to_element_list (&self->tree_to_build, root_code);
+          add_tree_to_build (self, root_code);
           file = html_convert_tree (self, root_code, "node file in ref");
-          remove_element_from_list (&self->tree_to_build, root_code);
+          remove_tree_to_build (self, root_code);
           destroy_element (root_code);
         }
 
@@ -12150,10 +12161,10 @@ convert_xref_commands (CONVERTER *self, const enum 
command_id cmd,
                   ELEMENT *node_no_file_tree = new_element (ET__code);
                   add_to_contents_as_array (node_no_file_tree, node_content);
 
-                  add_to_element_list (&self->tree_to_build, 
node_no_file_tree);
+                  add_tree_to_build (self, node_no_file_tree);
                   node_name = html_convert_tree (self, node_no_file_tree,
                                                  "node in ref");
-                  remove_element_from_list (&self->tree_to_build, 
node_no_file_tree);
+                  remove_tree_to_build (self, node_no_file_tree);
                   destroy_element (node_no_file_tree);
 
                   if (node_name && strcmp (node_name, "Top"))
@@ -12365,9 +12376,9 @@ convert_xref_commands (CONVERTER *self, const enum 
command_id cmd,
     {
       char *context_str;
       xasprintf (&context_str, "convert xref %s", builtin_command_name (cmd));
-      add_to_element_list (&self->tree_to_build, tree);
+      add_tree_to_build (self, tree);
       convert_to_html_internal (self, tree, result, context_str);
-      remove_element_from_list (&self->tree_to_build, tree);
+      remove_tree_to_build (self, tree);
       free (context_str);
       /* should destroy reference_element and book_element */
       destroy_element_and_children (tree);
@@ -12775,8 +12786,7 @@ convert_printindex_command (CONVERTER *self, const enum 
command_id cmd,
                              "index %s l %s index entry %zu subentry %d",
                              index_name, letter, entry_nr -1, level);
                   if (level > 0)
-                    add_to_element_list (&self->tree_to_build,
-                                         entry_trees[level]);
+                    add_tree_to_build (self, entry_trees[level]);
                   if (*formatted_index_entry_nr > 1)
                     {
                       /* call with multiple_pass argument */
@@ -12791,8 +12801,7 @@ convert_printindex_command (CONVERTER *self, const enum 
command_id cmd,
                     }
                   if (level > 0)
                     {
-                      remove_element_from_list (&self->tree_to_build,
-                                                entry_trees[level]);
+                      remove_tree_to_build (self, entry_trees[level]);
                       destroy_element (entry_trees[level]);
                     }
                   free (convert_info);
@@ -12885,7 +12894,7 @@ convert_printindex_command (CONVERTER *self, const enum 
command_id cmd,
                   xasprintf (&convert_info,
                              "index %s l %s index entry %zu seeentry",
                              index_name, letter, entry_nr -1);
-                  add_to_element_list (&self->tree_to_build, result_tree);
+                  add_tree_to_build (self, result_tree);
                   if (*formatted_index_entry_nr > 1)
                     {
                       /* call with multiple_pass argument */
@@ -12897,7 +12906,7 @@ convert_printindex_command (CONVERTER *self, const enum 
command_id cmd,
                       entry = html_convert_tree (self, result_tree,
                                                  convert_info);
                     }
-                  remove_element_from_list (&self->tree_to_build, result_tree);
+                  remove_tree_to_build (self, result_tree);
                   destroy_element_and_children (result_tree);
                   free (convert_info);
 
@@ -12924,8 +12933,8 @@ convert_printindex_command (CONVERTER *self, const enum 
command_id cmd,
                              "index %s l %s index entry %zu seealso",
                              index_name, letter, entry_nr -1);
 
-                  add_to_element_list (&self->tree_to_build, entry_tree);
-                  add_to_element_list (&self->tree_to_build, reference_tree);
+                  add_tree_to_build (self, entry_tree);
+                  add_tree_to_build (self, reference_tree);
                   if (*formatted_index_entry_nr > 1)
                     {
                       /* call with multiple_pass argument */
@@ -12943,10 +12952,8 @@ convert_printindex_command (CONVERTER *self, const 
enum command_id cmd,
                       reference = html_convert_tree (self, reference_tree,
                                                     conv_str_reference);
                     }
-                  remove_element_from_list (&self->tree_to_build,
-                                            reference_tree);
-                  remove_element_from_list (&self->tree_to_build,
-                                            entry_tree);
+                  remove_tree_to_build (self, entry_tree);
+                  remove_tree_to_build (self, reference_tree);
                   destroy_element_and_children (reference_tree);
 
                   free (conv_str_entry);
@@ -13006,7 +13013,7 @@ convert_printindex_command (CONVERTER *self, const enum 
command_id cmd,
                          index_name, letter, entry_nr -1);
 
               if (last_entry_level > 0)
-                 add_to_element_list (&self->tree_to_build, entry_tree);
+                add_tree_to_build (self, entry_tree);
               if (*formatted_index_entry_nr > 1)
                 {
                   /* call with multiple_pass argument */
@@ -13020,9 +13027,7 @@ convert_printindex_command (CONVERTER *self, const enum 
command_id cmd,
                                              convert_info);
                 }
               if (last_entry_level > 0)
-                {
-                  remove_element_from_list (&self->tree_to_build, entry_tree);
-                }
+                remove_tree_to_build (self, entry_tree);
               free (convert_info);
 
               if (last_entry_level == 0
@@ -13247,11 +13252,10 @@ convert_printindex_command (CONVERTER *self, const 
enum command_id cmd,
               xasprintf (&explanation, "index letter %s command", letter);
               if (formatted_command)
                 {
-                  add_to_element_list (&self->tree_to_build, 
formatted_command);
+                  add_tree_to_build (self, formatted_command);
                   formatted_letter
                     = html_convert_tree (self, formatted_command, explanation);
-                  remove_element_from_list (&self->tree_to_build,
-                                           formatted_command);
+                  remove_tree_to_build (self, formatted_command);
                   destroy_element (formatted_command);
                 }
               else
@@ -13723,10 +13727,10 @@ open_quotation_command (CONVERTER *self, const enum 
command_id cmd,
                            self, substrings, 0);
       destroy_named_string_element_list (substrings);
       xasprintf (&explanation, "open %s prepended arg", cmdname);
-      add_to_element_list (&self->tree_to_build, tree);
+      add_tree_to_build (self, tree);
       formatted_quotation_arg_to_prepend
         = html_convert_tree (self, tree, explanation);
-      remove_element_from_list (&self->tree_to_build, tree);
+      remove_tree_to_build (self, tree);
       destroy_element_and_children (tree);
       free (explanation);
     }
@@ -14337,12 +14341,12 @@ convert_menu_entry_type (CONVERTER *self, const enum 
element_type type,
 
           add_to_contents_as_array (root_code, menu_entry_node);
 
-          add_to_element_list (&self->tree_to_build, root_code);
+          add_tree_to_build (self, root_code);
 
           convert_to_html_internal (self, root_code, result,
                                "menu_arg menu_entry_node preformatted");
 
-          remove_element_from_list (&self->tree_to_build, root_code);
+          remove_tree_to_build (self, root_code);
 
           destroy_element (root_code);
 
@@ -14379,7 +14383,7 @@ convert_menu_entry_type (CONVERTER *self, const enum 
element_type type,
             {
               description_element = new_element (ET_NONE);
               description_element->contents = node_description->contents;
-              add_to_element_list (&self->tree_to_build, description_element);
+              add_tree_to_build (self, description_element);
             }
 
           description
@@ -14397,8 +14401,7 @@ convert_menu_entry_type (CONVERTER *self, const enum 
element_type type,
             free (multiple_formatted);
           if (node_description->cmd != CM_nodedescription)
             {
-              remove_element_from_list (&self->tree_to_build,
-                                        description_element);
+              remove_tree_to_build (self, description_element);
               description_element->contents.list = 0;
               destroy_element (description_element);
             }
@@ -14469,12 +14472,12 @@ convert_menu_entry_type (CONVERTER *self, const enum 
element_type type,
 
                   add_to_contents_as_array (root_code, node_content);
 
-                  add_to_element_list (&self->tree_to_build, root_code);
+                  add_tree_to_build (self, root_code);
 
                   name = html_convert_tree (self, root_code,
                                             "menu_arg name");
 
-                  remove_element_from_list (&self->tree_to_build, root_code);
+                  remove_tree_to_build (self, root_code);
 
                   destroy_element (root_code);
                 }
@@ -14540,7 +14543,7 @@ convert_menu_entry_type (CONVERTER *self, const enum 
element_type type,
             {
               description_element = new_element (ET_NONE);
               description_element->contents = node_description->contents;
-              add_to_element_list (&self->tree_to_build, description_element);
+              add_tree_to_build (self, description_element);
             }
 
           description
@@ -14552,8 +14555,7 @@ convert_menu_entry_type (CONVERTER *self, const enum 
element_type type,
             free (multiple_formatted);
           if (node_description->cmd != CM_nodedescription)
             {
-              remove_element_from_list (&self->tree_to_build,
-                                        description_element);
+              remove_tree_to_build (self, description_element);
               description_element->contents.list = 0;
               destroy_element (description_element);
             }
@@ -14797,11 +14799,11 @@ convert_def_line_type (CONVERTER *self, const enum 
element_type type,
 
       add_to_contents_as_array (root_code, parsed_def->type);
 
-      add_to_element_list (&self->tree_to_build, root_code);
+      add_tree_to_build (self, root_code);
 
       type_text = html_convert_tree (self, root_code, 0);
 
-      remove_element_from_list (&self->tree_to_build, root_code);
+      remove_tree_to_build (self, root_code);
 
       destroy_element (root_code);
       type_text_len = strlen (type_text);
@@ -14836,7 +14838,7 @@ convert_def_line_type (CONVERTER *self, const enum 
element_type type,
 
       add_to_contents_as_array (root_code, parsed_def->name);
 
-      add_to_element_list (&self->tree_to_build, root_code);
+      add_tree_to_build (self, root_code);
 
       text_append (&def_call, attribute_class);
       free (attribute_class);
@@ -14844,7 +14846,7 @@ convert_def_line_type (CONVERTER *self, const enum 
element_type type,
 
       convert_to_html_internal (self, root_code, &def_call, 0);
 
-      remove_element_from_list (&self->tree_to_build, root_code);
+      remove_tree_to_build (self, root_code);
       destroy_element (root_code);
 
       text_append_n (&def_call, "</strong>", 9);
@@ -14863,11 +14865,11 @@ convert_def_line_type (CONVERTER *self, const enum 
element_type type,
 
           add_to_contents_as_array (root_code, parsed_def->args);
 
-          add_to_element_list (&self->tree_to_build, root_code);
+          add_tree_to_build (self, root_code);
 
           args_formatted = html_convert_tree (self, root_code, 0);
 
-          remove_element_from_list (&self->tree_to_build, root_code);
+          remove_tree_to_build (self, root_code);
           destroy_element (root_code);
 
           if (args_formatted[strspn (args_formatted, whitespace_chars)] != 
'\0')
@@ -14940,9 +14942,9 @@ convert_def_line_type (CONVERTER *self, const enum 
element_type type,
 
       if (category_tree)
         {
-          add_to_element_list (&self->tree_to_build, category_tree);
+          add_tree_to_build (self, category_tree);
           convert_to_html_internal (self, category_tree, result, 0);
-          remove_element_from_list (&self->tree_to_build, category_tree);
+          remove_tree_to_build (self, category_tree);
           destroy_element_and_children (category_tree);
         }
       text_append_n (result, "]</td></tr>\n", 12);
@@ -15024,9 +15026,9 @@ convert_def_line_type (CONVERTER *self, const enum 
element_type type,
               text_append_n (result, ">", 1);
             }
           free (attribute_open);
-          add_to_element_list (&self->tree_to_build, category_tree);
+          add_tree_to_build (self, category_tree);
           convert_to_html_internal (self, category_tree, result, 0);
-          remove_element_from_list (&self->tree_to_build, category_tree);
+          remove_tree_to_build (self, category_tree);
           destroy_element_and_children (category_tree);
           if (open_len)
             text_append_n (result, "</span>", 7);
@@ -15893,8 +15895,8 @@ reset_translated_special_unit_info_tree (CONVERTER 
*self)
         {
           if (self->special_unit_info_tree[tree_type][i])
             {
-              remove_element_from_list (&self->tree_to_build,
-                       self->special_unit_info_tree[tree_type][i]);
+              remove_tree_to_build (self,
+                             self->special_unit_info_tree[tree_type][i]);
               destroy_element_and_children (
                 self->special_unit_info_tree[tree_type][i]);
 
@@ -17301,9 +17303,9 @@ reset_unset_no_arg_commands_formatting_context 
(CONVERTER *self,
       char *context;
       ELEMENT *tree_built = 0;
       ELEMENT *translated_tree = no_arg_command_context->tree;
-      if (!translated_tree->hv)
+      if (self->external_references_number > 0 && !translated_tree->hv)
         {
-          add_element_if_not_in_list (&self->tree_to_build, translated_tree);
+          add_to_element_list (&self->tree_to_build, translated_tree);
           tree_built = translated_tree;
         }
       xasprintf (&explanation, "Translated NO ARG @%s ctx %s",
@@ -17921,12 +17923,12 @@ convert_to_html_internal (CONVERTER *self, const 
ELEMENT *element,
           ELEMENT *translated = html_cdt_tree (element->text.text,
                                            self, 0, translation_context);
 
-          add_to_element_list (&self->tree_to_build, translated);
+          add_tree_to_build (self, translated);
 
           convert_to_html_internal (self, translated, &text_result,
                                     "translated TEXT");
 
-          remove_element_from_list (&self->tree_to_build, translated);
+          remove_tree_to_build (self, translated);
           destroy_element_and_children (translated);
         }
       else
@@ -17991,11 +17993,11 @@ convert_to_html_internal (CONVERTER *self, const 
ELEMENT *element,
                   ELEMENT *tmp = new_element (ET_NONE);
                   char *latex_content;
 
-                  add_to_element_list (&self->tree_to_build, tmp);
+                  add_tree_to_build (self, tmp);
                   tmp->contents = element->contents;
                   latex_content = call_latex_convert_to_latex_math (self,
                                                                     tmp);
-                  remove_element_from_list (&self->tree_to_build, tmp);
+                  remove_tree_to_build (self, tmp);
                   tmp->contents.list = 0;
                   destroy_element (tmp);
 
@@ -18718,10 +18720,10 @@ html_convert_output (CONVERTER *self, const ELEMENT 
*root,
 
       today_element->cmd = CM_today;
 
-      add_to_element_list (&self->tree_to_build, today_element);
+      add_tree_to_build (self, today_element);
       today = convert_tree_new_formatting_context (self, today_element,
                                                    "DATE_IN_HEADER", 0, 0, 0);
-      remove_element_from_list (&self->tree_to_build, today_element);
+      remove_tree_to_build (self, today_element);
       destroy_element (today_element);
 
       text_printf (&text,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]