MCPcopy Create free account
hub / github.com/apache/poi / rebase

Method rebase

src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java:95–106  ·  view source on GitHub ↗

When you open something like a theme, call this to re-base the XML Document onto the core child of the current core document

(OPCPackage pkg)

Source from the content-addressed store, hash-verified

93 * current core document
94 */
95 protected final void rebase(OPCPackage pkg) throws InvalidFormatException {
96 PackageRelationshipCollection cores =
97 packagePart.getRelationshipsByType(PackageRelationshipTypes.CORE_DOCUMENT);
98 if(cores.size() != 1) {
99 throw new IllegalStateException(
100 "Tried to rebase using " + PackageRelationshipTypes.CORE_DOCUMENT +
101 " but found " + cores.size() + " parts of the right type"
102 );
103 }
104 packageRel = cores.getRelationship(0);
105 packagePart = POIXMLDocument.getTargetPart(pkg, packageRel);
106 }
107
108 /**
109 * Provides access to the underlying PackagePart

Callers 1

XSLFSlideShowMethod · 0.80

Calls 4

sizeMethod · 0.95
getRelationshipMethod · 0.95
getTargetPartMethod · 0.95

Tested by

no test coverage detected