use of net.heartsome.cat.converter.msexcel2007.common.InternalFileException in project translationstudio8 by heartsome.
the class AbstractPart method save.
public void save() throws InternalFileException {
FileOutputStream os;
File f = new File(this.partXmlPath);
try {
os = new FileOutputStream(f);
xm.output(os);
os.close();
} catch (Exception e) {
throw new InternalFileException("保存文件出错\n" + e.getMessage());
}
}
use of net.heartsome.cat.converter.msexcel2007.common.InternalFileException in project translationstudio8 by heartsome.
the class DrawingsPart method updateDrawingObject.
public void updateDrawingObject() throws InternalFileException {
StringBuffer bf = new StringBuffer();
for (CellAnchor c : cellAnchorList) {
c.updateCellAnchor();
bf.append(c.getXmlContent());
}
vu.update(getAutoPilot(), xm, "/xdr:wsDr/text()", bf.toString());
save();
}
use of net.heartsome.cat.converter.msexcel2007.common.InternalFileException in project translationstudio8 by heartsome.
the class SheetPart method fillShareStringTable.
/***
* 将Share String Tbale中的数据填充满,即每一个引用都对应独立的String item
* @param sst
* ;
* @throws InternalFileException
*/
public int fillShareStringTable(ShareStringTablePart sst, int index, StringBuffer siBf) throws InternalFileException {
String xpath = "/worksheet/sheetData/row/c[@t='s']/v";
try {
AutoPilot ap = new AutoPilot(vu.getVTDNav());
ap.selectXPath(xpath);
while (ap.evalXPath() != -1) {
String c = vu.getElementContent();
int cInt = 0;
try {
cInt = Integer.parseInt(c);
} catch (NumberFormatException e) {
throw new InternalFileException(Messages.getString("msexcel.converter.exception.msg1"));
}
siBf.append(sst.getStringItemFragment(cInt));
xm.updateToken(vu.getVTDNav().getCurrentIndex() + 1, index + "");
index++;
}
saveAndReload();
} catch (VTDException e) {
logger.error("", e);
} catch (UnsupportedEncodingException e) {
logger.error("", e);
}
return index;
}
use of net.heartsome.cat.converter.msexcel2007.common.InternalFileException in project translationstudio8 by heartsome.
the class WorkBookPart method loadShareStringTable.
private void loadShareStringTable() throws InternalFileException {
List<Relationship> rList = relsPart.getRelationshipByType(Constants.PART_TYPE_SST);
if (rList.size() != 1) {
return;
}
Relationship r = rList.get(0);
try {
sst = new ShareStringTablePart(r.getTarget());
} catch (FileNotFoundException e) {
// 可能没有sharedStrings.xml
}
}
Aggregations