MathML without namespace (fix for OOo 3.2)
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@46 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
d57907d505
commit
5a8dcceea2
8 changed files with 70 additions and 30 deletions
|
@ -16,11 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2009 by Henrik Just
|
||||
* Copyright: 2002-2010 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2009-05-29)
|
||||
* Version 1.2 (2010-02-19)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -153,7 +153,10 @@ public class DrawConverter extends ConverterHelper {
|
|||
try {
|
||||
Document settings = ((EmbeddedXMLObject) object).getSettingsDOM();
|
||||
Document formuladoc = ((EmbeddedXMLObject) object).getContentDOM();
|
||||
Element formula = Misc.getChildByTagName(formuladoc,XMLString.MATH_MATH);
|
||||
Element formula = Misc.getChildByTagName(formuladoc,XMLString.MATH); // Since OOo3.2
|
||||
if (formula==null) {
|
||||
formula = Misc.getChildByTagName(formuladoc,XMLString.MATH_MATH);
|
||||
}
|
||||
ldp.append(" $")
|
||||
.append(palette.getMathmlCv().convert(settings,formula))
|
||||
.append("$");
|
||||
|
@ -184,7 +187,10 @@ public class DrawConverter extends ConverterHelper {
|
|||
}
|
||||
}
|
||||
else { // flat xml, object is contained in node
|
||||
Element formula = Misc.getChildByTagName(node,XMLString.MATH_MATH);
|
||||
Element formula = Misc.getChildByTagName(node,XMLString.MATH);
|
||||
if (formula==null) {
|
||||
formula = Misc.getChildByTagName(node,XMLString.MATH_MATH);
|
||||
}
|
||||
if (formula!=null) {
|
||||
ldp.append(" $")
|
||||
.append(palette.getMathmlCv().convert(null,formula))
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2009 by Henrik Just
|
||||
* Copyright: 2002-2010 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2009-09-21)
|
||||
* Version 1.2 (2010-02-19)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -73,9 +73,15 @@ public final class MathmlConverter extends ConverterHelper {
|
|||
// TODO: Use settings to determine display mode/text mode
|
||||
// formula must be a math:math node
|
||||
// First try to find a StarMath annotation
|
||||
Node semantics = Misc.getChildByTagName(formula,XMLString.MATH_SEMANTICS);
|
||||
Node semantics = Misc.getChildByTagName(formula,XMLString.SEMANTICS); // Since OOo 3.2
|
||||
if (semantics==null) {
|
||||
semantics = Misc.getChildByTagName(formula,XMLString.MATH_SEMANTICS);
|
||||
}
|
||||
if (semantics!=null) {
|
||||
Node annotation = Misc.getChildByTagName(semantics,XMLString.MATH_ANNOTATION);
|
||||
Node annotation = Misc.getChildByTagName(semantics,XMLString.ANNOTATION); // Since OOo 3.2
|
||||
if (annotation==null) {
|
||||
annotation = Misc.getChildByTagName(semantics,XMLString.MATH_ANNOTATION);
|
||||
}
|
||||
if (annotation!=null) {
|
||||
String sStarMath = "";
|
||||
if (annotation.hasChildNodes()) {
|
||||
|
@ -216,7 +222,11 @@ public final class MathmlConverter extends ConverterHelper {
|
|||
if (MIMETypes.MATH.equals(object.getType()) || MIMETypes.ODF.equals(object.getType())) { // Formula!
|
||||
try {
|
||||
Document formuladoc = ((EmbeddedXMLObject) object).getContentDOM();
|
||||
return Misc.getChildByTagName(formuladoc,XMLString.MATH_MATH);
|
||||
Element formula = Misc.getChildByTagName(formuladoc,XMLString.MATH); // Since OOo 3.2
|
||||
if (formula==null) {
|
||||
formula = Misc.getChildByTagName(formuladoc,XMLString.MATH_MATH);
|
||||
}
|
||||
return formula;
|
||||
}
|
||||
catch (org.xml.sax.SAXException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -229,7 +239,10 @@ public final class MathmlConverter extends ConverterHelper {
|
|||
}
|
||||
}
|
||||
else { // flat xml, object is contained in node
|
||||
return Misc.getChildByTagName(node,XMLString.MATH_MATH);
|
||||
Element formula = Misc.getChildByTagName(node,XMLString.MATH); // Since OOo 3.2
|
||||
if (formula==null) {
|
||||
formula = Misc.getChildByTagName(node,XMLString.MATH_MATH);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue