public final class MSODrawingGroup extends XLSRecord
offset name size contents
---
4 rgMSODrGr var MSO Drawing Group Data
There is only one drawing group per client document (=MSOFBTDGGCONTAINER, 0xF000 ?).
OfficeArtDggContainer:
rh (8 bytes): An OfficeArtRecordHeader structure, that specifies the header for this record. The following table specifies the subfields.
rh.recVer A value that MUST be 0xF.
rh.recInstance A value that MUST be 0x000.
rh.recType A value that MUST be 0xF000.
rh.recLen An unsigned integer specifying the number of bytes following the header that contain document-wide file records.
drawingGroup (variable): An OfficeArtFDGGBlock record, that specifies document-wide information about all the drawings that are saved in the file.
blipStore (variable): An OfficeArtBStoreContainer record, that specifies the container for all the BLIPs that are used in all the drawings in the parent document.
drawingPrimaryOptions (variable): An OfficeArtFOPT record, that specifies the default properties for all drawing objects that are contained in all the drawings in the parent document.
drawingTertiaryOptions (variable): An OfficeArtTertiaryFOPT record, that specifies the default properties for all the drawing objects that are contained in all the drawings in the parent document.
colorMRU (variable): An OfficeArtColorMRUContainer record, that specifies the most recently used custom colors.
splitColors (variable): An OfficeArtSplitMenuColorContainer record, that specifies a container for the colors that were most recently used to format shapes.
Drawing groups contain drawings. (= numDrawings)
Drawings in turn contain shapes that are the objects that actually mark a page. (= numShapes)
--Each drawing has a collection of rules that govern the shapes in the drawing
Shape store their properties in a property table (MSOFBTOPT record of Msodrawing)
The actual pictures and images are kept in a separate collection so can load and save separately
Records that are required in the MSODrawingGroup:
MSOFBTDGG- Drawing Group Record- holds total # shapes saved + last or max SPID (shapeID) + number of IDclusters(FIDCLs) + total # drawings saved
MSOFBTOPT- Property Table Record- Default properties of newly created shapes (can be 0'd)
MSOFBTBSTORECONTAINER-
MSOFBTBSE- BLIP Store Entry- holds image type, id, size, index, len of blip name ...MSODrawing,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
boolean |
dirtyflag |
byte[] |
PROTOTYPE_1C1
The XF record can either be a style XF or a BiffRec XF.
|
byte[] |
PROTOTYPE_863 |
byte[] |
PROTOTYPE_BYTES |
col, continues, DEBUGLEVEL, hyperlink, idx, isBlank, isBoolean, isContinueMerged, isString, lastidx, myxf, offset, rw, streamer, wkbook, worksheetAI, ALLOWDUPES, ALRUNS, AREA, AREAFORMAT, ARRAY, ATTACHEDLABEL, AUTOFILTER, AXCENT, AXESUSED, AXIS, AXISLINEFORMAT, AXISPARENT, BACKUP, BAR, BEGIN, BLANK, BOF, BOOKBOOL, BOOLERR, BOPPOP, BOPPOPCUSTOM, BOTTOM_MARGIN, BOTTOMMARGIN, BOUNDSHEET, CALC_MODE_PROP, CALCCOUNT, CALCMODE, CALCULATE_ALWAYS, CALCULATE_AUTO, CALCULATE_EXPLICIT, CATLAB, CATSERRANGE, CF, CF12, CHART, CHART3DBARSHAPE, CHARTFORMAT, CHARTFORMATLINK, CHARTFRTINFO, CHARTLINE, CODENAME, COLINFO, CONDFMT, CONDFMT12, CONTINUE, COUNTRY, CRN, CRTLAYOUT12, CRTLAYOUT12A, DAT, DATAFORMAT, DATALABEXT, DATALABEXTCONTENTS, DATE1904, DBCELL, DCON, DCONBIN, DCONNAME, DCONREF, DEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM, DEFAULTENCODING, DEFAULTROWHEIGHT, DEFAULTTEXT, DEFCOLWIDTH, DELTA, DIMENSIONS, DROPBAR, DSF, DV, DVAL, END, ENDBLOCK, ENDEXTSST, ENDOBJECT, EOF, EXCEL2K, EXTERNCOUNT, EXTERNNAME, EXTERNSHEET, EXTSST, FBI, FEATHEADR, FILE_LOCK, FILEPASS, FONT, FONTBASIS, FONTX, FOOTERREC, FORMAT, FORMULA, FRAME, FRTFONTLIST, FRTWRAPPER, GARBAGE, GELFRAME, GUTS, HCENTER, HEADERREC, HLINK, HORIZONTAL_PAGE_BREAKS, IFMT, INDEX, INTERFACE_HDR, ITERATION, LABEL, LABELSST, LEFT_MARGIN, LEFTMARGIN, LEGEND, LEGENDXN, LINE, LINEFORMAT, MARKERFORMAT, MAXCOLS, MAXCOLS_BIFF8, MAXRECLEN, MAXROWS, MAXROWS_BIFF8, MERGEDCELLS, MSODRAWING, MSODRAWINGGROUP, MSODRAWINGSELECTION, MULBLANK, MULRK, NAME, NOTE, NUMBER, OBJ, OBJECTLINK, OBJPROTECT, OBPROJ, PALETTE, PANE, PASSWORD, PHONETIC, PICF, PIE, PIEFORMAT, PIVOTCHARTBITS, PIVOTCHARTLINK, PLOTAREA, PLOTGROWTH, PLS, PLV, POS, PRECISION, PRINT_GRIDLINES, PRINT_ROW_HEADERS, PRINTGRID, PRINTROWCOL, PROT4REV, PROTECT, QSISXTAG, RADAR, RADARAREA, RANGEPROTECTION, REFMODE, REFTRACK_PROP, RIGHT_MARGIN, RIGHTMARGIN, RK, ROW, RRD_HEAD, RRD_INFO, RSTRING, RTENTEXU, RTMERGECELLS, SBASEREF, SCATTER, SCENPROTECT, SCL, SELECTION, SERAUXERRBAR, SERAUXTREND, SERFMT, SERIES, SERIESLIST, SERIESTEXT, SERPARENT, SERTOCRT, SETUP, SHAREDUPES, SHEETLAYOUT, SHEETPROTECTION, SHRFMLA, SHTPROPS, SIIINDEX, SST, STARTBLOCK, STARTOBJECT, STRING_ENCODING_AUTO, STRING_ENCODING_COMPRESSED, STRING_ENCODING_UNICODE, STRINGREC, STYLE, SUPBOOK, SURFACE, SXADDL, SXBOOL, SXDB, SXDBB, SXDBEX, SXDI, SXEX, SXFDB, SXFDBTYPE, SXFORMAT, SXIVD, SXLI, SXNUM, SXPI, SXSTREAMID, SXSTRING, SXVD, SXVDEX, SXVI, SXVIEW, SXVIEWEX9, SXVIEWLINK, SXVS, TABID, TABLE, TABLESTYLES, TEXTDISP, THREED, TICK, TOP_MARGIN, TOPMARGIN, TXO, TYPE_BLANK, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_FORMULA, TYPE_FP, TYPE_INT, TYPE_STRING, UNICODEENCODING, UNITS, USERBVIEW, USERSVIEWBEGIN, USERSVIEWEND, USETEMPFILE_PROP, USR_EXCL, VALIDATEWORKBOOK, VALUERANGE, VB_MODULE, VCENTER, VERTICAL_PAGE_BREAKS, WINDOW_PROTECT, WINDOW1, WINDOW2, WK_CHART, WK_FILE, WK_GLOBALS, WK_MACROSHEET, WK_WORKSHEET, WSBOOL, XCT, XF, XLS_MAX_COLS, YMULT| Constructor and Description |
|---|
MSODrawingGroup() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDrawingRecord(int spidMax,
MSODrawing rec)
add a new Drawing Record based on existing drawing record
i.e.
|
int |
addImage(byte[] imgData,
int imgType,
boolean bAddUnconditionally)
if imageData doesn't exist, add to array
otherwise just inc ref count
|
void |
addMsodrawingrec(MSODrawing rec) |
void |
clear() |
void |
close()
clear out object references in prep for closing workbook
|
protected int |
containsImage(byte[] imgData)
test to see if imageData is in imageArray
|
protected void |
decCRef(int idx)
decrement the reference count for the specific image
|
int |
findImage(byte[] imgData)
return the index into the imageData array for the specified image (via byte lookup)
|
protected int |
getCRef(int idx)
return the reference count for the specific image
|
byte[] |
getImageBytes(int index)
returns the underlying image bytes
|
int |
getImageType(int index) |
AbstractList |
getMsodrawingrecs() |
MSODrawing |
getMsoHeaderRec(Boundsheet bs)
return the Msodrawing header record for the given sheet
|
int |
getNextMsoSPID()
loop through all the Msodrawing recs and return the next valid SPID
|
int |
getNumDrawingRecs()
return the number of drawing recs
|
int |
getNumDrawings()
related to number of drawing objects (= images + charts) but unclear how the count goes; may include deleted, etc .
|
int |
getNumIdClusters()
return the # of Id Clusters (charts related?)
|
int |
getNumImages()
returns the number of *unique* images in this workbook
|
int |
getNumShapes()
count the number of shapes in the document; shape mso's contain a msofbtSpContainer sub-record (TODO: is this true in every case?)
|
static XLSRecord |
getPrototype() |
int |
getSpidMax()
return SpidMax
|
protected void |
incCRef(int idx)
increment reference count for specific image data
|
void |
init()
perform record initialization
|
void |
initNewMSODrawingGroup() |
void |
mergeAndRemoveContinues() |
void |
mergeRecords(MSODrawingGroup rec)
If large, MSODrawingGroup will span multiple records; merge data
|
void |
parse()
Parse the MSODrawingGroup bytes and generate state vars:
imageData, imageType, cRef
spidMax, numIdClusters, numDrawings, numShapes
|
void |
prestream()
Must ensure that oridinal drawing Id for each drawing record is correct
Plus ensure SPID's are correct
Not default prestreaming as we need these values when we assemble sheet recs
|
void |
removeMsodrawingrec(MSODrawing rec,
Boundsheet sheet,
boolean removeObjRec)
remove linked MsoDrawing rec from this drawing group + update image references if necessary
NOTE THIS IS STILL EXPERIMENTAL; MUST BE TESTED WITH A VARIETY OF SCENARIOS
|
boolean |
setImageBytes(byte[] bts,
Boundsheet bs,
MSODrawing rec,
String name)
sets the underlying image bytes
|
void |
setSpidMax(int spid)
set SpidMax
|
String |
toString()
show pertinent information for record
|
void |
updateRecord()
create a new MSODrawingGroup record based upon image datas defined in imageData/imageType/cRef arrays +
spidMax, numDrawings, numShapes, numIdClusters
The squenence of records here are:
F000, F006, F001, F007(xNumImages), F00B ,F11E
MSOFBTDGG MSOFBTBSTORECONTAINER MSOFBTBSE (x numimages)
|
addContinue, clone, copyFormat, getBooleanVal, getByteAt, getByteReader, getBytes, getBytesAt, getCellAddress, getCellAddressWithSheet, getCellType, getColNumber, getColorTable, getContinueVect, getData, getDataType, getDblVal, getDefaultVal, getEncryptedByteReader, getFirstBlock, getFloatVal, getFont, getFormatPattern, getFormulaRec, getHyperlink, getInternalVal, getIntLocation, getIntVal, getIxfe, getLastBlock, getLength, getMergeRange, getOffset, getOpcode, getRealRecordIndex, getRecDesc, getRecordIndex, getRow, getRowNumber, getSheet, getStreamer, getStringVal, getStringVal, getWorkBook, getXfRec, hasContinues, initRowCol, isFormula, isNumber, isReadOnly, isValueForCell, mergeContinues, postStream, preStream, remove, removeContinues, resetCacheBytes, setBooleanVal, setByteReader, setCol, setData, setDebugLevel, setDoubleVal, setEncryptedByteReader, setFirstBlock, setFloatVal, setHyperlink, setIndex, setIntVal, setIsValueForCell, setIxfe, setLastBlock, setLength, setMergeRange, setOffset, setOpcode, setRow, setRowCol, setRowNumber, setSheet, setStreamer, setStringVal, setValueForCell, setWorkBook, setXFRecord, setXFRecord, shouldEncrypt, toHexDumppublic boolean dirtyflag
public byte[] PROTOTYPE_BYTES
public byte[] PROTOTYPE_1C1
public byte[] PROTOTYPE_863
public void addMsodrawingrec(MSODrawing rec)
public int getNextMsoSPID()
public void removeMsodrawingrec(MSODrawing rec, Boundsheet sheet, boolean removeObjRec)
public MSODrawing getMsoHeaderRec(Boundsheet bs)
bs - public AbstractList getMsodrawingrecs()
public void init()
XLSRecordpublic static XLSRecord getPrototype()
public void initNewMSODrawingGroup()
public void parse()
public void updateRecord()
public boolean setImageBytes(byte[] bts,
Boundsheet bs,
MSODrawing rec,
String name)
bts - new image bytesbs - Boundsheetrec - original Msodrawing rec linked to imagename - original image name (used for lookups)public byte[] getImageBytes(int index)
index - public int getImageType(int index)
public int getNumImages()
public int getNumDrawings()
public int getNumShapes()
public int getNumIdClusters()
public int getSpidMax()
public void setSpidMax(int spid)
spid - protected int containsImage(byte[] imgData)
imgData - byte[] defining imagepublic int findImage(byte[] imgData)
imgData - image bytespublic int addImage(byte[] imgData,
int imgType,
boolean bAddUnconditionally)
imgData - byte[] defining imageimgType - type of imagebAddUnconditionally - add new even if already referenced (used in setting image bytes)public void clear()
public void mergeRecords(MSODrawingGroup rec)
rec - next MSODrawingGroup record in streampublic String toString()
public void mergeAndRemoveContinues()
protected void incCRef(int idx)
idx - protected int getCRef(int idx)
idx - protected void decCRef(int idx)
idx - public void addDrawingRecord(int spidMax,
MSODrawing rec)
spidMax - rec - public void prestream()
public int getNumDrawingRecs()
Copyright © 2002–2019 Starter Inc.. All rights reserved.