https://bz.apache.org/bugzilla/show_bug.cgi?id=63189

--- Comment #2 from Kwon Ohyoung <ohkwo...@outlook.com> ---
This issue is due to hyperlinks connected to picture objects not being properly
handled.

The picture object and the hyperlink object are stored in drawing1.xml, and the
picture file location to be displayed and hyperlink target information are
stored in drawing1.xml.rels.

ㅆhe correlation information stored in drawing1.xml.rels is processed based on
the existence of the actual target file when copying from poi. 

However, the hyperlink target information does not have actual file
information, so it is copied with the wrong target when copying.


original relationship in /xl/drawings/_rels/drawing1.xml.rels:
<Relationship Id="rId1" Target="#Sheet3!A1"
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"/>

copied relationship in /xl/drawings/_rels/drawing2.xml.rels:
<Relationship Id="rId1" Target="drawing1.xml"
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"/>

When the PackageRelationship.getTargetURI() method returns, the URI is
normalized to change it to the target file path. In this process, the fragment
information (#Sheet3!A1) is lost and the file name (/xl/drawing1.xml) will
remain.

However, /xl/drawing1.xml is recognized as an invalid file because it cannot be
a hyperlink target.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to