Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7769/src/org/hartmath/tex2css/reflection/convert
Modified Files:
Sqrt.java
Log Message:
misc changes
Index: Sqrt.java
===================================================================
RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Sqrt.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Sqrt.java 21 Mar 2004 16:58:58 -0000 1.1
--- Sqrt.java 28 Mar 2004 18:37:40 -0000 1.2
***************
*** 1,9 ****
package org.hartmath.tex2css.reflection.convert;
import org.hartmath.tex2mml.IRowCSSConverter;
import org.hartmath.tex2mml.Row;
public class Sqrt implements IRowCSSConverter {
!
/*
* (non-Javadoc)
--- 1,14 ----
package org.hartmath.tex2css.reflection.convert;
+ import java.util.ArrayList;
+
import org.hartmath.tex2mml.IRowCSSConverter;
+ import org.hartmath.tex2mml.Identifier;
+ import org.hartmath.tex2mml.Node;
+ import org.hartmath.tex2mml.Number;
import org.hartmath.tex2mml.Row;
public class Sqrt implements IRowCSSConverter {
!
/*
* (non-Javadoc)
***************
*** 14,21 ****
public boolean convert(StringBuffer buf, Row row) {
if (row.size() == 1) {
! buf.append("(");
! row.get(0).convert2CSS(buf, false);
! buf.append(")<t>1/2</t>");
! return true;
}
return false;
--- 19,47 ----
public boolean convert(StringBuffer buf, Row row) {
if (row.size() == 1) {
! ArrayList args = row.getArgs();
! if (args != null && args.size() > 0) {
! if (! (row.get(0) instanceof Number || row.get(0) instanceof Identifier) ) {
! buf.append("(");
! }
! row.get(0).convert2CSS(buf, false);
! if (! (row.get(0) instanceof Number || row.get(0) instanceof Identifier) ) {
! buf.append(")");
! }
! buf.append("<t>1/");
! ((Node) args.get(0)).convert2CSS(buf, false); // nth root
! buf.append("</t>");
! return true;
! } else {
! if (! (row.get(0) instanceof Number || row.get(0) instanceof Identifier) ) {
! buf.append("(");
! }
! row.get(0).convert2CSS(buf, false);
! if (! (row.get(0) instanceof Number || row.get(0) instanceof Identifier) ) {
! buf.append(")");
! }
! buf.append("<t>1/2</t>");
! return true;
! }
!
}
return false;
|