You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/04/20 15:35:05 UTC

DO NOT REPLY [Bug 51094] New: HWPFDocument.write() does not preserve all embedded documents

https://issues.apache.org/bugzilla/show_bug.cgi?id=51094

           Summary: HWPFDocument.write() does not preserve all embedded
                    documents
           Product: POI
           Version: 3.8-dev
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HWPF
        AssignedTo: dev@poi.apache.org
        ReportedBy: igor.rogov.35@gmail.com


Created an attachment (id=26916)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26916)
Test document

When I'm trying to write a Word document it does not preserve an embedded
entries. Attached test document. It's a Word document with another Word
document embedded. Here is a code to reproduce the issue:

String testdoc = "881-test-embedded.doc";
String testdocout = "out.doc";
POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(new
File(testdoc)));

HWPFDocument doc = new HWPFDocument(fs);
FileOutputStream out = new FileOutputStream(new File(testdocout));
doc.write(out);
out.close();

The resulting file "out.doc" does not contain embedded document. Is this a bug
or expected behavior?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 51094] HWPFDocument.write() does not preserve all embedded documents

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51094

--- Comment #1 from Nick Burch <ni...@alfresco.com> 2011-04-20 10:14:13 EDT ---
Looking at the HWPF write code, I can see that there's nothing there to copy
the embedded documents over

Short term, the fix would be to do something similar to in HSSF, where we copy
the extra entries over if a flag is set

Longer term, if we switch it from POIFSFileSystem to NPOIFSFileSystem then we
can just overwrite the word streams with the new data, and keep all the other
ones, which'd probably be a cleaner fix

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 51094] HWPFDocument.write() does not preserve all embedded documents

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51094

--- Comment #2 from Nick Burch <ni...@alfresco.com> 2011-04-20 10:16:15 EDT ---
As a workaround for now, you could manually copy the ObjectPool over. A patch
to do this properly (along with a unit test) would be very well received!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 51094] HWPFDocument.write() does not preserve all embedded documents

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51094

Sergey Vladimirov <vl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Sergey Vladimirov <vl...@gmail.com> 2011-10-30 00:08:11 UTC ---
Shall be fixed already, please check

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org