Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15555/src/org/hartmath/tex2mml/reflection/convert
Modified Files:
Sqrt.java
Log Message:
misc changes
Index: Sqrt.java
===================================================================
RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Sqrt.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Sqrt.java 19 Mar 2004 20:19:03 -0000 1.1
--- Sqrt.java 28 Mar 2004 19:16:07 -0000 1.2
***************
*** 1,10 ****
package org.hartmath.tex2mml.reflection.convert;
import org.hartmath.tex2mml.IRowMMLConverter;
import org.hartmath.tex2mml.Row;
import org.hartmath.tex2mml.TeX2MathMLFactory;
public class Sqrt implements IRowMMLConverter {
!
/*
* (non-Javadoc)
--- 1,13 ----
package org.hartmath.tex2mml.reflection.convert;
+ import java.util.ArrayList;
+
import org.hartmath.tex2mml.IRowMMLConverter;
+ import org.hartmath.tex2mml.Node;
import org.hartmath.tex2mml.Row;
import org.hartmath.tex2mml.TeX2MathMLFactory;
public class Sqrt implements IRowMMLConverter {
!
/*
* (non-Javadoc)
***************
*** 15,23 ****
public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) {
if (row.size() == 1) {
! f.tagStart(buf, "msqrt");
! row.get(0).convert2MML(f, buf);
! f.tagEnd(buf, "msqrt");
! return true;
! }
return false;
}
--- 18,35 ----
public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) {
if (row.size() == 1) {
! ArrayList args = row.getArgs();
! if (args != null && args.size() > 0) {
! f.tagStart(buf, "mroot");
! row.get(0).convert2MML(f, buf);
! ((Node) args.get(0)).convert2MML(f, buf); // nth root
! f.tagEnd(buf, "mroot");
! return true;
! } else {
! f.tagStart(buf, "msqrt");
! row.get(0).convert2MML(f, buf);
! f.tagEnd(buf, "msqrt");
! return true;
! }
! }
return false;
}
|