Bug 56171 - java.lang.RuntimeException: TODO
Summary: java.lang.RuntimeException: TODO
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: HDGF (show other bugs)
Version: 3.10-FINAL
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-20 14:49 UTC by Jim Kay
Modified: 2016-04-10 07:18 UTC (History)
0 users



Attachments
Visio .vsd file (79.00 KB, application/vnd.ms-visio.viewer)
2014-02-20 14:49 UTC, Jim Kay
Details
Slide1 (106.27 KB, application/pdf)
2014-02-21 15:40 UTC, Jim Kay
Details
Slide 2 (93.61 KB, application/pdf)
2014-02-21 15:41 UTC, Jim Kay
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Kay 2014-02-20 14:49:56 UTC
Created attachment 31341 [details]
Visio .vsd file

Exception in thread "main" java.lang.RuntimeException: TODO
	at org.apache.poi.hdgf.pointers.PointerFactory.createPointer(PointerFactory.java:45)
	at org.apache.poi.hdgf.HDGFDiagram.<init>(HDGFDiagram.java:99)
	at org.apache.poi.hdgf.HDGFDiagram.<init>(HDGFDiagram.java:60)


Visio .vsd file causes RuntimeException.
The file can viewed successfully in IE version 8
Comment 1 Nick Burch 2014-02-20 23:17:23 UTC
Looks like you have an older v5 file, which HDGF currently only has v6 pointer support

Are you interested in helping to add support for this? It looks like vsdump has support for v5 points, and while we can't copy their code (vsdump is mostly GPL, plus it's in c!), we can use the outputs of vsdump to help debug and investigate the file to identify what's needed
Comment 2 Jim Kay 2014-02-21 08:47:11 UTC
Don't mind having a go, but I am not sure my skills are up to it. What do you suggest. What would be the plan?
Comment 3 Jim Kay 2014-02-21 15:40:36 UTC
Created attachment 31343 [details]
Slide1

vsd file format details - slide 1
Comment 4 Jim Kay 2014-02-21 15:41:05 UTC
Created attachment 31344 [details]
Slide 2

vsd file format details - slide 2
Comment 5 Jim Kay 2014-02-21 15:45:17 UTC
.vsd file format details - slides 1 & 2

also, the python tool ole-toy seems to be the best bet for analyzing any ole file formats, including .vsd; this was written to help reverse engineer .vsd for LibreOffice

see:
http://libregraphicsworld.org/blog/entry/initial-support-for-visio-files-lands-to-libreoffice
Comment 6 Nick Burch 2014-02-21 16:54:55 UTC
You'll probably want to use POIFSDump and POIFSViewer to see the raw data in the pointers stream, get bits out to play with etc

Next up, try using vsdump to parse out the pointers from the test file

In TestPointerFactory you'll see some examples of the raw bytes of some pointers, along with what they mean. We'll want to identify some pointer bytes, what they correspond to, then write some more unit test bits like that. Finally, we'll want to add logic to the PointerFactory to decode them.

One other thing - both LibreOffice and vsdump are under incompatible licenses, so we can't take code from either of them. We can use them to debug, to analyse, to test, but not to borrow!
Comment 7 Jim Kay 2014-02-24 13:39:58 UTC
The libvisio library has been changed to MPL v2 (on the 31-01-2014).
See http://cgit.freedesktop.org/libreoffice/contrib/libvisio

I believe that MPL v2 is compatible with the Apache Licence and hence we can used the code. 

Is this true?
Comment 8 Nick Burch 2014-02-24 13:51:23 UTC
We can depend on a MPLv2 licensed library, but we can't borrow code from one