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 2019/02/19 14:00:21 UTC

[Bug 63189] New: Error when cloning sheet with a hyperlink

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

            Bug ID: 63189
           Summary: Error when cloning sheet with a hyperlink
           Product: POI
           Version: 4.0.0-FINAL
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: daschkachuk@gmail.com
  Target Milestone: ---

Created attachment 36443
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36443&action=edit
Error that excel shows when the documents is opened

I have .xlsx document with some sheets. And I need to clone one sheet.
The problem is that this sheet contains image with hyperlink to another sheet
on it. And after cloning the sheet the document is corrupted and shows attached
message when the document is opened.
Without this hyperlink sheet is cloned correctly.

-- 
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


[Bug 63189] Error when cloning sheet with a hyperlink

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

--- Comment #3 from Kwon Ohyoung <oh...@outlook.com> ---
To fundamentally solve this problem, I think we need to distinguish between
internal file-based relationships and reference-based relationships like
open-xml-sdk.

feat:
https://github.com/dotnet/Open-XML-SDK/blob/main/src/DocumentFormat.OpenXml.Framework/Packaging/PartRelationshipsFeature.cs

If we do that, I think it will be a bigger task than a minor version up rather
than just a single bug patch.

If it were a simple patch at the single commit level, I thought about
contributing, but it seems to be at the level of feature addition/change beyond
multiple commits, so I think it is something that needs to be reviewed within
the poi community.

-- 
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


[Bug 63189] Error when cloning sheet with a hyperlink

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

--- Comment #1 from Darya <da...@gmail.com> ---
Created attachment 36444
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36444&action=edit
Corrupted document

-- 
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


[Bug 63189] Error when cloning sheet with a hyperlink

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

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

-- 
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


[Bug 63189] Error when cloning sheet with a hyperlink

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

--- Comment #4 from Kwon Ohyoung <oh...@outlook.com> ---
I have published github PR : https://github.com/apache/poi/pull/617

-- 
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


[Bug 63189] Error when cloning sheet with a hyperlink

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

--- Comment #2 from Kwon Ohyoung <oh...@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-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63189] Error when cloning sheet with a hyperlink

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

Kwon Ohyoung <oh...@outlook.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ohkwon79@outlook.com

-- 
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