Added font-size to math formulas

This commit is contained in:
Georgy Litvinov 2020-01-16 17:40:55 +01:00
parent e31e013789
commit 54cda34c82
4 changed files with 87 additions and 3 deletions

View file

@ -43,11 +43,12 @@ public class EmbeddedXMLObject extends EmbeddedObject {
// Byte entries for the XML streams of this object
private byte[] contentBytes = null;
private byte[] stylesBytes = null;
private byte[] settingsBytes = null;
// DOM trees representing the XML parts of this object
protected Document contentDOM = null;
protected Document stylesDOM = null;
protected Document settingsDOM = null;
/** Read an object from an ODF package document
*
* @param sName The name of the object.
@ -59,6 +60,8 @@ public class EmbeddedXMLObject extends EmbeddedObject {
// Read the bytes, but defer parsing until required (at that point, the bytes are nullified)
contentBytes = source.getEntry(sName+"/"+OfficeDocument.CONTENTXML);
stylesBytes = source.getEntry(sName+"/"+OfficeDocument.STYLESXML);
settingsBytes = source.getEntry(sName+"/"+OfficeDocument.SETTINGSXML);
}
/**
@ -92,6 +95,23 @@ public class EmbeddedXMLObject extends EmbeddedObject {
}
return stylesDOM;
}
public Document getSettingsDOM() {
if (settingsDOM == null) {
try {
settingsDOM = getDOM(settingsBytes);
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
settingsDOM = null;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
settingsDOM = null;
}
settingsBytes = null;
}
return settingsDOM;
}
private Document getDOM(byte[] data) throws SAXException, IOException {
if (data!=null) {

View file

@ -51,6 +51,7 @@ public class OfficeDocument {
// File names for the XML streams in a package document (settings.xml is ignored)
protected final static String CONTENTXML = "content.xml";
protected final static String STYLESXML = "styles.xml";
protected final static String SETTINGSXML = "settings.xml";
private final static String METAXML = "meta.xml";
private final static String MANIFESTXML = "META-INF/manifest.xml";