Revision: c886ad1c00a0 Author: John Boyer <john.boyer@xxxxxxxxxxxxxxxxx> Date: Sun Jun 3 18:07:40 2012 Log: eliminating some unnecessary procesing http://code.google.com/p/liblouisutdml/source/detail?r=c886ad1c00a0 Modified: /liblouisutdml/louisutdml.h /liblouisutdml/transcribe_math.c /liblouisutdml/transcriber.c ======================================= --- /liblouisutdml/louisutdml.h Sun Jun 3 04:36:20 2012 +++ /liblouisutdml/louisutdml.h Sun Jun 3 18:07:40 2012 @@ -164,6 +164,7 @@ int old_text_length; int translated_length; int string_buf_len; + int needs_editing; int has_math; int has_comp_code; int has_chem; ======================================= --- /liblouisutdml/transcribe_math.c Sun Jun 3 04:36:20 2012 +++ /liblouisutdml/transcribe_math.c Sun Jun 3 18:07:40 2012 @@ -105,6 +105,7 @@ int translationLength; int translatedLength; int k; + ud->needs_editing = 1; translatedLength = MAX_TRANS_LENGTH - ud->translated_length; translationLength = ud->text_length; if (ud->format_for == utd) ======================================= --- /liblouisutdml/transcriber.c Sun Jun 3 04:36:20 2012 +++ /liblouisutdml/transcriber.c Sun Jun 3 18:07:40 2012 @@ -307,6 +307,7 @@ if (!start_document ()) return 0; start_style (docStyle, NULL); + ud->outbuf = outbufx; ud->outbuf1_len = outlenx; ud->input_encoding = ud->input_text_encoding; @@ -2518,7 +2519,8 @@ static int editTrans () { - if (!(ud->contents == 2) && !(ud->style_format == computerCoded) && + if (ud->needs_editing && !(ud->contents == 2) && !(ud->style_format + == computerCoded) &&*ud->edit_table_name && (ud->has_math || ud->has_chem || ud->has_music))
{ translationLength = ud->translated_length; @@ -2729,6 +2731,7 @@ insert_translation (ud->main_braille_table); styleBody (); end_style (); + ud->needs_editing = 0; return 1; } @@ -3272,6 +3275,7 @@ int start_style (StyleType * curStyle, xmlNode * node) { + ud->needs_editing = 0; if (curStyle == NULL) curStyle = lookup_style ("para"); if (prevStyle == NULL) @@ -3352,6 +3356,7 @@ ud->style_left_margin = styleSpec->curLeftMargin; ud->style_right_margin = styleSpec->curRightMargin; ud->style_first_line_indent = styleSpec->curFirstLineIndent; + ud->needs_editing = 0; return 1; } @@ -4982,7 +4987,7 @@ static int utd_editTrans () { - if (!(ud->contents == 2) + if (ud->needs_editing && !(ud->contents == 2) && !(style->format == computerCoded) && ud->edit_table_name && (ud->has_math || ud->has_chem || ud->has_music)) For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com