View | Details | Raw Unified | Return to bug 56468
Collapse All | Expand All

(-)a/src/ooxml/java/org/apache/poi/POIXMLProperties.java (+3 lines)
Lines 148-153 public class POIXMLProperties { Link Here
148
			xmlOptions.setSaveSuggestedPrefixes(map);
148
			xmlOptions.setSaveSuggestedPrefixes(map);
149
149
150
			OutputStream out = extPart.getOutputStream();
150
			OutputStream out = extPart.getOutputStream();
151
			if (extPart.getSize() > 0) {
152
			    extPart.clear();
153
			}
151
			ext.props.save(out, xmlOptions);
154
			ext.props.save(out, xmlOptions);
152
			out.close();
155
			out.close();
153
		}
156
		}
(-)a/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java (-1 / +4 lines)
Lines 599-605 public abstract class OPCPackage implements RelationshipSource, Closeable { Link Here
599
			throw new IllegalArgumentException("relationshipType");
599
			throw new IllegalArgumentException("relationshipType");
600
		ArrayList<PackagePart> retArr = new ArrayList<PackagePart>();
600
		ArrayList<PackagePart> retArr = new ArrayList<PackagePart>();
601
		for (PackageRelationship rel : getRelationshipsByType(relationshipType)) {
601
		for (PackageRelationship rel : getRelationshipsByType(relationshipType)) {
602
			retArr.add(getPart(rel));
602
			PackagePart part = getPart(rel);
603
			if (part != null) {
604
			    retArr.add(part);
605
			}
603
		}
606
		}
604
		return retArr;
607
		return retArr;
605
	}
608
	}
(-)a/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java (-4 / +2 lines)
Lines 37-43 import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart; Link Here
37
import org.apache.poi.openxml4j.opc.internal.PartMarshaller;
37
import org.apache.poi.openxml4j.opc.internal.PartMarshaller;
38
import org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager;
38
import org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager;
39
import org.apache.poi.openxml4j.opc.internal.ZipHelper;
39
import org.apache.poi.openxml4j.opc.internal.ZipHelper;
40
import org.apache.poi.openxml4j.opc.internal.marshallers.ZipPackagePropertiesMarshaller;
41
import org.apache.poi.openxml4j.opc.internal.marshallers.ZipPartMarshaller;
40
import org.apache.poi.openxml4j.opc.internal.marshallers.ZipPartMarshaller;
42
import org.apache.poi.openxml4j.util.ZipEntrySource;
41
import org.apache.poi.openxml4j.util.ZipEntrySource;
43
import org.apache.poi.openxml4j.util.ZipFileZipEntrySource;
42
import org.apache.poi.openxml4j.util.ZipFileZipEntrySource;
Lines 444-452 public final class ZipPackage extends Package { Link Here
444
                this.getPartsByRelationshipType(PackageRelationshipTypes.CORE_PROPERTIES_ECMA376).size() == 0    ) {
443
                this.getPartsByRelationshipType(PackageRelationshipTypes.CORE_PROPERTIES_ECMA376).size() == 0    ) {
445
				logger.log(POILogger.DEBUG,"Save core properties part");
444
				logger.log(POILogger.DEBUG,"Save core properties part");
446
445
447
				// We have to save the core properties part ...
446
				// Add core properties to part list ...
448
				new ZipPackagePropertiesMarshaller().marshall(
447
				addPackagePart(this.packageProperties);
449
                        this.packageProperties, zos);
450
				// ... and to add its relationship ...
448
				// ... and to add its relationship ...
451
				this.relationships.addRelationship(this.packageProperties
449
				this.relationships.addRelationship(this.packageProperties
452
						.getPartName().getURI(), TargetMode.INTERNAL,
450
						.getPartName().getURI(), TargetMode.INTERNAL,

Return to bug 56468