Skip to content

Commit

Permalink
docx closing
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed May 22, 2019
1 parent b6f3a21 commit 29f5faa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/msdocx.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Luwrain.addHook("luwrain.reader.doc.builder", function(contentType, props, path)
if (!contentType.equals("application/vnd.openxmlformats-officedocument.wordprocessingml.document"))
return null;
var f = new java.io.FileInputStream(path);
try {
var doc = new org.apache.poi.xwpf.usermodel.XWPFDocument(f);
var body = doc.getBodyElements();
var paragraphs = [];
Expand All @@ -70,7 +71,11 @@ Luwrain.addHook("luwrain.reader.doc.builder", function(contentType, props, path)
if (obj != null)
paragraphs.push(obj);
}
return {nodes: paragraphs};
return {nodes: paragraphs};
}
finally {
f.close();
}
});

org.apache.poi.openxml4j.util.ZipSecureFile.setMinInflateRatio(0.0009);
Expand Down

0 comments on commit 29f5faa

Please sign in to comment.