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)
| 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 |
no test coverage detected