use content types from constants

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894506 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2021-10-23 09:46:13 +00:00
parent 802165ecd0
commit 22bac58465
1 changed files with 56 additions and 48 deletions

View File

@ -22,6 +22,7 @@ import java.util.Map;
import org.apache.poi.ooxml.POIXMLDocument; import org.apache.poi.ooxml.POIXMLDocument;
import org.apache.poi.ooxml.POIXMLRelation; import org.apache.poi.ooxml.POIXMLRelation;
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes; import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
import org.apache.poi.sl.usermodel.PictureData;
import org.apache.poi.xssf.model.CalculationChain; import org.apache.poi.xssf.model.CalculationChain;
import org.apache.poi.xssf.model.CommentsTable; import org.apache.poi.xssf.model.CommentsTable;
import org.apache.poi.xssf.model.ExternalLinksTable; import org.apache.poi.xssf.model.ExternalLinksTable;
@ -150,87 +151,94 @@ public final class XSSFRelation extends POIXMLRelation {
); );
public static final XSSFRelation IMAGES = new XSSFRelation( public static final XSSFRelation IMAGES = new XSSFRelation(
null, null,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
null, null,
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_EMF = new XSSFRelation( public static final XSSFRelation IMAGE_EMF = new XSSFRelation(
"image/x-emf", PictureData.PictureType.EMF.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.emf", "/xl/media/image#.emf",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_WMF = new XSSFRelation( public static final XSSFRelation IMAGE_WMF = new XSSFRelation(
"image/x-wmf", PictureData.PictureType.WMF.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.wmf", "/xl/media/image#.wmf",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_PICT = new XSSFRelation( public static final XSSFRelation IMAGE_PICT = new XSSFRelation(
"image/pict", PictureData.PictureType.PICT.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.pict", "/xl/media/image#.pict",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_JPEG = new XSSFRelation( public static final XSSFRelation IMAGE_JPEG = new XSSFRelation(
"image/jpeg", PictureData.PictureType.JPEG.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.jpeg", "/xl/media/image#.jpeg",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_PNG = new XSSFRelation( public static final XSSFRelation IMAGE_PNG = new XSSFRelation(
"image/png", PictureData.PictureType.PNG.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.png", "/xl/media/image#.png",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_DIB = new XSSFRelation( public static final XSSFRelation IMAGE_DIB = new XSSFRelation(
"image/dib", PictureData.PictureType.DIB.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.dib", "/xl/media/image#.dib",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_GIF = new XSSFRelation( public static final XSSFRelation IMAGE_GIF = new XSSFRelation(
"image/gif", PictureData.PictureType.GIF.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.gif", "/xl/media/image#.gif",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_TIFF = new XSSFRelation( public static final XSSFRelation IMAGE_TIFF = new XSSFRelation(
"image/tiff", PictureData.PictureType.TIFF.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.tiff", "/xl/media/image#.tiff",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_EPS = new XSSFRelation( public static final XSSFRelation IMAGE_EPS = new XSSFRelation(
"image/x-eps", PictureData.PictureType.EPS.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.eps", "/xl/media/image#.eps",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_BMP = new XSSFRelation( public static final XSSFRelation IMAGE_BMP = new XSSFRelation(
"image/x-ms-bmp", PictureData.PictureType.BMP.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.bmp", "/xl/media/image#.bmp",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation IMAGE_WPG = new XSSFRelation( public static final XSSFRelation IMAGE_WPG = new XSSFRelation(
"image/x-wpg", PictureData.PictureType.WPG.contentType,
PackageRelationshipTypes.IMAGE_PART, PackageRelationshipTypes.IMAGE_PART,
"/xl/media/image#.wpg", "/xl/media/image#.wpg",
XSSFPictureData::new, XSSFPictureData::new XSSFPictureData::new, XSSFPictureData::new
);
public static final XSSFRelation HDPHOTO_WDP = new XSSFRelation(
PictureData.PictureType.WDP.contentType,
PackageRelationshipTypes.HDPHOTO_PART,
"/xl/media/hdphoto#.wdp",
XSSFPictureData::new, XSSFPictureData::new
); );
public static final XSSFRelation SHEET_COMMENTS = new XSSFRelation( public static final XSSFRelation SHEET_COMMENTS = new XSSFRelation(