git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1738782 13f79535-47bb-0310-9956-ffa450edef68tags/REL_3_15_BETA2
case HSSFWorkbook.PICTURE_TYPE_PICT: | case HSSFWorkbook.PICTURE_TYPE_PICT: | ||||
ftCf.setFlags(FtCfSubRecord.BITMAP_BIT); | ftCf.setFlags(FtCfSubRecord.BITMAP_BIT); | ||||
break; | break; | ||||
default: | |||||
throw new IllegalStateException("Invalid picture type: " + pictData.getFormat()); | |||||
} | } | ||||
obj.addSubRecord(ftCf); | obj.addSubRecord(ftCf); | ||||
// FtPioGrbit (pictFlags) | // FtPioGrbit (pictFlags) |
case EscherTextboxRecord.RECORD_ID: | case EscherTextboxRecord.RECORD_ID: | ||||
txtRecord = (TextObjectRecord) shapeToObj.get(record); | txtRecord = (TextObjectRecord) shapeToObj.get(record); | ||||
break; | break; | ||||
default: | |||||
break; | |||||
} | } | ||||
} | } | ||||
if (isEmbeddedObject(objRecord)) { | if (isEmbeddedObject(objRecord)) { |
case EscherChildAnchorRecord.RECORD_ID: | case EscherChildAnchorRecord.RECORD_ID: | ||||
anchor = new HSSFChildAnchor((EscherChildAnchorRecord) ch); | anchor = new HSSFChildAnchor((EscherChildAnchorRecord) ch); | ||||
break; | break; | ||||
default: | |||||
break; | |||||
} | } | ||||
} | } | ||||
} | } |
* @param format The format of the picture. One of <code>PICTURE_TYPE_*</code> | * @param format The format of the picture. One of <code>PICTURE_TYPE_*</code> | ||||
* | * | ||||
* @return the index to this picture (1 based). | * @return the index to this picture (1 based). | ||||
* @see #PICTURE_TYPE_WMF | |||||
* @see #PICTURE_TYPE_EMF | |||||
* @see #PICTURE_TYPE_PICT | |||||
* @see #PICTURE_TYPE_PNG | |||||
* @see #PICTURE_TYPE_JPEG | |||||
* @see #PICTURE_TYPE_DIB | |||||
*/ | */ | ||||
@Override | @Override | ||||
public int addPicture(byte[] pictureData, int format) | public int addPicture(byte[] pictureData, int format) | ||||
case PICTURE_TYPE_PNG: | case PICTURE_TYPE_PNG: | ||||
blipRecord.setOptions(HSSFPictureData.MSOBI_PNG); | blipRecord.setOptions(HSSFPictureData.MSOBI_PNG); | ||||
break; | break; | ||||
case HSSFWorkbook.PICTURE_TYPE_JPEG: | |||||
case PICTURE_TYPE_JPEG: | |||||
blipRecord.setOptions(HSSFPictureData.MSOBI_JPEG); | blipRecord.setOptions(HSSFPictureData.MSOBI_JPEG); | ||||
break; | break; | ||||
case HSSFWorkbook.PICTURE_TYPE_DIB: | |||||
case PICTURE_TYPE_DIB: | |||||
blipRecord.setOptions(HSSFPictureData.MSOBI_DIB); | blipRecord.setOptions(HSSFPictureData.MSOBI_DIB); | ||||
break; | break; | ||||
default: | |||||
throw new IllegalStateException("Unexpected picture format: " + format); | |||||
} | } | ||||
EscherBSERecord r = new EscherBSERecord(); | EscherBSERecord r = new EscherBSERecord(); |
} | } | ||||
return evaluate(srcRowIndex, srcColumnIndex, args[0], args[1], args[2], arg3, arg4); | return evaluate(srcRowIndex, srcColumnIndex, args[0], args[1], args[2], arg3, arg4); | ||||
} | } | ||||
default: | |||||
return ErrorEval.VALUE_INVALID; | |||||
} | } | ||||
return ErrorEval.VALUE_INVALID; | |||||
} | } | ||||
protected double evaluate(double[] ds) throws EvaluationException { | protected double evaluate(double[] ds) throws EvaluationException { |
if(!(args[4] instanceof MissingArgEval)) { | if(!(args[4] instanceof MissingArgEval)) { | ||||
width = evaluateIntArg(args[4], srcCellRow, srcCellCol); | width = evaluateIntArg(args[4], srcCellRow, srcCellCol); | ||||
} | } | ||||
// fall-through to pick up height | |||||
case 4: | case 4: | ||||
if(!(args[3] instanceof MissingArgEval)) { | if(!(args[3] instanceof MissingArgEval)) { | ||||
height = evaluateIntArg(args[3], srcCellRow, srcCellCol); | height = evaluateIntArg(args[3], srcCellRow, srcCellCol); | ||||
} | } | ||||
break; | |||||
//case 3: | |||||
// nothing to do | |||||
default: | |||||
break; | |||||
} | } | ||||
// Zero height or width raises #REF! error | // Zero height or width raises #REF! error | ||||
if(height == 0 || width == 0) { | if(height == 0 || width == 0) { |
if (Character.isISOControl(charB)) return '.'; | if (Character.isISOControl(charB)) return '.'; | ||||
switch (charB) { | switch (charB) { | ||||
// printable, but not compilable with current compiler encoding | |||||
case 0xFF: case 0xDD: | |||||
charB = '.'; | |||||
break; | |||||
// printable, but not compilable with current compiler encoding | |||||
case 0xFF: | |||||
case 0xDD: | |||||
charB = '.'; | |||||
break; | |||||
default: | |||||
break; | |||||
} | } | ||||
return charB; | return charB; | ||||
} | } |
numPoints++; | numPoints++; | ||||
ctPath.addNewClose(); | ctPath.addNewClose(); | ||||
break; | break; | ||||
default: | |||||
throw new IllegalStateException("Unrecognized path segment type: " + type); | |||||
} | } | ||||
it.next(); | it.next(); | ||||
} | } |
_out.write("<v>" + nval + "</v>"); | _out.write("<v>" + nval + "</v>"); | ||||
} | } | ||||
break; | break; | ||||
default: | |||||
break; | |||||
} | } | ||||
break; | break; | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
default: { | default: { | ||||
throw new RuntimeException("Huh?"); | |||||
throw new IllegalStateException("Invalid cell type: " + cellType); | |||||
} | } | ||||
} | } | ||||
_out.write("</c>"); | _out.write("</c>"); |
case Font.SS_SUPER: | case Font.SS_SUPER: | ||||
offsetProperty.setVal(STVerticalAlignRun.SUPERSCRIPT); | offsetProperty.setVal(STVerticalAlignRun.SUPERSCRIPT); | ||||
break; | break; | ||||
default: | |||||
throw new IllegalStateException("Invalid type offset: " + offset); | |||||
} | } | ||||
} | } | ||||
} | } |
case 0x0112: | case 0x0112: | ||||
assertCbRgFcLcb( "0x0112", 0x00B7, "0x00B7", _cbRgFcLcb ); | assertCbRgFcLcb( "0x0112", 0x00B7, "0x00B7", _cbRgFcLcb ); | ||||
break; | break; | ||||
default: | |||||
throw new IllegalStateException("Invalid file format version number: " + getNFib()); | |||||
} | } | ||||
} | } | ||||
case 0x0112: | case 0x0112: | ||||
assertCswNew( "0x0112", 0x0005, "0x0005", _cswNew ); | assertCswNew( "0x0112", 0x0005, "0x0005", _cswNew ); | ||||
break; | break; | ||||
default: | |||||
throw new IllegalStateException("Invalid file format version number: " + getNFib()); | |||||
} | } | ||||
} | } | ||||