diff options
author | Yegor Kozlov <yegor@apache.org> | 2009-07-12 07:18:42 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2009-07-12 07:18:42 +0000 |
commit | 3601f7f8c60b971f77ef80f51c2e91bc28be59b0 (patch) | |
tree | 708d3615407214d3b3d492bb5ddf45e991b66ec2 /src/ooxml/java/org/apache/poi/openxml4j | |
parent | 431be7dc97704780a8d2ad24842bc875ca68a8c3 (diff) | |
download | poi-3601f7f8c60b971f77ef80f51c2e91bc28be59b0.tar.gz poi-3601f7f8c60b971f77ef80f51c2e91bc28be59b0.zip |
fixed XSSF and OpenXml4J to read/write relationships with targets starting with '#' (internal locations), see Bugzilla 47504
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@793280 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/openxml4j')
-rwxr-xr-x | src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java index b59a78b74c..cfe0fb0a5d 100755 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java @@ -161,8 +161,12 @@ public final class ZipPartMarshaller implements PartMarshaller { PackageRelationship.TARGET_MODE_ATTRIBUTE_NAME, "External"); } else { - targetValue = PackagingURIHelper.relativizeURI( - sourcePartURI, rel.getTargetURI()).getPath(); + URI targetURI = rel.getTargetURI(); + targetValue = PackagingURIHelper.relativizeURI( + sourcePartURI, targetURI).getPath(); + if (targetURI.getRawFragment() != null) { + targetValue += "#" + targetURI.getRawFragment(); + } } relElem.addAttribute(PackageRelationship.TARGET_ATTRIBUTE_NAME, targetValue); |