[liblouis-liblouisxml] [liblouisutdml] push by john.bo...@xxxxxxxxxxxxxxxxx - Removing indexing from translations of MathML in utd on 2012-06-12 09:57 GMT

  • From: liblouisutdml@xxxxxxxxxxxxxx
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Tue, 12 Jun 2012 09:57:21 +0000

Revision: 16bf7c15fac4
Author:   John Boyer <john.boyer@xxxxxxxxxxxxxxxxx>
Date:     Tue Jun 12 02:51:58 2012
Log:      Removing indexing from translations of MathML in utd
http://code.google.com/p/liblouisutdml/source/detail?r=16bf7c15fac4

Modified:
 /liblouisutdml/transcribe_math.c
 /liblouisutdml/transcriber.c

=======================================
--- /liblouisutdml/transcribe_math.c    Sun Jun  3 18:07:40 2012
+++ /liblouisutdml/transcribe_math.c    Tue Jun 12 02:51:58 2012
@@ -110,7 +110,6 @@
   translationLength = ud->text_length;
   if (ud->format_for == utd)
     {
-      int *setIndices;
       xmlNode *curBrlNode;
       xmlNode *newNode = xmlNewNode (NULL, (xmlChar *) "brl");
       xmlSetProp (newNode, (xmlChar *) "modifiers", (xmlChar *) "notext");
@@ -118,10 +117,6 @@
       link_brl_node (curBrlNode);
       ud->text_buffer[ud->text_length++] = ENDSEGMENT;
       translationLength++;
-      if (!(ud->mode & notSync))
-       setIndices = &ud->positions_array[ud->translated_length];
-      else
-       setIndices = NULL;
       k = lou_translate (ud->mathexpr_table_name,
                         ud->text_buffer,
                         &translationLength,
@@ -129,7 +124,7 @@
                         translated_buffer[ud->translated_length],
                         &translatedLength,
                         (char *) ud->typeform, NULL, NULL,
-                        setIndices, NULL, dotsIO);
+                        NULL, NULL, dotsIO);
       memset (ud->typeform, 0, sizeof (ud->typeform));
       ud->text_length = 0;
       if (!k)
@@ -139,13 +134,7 @@
          return 0;
        }
       if ((ud->translated_length + translatedLength) < MAX_TRANS_LENGTH)
-       {
-         if (!(ud->mode & notSync))
-           for (k = 0; k <           translatedLength; k++)
-             ud->positions_array[ud->translated_length + k] =
-               ud->translated_length + k;
          ud->translated_length += translatedLength;
-       }
       else
        ud->translated_length = MAX_TRANS_LENGTH;
     }
=======================================
--- /liblouisutdml/transcriber.c        Sun Jun  3 18:07:40 2012
+++ /liblouisutdml/transcriber.c        Tue Jun 12 02:51:58 2012
@@ -4239,14 +4239,16 @@
 int
 hasAttrValue (xmlNode * node, char *attrName, char *value)
 {
-  xmlChar *values;
+  char values[MAXNAMELEN];
+  xmlChar *allValues;
   int k;
   int prevValue = 0;
   if (node == NULL)
     return 0;
-  values = xmlGetProp (node, (xmlChar *) attrName);
-  if (values == NULL)
+  allValues = xmlGetProp (node, (xmlChar *) attrName);
+  if (allValues == NULL)
     return 0;
+  strcpy (values, allValues);
   for (k = 0; values[k]; k++)
     if (values[k] == ' ')
       {
@@ -4274,6 +4276,13 @@
   while (curPos < translatedLength && curBrlNode != NULL &&
         nextSegment < translatedLength)
     {
+      if (hasAttrValue (curBrlNode, "modifiers", "notext"))
+      {
+      for (; translatedBuffer[curPos] != ENDSEGMENT && curPos <
+      translatedLength; curPos++);
+      curBrlNode = curBrlNode->_private;
+      continue;
+      }
       if (translatedBuffer[curPos] == ENDSEGMENT || nextSegment == 0)
        {
          int indexPos = nextSegment;
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts:

  • » [liblouis-liblouisxml] [liblouisutdml] push by john.bo...@xxxxxxxxxxxxxxxxx - Removing indexing from translations of MathML in utd on 2012-06-12 09:57 GMT - liblouisutdml