Re: Strange behavior in XWPF

2016-06-08 Thread Nick Burch
On Fri, 3 Jun 2016, Mark Murphy wrote: Where can I find that. I searched for the 58779 bug, but there is no test that references it. Sorry, not really fully up to speed on the entire project yet. I added a disabled "word read-only file to new stream" test last week, it's

Re: Strange behavior in XWPF

2016-06-03 Thread Mark Murphy
Where can I find that. I searched for the 58779 bug, but there is no test that references it. Sorry, not really fully up to speed on the entire project yet. On Thu, Jun 2, 2016 at 3:33 PM, Nick Burch wrote: > On Thu, 2 Jun 2016, Murphy, Mark wrote: > >> Read Only doesn't

Re: Strange behavior in XWPF

2016-06-03 Thread Mark Murphy
You can edit a read only file in Excel and Word, you just can't save it over the read only file, you have to do a Save As. I was trying to read a file, modify it, and then write it back out to a different file. Like using a Template. Using POI I was able to make changes to the in-memory

RE: Strange behavior in XWPF

2016-06-02 Thread Javen O'Neal
> [XWPF] Read Only ... won't let me write to any file That seems _almost_ correct. A read only file shouldn't be editable. But if it's not editable, what's the point of saving it? Would be easier to copy the file via the filesystem. To get around the underlying problems 1. Copy the dotx to a

RE: Strange behavior in XWPF

2016-06-02 Thread Nick Burch
On Thu, 2 Jun 2016, Murphy, Mark wrote: Read Only doesn't work in XWPF, it won't let me write to any file. Plenty of bugs to go around. Hmm, that's bad, it ought to! Maybe add a quick disabled unit test for that (along the lines of the one we have for XSSF), and maybe also a XSLF one too

RE: Strange behavior in XWPF

2016-06-02 Thread Murphy, Mark
Doesn't matter though since XWPF also doesn't handle templates properly. -Original Message- From: Murphy, Mark [mailto:murphym...@metalexmfg.com] Sent: Thursday, June 02, 2016 3:16 PM To: 'POI Developers List' Subject: RE: Strange behavior in XWPF Read Only doesn't work in XWPF

RE: Strange behavior in XWPF

2016-06-02 Thread Murphy, Mark
Read Only doesn't work in XWPF, it won't let me write to any file. Plenty of bugs to go around. -Original Message- From: Nick Burch [mailto:apa...@gagravarr.org] Sent: Thursday, June 02, 2016 3:09 PM To: POI Developers List Subject: RE: Strange behavior in XWPF On Thu, 2 Jun 2016

RE: Strange behavior in XWPF

2016-06-02 Thread Nick Burch
On Thu, 2 Jun 2016, Murphy, Mark wrote: Does that not cause a memory leak in Closeable objects? We need to fix the underlying bug really! For now, you can open the package Read Only to avoid it, or wait for GC to clear out the closable object a bit later Nick

RE: Strange behavior in XWPF

2016-06-02 Thread Murphy, Mark
Does that not cause a memory leak in Closeable objects? -Original Message- From: Nick Burch [mailto:apa...@gagravarr.org] Sent: Wednesday, June 01, 2016 6:04 PM To: POI Developers List Subject: Re: Strange behavior in XWPF On Wed, 1 Jun 2016, Murphy, Mark wrote: > Then wr

Re: Strange behavior in XWPF

2016-06-01 Thread Nick Burch
On Wed, 1 Jun 2016, Murphy, Mark wrote: Then write to a different file: FileOutputStream out = new FileOutputStream(new File( "createdocument.docx")); document.write(out); out.close(); document.close(); There's an issue with close and things opened from files with X??F, I'd

Re: Strange behavior in XWPF

2016-06-01 Thread Javen O'Neal
Either open the OPCPackage as read only or buffer the file to an input stream. OPCPackage.close does the modifying. On Jun 1, 2016 13:47, "Javen O'Neal" wrote: > Here: https://bz.apache.org/bugzilla/show_bug.cgi?id=58779 > On Jun 1, 2016 13:07, "Murphy, Mark"

Re: Strange behavior in XWPF

2016-06-01 Thread Javen O'Neal
Here: https://bz.apache.org/bugzilla/show_bug.cgi?id=58779 On Jun 1, 2016 13:07, "Murphy, Mark" wrote: > If I open a document template: > > XWPFDocument document = new > XWPFDocument(POIXMLDocument.openPackage("Normal.dotm")); > > Add some text: > > XWPFParagraph

Strange behavior in XWPF

2016-06-01 Thread Murphy, Mark
If I open a document template: XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage("Normal.dotm")); Add some text: XWPFParagraph paragraph = document.createParagraph(); XWPFRun run = paragraph.createRun(); run.setText("At tutorialspoint.com, we strive hard to "