diff --git a/src/scratchpad/src/org/apache/poi/hdf/generator/HDFFieldIterator.java b/src/scratchpad/src/org/apache/poi/hdf/generator/HDFFieldIterator.java index 41051a99e..432ecf0c7 100644 --- a/src/scratchpad/src/org/apache/poi/hdf/generator/HDFFieldIterator.java +++ b/src/scratchpad/src/org/apache/poi/hdf/generator/HDFFieldIterator.java @@ -76,6 +76,10 @@ public class HDFFieldIterator extends FieldIterator result = "LittleEndian.getSimpleShortArray(data, 0x" + Integer.toHexString(offset) + " + offset," + size + ")"; else if (type.equals("byte[]")) result = "LittleEndian.getByteArray(data, 0x" + Integer.toHexString(offset) + " + offset," + size + ")"; + else if (type.equals("BorderCode")) + result = "new BorderCode(data, 0x" + Integer.toHexString(offset) + " + offset)"; + else if (type.equals("DateAndTime")) + result = "new DateAndTime(data, 0x" + Integer.toHexString(offset) + " + offset)"; else if (size.equals("2")) result = "LittleEndian.getShort(data, 0x" + Integer.toHexString(offset) + " + offset)"; else if (size.equals("4")) @@ -97,23 +101,27 @@ public class HDFFieldIterator extends FieldIterator public String serialiseEncoder( int fieldNumber, String fieldName, String size, String type) { - String javaType = RecordUtil.getType(size, type, 0); + //String javaType = RecordUtil.getType(size, type, 0); String javaFieldName = RecordUtil.getFieldName(fieldNumber,fieldName,0); String result = ""; - if (javaType.equals("short[]")) + if (type.equals("short[]")) result = "LittleEndian.putShortArray(data, 0x" + Integer.toHexString(offset) + " + offset, " + javaFieldName + ");"; - else if (javaType.equals("byte[]")) - result = "LittleEndian.putByteArray(data, 0x" + Integer.toHexString(offset) + " + offset, " + javaFieldName + ");"; + else if (type.equals("byte[]")) + result = "System.arraycopy(" + javaFieldName + ", 0, data, 0x" + Integer.toHexString(offset) + " + offset, " + javaFieldName + ".length);"; + else if (type.equals("BorderCode")) + result = javaFieldName + ".serialize(data, 0x" + Integer.toHexString(offset) + " + offset);"; + else if (type.equals("DateAndTime")) + result = javaFieldName + ".serialize(data, 0x" + Integer.toHexString(offset) + " + offset);"; else if (size.equals("2")) result = "LittleEndian.putShort(data, 0x" + Integer.toHexString(offset) + " + offset, (short)" + javaFieldName + ");"; else if (size.equals("4")) result = "LittleEndian.putInt(data, 0x" + Integer.toHexString(offset) + " + offset, " + javaFieldName + ");"; else if (size.equals("1")) result = "data[ 0x" + Integer.toHexString(offset) + " + offset] = " + javaFieldName + ";"; - else if (javaType.equals("double")) + else if (type.equals("double")) result = "LittleEndian.putDouble(data, 0x" + Integer.toHexString(offset) + " + offset, " + javaFieldName + ");"; try diff --git a/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java b/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java index a1a87d2cd..1323bc1d5 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java @@ -161,6 +161,12 @@ public class HWPFDocument } + public StyleSheet getStyleSheet() + { + return _ss; + } + + /** * Writes out the word file that is represented by an instance of this class. * @@ -271,6 +277,28 @@ public class HWPFDocument pfs.writeFilesystem(out); } + CHPBinTable getCharacterTable() + { + return _cbt; + } + + PAPBinTable getParagraphTable() + { + return _pbt; + } + + SectionTable getSectionTable() + { + return _st; + } + + TextPieceTable getTextTable() + { + return _cft.getTextPieceTable(); + } + + + /** * Takes two arguments, 1) name of the Word file to read in 2) location to * write it out at. diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPBinTable.java index c8614daf0..a40d71939 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPBinTable.java @@ -56,6 +56,7 @@ package org.apache.poi.hwpf.model.hdftypes; +import java.util.List; import java.util.ArrayList; import java.io.OutputStream; import java.io.IOException; @@ -64,11 +65,25 @@ import org.apache.poi.poifs.common.POIFSConstants; import org.apache.poi.util.LittleEndian; import org.apache.poi.hwpf.model.io.*; - +/** + * This class holds all of the character formatting properties. + * + * @author Ryan Ackley + */ public class CHPBinTable { + /** List of character properties.*/ ArrayList _textRuns = new ArrayList(); + /** + * Constructor used to read a binTable in from a Word document. + * + * @param documentStream + * @param tableStream + * @param offset + * @param size + * @param fcMin + */ public CHPBinTable(byte[] documentStream, byte[] tableStream, int offset, int size, int fcMin) { @@ -94,7 +109,7 @@ public class CHPBinTable } } - public ArrayList getTextRuns() + public List getTextRuns() { return _textRuns; } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPFormattedDiskPage.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPFormattedDiskPage.java index a906c4651..5a5d9e490 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPFormattedDiskPage.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPFormattedDiskPage.java @@ -150,25 +150,26 @@ public class CHPFormattedDiskPage extends FormattedDiskPage int fcOffset = 0; // total size is currently the size of one FC - int totalSize = FC_SIZE; + int totalSize = FC_SIZE + 1; int index = 0; for (; index < size; index++) { int grpprlLength = ((CHPX)_chpxList.get(index)).getGrpprl().length; - // check to see if we have enough room for an FC, a byte, and the grpprl. - totalSize += (FC_SIZE + 1 + grpprlLength); + // check to see if we have enough room for an FC, the grpprl offset, + // the grpprl size byte and the grpprl. + totalSize += (FC_SIZE + 2 + grpprlLength); // if size is uneven we will have to add one so the first grpprl falls // on a word boundary if (totalSize > 511 + (index % 2)) { - totalSize -= (FC_SIZE + 1 + grpprlLength); + totalSize -= (FC_SIZE + 2 + grpprlLength); break; } // grpprls must fall on word boundaries - if (grpprlLength % 2 > 0) + if ((1 + grpprlLength) % 2 > 0) { totalSize += 1; } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPX.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPX.java index f14115509..5543148ea 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPX.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPX.java @@ -64,6 +64,7 @@ package org.apache.poi.hwpf.model.hdftypes; public class CHPX extends PropertyNode { + public CHPX(int fcStart, int fcEnd, byte[] grpprl) { super(fcStart, fcEnd, grpprl); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/DocumentProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/DocumentProperties.java index dc196417b..43c0b7b13 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/DocumentProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/DocumentProperties.java @@ -72,6 +72,6 @@ public class DocumentProperties extends DOPAbstractType public DocumentProperties(byte[] tableStream, int offset) { - super.fillFields(tableStream, (short)0, offset); + super.fillFields(tableStream, offset); } } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/FileInformationBlock.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/FileInformationBlock.java index ead8a4d36..00dc55aa8 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/FileInformationBlock.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/FileInformationBlock.java @@ -75,7 +75,7 @@ public class FileInformationBlock extends FIBAbstractType /** Creates a new instance of FileInformationBlock */ public FileInformationBlock(byte[] mainDocument) { - fillFields(mainDocument, (short)0, (short)0); + fillFields(mainDocument, 0); } public void clearOffsetsSizes() diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/ListData.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/ListData.java new file mode 100644 index 000000000..69c4e3423 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/ListData.java @@ -0,0 +1,133 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" and + * "Apache POI" must not be used to endorse or promote products + * derived from this software without prior written permission. For + * written permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * "Apache POI", nor may "Apache" appear in their name, without + * prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +package org.apache.poi.hwpf.model.hdftypes; + +import org.apache.poi.util.BitField; +import org.apache.poi.util.LittleEndian; + +public class ListData +{ + private int _lsid; + private int _tplc; + private short[] _rglst; + private byte _info; + private static BitField _fSimpleList = new BitField(0x1); + private static BitField _fRestartHdn = new BitField(0x2); + private byte _reserved; + ListLevel[] _levels; + + + public ListData(byte[] buf, int offset) + { + _lsid = LittleEndian.getInt(buf, offset); + offset += LittleEndian.INT_SIZE; + _tplc = LittleEndian.getInt(buf, offset); + offset += LittleEndian.INT_SIZE; + _rglst = new short[9]; + for (int x = 0; x < 9; x++) + { + _rglst[x] = LittleEndian.getShort(buf, offset); + offset += LittleEndian.SHORT_SIZE; + } + _info = buf[offset++]; + _reserved = buf[offset]; + if (_fSimpleList.getValue(_info) > 0) + { + _levels = new ListLevel[1]; + } + else + { + _levels = new ListLevel[9]; + } + } + + public int getLsid() + { + return _lsid; + } + + public int numLevels() + { + return _levels.length; + } + + public void setLevel(int index, ListLevel level) + { + _levels[index] = level; + } + + public ListLevel[] getLevels() + { + return _levels; + } + + public byte[] toByteArray() + { + byte[] buf = new byte[28]; + int offset = 0; + LittleEndian.putInt(buf, _lsid); + offset += LittleEndian.INT_SIZE; + LittleEndian.putInt(buf, offset, _tplc); + offset += LittleEndian.INT_SIZE; + for (int x = 0; x < 9; x++) + { + LittleEndian.putShort(buf, offset, _rglst[x]); + offset += LittleEndian.SHORT_SIZE; + } + buf[offset++] = _info; + buf[offset] = _reserved; + return buf; + } +} diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPX.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPX.java index 15b1326b6..cc67c4400 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPX.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPX.java @@ -90,5 +90,4 @@ public class PAPX extends PropertyNode } return false; } - } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PropertyNode.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PropertyNode.java index 1d94ba83a..b070d833d 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PropertyNode.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PropertyNode.java @@ -53,7 +53,10 @@ */ package org.apache.poi.hwpf.model.hdftypes; +import java.lang.ref.SoftReference; +import java.io.ByteArrayOutputStream; +import org.apache.poi.hwpf.sprm.SprmBuffer; /** * Represents a lightweight node in the Trees used to store content @@ -63,9 +66,10 @@ package org.apache.poi.hwpf.model.hdftypes; */ public class PropertyNode implements Comparable { - private byte[] _buf; + private SprmBuffer _buf; private int _cpStart; private int _cpEnd; + private SoftReference _propCache; /** * @param fcStart The start of the text for this property. @@ -76,7 +80,8 @@ public class PropertyNode implements Comparable { _cpStart = fcStart; _cpEnd = fcEnd; - _buf = buf; + _buf = new SprmBuffer(buf); + } /** * @return The offset of this property's text. @@ -97,21 +102,22 @@ public class PropertyNode implements Comparable */ public byte[] getBuf() { - return _buf; + return _buf.toByteArray(); } public boolean equals(Object o) { + byte[] buf = _buf.toByteArray(); if (((PropertyNode)o).getStart() == _cpStart && ((PropertyNode)o).getEnd() == _cpEnd) { byte[] testBuf = ((PropertyNode)o).getBuf(); - if (testBuf.length == _buf.length) + if (testBuf.length == buf.length) { - for (int x = 0; x < _buf.length; x++) + for (int x = 0; x < buf.length; x++) { - if (testBuf[x] != _buf[x]) + if (testBuf[x] != buf[x]) { return false; } @@ -140,4 +146,17 @@ public class PropertyNode implements Comparable return 1; } } + + public void fillCache(Object ref) + { + _propCache = new SoftReference(ref); + } + + public Object getCacheContents() + { + return _propCache == null ? null : _propCache.get(); + } + + + } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/StyleDescription.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/StyleDescription.java index c8f0976b8..68f1bdb9b 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/StyleDescription.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/StyleDescription.java @@ -59,6 +59,8 @@ package org.apache.poi.hwpf.model.hdftypes; import java.io.UnsupportedEncodingException; import java.util.Arrays; +import org.apache.poi.hwpf.usermodel.CharacterProperties; +import org.apache.poi.hwpf.usermodel.ParagraphProperties; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.BitField; /** @@ -70,8 +72,8 @@ import org.apache.poi.util.BitField; public class StyleDescription implements HDFType { - private static int PARAGRAPH_STYLE = 1; - private static int CHARACTER_STYLE = 2; + private final static int PARAGRAPH_STYLE = 1; + private final static int CHARACTER_STYLE = 2; private int _istd; private int _baseLength; @@ -92,11 +94,10 @@ public class StyleDescription implements HDFType private static BitField _fAutoRedef = new BitField(0x1); private static BitField _fHidden = new BitField(0x2); - byte[] _papx; - byte[] _chpx; + UPX[] _upxs; String _name; -// ParagraphProperties _pap; -// CharacterProperties _chp; + ParagraphProperties _pap; + CharacterProperties _chp; public StyleDescription() { @@ -149,33 +150,17 @@ public class StyleDescription implements HDFType // that more may be added in the future int varOffset = grupxStart; int numUPX = _numUPX.getValue(_infoShort3); + _upxs = new UPX[numUPX]; for(int x = 0; x < numUPX; x++) { int upxSize = LittleEndian.getShort(std, varOffset); varOffset += LittleEndian.SHORT_SIZE; - if(_styleTypeCode.getValue(_infoShort2) == PARAGRAPH_STYLE) - { - if(x == 0) - { - _istd = LittleEndian.getShort(std, varOffset); - //varOffset += LittleEndian.SHORT_SIZE; - int grrprlSize = upxSize; - _papx = new byte[grrprlSize]; - System.arraycopy(std, varOffset, _papx, 0, grrprlSize); - varOffset += grrprlSize; - } - else if(x == 1) - { - _chpx = new byte[upxSize]; - System.arraycopy(std, varOffset, _chpx, 0, upxSize); - varOffset += upxSize; - } - } - else if(_styleTypeCode.getValue(_infoShort2) == CHARACTER_STYLE && x == 0) - { - _chpx = new byte[upxSize]; - System.arraycopy(std, varOffset, _chpx, 0, upxSize); - } + + byte[] upx = new byte[upxSize]; + System.arraycopy(std, varOffset, upx, 0, upxSize); + _upxs[x] = new UPX(upx); + varOffset += upxSize; + // the upx will always start on a word boundary. if(upxSize % 2 == 1) @@ -189,32 +174,52 @@ public class StyleDescription implements HDFType } public int getBaseStyle() { - return _baseStyle.getValue(_infoShort2); + return _baseStyle.getValue(_infoShort2); } public byte[] getCHPX() { - return _chpx; + switch (_styleTypeCode.getValue(_infoShort2)) + { + case PARAGRAPH_STYLE: + if (_upxs.length > 1) + { + return _upxs[1].getUPX(); + } + return null; + case CHARACTER_STYLE: + return _upxs[0].getUPX(); + default: + return null; + } + } public byte[] getPAPX() { - return _papx; + switch (_styleTypeCode.getValue(_infoShort2)) + { + case PARAGRAPH_STYLE: + return _upxs[0].getUPX(); + default: + return null; + } } -// public ParagraphProperties getPAP() -// { -// return _pap; -// } -// public CharacterProperties getCHP() -// { -// return _chp; -// } -// public void setPAP(ParagraphProperties pap) -// { -// _pap = pap; -// } -// public void setCHP(CharacterProperties chp) -// { -// _chp = chp; -// } + public ParagraphProperties getPAP() + { + return _pap; + } + public CharacterProperties getCHP() + { + return _chp; + } + void setPAP(ParagraphProperties pap) + { + _pap = pap; + } + void setCHP(CharacterProperties chp) + { + _chp = chp; + } + public byte[] toByteArray() { // size equals _baseLength bytes for known variables plus 2 bytes for name @@ -222,20 +227,16 @@ public class StyleDescription implements HDFType // length int size = _baseLength + 2 + ((_name.length() + 1) * 2); - //only worry about papx and chpx for upxs - if(_styleTypeCode.getValue(_infoShort2) == PARAGRAPH_STYLE) + // determine the size needed for the upxs. They always fall on word + // boundaries. + size += _upxs[0].size() + 2; + for (int x = 1; x < _upxs.length; x++) { - size += _papx.length + 2 + (_papx.length % 2); - if (_chpx != null) - { - size += _chpx.length + 2; - } - } - else if (_styleTypeCode.getValue(_infoShort2) == CHARACTER_STYLE) - { - size += _chpx.length + 2; + size += _upxs[x-1].size() % 2; + size += _upxs[x].size() + 2; } + byte[] buf = new byte[size]; int offset = 0; @@ -248,10 +249,10 @@ public class StyleDescription implements HDFType LittleEndian.putShort(buf, offset, _bchUpe); offset += LittleEndian.SHORT_SIZE; LittleEndian.putShort(buf, offset, _infoShort4); - offset += LittleEndian.SHORT_SIZE; + offset = _baseLength; char[] letters = _name.toCharArray(); - LittleEndian.putShort(buf, offset, (short)letters.length); + LittleEndian.putShort(buf, _baseLength, (short)letters.length); offset += LittleEndian.SHORT_SIZE; for (int x = 0; x < letters.length; x++) { @@ -261,28 +262,13 @@ public class StyleDescription implements HDFType // get past the null delimiter for the name. offset += LittleEndian.SHORT_SIZE; - //only worry about papx and chpx for upxs - if(_styleTypeCode.getValue(_infoShort2) == PARAGRAPH_STYLE) + for (int x = 0; x < _upxs.length; x++) { - LittleEndian.putShort(buf, offset, (short)(_papx.length)); + short upxSize = (short)_upxs[x].size(); + LittleEndian.putShort(buf, offset, upxSize); offset += LittleEndian.SHORT_SIZE; - System.arraycopy(_papx, 0, buf, offset, _papx.length); - offset += _papx.length + (_papx.length % 2); - - if (_chpx != null) - { - LittleEndian.putShort(buf, offset, (short) _chpx.length); - offset += LittleEndian.SHORT_SIZE; - System.arraycopy(_chpx, 0, buf, offset, _chpx.length); - offset += _chpx.length; - } - } - else if (_styleTypeCode.getValue(_infoShort2) == CHARACTER_STYLE) - { - LittleEndian.putShort(buf, offset, (short)_chpx.length); - offset += LittleEndian.SHORT_SIZE; - System.arraycopy(_chpx, 0, buf, offset, _chpx.length); - offset += _chpx.length; + System.arraycopy(_upxs[x].getUPX(), 0, buf, offset, upxSize); + offset += upxSize + (upxSize % 2); } return buf; @@ -297,16 +283,10 @@ public class StyleDescription implements HDFType _name.equals(sd._name)) { - if (!Arrays.equals(_chpx, sd._chpx)) + if (!Arrays.equals(_upxs, sd._upxs)) { return false; } - - if (!Arrays.equals(_papx, sd._papx)) - { - return false; - } - return true; } return false; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/StyleSheet.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/StyleSheet.java index a0c7cae13..89a87c059 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/StyleSheet.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/StyleSheet.java @@ -62,7 +62,10 @@ import java.io.IOException; import org.apache.poi.util.LittleEndian; import org.apache.poi.hwpf.model.io.HWPFOutputStream; -//import org.apache.poi.hdf.model.hdftypes.definitions.TCAbstractType; +import org.apache.poi.hwpf.usermodel.CharacterProperties; +import org.apache.poi.hwpf.usermodel.ParagraphProperties; +import org.apache.poi.hwpf.sprm.ParagraphSprmUncompressor; +import org.apache.poi.hwpf.sprm.CharacterSprmUncompressor; /** * Represents a document's stylesheet. A word documents formatting is stored as @@ -91,7 +94,6 @@ public class StyleSheet implements HDFType private int _stylenameVersion; private int[] _rgftc; - StyleDescription _nilStyle = new StyleDescription(); StyleDescription[] _styleDescriptions; /** @@ -126,11 +128,10 @@ public class StyleSheet implements HDFType _rgftc[2] = LittleEndian.getShort(tableStream, offset); offset += LittleEndian.SHORT_SIZE; - //offset = (2 + _stshiLength); + offset = (LittleEndian.SHORT_SIZE + _stshiLength); _styleDescriptions = new StyleDescription[stdCount]; for(int x = 0; x < stdCount; x++) { - int stdSize = LittleEndian.getShort(tableStream, offset); //get past the size offset += 2; @@ -151,8 +152,8 @@ public class StyleSheet implements HDFType { if(_styleDescriptions[x] != null) { -// createPap(x); -// createChp(x); + createPap(x); + createChp(x); } } } @@ -244,66 +245,66 @@ public class StyleSheet implements HDFType * @param istd The index of the StyleDescription to create the * ParagraphProperties from (and also place the finished PAP in) */ -// private void createPap(int istd) -// { -// StyleDescription sd = _styleDescriptions[istd]; -// ParagraphProperties pap = sd.getPAP(); -// byte[] papx = sd.getPAPX(); -// int baseIndex = sd.getBaseStyle(); -// if(pap == null && papx != null) -// { -// ParagraphProperties parentPAP = _nilStyle.getPAP(); -// if(baseIndex != NIL_STYLE) -// { -// -// parentPAP = _styleDescriptions[baseIndex].getPAP(); -// if(parentPAP == null) -// { -// createPap(baseIndex); -// parentPAP = _styleDescriptions[baseIndex].getPAP(); -// } -// -// } -// -// pap = (ParagraphProperties)uncompressProperty(papx, parentPAP, this); -// sd.setPAP(pap); -// } -// } -// /** -// * Creates a CharacterProperties object from a chpx stored in the -// * StyleDescription at the index istd in the StyleDescription array. The -// * CharacterProperties object is placed in the StyleDescription at istd after -// * its been created. Not every StyleDescription will contain a chpx. In these -// * cases this function does nothing. -// * -// * @param istd The index of the StyleDescription to create the -// * CharacterProperties object from. -// */ -// private void createChp(int istd) -// { -// StyleDescription sd = _styleDescriptions[istd]; -// CharacterProperties chp = sd.getCHP(); -// byte[] chpx = sd.getCHPX(); -// int baseIndex = sd.getBaseStyle(); -// if(chp == null && chpx != null) -// { -// CharacterProperties parentCHP = _nilStyle.getCHP(); -// if(baseIndex != NIL_STYLE) -// { -// -// parentCHP = _styleDescriptions[baseIndex].getCHP(); -// if(parentCHP == null) -// { -// createChp(baseIndex); -// parentCHP = _styleDescriptions[baseIndex].getCHP(); -// } -// -// } -// -// chp = (CharacterProperties)uncompressProperty(chpx, parentCHP, this); -// sd.setCHP(chp); -// } -// } + private void createPap(int istd) + { + StyleDescription sd = _styleDescriptions[istd]; + ParagraphProperties pap = sd.getPAP(); + byte[] papx = sd.getPAPX(); + int baseIndex = sd.getBaseStyle(); + if(pap == null && papx != null) + { + ParagraphProperties parentPAP = new ParagraphProperties(); + if(baseIndex != NIL_STYLE) + { + + parentPAP = _styleDescriptions[baseIndex].getPAP(); + if(parentPAP == null) + { + createPap(baseIndex); + parentPAP = _styleDescriptions[baseIndex].getPAP(); + } + + } + + pap = (ParagraphProperties)ParagraphSprmUncompressor.uncompressPAP(parentPAP, papx, 2); + sd.setPAP(pap); + } + } + /** + * Creates a CharacterProperties object from a chpx stored in the + * StyleDescription at the index istd in the StyleDescription array. The + * CharacterProperties object is placed in the StyleDescription at istd after + * its been created. Not every StyleDescription will contain a chpx. In these + * cases this function does nothing. + * + * @param istd The index of the StyleDescription to create the + * CharacterProperties object from. + */ + private void createChp(int istd) + { + StyleDescription sd = _styleDescriptions[istd]; + CharacterProperties chp = sd.getCHP(); + byte[] chpx = sd.getCHPX(); + int baseIndex = sd.getBaseStyle(); + if(chp == null && chpx != null) + { + CharacterProperties parentCHP = new CharacterProperties(); + if(baseIndex != NIL_STYLE) + { + + parentCHP = _styleDescriptions[baseIndex].getCHP(); + if(parentCHP == null) + { + createChp(baseIndex); + parentCHP = _styleDescriptions[baseIndex].getCHP(); + } + + } + + chp = (CharacterProperties)CharacterSprmUncompressor.uncompressCHP(parentCHP, chpx, 0); + sd.setCHP(chp); + } + } /** * Gets the StyleDescription at index x. @@ -315,1310 +316,14 @@ public class StyleSheet implements HDFType return _styleDescriptions[x]; } -// /** -// * Used in decompression of a chpx. This performs an operation defined by -// * a single sprm. -// * -// * @param oldCHP The base CharacterProperties. -// * @param newCHP The current CharacterProperties. -// * @param operand The operand defined by the sprm (See Word file format spec) -// * @param param The parameter defined by the sprm (See Word file format spec) -// * @param varParam The variable length parameter defined by the sprm. (See -// * Word file format spec) -// * @param grpprl The entire chpx that this operation is a part of. -// * @param offset The offset in the grpprl of the next sprm -// * @param styleSheet The StyleSheet for this document. -// */ -// static void doCHPOperation(CharacterProperties oldCHP, CharacterProperties newCHP, -// int operand, int param, -// byte[] varParam, byte[] grpprl, int offset, -// StyleSheet styleSheet) -// { -// switch(operand) -// { -// case 0: -// newCHP.setFRMarkDel(getFlag(param)); -// break; -// case 0x1: -// newCHP.setFRMark(getFlag(param)); -// break; -// case 0x2: -// break; -// case 0x3: -// newCHP.setFcPic(param); -// newCHP.setFSpec(true); -// break; -// case 0x4: -// newCHP.setIbstRMark((short)param); -// break; -// case 0x5: -// short[] dttmRMark = new short[2]; -// dttmRMark[0] = LittleEndian.getShort(grpprl, (offset - 4)); -// dttmRMark[1] = LittleEndian.getShort(grpprl, (offset - 2)); -// newCHP.setDttmRMark(dttmRMark); -// break; -// case 0x6: -// newCHP.setFData(getFlag(param)); -// break; -// case 0x7: -// //don't care about this -// break; -// case 0x8: -// short chsDiff = (short)((param & 0xff0000) >>> 8); -// newCHP.setFChsDiff(getFlag(chsDiff)); -// newCHP.setChse((short)(param & 0xffff)); -// break; -// case 0x9: -// newCHP.setFSpec(true); -// newCHP.setFtcSym((short)LittleEndian.getShort(varParam, 0)); -// newCHP.setXchSym((short)LittleEndian.getShort(varParam, 2)); -// break; -// case 0xa: -// newCHP.setFOle2(getFlag(param)); -// break; -// case 0xb: -// //? -// break; -// case 0xc: -// newCHP.setIcoHighlight((byte)param); -// newCHP.setFHighlight(getFlag(param)); -// break; -// case 0xd: -// break; -// case 0xe: -// newCHP.setFcObj(param); -// break; -// case 0xf: -// break; -// case 0x10: -// //? -// break; -// case 0x11: -// break; -// case 0x12: -// break; -// case 0x13: -// break; -// case 0x14: -// break; -// case 0x15: -// break; -// case 0x16: -// break; -// case 0x17: -// break; -// case 0x18: -// break; -// case 0x19: -// break; -// case 0x1a: -// break; -// case 0x1b: -// break; -// case 0x1c: -// break; -// case 0x1d: -// break; -// case 0x1e: -// break; -// case 0x1f: -// break; -// case 0x20: -// break; -// case 0x21: -// break; -// case 0x22: -// break; -// case 0x23: -// break; -// case 0x24: -// break; -// case 0x25: -// break; -// case 0x26: -// break; -// case 0x27: -// break; -// case 0x28: -// break; -// case 0x29: -// break; -// case 0x2a: -// break; -// case 0x2b: -// break; -// case 0x2c: -// break; -// case 0x2d: -// break; -// case 0x2e: -// break; -// case 0x2f: -// break; -// case 0x30: -// newCHP.setIstd(param); -// break; -// case 0x31: -// //permutation vector for fast saves, who cares! -// break; -// case 0x32: -// newCHP.setFBold(false); -// newCHP.setFItalic(false); -// newCHP.setFOutline(false); -// newCHP.setFStrike(false); -// newCHP.setFShadow(false); -// newCHP.setFSmallCaps(false); -// newCHP.setFCaps(false); -// newCHP.setFVanish(false); -// newCHP.setKul((byte)0); -// newCHP.setIco((byte)0); -// break; -// case 0x33: -// try -// { -// newCHP = (CharacterProperties)oldCHP.clone(); -// } -// catch(CloneNotSupportedException e) -// { -// //do nothing -// } -// return; -// case 0x34: -// break; -// case 0x35: -// newCHP.setFBold(getCHPFlag((byte)param, oldCHP.isFBold())); -// break; -// case 0x36: -// newCHP.setFItalic(getCHPFlag((byte)param, oldCHP.isFItalic())); -// break; -// case 0x37: -// newCHP.setFStrike(getCHPFlag((byte)param, oldCHP.isFStrike())); -// break; -// case 0x38: -// newCHP.setFOutline(getCHPFlag((byte)param, oldCHP.isFOutline())); -// break; -// case 0x39: -// newCHP.setFShadow(getCHPFlag((byte)param, oldCHP.isFShadow())); -// break; -// case 0x3a: -// newCHP.setFSmallCaps(getCHPFlag((byte)param, oldCHP.isFSmallCaps())); -// break; -// case 0x3b: -// newCHP.setFCaps(getCHPFlag((byte)param, oldCHP.isFCaps())); -// break; -// case 0x3c: -// newCHP.setFVanish(getCHPFlag((byte)param, oldCHP.isFVanish())); -// break; -// case 0x3d: -// newCHP.setFtcAscii((short)param); -// break; -// case 0x3e: -// newCHP.setKul((byte)param); -// break; -// case 0x3f: -// int hps = param & 0xff; -// if(hps != 0) -// { -// newCHP.setHps(hps); -// } -// byte cInc = (byte)(((byte)(param & 0xfe00) >>> 4) >> 1); -// if(cInc != 0) -// { -// newCHP.setHps(Math.max(newCHP.getHps() + (cInc * 2), 2)); -// } -// byte hpsPos = (byte)((param & 0xff0000) >>> 8); -// if(hpsPos != 0x80) -// { -// newCHP.setHpsPos(hpsPos); -// } -// boolean fAdjust = (param & 0x0100) > 0; -// if(fAdjust && hpsPos != 128 && hpsPos != 0 && oldCHP.getHpsPos() == 0) -// { -// newCHP.setHps(Math.max(newCHP.getHps() + (-2), 2)); -// } -// if(fAdjust && hpsPos == 0 && oldCHP.getHpsPos() != 0) -// { -// newCHP.setHps(Math.max(newCHP.getHps() + 2, 2)); -// } -// break; -// case 0x40: -// newCHP.setDxaSpace(param); -// break; -// case 0x41: -// newCHP.setLidDefault((short)param); -// break; -// case 0x42: -// newCHP.setIco((byte)param); -// break; -// case 0x43: -// newCHP.setHps(param); -// break; -// case 0x44: -// byte hpsLvl = (byte)param; -// newCHP.setHps(Math.max(newCHP.getHps() + (hpsLvl * 2), 2)); -// break; -// case 0x45: -// newCHP.setHpsPos((short)param); -// break; -// case 0x46: -// if(param != 0) -// { -// if(oldCHP.getHpsPos() == 0) -// { -// newCHP.setHps(Math.max(newCHP.getHps() + (-2), 2)); -// } -// } -// else -// { -// if(oldCHP.getHpsPos() != 0) -// { -// newCHP.setHps(Math.max(newCHP.getHps() + 2, 2)); -// } -// } -// break; -// case 0x47: -// CharacterProperties genCHP = new CharacterProperties(); -// genCHP.setFtcAscii(4); -// genCHP = (CharacterProperties)uncompressProperty(varParam, genCHP, styleSheet); -// CharacterProperties styleCHP = styleSheet.getStyleDescription(oldCHP.getBaseIstd()).getCHP(); -// if(genCHP.isFBold() == newCHP.isFBold()) -// { -// newCHP.setFBold(styleCHP.isFBold()); -// } -// if(genCHP.isFItalic() == newCHP.isFItalic()) -// { -// newCHP.setFItalic(styleCHP.isFItalic()); -// } -// if(genCHP.isFSmallCaps() == newCHP.isFSmallCaps()) -// { -// newCHP.setFSmallCaps(styleCHP.isFSmallCaps()); -// } -// if(genCHP.isFVanish() == newCHP.isFVanish()) -// { -// newCHP.setFVanish(styleCHP.isFVanish()); -// } -// if(genCHP.isFStrike() == newCHP.isFStrike()) -// { -// newCHP.setFStrike(styleCHP.isFStrike()); -// } -// if(genCHP.isFCaps() == newCHP.isFCaps()) -// { -// newCHP.setFCaps(styleCHP.isFCaps()); -// } -// if(genCHP.getFtcAscii() == newCHP.getFtcAscii()) -// { -// newCHP.setFtcAscii(styleCHP.getFtcAscii()); -// } -// if(genCHP.getFtcFE() == newCHP.getFtcFE()) -// { -// newCHP.setFtcFE(styleCHP.getFtcFE()); -// } -// if(genCHP.getFtcOther() == newCHP.getFtcOther()) -// { -// newCHP.setFtcOther(styleCHP.getFtcOther()); -// } -// if(genCHP.getHps() == newCHP.getHps()) -// { -// newCHP.setHps(styleCHP.getHps()); -// } -// if(genCHP.getHpsPos() == newCHP.getHpsPos()) -// { -// newCHP.setHpsPos(styleCHP.getHpsPos()); -// } -// if(genCHP.getKul() == newCHP.getKul()) -// { -// newCHP.setKul(styleCHP.getKul()); -// } -// if(genCHP.getDxaSpace() == newCHP.getDxaSpace()) -// { -// newCHP.setDxaSpace(styleCHP.getDxaSpace()); -// } -// if(genCHP.getIco() == newCHP.getIco()) -// { -// newCHP.setIco(styleCHP.getIco()); -// } -// if(genCHP.getLidDefault() == newCHP.getLidDefault()) -// { -// newCHP.setLidDefault(styleCHP.getLidDefault()); -// } -// if(genCHP.getLidFE() == newCHP.getLidFE()) -// { -// newCHP.setLidFE(styleCHP.getLidFE()); -// } -// break; -// case 0x48: -// newCHP.setIss((byte)param); -// break; -// case 0x49: -// newCHP.setHps(LittleEndian.getShort(varParam, 0)); -// break; -// case 0x4a: -// int increment = LittleEndian.getShort(varParam, 0); -// newCHP.setHps(Math.max(newCHP.getHps() + increment, 8)); -// break; -// case 0x4b: -// newCHP.setHpsKern(param); -// break; -// case 0x4c: -// doCHPOperation(oldCHP, newCHP, 0x47, param, varParam, grpprl, offset, styleSheet); -// break; -// case 0x4d: -// float percentage = (float)param/100.0f; -// int add = (int)((float)percentage * (float)newCHP.getHps()); -// newCHP.setHps(newCHP.getHps() + add); -// break; -// case 0x4e: -// newCHP.setYsr((byte)param); -// break; -// case 0x4f: -// newCHP.setFtcAscii((short)param); -// break; -// case 0x50: -// newCHP.setFtcFE((short)param); -// break; -// case 0x51: -// newCHP.setFtcOther((short)param); -// break; -// case 0x52: -// break; -// case 0x53: -// newCHP.setFDStrike(getFlag(param)); -// break; -// case 0x54: -// newCHP.setFImprint(getFlag(param)); -// break; -// case 0x55: -// newCHP.setFSpec(getFlag(param)); -// break; -// case 0x56: -// newCHP.setFObj(getFlag(param)); -// break; -// case 0x57: -// newCHP.setFPropMark(varParam[0]); -// newCHP.setIbstPropRMark((short)LittleEndian.getShort(varParam, 1)); -// newCHP.setDttmPropRMark(LittleEndian.getInt(varParam, 3)); -// break; -// case 0x58: -// newCHP.setFEmboss(getFlag(param)); -// break; -// case 0x59: -// newCHP.setSfxtText((byte)param); -// break; -// case 0x5a: -// break; -// case 0x5b: -// break; -// case 0x5c: -// break; -// case 0x5d: -// break; -// case 0x5e: -// break; -// case 0x5f: -// break; -// case 0x60: -// break; -// case 0x61: -// break; -// case 0x62: -// byte[] xstDispFldRMark = new byte[32]; -// newCHP.setFDispFldRMark(varParam[0]); -// newCHP.setIbstDispFldRMark((short)LittleEndian.getShort(varParam, 1)); -// newCHP.setDttmDispFldRMark(LittleEndian.getInt(varParam, 3)); -// System.arraycopy(varParam, 7, xstDispFldRMark, 0, 32); -// newCHP.setXstDispFldRMark(xstDispFldRMark); -// break; -// case 0x63: -// newCHP.setIbstRMarkDel((short)param); -// break; -// case 0x64: -// short[] dttmRMarkDel = new short[2]; -// dttmRMarkDel[0] = LittleEndian.getShort(grpprl, offset - 4); -// dttmRMarkDel[1] = LittleEndian.getShort(grpprl, offset - 2); -// newCHP.setDttmRMarkDel(dttmRMarkDel); -// break; -// case 0x65: -// short[] brc = new short[2]; -// brc[0] = (short)LittleEndian.getShort(grpprl, offset - 4); -// brc[1] = (short)LittleEndian.getShort(grpprl, offset - 2); -// newCHP.setBrc(brc); -// break; -// case 0x66: -// newCHP.setShd((short)param); -// break; -// case 0x67: -// break; -// case 0x68: -// break; -// case 0x69: -// break; -// case 0x6a: -// break; -// case 0x6b: -// break; -// case 0x6c: -// break; -// case 0x6d: -// newCHP.setLidDefault((short)param); -// break; -// case 0x6e: -// newCHP.setLidFE((short)param); -// break; -// case 0x6f: -// newCHP.setIdctHint((byte)param); -// break; -// } -// } - - /** - * Used to uncompress a property stored in a grpprl. These include - * CharacterProperties, ParagraphProperties, TableProperties, and - * SectionProperties. - * - * @param grpprl The compressed form of the property. - * @param parent The base property of the property. - * @param styleSheet The document's stylesheet. - * - * @return An object that should be casted to the appropriate property. - */ -// public static Object uncompressProperty(byte[] grpprl, Object parent, StyleSheet styleSheet) -// { -// return uncompressProperty(grpprl, parent, styleSheet, true); -// } - -// /** -// * Used to uncompress a property stored in a grpprl. These include -// * CharacterProperties, ParagraphProperties, TableProperties, and -// * SectionProperties. -// * -// * @param grpprl The compressed form of the property. -// * @param parent The base property of the property. -// * @param styleSheet The document's stylesheet. -// * -// * @return An object that should be casted to the appropriate property. -// */ -// public static Object uncompressProperty(byte[] grpprl, Object parent, StyleSheet styleSheet, boolean doIstd) -// { -// Object newProperty = null; -// int offset = 0; -// int propertyType = PAP_TYPE; -// -// -// if(parent instanceof ParagraphProperties) -// { -// try -// { -// newProperty = ((ParagraphProperties)parent).clone(); -// } -// catch(Exception e){} -// if(doIstd) -// { -// ((ParagraphProperties)newProperty).setIstd(LittleEndian.getShort(grpprl, 0)); -// -// offset = 2; -// } -// } -// else if(parent instanceof CharacterProperties) -// { -// try -// { -// newProperty = ((CharacterProperties)parent).clone(); -// ((CharacterProperties)newProperty).setBaseIstd(((CharacterProperties)parent).getIstd()); -// } -// catch(Exception e){} -// propertyType = CHP_TYPE; -// } -// else if(parent instanceof SectionProperties) -// { -// newProperty = parent; -// propertyType = SEP_TYPE; -// } -// else if(parent instanceof TableProperties) -// { -// newProperty = parent; -// propertyType = TAP_TYPE; -// offset = 2;//because this is really just a papx -// } -// else -// { -// return null; -// } -// -// while(offset < grpprl.length) -// { -// short sprm = LittleEndian.getShort(grpprl, offset); -// offset += 2; -// -// byte spra = (byte)((sprm & 0xe000) >> 13); -// int opSize = 0; -// int param = 0; -// byte[] varParam = null; -// -// switch(spra) -// { -// case 0: -// case 1: -// opSize = 1; -// param = grpprl[offset]; -// break; -// case 2: -// opSize = 2; -// param = LittleEndian.getShort(grpprl, offset); -// break; -// case 3: -// opSize = 4; -// param = LittleEndian.getInt(grpprl, offset); -// break; -// case 4: -// case 5: -// opSize = 2; -// param = LittleEndian.getShort(grpprl, offset); -// break; -// case 6://variable size -// -// //there is one sprm that is a very special case -// if(sprm != (short)0xd608) -// { -// opSize = LittleEndian.getUnsignedByte(grpprl, offset); -// offset++; -// } -// else -// { -// opSize = LittleEndian.getShort(grpprl, offset) - 1; -// offset += 2; -// } -// varParam = new byte[opSize]; -// System.arraycopy(grpprl, offset, varParam, 0, opSize); -// -// break; -// case 7: -// opSize = 3; -// byte threeByteInt[] = new byte[4]; -// threeByteInt[0] = grpprl[offset]; -// threeByteInt[1] = grpprl[offset + 1]; -// threeByteInt[2] = grpprl[offset + 2]; -// threeByteInt[3] = (byte)0; -// param = LittleEndian.getInt(threeByteInt, 0); -// break; -// default: -// throw new RuntimeException("unrecognized pap opcode"); -// } -// -// offset += opSize; -// short operand = (short)(sprm & 0x1ff); -// byte type = (byte)((sprm & 0x1c00) >> 10); -// switch(propertyType) -// { -// case PAP_TYPE: -// if(type == 1)//papx stores TAP sprms along with PAP sprms -// { -// doPAPOperation((ParagraphProperties)newProperty, operand, -// param, varParam, grpprl, -// offset, spra); -// } -// break; -// case CHP_TYPE: -// -// doCHPOperation((CharacterProperties)parent, -// (CharacterProperties)newProperty, -// operand, param, varParam, -// grpprl, offset, styleSheet); -// break; -// case SEP_TYPE: -// -// doSEPOperation((SectionProperties)newProperty, operand, param, varParam); -// break; -// case TAP_TYPE: -// if(type == 5) -// { -// doTAPOperation((TableProperties)newProperty, operand, param, varParam); -// } -// break; -// } -// -// -// } -// return newProperty; -// -// } -// /** -// * Performs an operation on a ParagraphProperties object. Used to uncompress -// * from a papx. -// * -// * @param newPAP The ParagraphProperties object to perform the operation on. -// * @param operand The operand that defines the operation. -// * @param param The operation's parameter. -// * @param varParam The operation's variable length parameter. -// * @param grpprl The original papx. -// * @param offset The current offset in the papx. -// * @param spra A part of the sprm that defined this operation. -// */ -// static void doPAPOperation(ParagraphProperties newPAP, int operand, int param, -// byte[] varParam, byte[] grpprl, int offset, -// int spra) -// { -// switch(operand) -// { -// case 0: -// newPAP.setIstd(param); -// break; -// case 0x1: -// //permuteIstd(newPAP, varParam); -// break; -// case 0x2: -// if(newPAP.getIstd() <=9 || newPAP.getIstd() >=1) -// { -// newPAP.setIstd(newPAP.getIstd() + param); -// if(param > 0) -// { -// newPAP.setIstd(Math.max(newPAP.getIstd(), 9)); -// } -// else -// { -// newPAP.setIstd(Math.min(newPAP.getIstd(), 1)); -// } -// } -// break; -// case 0x3: -// newPAP.setJc((byte)param); -// break; -// case 0x4: -// newPAP.setFSideBySide((byte)param); -// break; -// case 0x5: -// newPAP.setFKeep((byte)param); -// break; -// case 0x6: -// newPAP.setFKeepFollow((byte)param); -// break; -// case 0x7: -// newPAP.setFPageBreakBefore((byte)param); -// break; -// case 0x8: -// newPAP.setBrcl((byte)param); -// break; -// case 0x9: -// newPAP.setBrcp((byte)param); -// break; -// case 0xa: -// newPAP.setIlvl((byte)param); -// break; -// case 0xb: -// newPAP.setIlfo(param); -// break; -// case 0xc: -// newPAP.setFNoLnn((byte)param); -// break; -// case 0xd: -// /**@todo handle tabs*/ -// break; -// case 0xe: -// newPAP.setDxaRight(param); -// break; -// case 0xf: -// newPAP.setDxaLeft(param); -// break; -// case 0x10: -// newPAP.setDxaLeft(newPAP.getDxaLeft() + param); -// newPAP.setDxaLeft(Math.max(0, newPAP.getDxaLeft())); -// break; -// case 0x11: -// newPAP.setDxaLeft1(param); -// break; -// case 0x12: -// short[] lspd = newPAP.getLspd(); -// lspd[0] = LittleEndian.getShort(grpprl, offset - 4); -// lspd[1] = LittleEndian.getShort(grpprl, offset - 2); -// break; -// case 0x13: -// newPAP.setDyaBefore(param); -// break; -// case 0x14: -// newPAP.setDyaAfter(param); -// break; -// case 0x15: -// /**@todo handle tabs*/ -// break; -// case 0x16: -// newPAP.setFInTable((byte)param); -// break; -// case 0x17: -// newPAP.setFTtp((byte)param); -// break; -// case 0x18: -// newPAP.setDxaAbs(param); -// break; -// case 0x19: -// newPAP.setDyaAbs(param); -// break; -// case 0x1a: -// newPAP.setDxaWidth(param); -// break; -// case 0x1b: -// /** @todo handle paragraph postioning*/ -// /*byte pcVert = (param & 0x0c) >> 2; -// byte pcHorz = param & 0x03; -// if(pcVert != 3) -// { -// newPAP._pcVert = pcVert; -// } -// if(pcHorz != 3) -// { -// newPAP._pcHorz = pcHorz; -// }*/ -// break; -// case 0x1c: -// //newPAP.setBrcTop1((short)param); -// break; -// case 0x1d: -// //newPAP.setBrcLeft1((short)param); -// break; -// case 0x1e: -// //newPAP.setBrcBottom1((short)param); -// break; -// case 0x1f: -// //newPAP.setBrcRight1((short)param); -// break; -// case 0x20: -// //newPAP.setBrcBetween1((short)param); -// break; -// case 0x21: -// //newPAP.setBrcBar1((byte)param); -// break; -// case 0x22: -// newPAP.setDxaFromText(param); -// break; -// case 0x23: -// newPAP.setWr((byte)param); -// break; -// case 0x24: -// short[] brcTop = newPAP.getBrcTop(); -// brcTop[0] = (short)LittleEndian.getShort(grpprl, offset - 4); -// brcTop[1] = (short)LittleEndian.getShort(grpprl, offset - 2); -// break; -// case 0x25: -// short[] brcLeft = newPAP.getBrcLeft(); -// brcLeft[0] = (short)LittleEndian.getShort(grpprl, offset - 4); -// brcLeft[1] = (short)LittleEndian.getShort(grpprl, offset - 2); -// break; -// case 0x26: -// short[] brcBottom = newPAP.getBrcBottom(); -// brcBottom[0] = (short)LittleEndian.getShort(grpprl, offset - 4); -// brcBottom[1] = (short)LittleEndian.getShort(grpprl, offset - 2); -// break; -// case 0x27: -// short[] brcRight = newPAP.getBrcRight(); -// brcRight[0] = (short)LittleEndian.getShort(grpprl, offset - 4); -// brcRight[1] = (short)LittleEndian.getShort(grpprl, offset - 2); -// break; -// case 0x28: -// short[] brcBetween = newPAP.getBrcBetween(); -// brcBetween[0] = (short)LittleEndian.getShort(grpprl, offset - 4); -// brcBetween[1] = (short)LittleEndian.getShort(grpprl, offset - 2); -// break; -// case 0x29: -// short[] brcBar = newPAP.getBrcBar(); -// brcBar[0] = (short)LittleEndian.getShort(grpprl, offset - 4); -// brcBar[1] = (short)LittleEndian.getShort(grpprl, offset - 2); -// break; -// case 0x2a: -// newPAP.setFNoAutoHyph((byte)param); -// break; -// case 0x2b: -// newPAP.setDyaHeight(param); -// break; -// case 0x2c: -// newPAP.setDcs((short)param); -// break; -// case 0x2d: -// newPAP.setShd((short)param); -// break; -// case 0x2e: -// newPAP.setDyaFromText(param); -// break; -// case 0x2f: -// newPAP.setDxaFromText(param); -// break; -// case 0x30: -// newPAP.setFLocked((byte)param); -// break; -// case 0x31: -// newPAP.setFWidowControl((byte)param); -// break; -// case 0x32: -// //undocumented -// break; -// case 0x33: -// newPAP.setFKinsoku((byte)param); -// break; -// case 0x34: -// newPAP.setFWordWrap((byte)param); -// break; -// case 0x35: -// newPAP.setFOverflowPunct((byte)param); -// break; -// case 0x36: -// newPAP.setFTopLinePunct((byte)param); -// break; -// case 0x37: -// newPAP.setFAutoSpaceDE((byte)param); -// break; -// case 0x38: -// newPAP.setFAutoSpaceDN((byte)param); -// break; -// case 0x39: -// newPAP.setWAlignFont(param); -// break; -// case 0x3a: -// newPAP.setFontAlign((short)param); -// break; -// case 0x3b: -// //obsolete -// break; -// case 0x3e: -// newPAP.setAnld(varParam); -// break; -// case 0x3f: -// //don't really need this. spec is confusing regarding this -// //sprm -// break; -// case 0x40: -// //newPAP._lvl = param; -// break; -// case 0x41: -// //? -// break; -// case 0x43: -// //? -// break; -// case 0x44: -// //? -// break; -// case 0x45: -// if(spra == 6) -// { -// newPAP.setNumrm(varParam); -// } -// else -// { -// /**@todo handle large PAPX from data stream*/ -// } -// break; -// -// case 0x47: -// newPAP.setFUsePgsuSettings((byte)param); -// break; -// case 0x48: -// newPAP.setFAdjustRight((byte)param); -// break; -// default: -// break; -// } -// } -// /** -// * Used to uncompress a table property. Performs an operation defined -// * by a sprm stored in a tapx. -// * -// * @param newTAP The TableProperties object to perform the operation on. -// * @param operand The operand that defines this operation. -// * @param param The parameter for this operation. -// * @param varParam Variable length parameter for this operation. -// */ -// static void doTAPOperation(TableProperties newTAP, int operand, int param, byte[] varParam) -// { -// switch(operand) -// { -// case 0: -// newTAP.setJc((short)param); -// break; -// case 0x01: -// { -// short[] rgdxaCenter = newTAP.getRgdxaCenter(); -// short itcMac = newTAP.getItcMac(); -// int adjust = param - (rgdxaCenter[0] + newTAP.getDxaGapHalf()); -// for(int x = 0; x < itcMac; x++) -// { -// rgdxaCenter[x] += adjust; -// } -// break; -// } -// case 0x02: -// { -// short[] rgdxaCenter = newTAP.getRgdxaCenter(); -// if(rgdxaCenter != null) -// { -// int adjust = newTAP.getDxaGapHalf() - param; -// rgdxaCenter[0] += adjust; -// } -// newTAP.setDxaGapHalf(param); -// break; -// } -// case 0x03: -// newTAP.setFCantSplit(getFlag(param)); -// break; -// case 0x04: -// newTAP.setFTableHeader(getFlag(param)); -// break; -// case 0x05: -// { -// short[] brcTop = newTAP.getBrcTop(); -// short[] brcLeft = newTAP.getBrcLeft(); -// short[] brcBottom = newTAP.getBrcBottom(); -// short[] brcRight = newTAP.getBrcRight(); -// short[] brcVertical = newTAP.getBrcVertical(); -// short[] brcHorizontal = newTAP.getBrcHorizontal(); -// -// brcTop[0] = LittleEndian.getShort(varParam, 0); -// brcTop[1] = LittleEndian.getShort(varParam, 2); -// -// brcLeft[0] = LittleEndian.getShort(varParam, 4); -// brcLeft[1] = LittleEndian.getShort(varParam, 6); -// -// brcBottom[0] = LittleEndian.getShort(varParam, 8); -// brcBottom[1] = LittleEndian.getShort(varParam, 10); -// -// brcRight[0] = LittleEndian.getShort(varParam, 12); -// brcRight[1] = LittleEndian.getShort(varParam, 14); -// -// brcHorizontal[0] = LittleEndian.getShort(varParam, 16); -// brcHorizontal[1] = LittleEndian.getShort(varParam, 18); -// -// brcVertical[0] = LittleEndian.getShort(varParam, 20); -// brcVertical[1] = LittleEndian.getShort(varParam, 22); -// break; -// } -// case 0x06: -// //obsolete, used in word 1.x -// break; -// case 0x07: -// newTAP.setDyaRowHeight(param); -// break; -// case 0x08: -// { -// short[] rgdxaCenter = new short[varParam[0] + 1]; -// TableCellDescriptor[] rgtc = new TableCellDescriptor[varParam[0]]; -// short itcMac = varParam[0]; -// //I use varParam[0] and newTAP._itcMac interchangably -// newTAP.setItcMac(itcMac); -// newTAP.setRgdxaCenter(rgdxaCenter) ; -// newTAP.setRgtc(rgtc); -// -// for(int x = 0; x < itcMac; x++) -// { -// rgdxaCenter[x] = LittleEndian.getShort(varParam , 1 + (x * 2)); -// rgtc[x] = TableCellDescriptor.convertBytesToTC(varParam, 1 + ((itcMac + 1) * 2) + (x * 20)); -// } -// rgdxaCenter[itcMac] = LittleEndian.getShort(varParam , 1 + (itcMac * 2)); -// break; -// } -// case 0x09: -// /** @todo handle cell shading*/ -// break; -// case 0x0a: -// /** @todo handle word defined table styles*/ -// break; -// case 0x20: -// { -// TCAbstractType[] rgtc = newTAP.getRgtc(); -// -// for(int x = varParam[0]; x < varParam[1]; x++) -// { -// -// if((varParam[2] & 0x08) > 0) -// { -// short[] brcRight = rgtc[x].getBrcRight(); -// brcRight[0] = LittleEndian.getShort(varParam, 6); -// brcRight[1] = LittleEndian.getShort(varParam, 8); -// } -// else if((varParam[2] & 0x04) > 0) -// { -// short[] brcBottom = rgtc[x].getBrcBottom(); -// brcBottom[0] = LittleEndian.getShort(varParam, 6); -// brcBottom[1] = LittleEndian.getShort(varParam, 8); -// } -// else if((varParam[2] & 0x02) > 0) -// { -// short[] brcLeft = rgtc[x].getBrcLeft(); -// brcLeft[0] = LittleEndian.getShort(varParam, 6); -// brcLeft[1] = LittleEndian.getShort(varParam, 8); -// } -// else if((varParam[2] & 0x01) > 0) -// { -// short[] brcTop = rgtc[x].getBrcTop(); -// brcTop[0] = LittleEndian.getShort(varParam, 6); -// brcTop[1] = LittleEndian.getShort(varParam, 8); -// } -// } -// break; -// } -// case 0x21: -// int index = (param & 0xff000000) >> 24; -// int count = (param & 0x00ff0000) >> 16; -// int width = (param & 0x0000ffff); -// int itcMac = newTAP.getItcMac(); -// -// short[] rgdxaCenter = new short[itcMac + count + 1]; -// TableCellDescriptor[] rgtc = new TableCellDescriptor[itcMac + count]; -// if(index >= itcMac) -// { -// index = itcMac; -// System.arraycopy(newTAP.getRgdxaCenter(), 0, rgdxaCenter, 0, itcMac + 1); -// System.arraycopy(newTAP.getRgtc(), 0, rgtc, 0, itcMac); -// } -// else -// { -// //copy rgdxaCenter -// System.arraycopy(newTAP.getRgdxaCenter(), 0, rgdxaCenter, 0, index + 1); -// System.arraycopy(newTAP.getRgdxaCenter(), index + 1, rgdxaCenter, index + count, itcMac - (index)); -// //copy rgtc -// System.arraycopy(newTAP.getRgtc(), 0, rgtc, 0, index); -// System.arraycopy(newTAP.getRgtc(), index, rgtc, index + count, itcMac - index); -// } -// -// for(int x = index; x < index + count; x++) -// { -// rgtc[x] = new TableCellDescriptor(); -// rgdxaCenter[x] = (short)(rgdxaCenter[x-1] + width); -// } -// rgdxaCenter[index + count] = (short)(rgdxaCenter[(index + count)-1] + width); -// break; -// /**@todo handle table sprms from complex files*/ -// case 0x22: -// case 0x23: -// case 0x24: -// case 0x25: -// case 0x26: -// case 0x27: -// case 0x28: -// case 0x29: -// case 0x2a: -// case 0x2b: -// case 0x2c: -// break; -// default: -// break; -// } -// } -// /** -// * Used in decompression of a sepx. This performs an operation defined by -// * a single sprm. -// * -// * @param newSEP The SectionProperty to perfrom the operation on. -// * @param operand The operation to perform. -// * @param param The operation's parameter. -// * @param varParam The operation variable length parameter. -// */ -// static void doSEPOperation(SectionProperties newSEP, int operand, int param, byte[] varParam) -// { -// switch(operand) -// { -// case 0: -// newSEP.setCnsPgn((byte)param); -// break; -// case 0x1: -// newSEP.setIHeadingPgn((byte)param); -// break; -// case 0x2: -// newSEP.setOlstAnm(varParam); -// break; -// case 0x3: -// //not quite sure -// break; -// case 0x4: -// //not quite sure -// break; -// case 0x5: -// newSEP.setFEvenlySpaced(getFlag(param)); -// break; -// case 0x6: -// newSEP.setFUnlocked(getFlag(param)); -// break; -// case 0x7: -// newSEP.setDmBinFirst((short)param); -// break; -// case 0x8: -// newSEP.setDmBinOther((short)param); -// break; -// case 0x9: -// newSEP.setBkc((byte)param); -// break; -// case 0xa: -// newSEP.setFTitlePage(getFlag(param)); -// break; -// case 0xb: -// newSEP.setCcolM1((short)param); -// break; -// case 0xc: -// newSEP.setDxaColumns(param); -// break; -// case 0xd: -// newSEP.setFAutoPgn(getFlag(param)); -// break; -// case 0xe: -// newSEP.setNfcPgn((byte)param); -// break; -// case 0xf: -// newSEP.setDyaPgn((short)param); -// break; -// case 0x10: -// newSEP.setDxaPgn((short)param); -// break; -// case 0x11: -// newSEP.setFPgnRestart(getFlag(param)); -// break; -// case 0x12: -// newSEP.setFEndNote(getFlag(param)); -// break; -// case 0x13: -// newSEP.setLnc((byte)param); -// break; -// case 0x14: -// newSEP.setGrpfIhdt((byte)param); -// break; -// case 0x15: -// newSEP.setNLnnMod((short)param); -// break; -// case 0x16: -// newSEP.setDxaLnn(param); -// break; -// case 0x17: -// newSEP.setDyaHdrTop(param); -// break; -// case 0x18: -// newSEP.setDyaHdrBottom(param); -// break; -// case 0x19: -// newSEP.setFLBetween(getFlag(param)); -// break; -// case 0x1a: -// newSEP.setVjc((byte)param); -// break; -// case 0x1b: -// newSEP.setLnnMin((short)param); -// break; -// case 0x1c: -// newSEP.setPgnStart((short)param); -// break; -// case 0x1d: -// newSEP.setDmOrientPage((byte)param); -// break; -// case 0x1e: -// //nothing -// break; -// case 0x1f: -// newSEP.setXaPage(param); -// break; -// case 0x20: -// newSEP.setYaPage(param); -// break; -// case 0x21: -// newSEP.setDxaLeft(param); -// break; -// case 0x22: -// newSEP.setDxaRight(param); -// break; -// case 0x23: -// newSEP.setDyaTop(param); -// break; -// case 0x24: -// newSEP.setDyaBottom(param); -// break; -// case 0x25: -// newSEP.setDzaGutter(param); -// break; -// case 0x26: -// newSEP.setDmPaperReq((short)param); -// break; -// case 0x27: -// newSEP.setFPropMark(getFlag(varParam[0])); -// break; -// case 0x28: -// break; -// case 0x29: -// break; -// case 0x2a: -// break; -// case 0x2b: -// short[] brcTop = newSEP.getBrcTop(); -// brcTop[0] = (short)(param & 0xffff); -// brcTop[1] = (short)((param & 0xffff0000) >> 16); -// break; -// case 0x2c: -// short[] brcLeft = newSEP.getBrcLeft(); -// brcLeft[0] = (short)(param & 0xffff); -// brcLeft[1] = (short)((param & 0xffff0000) >> 16); -// break; -// case 0x2d: -// short[] brcBottom = newSEP.getBrcBottom(); -// brcBottom[0] = (short)(param & 0xffff); -// brcBottom[1] = (short)((param & 0xffff0000) >> 16); -// break; -// case 0x2e: -// short[] brcRight = newSEP.getBrcRight(); -// brcRight[0] = (short)(param & 0xffff); -// brcRight[1] = (short)((param & 0xffff0000) >> 16); -// break; -// case 0x2f: -// newSEP.setPgbProp(param); -// break; -// case 0x30: -// newSEP.setDxtCharSpace(param); -// break; -// case 0x31: -// newSEP.setDyaLinePitch(param); -// break; -// case 0x33: -// newSEP.setWTextFlow((short)param); -// break; -// default: -// break; -// } -// -// } - /** - * Converts an byte value into a boolean. The byte parameter can be 1,0, 128, - * or 129. if it is 128, this function returns the same value as oldVal. If - * it is 129, this function returns !oldVal. This is used for certain sprms - * - * @param x The byte value to convert. - * @param oldVal The old boolean value. - * - * @return A boolean whose value depends on x and oldVal. - */ - private static boolean getCHPFlag(byte x, boolean oldVal) + public CharacterProperties getCharacterStyle(int x) { - switch(x) - { - case 0: - return false; - case 1: - return true; - case (byte)0x80: - return oldVal; - case (byte)0x81: - return !oldVal; - default: - return false; - } + return (_styleDescriptions[x] != null ? _styleDescriptions[x].getCHP() : null); } - /** - * Converts an int into a boolean. If the int is non-zero, it returns true. - * Otherwise it returns false. - * - * @param x The int to convert. - * - * @return A boolean whose value depends on x. - */ - public static boolean getFlag(int x) + public ParagraphProperties getParagraphStyle(int x) { - if(x != 0) - { - return true; - } - else - { - return false; - } + return (_styleDescriptions[x] != null ? _styleDescriptions[x].getPAP() : null); } + } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/TextPieceTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/TextPieceTable.java index ddac07795..db2ac44ef 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/TextPieceTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/TextPieceTable.java @@ -60,6 +60,7 @@ package org.apache.poi.hwpf.model.hdftypes; import java.io.UnsupportedEncodingException; import java.io.IOException; +import java.util.List; import java.util.ArrayList; import org.apache.poi.hwpf.model.io.*; @@ -67,6 +68,7 @@ import org.apache.poi.hwpf.model.io.*; public class TextPieceTable { ArrayList _textPieces = new ArrayList(); + int _multiple; public TextPieceTable(byte[] documentStream, byte[] tableStream, int offset, int size, int fcMin) @@ -75,7 +77,7 @@ public class TextPieceTable // get our plex of PieceDescriptors PlexOfCps pieceTable = new PlexOfCps(tableStream, offset, size, PieceDescriptor.getSizeInBytes()); - int multiple = 2; + _multiple = 2; int length = pieceTable.length(); PieceDescriptor[] pieces = new PieceDescriptor[length]; @@ -88,7 +90,7 @@ public class TextPieceTable if (!pieces[x].isUnicode()) { - multiple = 1; + _multiple = 1; } } @@ -97,33 +99,33 @@ public class TextPieceTable { int start = pieces[x].getFilePosition(); PropertyNode node = pieceTable.getProperty(x); - int nodeStart = node.getStart() - fcMin; - int nodeEnd = node.getEnd() - fcMin; + int nodeStart = node.getStart(); + // multiple will be 2 if there is only one piece and its unicode. Some + // type of optimization. + int nodeEnd = ((node.getEnd() - nodeStart) * _multiple) + nodeStart; int textSize = nodeEnd - nodeStart; boolean unicode = pieces[x].isUnicode(); String toStr = null; - if (unicode) - { - byte[] buf = new byte[textSize * multiple]; - System.arraycopy(documentStream, start, buf, 0, textSize * multiple); - _textPieces.add(new TextPiece(nodeStart, nodeEnd, buf, pieces[x])); - } - else - { - byte[] buf = new byte[textSize]; - System.arraycopy(documentStream, start, buf, 0, textSize); - _textPieces.add(new TextPiece(nodeStart, nodeEnd, buf, pieces[x])); - } + + byte[] buf = new byte[textSize + (unicode ? textSize % 2 : 0)]; + System.arraycopy(documentStream, start, buf, 0, textSize); + _textPieces.add(new TextPiece(nodeStart, nodeEnd, buf, pieces[x])); + } } + public List getTextPieces() + { + return _textPieces; + } + public byte[] writeTo(HWPFOutputStream docStream) throws IOException { PlexOfCps textPlex = new PlexOfCps(PieceDescriptor.getSizeInBytes()); - int fcMin = docStream.getOffset(); + //int fcMin = docStream.getOffset(); int size = _textPieces.size(); for (int x = 0; x < size; x++) @@ -137,8 +139,10 @@ public class TextPieceTable // write the text to the docstream and save the piece descriptor to the // plex which will be written later to the tableStream. docStream.write(next.getBuf()); - textPlex.addProperty(new PropertyNode(next.getStart() + fcMin, - next.getEnd() + fcMin, + + int nodeStart = next.getStart(); + textPlex.addProperty(new PropertyNode(nodeStart, + (next.getEnd() - nodeStart)/_multiple + nodeStart, pd.toByteArray())); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/CHPAbstractType.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/CHPAbstractType.java index ae019e9bf..7c42ec52e 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/CHPAbstractType.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/CHPAbstractType.java @@ -63,6 +63,7 @@ import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; import org.apache.poi.util.HexDump; import org.apache.poi.hdf.model.hdftypes.HDFType; +import org.apache.poi.hwpf.usermodel.*; /** * Character Properties. @@ -75,8 +76,8 @@ public abstract class CHPAbstractType implements HDFType { - private short field_1_chse; - private int field_2_format_flags; + protected short field_1_chse; + protected int field_2_format_flags; private static BitField fBold = new BitField(0x0001); private static BitField fItalic = new BitField(0x0002); private static BitField fRMarkDel = new BitField(0x0004); @@ -93,41 +94,41 @@ public abstract class CHPAbstractType private static BitField fLowerCase = new BitField(0x2000); private static BitField fData = new BitField(0x4000); private static BitField fOle2 = new BitField(0x8000); - private int field_3_format_flags1; + protected int field_3_format_flags1; private static BitField fEmboss = new BitField(0x0001); private static BitField fImprint = new BitField(0x0002); private static BitField fDStrike = new BitField(0x0004); private static BitField fUsePgsuSettings = new BitField(0x0008); - private int field_4_ftcAscii; - private int field_5_ftcFE; - private int field_6_ftcOther; - private int field_7_hps; - private int field_8_dxaSpace; - private byte field_9_iss; - private byte field_10_kul; - private byte field_11_ico; - private int field_12_hpsPos; - private int field_13_lidDefault; - private int field_14_lidFE; - private byte field_15_idctHint; - private int field_16_wCharScale; - private int field_17_fcPic; - private int field_18_fcObj; - private int field_19_lTagObj; - private int field_20_ibstRMark; - private int field_21_ibstRMarkDel; - private short[] field_22_dttmRMark; - private short[] field_23_dttmRMarkDel; - private int field_24_istd; - private int field_25_baseIstd; - private int field_26_ftcSym; - private int field_27_xchSym; - private int field_28_idslRMReason; - private int field_29_idslReasonDel; - private byte field_30_ysr; - private byte field_31_chYsr; - private int field_32_hpsKern; - private short field_33_Highlight; + protected int field_4_ftcAscii; + protected int field_5_ftcFE; + protected int field_6_ftcOther; + protected int field_7_hps; + protected int field_8_dxaSpace; + protected byte field_9_iss; + protected byte field_10_kul; + protected byte field_11_ico; + protected int field_12_hpsPos; + protected int field_13_lidDefault; + protected int field_14_lidFE; + protected byte field_15_idctHint; + protected int field_16_wCharScale; + protected int field_17_fcPic; + protected int field_18_fcObj; + protected int field_19_lTagObj; + protected int field_20_ibstRMark; + protected int field_21_ibstRMarkDel; + protected DateAndTime field_22_dttmRMark; + protected DateAndTime field_23_dttmRMarkDel; + protected int field_24_istd; + protected int field_25_baseIstd; + protected int field_26_ftcSym; + protected int field_27_xchSym; + protected int field_28_idslRMReason; + protected int field_29_idslReasonDel; + protected byte field_30_ysr; + protected byte field_31_chYsr; + protected int field_32_hpsKern; + protected short field_33_Highlight; private static BitField icoHighlight = new BitField(0x001f); private static BitField fHighlight = new BitField(0x0020); private static BitField kcd = new BitField(0x01c0); @@ -135,16 +136,16 @@ public abstract class CHPAbstractType private static BitField fChsDiff = new BitField(0x0400); private static BitField fMacChs = new BitField(0x0800); private static BitField fFtcAsciSym = new BitField(0x1000); - private short field_34_fPropMark; - private int field_35_ibstPropRMark; - private int field_36_dttmPropRMark; - private byte field_37_sfxtText; - private byte field_38_fDispFldRMark; - private int field_39_ibstDispFldRMark; - private int field_40_dttmDispFldRMark; - private byte[] field_41_xstDispFldRMark; - private int field_42_shd; - private short[] field_43_brc; + protected short field_34_fPropMark; + protected int field_35_ibstPropRMark; + protected DateAndTime field_36_dttmPropRMark; + protected byte field_37_sfxtText; + protected byte field_38_fDispFldRMark; + protected int field_39_ibstDispFldRMark; + protected DateAndTime field_40_dttmDispFldRMark; + protected byte[] field_41_xstDispFldRMark; + protected ShadingDescriptor field_42_shd; + protected BorderCode field_43_brc; public CHPAbstractType() @@ -501,7 +502,7 @@ public abstract class CHPAbstractType /** * Get the dttmRMark field for the CHP record. */ - public short[] getDttmRMark() + public DateAndTime getDttmRMark() { return field_22_dttmRMark; } @@ -509,7 +510,7 @@ public abstract class CHPAbstractType /** * Set the dttmRMark field for the CHP record. */ - public void setDttmRMark(short[] field_22_dttmRMark) + public void setDttmRMark(DateAndTime field_22_dttmRMark) { this.field_22_dttmRMark = field_22_dttmRMark; } @@ -517,7 +518,7 @@ public abstract class CHPAbstractType /** * Get the dttmRMarkDel field for the CHP record. */ - public short[] getDttmRMarkDel() + public DateAndTime getDttmRMarkDel() { return field_23_dttmRMarkDel; } @@ -525,7 +526,7 @@ public abstract class CHPAbstractType /** * Set the dttmRMarkDel field for the CHP record. */ - public void setDttmRMarkDel(short[] field_23_dttmRMarkDel) + public void setDttmRMarkDel(DateAndTime field_23_dttmRMarkDel) { this.field_23_dttmRMarkDel = field_23_dttmRMarkDel; } @@ -725,7 +726,7 @@ public abstract class CHPAbstractType /** * Get the dttmPropRMark field for the CHP record. */ - public int getDttmPropRMark() + public DateAndTime getDttmPropRMark() { return field_36_dttmPropRMark; } @@ -733,7 +734,7 @@ public abstract class CHPAbstractType /** * Set the dttmPropRMark field for the CHP record. */ - public void setDttmPropRMark(int field_36_dttmPropRMark) + public void setDttmPropRMark(DateAndTime field_36_dttmPropRMark) { this.field_36_dttmPropRMark = field_36_dttmPropRMark; } @@ -789,7 +790,7 @@ public abstract class CHPAbstractType /** * Get the dttmDispFldRMark field for the CHP record. */ - public int getDttmDispFldRMark() + public DateAndTime getDttmDispFldRMark() { return field_40_dttmDispFldRMark; } @@ -797,7 +798,7 @@ public abstract class CHPAbstractType /** * Set the dttmDispFldRMark field for the CHP record. */ - public void setDttmDispFldRMark(int field_40_dttmDispFldRMark) + public void setDttmDispFldRMark(DateAndTime field_40_dttmDispFldRMark) { this.field_40_dttmDispFldRMark = field_40_dttmDispFldRMark; } @@ -821,7 +822,7 @@ public abstract class CHPAbstractType /** * Get the shd field for the CHP record. */ - public int getShd() + public ShadingDescriptor getShd() { return field_42_shd; } @@ -829,7 +830,7 @@ public abstract class CHPAbstractType /** * Set the shd field for the CHP record. */ - public void setShd(int field_42_shd) + public void setShd(ShadingDescriptor field_42_shd) { this.field_42_shd = field_42_shd; } @@ -837,7 +838,7 @@ public abstract class CHPAbstractType /** * Get the brc field for the CHP record. */ - public short[] getBrc() + public BorderCode getBrc() { return field_43_brc; } @@ -845,7 +846,7 @@ public abstract class CHPAbstractType /** * Set the brc field for the CHP record. */ - public void setBrc(short[] field_43_brc) + public void setBrc(BorderCode field_43_brc) { this.field_43_brc = field_43_brc; } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/DOPAbstractType.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/DOPAbstractType.java index a0f79f103..232fb1750 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/DOPAbstractType.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/DOPAbstractType.java @@ -63,6 +63,7 @@ import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; import org.apache.poi.util.HexDump; import org.apache.poi.hdf.model.hdftypes.HDFType; +import org.apache.poi.hwpf.usermodel.*; /** * Document Properties. @@ -75,19 +76,19 @@ public abstract class DOPAbstractType implements HDFType { - private byte field_1_formatFlags; + protected byte field_1_formatFlags; private static BitField fFacingPages = new BitField(0x01); private static BitField fWidowControl = new BitField(0x02); private static BitField fPMHMainDoc = new BitField(0x04); private static BitField grfSupression = new BitField(0x18); private static BitField fpc = new BitField(0x60); private static BitField unused1 = new BitField(0x80); - private byte field_2_unused2; - private short field_3_footnoteInfo; + protected byte field_2_unused2; + protected short field_3_footnoteInfo; private static BitField rncFtn = new BitField(0x0003); private static BitField nFtn = new BitField(0xfffc); - private byte field_4_fOutlineDirtySave; - private byte field_5_docinfo; + protected byte field_4_fOutlineDirtySave; + protected byte field_5_docinfo; private static BitField fOnlyMacPics = new BitField(0x01); private static BitField fOnlyWinPics = new BitField(0x02); private static BitField fLabelDoc = new BitField(0x04); @@ -96,7 +97,7 @@ public abstract class DOPAbstractType private static BitField fFormNoFields = new BitField(0x20); private static BitField fLinkStyles = new BitField(0x40); private static BitField fRevMarking = new BitField(0x80); - private byte field_6_docinfo1; + protected byte field_6_docinfo1; private static BitField fBackup = new BitField(0x01); private static BitField fExactCWords = new BitField(0x02); private static BitField fPagHidden = new BitField(0x04); @@ -105,7 +106,7 @@ public abstract class DOPAbstractType private static BitField fMirrorMargins = new BitField(0x20); private static BitField unused3 = new BitField(0x40); private static BitField fDfltTrueType = new BitField(0x80); - private byte field_7_docinfo2; + protected byte field_7_docinfo2; private static BitField fPagSupressTopSpacing = new BitField(0x01); private static BitField fProtEnabled = new BitField(0x02); private static BitField fDispFormFldSel = new BitField(0x04); @@ -114,7 +115,7 @@ public abstract class DOPAbstractType private static BitField unused4 = new BitField(0x20); private static BitField fLockRev = new BitField(0x40); private static BitField fEmbedFonts = new BitField(0x80); - private short field_8_docinfo3; + protected short field_8_docinfo3; private static BitField oldfNoTabForInd = new BitField(0x0001); private static BitField oldfNoSpaceRaiseLower = new BitField(0x0002); private static BitField oldfSuppressSpbfAfterPageBreak = new BitField(0x0004); @@ -128,24 +129,24 @@ public abstract class DOPAbstractType private static BitField oldfShowBreaksInFrames = new BitField(0x0400); private static BitField oldfSwapBordersFacingPgs = new BitField(0x0800); private static BitField unused5 = new BitField(0xf000); - private int field_9_dxaTab; - private int field_10_wSpare; - private int field_11_dxaHotz; - private int field_12_cConsexHypLim; - private int field_13_wSpare2; - private int field_14_dttmCreated; - private int field_15_dttmRevised; - private int field_16_dttmLastPrint; - private int field_17_nRevision; - private int field_18_tmEdited; - private int field_19_cWords; - private int field_20_cCh; - private int field_21_cPg; - private int field_22_cParas; - private short field_23_Edn; + protected int field_9_dxaTab; + protected int field_10_wSpare; + protected int field_11_dxaHotz; + protected int field_12_cConsexHypLim; + protected int field_13_wSpare2; + protected int field_14_dttmCreated; + protected int field_15_dttmRevised; + protected int field_16_dttmLastPrint; + protected int field_17_nRevision; + protected int field_18_tmEdited; + protected int field_19_cWords; + protected int field_20_cCh; + protected int field_21_cPg; + protected int field_22_cParas; + protected short field_23_Edn; private static BitField rncEdn = new BitField(0x0003); private static BitField nEdn = new BitField(0xfffc); - private short field_24_Edn1; + protected short field_24_Edn1; private static BitField epc = new BitField(0x0003); private static BitField nfcFtnRef1 = new BitField(0x003c); private static BitField nfcEdnRef1 = new BitField(0x03c0); @@ -153,20 +154,20 @@ public abstract class DOPAbstractType private static BitField fSaveFormData = new BitField(0x0800); private static BitField fShadeFormData = new BitField(0x1000); private static BitField fWCFtnEdn = new BitField(0x8000); - private int field_25_cLines; - private int field_26_cWordsFtnEnd; - private int field_27_cChFtnEdn; - private short field_28_cPgFtnEdn; - private int field_29_cParasFtnEdn; - private int field_30_cLinesFtnEdn; - private int field_31_lKeyProtDoc; - private short field_32_view; + protected int field_25_cLines; + protected int field_26_cWordsFtnEnd; + protected int field_27_cChFtnEdn; + protected short field_28_cPgFtnEdn; + protected int field_29_cParasFtnEdn; + protected int field_30_cLinesFtnEdn; + protected int field_31_lKeyProtDoc; + protected short field_32_view; private static BitField wvkSaved = new BitField(0x0007); private static BitField wScaleSaved = new BitField(0x0ff8); private static BitField zkSaved = new BitField(0x3000); private static BitField fRotateFontW6 = new BitField(0x4000); private static BitField iGutterPos = new BitField(0x8000); - private int field_33_docinfo4; + protected int field_33_docinfo4; private static BitField fNoTabForInd = new BitField(0x00000001); private static BitField fNoSpaceRaiseLower = new BitField(0x00000002); private static BitField fSupressSpdfAfterPageBreak = new BitField(0x00000004); @@ -184,10 +185,10 @@ public abstract class DOPAbstractType private static BitField fPrintBodyBeforeHdr = new BitField(0x00040000); private static BitField fNoLeading = new BitField(0x00080000); private static BitField fMWSmallCaps = new BitField(0x00200000); - private short field_34_adt; - private byte[] field_35_doptypography; - private byte[] field_36_dogrid; - private short field_37_docinfo5; + protected short field_34_adt; + protected byte[] field_35_doptypography; + protected byte[] field_36_dogrid; + protected short field_37_docinfo5; private static BitField lvl = new BitField(0x001e); private static BitField fGramAllDone = new BitField(0x0020); private static BitField fGramAllClean = new BitField(0x0040); @@ -199,27 +200,27 @@ public abstract class DOPAbstractType private static BitField fIncludeFooter = new BitField(0x2000); private static BitField fForcePageSizePag = new BitField(0x4000); private static BitField fMinFontSizePag = new BitField(0x8000); - private short field_38_docinfo6; + protected short field_38_docinfo6; private static BitField fHaveVersions = new BitField(0x0001); private static BitField fAutoVersions = new BitField(0x0002); - private byte[] field_39_asumyi; - private int field_40_cChWS; - private int field_41_cChWSFtnEdn; - private int field_42_grfDocEvents; - private int field_43_virusinfo; + protected byte[] field_39_asumyi; + protected int field_40_cChWS; + protected int field_41_cChWSFtnEdn; + protected int field_42_grfDocEvents; + protected int field_43_virusinfo; private static BitField fVirusPrompted = new BitField(0x0001); private static BitField fVirusLoadSafe = new BitField(0x0002); private static BitField KeyVirusSession30 = new BitField(0xfffffffc); - private byte[] field_44_Spare; - private int field_45_reserved1; - private int field_46_reserved2; - private int field_47_cDBC; - private int field_48_cDBCFtnEdn; - private int field_49_reserved; - private short field_50_nfcFtnRef; - private short field_51_nfcEdnRef; - private short field_52_hpsZoonFontPag; - private short field_53_dywDispPag; + protected byte[] field_44_Spare; + protected int field_45_reserved1; + protected int field_46_reserved2; + protected int field_47_cDBC; + protected int field_48_cDBCFtnEdn; + protected int field_49_reserved; + protected short field_50_nfcFtnRef; + protected short field_51_nfcEdnRef; + protected short field_52_hpsZoonFontPag; + protected short field_53_dywDispPag; public DOPAbstractType() @@ -227,7 +228,7 @@ public abstract class DOPAbstractType } - protected void fillFields(byte [] data, short size, int offset) + protected void fillFields(byte [] data, int offset) { field_1_formatFlags = data[ 0x0 + offset ]; field_2_unused2 = data[ 0x1 + offset ]; @@ -321,16 +322,16 @@ public abstract class DOPAbstractType LittleEndian.putShort(data, 0x52 + offset, (short)field_32_view);; LittleEndian.putInt(data, 0x54 + offset, field_33_docinfo4);; LittleEndian.putShort(data, 0x58 + offset, (short)field_34_adt);; - ; - ; + System.arraycopy(field_35_doptypography, 0, data, 0x5a + offset, field_35_doptypography.length);; + System.arraycopy(field_36_dogrid, 0, data, 0x190 + offset, field_36_dogrid.length);; LittleEndian.putShort(data, 0x19a + offset, (short)field_37_docinfo5);; LittleEndian.putShort(data, 0x19c + offset, (short)field_38_docinfo6);; - ; + System.arraycopy(field_39_asumyi, 0, data, 0x19e + offset, field_39_asumyi.length);; LittleEndian.putInt(data, 0x1aa + offset, field_40_cChWS);; LittleEndian.putInt(data, 0x1ae + offset, field_41_cChWSFtnEdn);; LittleEndian.putInt(data, 0x1b2 + offset, field_42_grfDocEvents);; LittleEndian.putInt(data, 0x1b6 + offset, field_43_virusinfo);; - ; + System.arraycopy(field_44_Spare, 0, data, 0x1ba + offset, field_44_Spare.length);; LittleEndian.putInt(data, 0x1d8 + offset, field_45_reserved1);; LittleEndian.putInt(data, 0x1dc + offset, field_46_reserved2);; LittleEndian.putInt(data, 0x1e0 + offset, field_47_cDBC);; @@ -350,8 +351,6 @@ public abstract class DOPAbstractType buffer.append("[DOP]\n"); buffer.append(" .formatFlags = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte)getFormatFlags())); buffer.append(" (").append(getFormatFlags()).append(" )\n"); buffer.append(" .fFacingPages = ").append(isFFacingPages()).append('\n'); buffer.append(" .fWidowControl = ").append(isFWidowControl()).append('\n'); @@ -361,25 +360,17 @@ public abstract class DOPAbstractType buffer.append(" .unused1 = ").append(isUnused1()).append('\n'); buffer.append(" .unused2 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte)getUnused2())); buffer.append(" (").append(getUnused2()).append(" )\n"); buffer.append(" .footnoteInfo = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getFootnoteInfo())); buffer.append(" (").append(getFootnoteInfo()).append(" )\n"); buffer.append(" .rncFtn = ").append(getRncFtn()).append('\n'); buffer.append(" .nFtn = ").append(getNFtn()).append('\n'); buffer.append(" .fOutlineDirtySave = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte)getFOutlineDirtySave())); buffer.append(" (").append(getFOutlineDirtySave()).append(" )\n"); buffer.append(" .docinfo = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte)getDocinfo())); buffer.append(" (").append(getDocinfo()).append(" )\n"); buffer.append(" .fOnlyMacPics = ").append(isFOnlyMacPics()).append('\n'); buffer.append(" .fOnlyWinPics = ").append(isFOnlyWinPics()).append('\n'); @@ -391,8 +382,6 @@ public abstract class DOPAbstractType buffer.append(" .fRevMarking = ").append(isFRevMarking()).append('\n'); buffer.append(" .docinfo1 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte)getDocinfo1())); buffer.append(" (").append(getDocinfo1()).append(" )\n"); buffer.append(" .fBackup = ").append(isFBackup()).append('\n'); buffer.append(" .fExactCWords = ").append(isFExactCWords()).append('\n'); @@ -404,8 +393,6 @@ public abstract class DOPAbstractType buffer.append(" .fDfltTrueType = ").append(isFDfltTrueType()).append('\n'); buffer.append(" .docinfo2 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte)getDocinfo2())); buffer.append(" (").append(getDocinfo2()).append(" )\n"); buffer.append(" .fPagSupressTopSpacing = ").append(isFPagSupressTopSpacing()).append('\n'); buffer.append(" .fProtEnabled = ").append(isFProtEnabled()).append('\n'); @@ -417,8 +404,6 @@ public abstract class DOPAbstractType buffer.append(" .fEmbedFonts = ").append(isFEmbedFonts()).append('\n'); buffer.append(" .docinfo3 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getDocinfo3())); buffer.append(" (").append(getDocinfo3()).append(" )\n"); buffer.append(" .oldfNoTabForInd = ").append(isOldfNoTabForInd()).append('\n'); buffer.append(" .oldfNoSpaceRaiseLower = ").append(isOldfNoSpaceRaiseLower()).append('\n'); @@ -435,85 +420,53 @@ public abstract class DOPAbstractType buffer.append(" .unused5 = ").append(getUnused5()).append('\n'); buffer.append(" .dxaTab = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getDxaTab())); buffer.append(" (").append(getDxaTab()).append(" )\n"); buffer.append(" .wSpare = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getWSpare())); buffer.append(" (").append(getWSpare()).append(" )\n"); buffer.append(" .dxaHotz = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getDxaHotz())); buffer.append(" (").append(getDxaHotz()).append(" )\n"); buffer.append(" .cConsexHypLim = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCConsexHypLim())); buffer.append(" (").append(getCConsexHypLim()).append(" )\n"); buffer.append(" .wSpare2 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getWSpare2())); buffer.append(" (").append(getWSpare2()).append(" )\n"); buffer.append(" .dttmCreated = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getDttmCreated())); buffer.append(" (").append(getDttmCreated()).append(" )\n"); buffer.append(" .dttmRevised = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getDttmRevised())); buffer.append(" (").append(getDttmRevised()).append(" )\n"); buffer.append(" .dttmLastPrint = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getDttmLastPrint())); buffer.append(" (").append(getDttmLastPrint()).append(" )\n"); buffer.append(" .nRevision = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getNRevision())); buffer.append(" (").append(getNRevision()).append(" )\n"); buffer.append(" .tmEdited = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getTmEdited())); buffer.append(" (").append(getTmEdited()).append(" )\n"); buffer.append(" .cWords = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCWords())); buffer.append(" (").append(getCWords()).append(" )\n"); buffer.append(" .cCh = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCCh())); buffer.append(" (").append(getCCh()).append(" )\n"); buffer.append(" .cPg = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCPg())); buffer.append(" (").append(getCPg()).append(" )\n"); buffer.append(" .cParas = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCParas())); buffer.append(" (").append(getCParas()).append(" )\n"); buffer.append(" .Edn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getEdn())); buffer.append(" (").append(getEdn()).append(" )\n"); buffer.append(" .rncEdn = ").append(getRncEdn()).append('\n'); buffer.append(" .nEdn = ").append(getNEdn()).append('\n'); buffer.append(" .Edn1 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getEdn1())); buffer.append(" (").append(getEdn1()).append(" )\n"); buffer.append(" .epc = ").append(getEpc()).append('\n'); buffer.append(" .nfcFtnRef1 = ").append(getNfcFtnRef1()).append('\n'); @@ -524,43 +477,27 @@ public abstract class DOPAbstractType buffer.append(" .fWCFtnEdn = ").append(isFWCFtnEdn()).append('\n'); buffer.append(" .cLines = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCLines())); buffer.append(" (").append(getCLines()).append(" )\n"); buffer.append(" .cWordsFtnEnd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCWordsFtnEnd())); buffer.append(" (").append(getCWordsFtnEnd()).append(" )\n"); buffer.append(" .cChFtnEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCChFtnEdn())); buffer.append(" (").append(getCChFtnEdn()).append(" )\n"); buffer.append(" .cPgFtnEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getCPgFtnEdn())); buffer.append(" (").append(getCPgFtnEdn()).append(" )\n"); buffer.append(" .cParasFtnEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCParasFtnEdn())); buffer.append(" (").append(getCParasFtnEdn()).append(" )\n"); buffer.append(" .cLinesFtnEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCLinesFtnEdn())); buffer.append(" (").append(getCLinesFtnEdn()).append(" )\n"); buffer.append(" .lKeyProtDoc = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLKeyProtDoc())); buffer.append(" (").append(getLKeyProtDoc()).append(" )\n"); buffer.append(" .view = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getView())); buffer.append(" (").append(getView()).append(" )\n"); buffer.append(" .wvkSaved = ").append(getWvkSaved()).append('\n'); buffer.append(" .wScaleSaved = ").append(getWScaleSaved()).append('\n'); @@ -569,8 +506,6 @@ public abstract class DOPAbstractType buffer.append(" .iGutterPos = ").append(isIGutterPos()).append('\n'); buffer.append(" .docinfo4 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getDocinfo4())); buffer.append(" (").append(getDocinfo4()).append(" )\n"); buffer.append(" .fNoTabForInd = ").append(isFNoTabForInd()).append('\n'); buffer.append(" .fNoSpaceRaiseLower = ").append(isFNoSpaceRaiseLower()).append('\n'); @@ -591,23 +526,15 @@ public abstract class DOPAbstractType buffer.append(" .fMWSmallCaps = ").append(isFMWSmallCaps()).append('\n'); buffer.append(" .adt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getAdt())); buffer.append(" (").append(getAdt()).append(" )\n"); buffer.append(" .doptypography = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte[])getDoptypography())); buffer.append(" (").append(getDoptypography()).append(" )\n"); buffer.append(" .dogrid = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte[])getDogrid())); buffer.append(" (").append(getDogrid()).append(" )\n"); buffer.append(" .docinfo5 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getDocinfo5())); buffer.append(" (").append(getDocinfo5()).append(" )\n"); buffer.append(" .lvl = ").append(getLvl()).append('\n'); buffer.append(" .fGramAllDone = ").append(isFGramAllDone()).append('\n'); @@ -622,88 +549,56 @@ public abstract class DOPAbstractType buffer.append(" .fMinFontSizePag = ").append(isFMinFontSizePag()).append('\n'); buffer.append(" .docinfo6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getDocinfo6())); buffer.append(" (").append(getDocinfo6()).append(" )\n"); buffer.append(" .fHaveVersions = ").append(isFHaveVersions()).append('\n'); buffer.append(" .fAutoVersions = ").append(isFAutoVersions()).append('\n'); buffer.append(" .asumyi = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte[])getAsumyi())); buffer.append(" (").append(getAsumyi()).append(" )\n"); buffer.append(" .cChWS = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCChWS())); buffer.append(" (").append(getCChWS()).append(" )\n"); buffer.append(" .cChWSFtnEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCChWSFtnEdn())); buffer.append(" (").append(getCChWSFtnEdn()).append(" )\n"); buffer.append(" .grfDocEvents = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getGrfDocEvents())); buffer.append(" (").append(getGrfDocEvents()).append(" )\n"); buffer.append(" .virusinfo = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getVirusinfo())); buffer.append(" (").append(getVirusinfo()).append(" )\n"); buffer.append(" .fVirusPrompted = ").append(isFVirusPrompted()).append('\n'); buffer.append(" .fVirusLoadSafe = ").append(isFVirusLoadSafe()).append('\n'); buffer.append(" .KeyVirusSession30 = ").append(getKeyVirusSession30()).append('\n'); buffer.append(" .Spare = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((byte[])getSpare())); buffer.append(" (").append(getSpare()).append(" )\n"); buffer.append(" .reserved1 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getReserved1())); buffer.append(" (").append(getReserved1()).append(" )\n"); buffer.append(" .reserved2 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getReserved2())); buffer.append(" (").append(getReserved2()).append(" )\n"); buffer.append(" .cDBC = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCDBC())); buffer.append(" (").append(getCDBC()).append(" )\n"); buffer.append(" .cDBCFtnEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCDBCFtnEdn())); buffer.append(" (").append(getCDBCFtnEdn()).append(" )\n"); buffer.append(" .reserved = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getReserved())); buffer.append(" (").append(getReserved()).append(" )\n"); buffer.append(" .nfcFtnRef = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getNfcFtnRef())); buffer.append(" (").append(getNfcFtnRef()).append(" )\n"); buffer.append(" .nfcEdnRef = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getNfcEdnRef())); buffer.append(" (").append(getNfcEdnRef()).append(" )\n"); buffer.append(" .hpsZoonFontPag = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getHpsZoonFontPag())); buffer.append(" (").append(getHpsZoonFontPag()).append(" )\n"); buffer.append(" .dywDispPag = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getDywDispPag())); buffer.append(" (").append(getDywDispPag()).append(" )\n"); buffer.append("[/DOP]\n"); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/FIBAbstractType.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/FIBAbstractType.java index 5aa02fa5a..dc33e49bf 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/FIBAbstractType.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/FIBAbstractType.java @@ -63,6 +63,7 @@ import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; import org.apache.poi.util.HexDump; import org.apache.poi.hdf.model.hdftypes.HDFType; +import org.apache.poi.hwpf.usermodel.*; /** * File information Block. @@ -75,12 +76,12 @@ public abstract class FIBAbstractType implements HDFType { - private int field_1_wIdent; - private int field_2_nFib; - private int field_3_nProduct; - private int field_4_lid; - private int field_5_pnNext; - private short field_6_options; + protected int field_1_wIdent; + protected int field_2_nFib; + protected int field_3_nProduct; + protected int field_4_lid; + protected int field_5_pnNext; + protected short field_6_options; private static BitField fDot = new BitField(0x0001); private static BitField fGlsy = new BitField(0x0002); private static BitField fComplex = new BitField(0x0004); @@ -94,245 +95,245 @@ public abstract class FIBAbstractType private static BitField fLoadOverride = new BitField(0x2000); private static BitField fFarEast = new BitField(0x4000); private static BitField fCrypto = new BitField(0x8000); - private int field_7_nFibBack; - private int field_8_lKey; - private int field_9_envr; - private short field_10_history; + protected int field_7_nFibBack; + protected int field_8_lKey; + protected int field_9_envr; + protected short field_10_history; private static BitField fMac = new BitField(0x0001); private static BitField fEmptySpecial = new BitField(0x0002); private static BitField fLoadOverridePage = new BitField(0x0004); private static BitField fFutureSavedUndo = new BitField(0x0008); private static BitField fWord97Saved = new BitField(0x0010); private static BitField fSpare0 = new BitField(0x00FE); - private int field_11_chs; - private int field_12_chsTables; - private int field_13_fcMin; - private int field_14_fcMac; - private int field_15_csw; - private int field_16_wMagicCreated; - private int field_17_wMagicRevised; - private int field_18_wMagicCreatedPrivate; - private int field_19_wMagicRevisedPrivate; - private int field_20_pnFbpChpFirst_W6; - private int field_21_pnChpFirst_W6; - private int field_22_cpnBteChp_W6; - private int field_23_pnFbpPapFirst_W6; - private int field_24_pnPapFirst_W6; - private int field_25_cpnBtePap_W6; - private int field_26_pnFbpLvcFirst_W6; - private int field_27_pnLvcFirst_W6; - private int field_28_cpnBteLvc_W6; - private int field_29_lidFE; - private int field_30_clw; - private int field_31_cbMac; - private int field_32_lProductCreated; - private int field_33_lProductRevised; - private int field_34_ccpText; - private int field_35_ccpFtn; - private int field_36_ccpHdd; - private int field_37_ccpMcr; - private int field_38_ccpAtn; - private int field_39_ccpEdn; - private int field_40_ccpTxbx; - private int field_41_ccpHdrTxbx; - private int field_42_pnFbpChpFirst; - private int field_43_pnChpFirst; - private int field_44_cpnBteChp; - private int field_45_pnFbpPapFirst; - private int field_46_pnPapFirst; - private int field_47_cpnBtePap; - private int field_48_pnFbpLvcFirst; - private int field_49_pnLvcFirst; - private int field_50_cpnBteLvc; - private int field_51_fcIslandFirst; - private int field_52_fcIslandLim; - private int field_53_cfclcb; - private int field_54_fcStshfOrig; - private int field_55_lcbStshfOrig; - private int field_56_fcStshf; - private int field_57_lcbStshf; - private int field_58_fcPlcffndRef; - private int field_59_lcbPlcffndRef; - private int field_60_fcPlcffndTxt; - private int field_61_lcbPlcffndTxt; - private int field_62_fcPlcfandRef; - private int field_63_lcbPlcfandRef; - private int field_64_fcPlcfandTxt; - private int field_65_lcbPlcfandTxt; - private int field_66_fcPlcfsed; - private int field_67_lcbPlcfsed; - private int field_68_fcPlcpad; - private int field_69_lcbPlcpad; - private int field_70_fcPlcfphe; - private int field_71_lcbPlcfphe; - private int field_72_fcSttbfglsy; - private int field_73_lcbSttbfglsy; - private int field_74_fcPlcfglsy; - private int field_75_lcbPlcfglsy; - private int field_76_fcPlcfhdd; - private int field_77_lcbPlcfhdd; - private int field_78_fcPlcfbteChpx; - private int field_79_lcbPlcfbteChpx; - private int field_80_fcPlcfbtePapx; - private int field_81_lcbPlcfbtePapx; - private int field_82_fcPlcfsea; - private int field_83_lcbPlcfsea; - private int field_84_fcSttbfffn; - private int field_85_lcbSttbfffn; - private int field_86_fcPlcffldMom; - private int field_87_lcbPlcffldMom; - private int field_88_fcPlcffldHdr; - private int field_89_lcbPlcffldHdr; - private int field_90_fcPlcffldFtn; - private int field_91_lcbPlcffldFtn; - private int field_92_fcPlcffldAtn; - private int field_93_lcbPlcffldAtn; - private int field_94_fcPlcffldMcr; - private int field_95_lcbPlcffldMcr; - private int field_96_fcSttbfbkmk; - private int field_97_lcbSttbfbkmk; - private int field_98_fcPlcfbkf; - private int field_99_lcbPlcfbkf; - private int field_100_fcPlcfbkl; - private int field_101_lcbPlcfbkl; - private int field_102_fcCmds; - private int field_103_lcbCmds; - private int field_104_fcPlcmcr; - private int field_105_lcbPlcmcr; - private int field_106_fcSttbfmcr; - private int field_107_lcbSttbfmcr; - private int field_108_fcPrDrvr; - private int field_109_lcbPrDrvr; - private int field_110_fcPrEnvPort; - private int field_111_lcbPrEnvPort; - private int field_112_fcPrEnvLand; - private int field_113_lcbPrEnvLand; - private int field_114_fcWss; - private int field_115_lcbWss; - private int field_116_fcDop; - private int field_117_lcbDop; - private int field_118_fcSttbfAssoc; - private int field_119_lcbSttbfAssoc; - private int field_120_fcClx; - private int field_121_lcbClx; - private int field_122_fcPlcfpgdFtn; - private int field_123_lcbPlcfpgdFtn; - private int field_124_fcAutosaveSource; - private int field_125_lcbAutosaveSource; - private int field_126_fcGrpXstAtnOwners; - private int field_127_lcbGrpXstAtnOwners; - private int field_128_fcSttbfAtnbkmk; - private int field_129_lcbSttbfAtnbkmk; - private int field_130_fcPlcdoaMom; - private int field_131_lcbPlcdoaMom; - private int field_132_fcPlcdoaHdr; - private int field_133_lcbPlcdoaHdr; - private int field_134_fcPlcspaMom; - private int field_135_lcbPlcspaMom; - private int field_136_fcPlcspaHdr; - private int field_137_lcbPlcspaHdr; - private int field_138_fcPlcfAtnbkf; - private int field_139_lcbPlcfAtnbkf; - private int field_140_fcPlcfAtnbkl; - private int field_141_lcbPlcfAtnbkl; - private int field_142_fcPms; - private int field_143_lcbPms; - private int field_144_fcFormFldSttbs; - private int field_145_lcbFormFldSttbs; - private int field_146_fcPlcfendRef; - private int field_147_lcbPlcfendRef; - private int field_148_fcPlcfendTxt; - private int field_149_lcbPlcfendTxt; - private int field_150_fcPlcffldEdn; - private int field_151_lcbPlcffldEdn; - private int field_152_fcPlcfpgdEdn; - private int field_153_lcbPlcfpgdEdn; - private int field_154_fcDggInfo; - private int field_155_lcbDggInfo; - private int field_156_fcSttbfRMark; - private int field_157_lcbSttbfRMark; - private int field_158_fcSttbCaption; - private int field_159_lcbSttbCaption; - private int field_160_fcSttbAutoCaption; - private int field_161_lcbSttbAutoCaption; - private int field_162_fcPlcfwkb; - private int field_163_lcbPlcfwkb; - private int field_164_fcPlcfspl; - private int field_165_lcbPlcfspl; - private int field_166_fcPlcftxbxTxt; - private int field_167_lcbPlcftxbxTxt; - private int field_168_fcPlcffldTxbx; - private int field_169_lcbPlcffldTxbx; - private int field_170_fcPlcfhdrtxbxTxt; - private int field_171_lcbPlcfhdrtxbxTxt; - private int field_172_fcPlcffldHdrTxbx; - private int field_173_lcbPlcffldHdrTxbx; - private int field_174_fcStwUser; - private int field_175_lcbStwUser; - private int field_176_fcSttbttmbd; - private int field_177_cbSttbttmbd; - private int field_178_fcUnused; - private int field_179_lcbUnused; - private int field_180_fcPgdMother; - private int field_181_lcbPgdMother; - private int field_182_fcBkdMother; - private int field_183_lcbBkdMother; - private int field_184_fcPgdFtn; - private int field_185_lcbPgdFtn; - private int field_186_fcBkdFtn; - private int field_187_lcbBkdFtn; - private int field_188_fcPgdEdn; - private int field_189_lcbPgdEdn; - private int field_190_fcBkdEdn; - private int field_191_lcbBkdEdn; - private int field_192_fcSttbfIntlFld; - private int field_193_lcbSttbfIntlFld; - private int field_194_fcRouteSlip; - private int field_195_lcbRouteSlip; - private int field_196_fcSttbSavedBy; - private int field_197_lcbSttbSavedBy; - private int field_198_fcSttbFnm; - private int field_199_lcbSttbFnm; - private int field_200_fcPlcfLst; - private int field_201_lcbPlcfLst; - private int field_202_fcPlfLfo; - private int field_203_lcbPlfLfo; - private int field_204_fcPlcftxbxBkd; - private int field_205_lcbPlcftxbxBkd; - private int field_206_fcPlcftxbxHdrBkd; - private int field_207_lcbPlcftxbxHdrBkd; - private int field_208_fcDocUndo; - private int field_209_lcbDocUndo; - private int field_210_fcRgbuse; - private int field_211_lcbRgbuse; - private int field_212_fcUsp; - private int field_213_lcbUsp; - private int field_214_fcUskf; - private int field_215_lcbUskf; - private int field_216_fcPlcupcRgbuse; - private int field_217_lcbPlcupcRgbuse; - private int field_218_fcPlcupcUsp; - private int field_219_lcbPlcupcUsp; - private int field_220_fcSttbGlsyStyle; - private int field_221_lcbSttbGlsyStyle; - private int field_222_fcPlgosl; - private int field_223_lcbPlgosl; - private int field_224_fcPlcocx; - private int field_225_lcbPlcocx; - private int field_226_fcPlcfbteLvc; - private int field_227_lcbPlcfbteLvc; - private int field_228_dwLowDateTime; - private int field_229_dwHighDateTime; - private int field_230_fcPlcflvc; - private int field_231_lcbPlcflvc; - private int field_232_fcPlcasumy; - private int field_233_lcbPlcasumy; - private int field_234_fcPlcfgram; - private int field_235_lcbPlcfgram; - private int field_236_fcSttbListNames; - private int field_237_lcbSttbListNames; - private int field_238_fcSttbfUssr; - private int field_239_lcbSttbfUssr; + protected int field_11_chs; + protected int field_12_chsTables; + protected int field_13_fcMin; + protected int field_14_fcMac; + protected int field_15_csw; + protected int field_16_wMagicCreated; + protected int field_17_wMagicRevised; + protected int field_18_wMagicCreatedPrivate; + protected int field_19_wMagicRevisedPrivate; + protected int field_20_pnFbpChpFirst_W6; + protected int field_21_pnChpFirst_W6; + protected int field_22_cpnBteChp_W6; + protected int field_23_pnFbpPapFirst_W6; + protected int field_24_pnPapFirst_W6; + protected int field_25_cpnBtePap_W6; + protected int field_26_pnFbpLvcFirst_W6; + protected int field_27_pnLvcFirst_W6; + protected int field_28_cpnBteLvc_W6; + protected int field_29_lidFE; + protected int field_30_clw; + protected int field_31_cbMac; + protected int field_32_lProductCreated; + protected int field_33_lProductRevised; + protected int field_34_ccpText; + protected int field_35_ccpFtn; + protected int field_36_ccpHdd; + protected int field_37_ccpMcr; + protected int field_38_ccpAtn; + protected int field_39_ccpEdn; + protected int field_40_ccpTxbx; + protected int field_41_ccpHdrTxbx; + protected int field_42_pnFbpChpFirst; + protected int field_43_pnChpFirst; + protected int field_44_cpnBteChp; + protected int field_45_pnFbpPapFirst; + protected int field_46_pnPapFirst; + protected int field_47_cpnBtePap; + protected int field_48_pnFbpLvcFirst; + protected int field_49_pnLvcFirst; + protected int field_50_cpnBteLvc; + protected int field_51_fcIslandFirst; + protected int field_52_fcIslandLim; + protected int field_53_cfclcb; + protected int field_54_fcStshfOrig; + protected int field_55_lcbStshfOrig; + protected int field_56_fcStshf; + protected int field_57_lcbStshf; + protected int field_58_fcPlcffndRef; + protected int field_59_lcbPlcffndRef; + protected int field_60_fcPlcffndTxt; + protected int field_61_lcbPlcffndTxt; + protected int field_62_fcPlcfandRef; + protected int field_63_lcbPlcfandRef; + protected int field_64_fcPlcfandTxt; + protected int field_65_lcbPlcfandTxt; + protected int field_66_fcPlcfsed; + protected int field_67_lcbPlcfsed; + protected int field_68_fcPlcpad; + protected int field_69_lcbPlcpad; + protected int field_70_fcPlcfphe; + protected int field_71_lcbPlcfphe; + protected int field_72_fcSttbfglsy; + protected int field_73_lcbSttbfglsy; + protected int field_74_fcPlcfglsy; + protected int field_75_lcbPlcfglsy; + protected int field_76_fcPlcfhdd; + protected int field_77_lcbPlcfhdd; + protected int field_78_fcPlcfbteChpx; + protected int field_79_lcbPlcfbteChpx; + protected int field_80_fcPlcfbtePapx; + protected int field_81_lcbPlcfbtePapx; + protected int field_82_fcPlcfsea; + protected int field_83_lcbPlcfsea; + protected int field_84_fcSttbfffn; + protected int field_85_lcbSttbfffn; + protected int field_86_fcPlcffldMom; + protected int field_87_lcbPlcffldMom; + protected int field_88_fcPlcffldHdr; + protected int field_89_lcbPlcffldHdr; + protected int field_90_fcPlcffldFtn; + protected int field_91_lcbPlcffldFtn; + protected int field_92_fcPlcffldAtn; + protected int field_93_lcbPlcffldAtn; + protected int field_94_fcPlcffldMcr; + protected int field_95_lcbPlcffldMcr; + protected int field_96_fcSttbfbkmk; + protected int field_97_lcbSttbfbkmk; + protected int field_98_fcPlcfbkf; + protected int field_99_lcbPlcfbkf; + protected int field_100_fcPlcfbkl; + protected int field_101_lcbPlcfbkl; + protected int field_102_fcCmds; + protected int field_103_lcbCmds; + protected int field_104_fcPlcmcr; + protected int field_105_lcbPlcmcr; + protected int field_106_fcSttbfmcr; + protected int field_107_lcbSttbfmcr; + protected int field_108_fcPrDrvr; + protected int field_109_lcbPrDrvr; + protected int field_110_fcPrEnvPort; + protected int field_111_lcbPrEnvPort; + protected int field_112_fcPrEnvLand; + protected int field_113_lcbPrEnvLand; + protected int field_114_fcWss; + protected int field_115_lcbWss; + protected int field_116_fcDop; + protected int field_117_lcbDop; + protected int field_118_fcSttbfAssoc; + protected int field_119_lcbSttbfAssoc; + protected int field_120_fcClx; + protected int field_121_lcbClx; + protected int field_122_fcPlcfpgdFtn; + protected int field_123_lcbPlcfpgdFtn; + protected int field_124_fcAutosaveSource; + protected int field_125_lcbAutosaveSource; + protected int field_126_fcGrpXstAtnOwners; + protected int field_127_lcbGrpXstAtnOwners; + protected int field_128_fcSttbfAtnbkmk; + protected int field_129_lcbSttbfAtnbkmk; + protected int field_130_fcPlcdoaMom; + protected int field_131_lcbPlcdoaMom; + protected int field_132_fcPlcdoaHdr; + protected int field_133_lcbPlcdoaHdr; + protected int field_134_fcPlcspaMom; + protected int field_135_lcbPlcspaMom; + protected int field_136_fcPlcspaHdr; + protected int field_137_lcbPlcspaHdr; + protected int field_138_fcPlcfAtnbkf; + protected int field_139_lcbPlcfAtnbkf; + protected int field_140_fcPlcfAtnbkl; + protected int field_141_lcbPlcfAtnbkl; + protected int field_142_fcPms; + protected int field_143_lcbPms; + protected int field_144_fcFormFldSttbs; + protected int field_145_lcbFormFldSttbs; + protected int field_146_fcPlcfendRef; + protected int field_147_lcbPlcfendRef; + protected int field_148_fcPlcfendTxt; + protected int field_149_lcbPlcfendTxt; + protected int field_150_fcPlcffldEdn; + protected int field_151_lcbPlcffldEdn; + protected int field_152_fcPlcfpgdEdn; + protected int field_153_lcbPlcfpgdEdn; + protected int field_154_fcDggInfo; + protected int field_155_lcbDggInfo; + protected int field_156_fcSttbfRMark; + protected int field_157_lcbSttbfRMark; + protected int field_158_fcSttbCaption; + protected int field_159_lcbSttbCaption; + protected int field_160_fcSttbAutoCaption; + protected int field_161_lcbSttbAutoCaption; + protected int field_162_fcPlcfwkb; + protected int field_163_lcbPlcfwkb; + protected int field_164_fcPlcfspl; + protected int field_165_lcbPlcfspl; + protected int field_166_fcPlcftxbxTxt; + protected int field_167_lcbPlcftxbxTxt; + protected int field_168_fcPlcffldTxbx; + protected int field_169_lcbPlcffldTxbx; + protected int field_170_fcPlcfhdrtxbxTxt; + protected int field_171_lcbPlcfhdrtxbxTxt; + protected int field_172_fcPlcffldHdrTxbx; + protected int field_173_lcbPlcffldHdrTxbx; + protected int field_174_fcStwUser; + protected int field_175_lcbStwUser; + protected int field_176_fcSttbttmbd; + protected int field_177_cbSttbttmbd; + protected int field_178_fcUnused; + protected int field_179_lcbUnused; + protected int field_180_fcPgdMother; + protected int field_181_lcbPgdMother; + protected int field_182_fcBkdMother; + protected int field_183_lcbBkdMother; + protected int field_184_fcPgdFtn; + protected int field_185_lcbPgdFtn; + protected int field_186_fcBkdFtn; + protected int field_187_lcbBkdFtn; + protected int field_188_fcPgdEdn; + protected int field_189_lcbPgdEdn; + protected int field_190_fcBkdEdn; + protected int field_191_lcbBkdEdn; + protected int field_192_fcSttbfIntlFld; + protected int field_193_lcbSttbfIntlFld; + protected int field_194_fcRouteSlip; + protected int field_195_lcbRouteSlip; + protected int field_196_fcSttbSavedBy; + protected int field_197_lcbSttbSavedBy; + protected int field_198_fcSttbFnm; + protected int field_199_lcbSttbFnm; + protected int field_200_fcPlcfLst; + protected int field_201_lcbPlcfLst; + protected int field_202_fcPlfLfo; + protected int field_203_lcbPlfLfo; + protected int field_204_fcPlcftxbxBkd; + protected int field_205_lcbPlcftxbxBkd; + protected int field_206_fcPlcftxbxHdrBkd; + protected int field_207_lcbPlcftxbxHdrBkd; + protected int field_208_fcDocUndo; + protected int field_209_lcbDocUndo; + protected int field_210_fcRgbuse; + protected int field_211_lcbRgbuse; + protected int field_212_fcUsp; + protected int field_213_lcbUsp; + protected int field_214_fcUskf; + protected int field_215_lcbUskf; + protected int field_216_fcPlcupcRgbuse; + protected int field_217_lcbPlcupcRgbuse; + protected int field_218_fcPlcupcUsp; + protected int field_219_lcbPlcupcUsp; + protected int field_220_fcSttbGlsyStyle; + protected int field_221_lcbSttbGlsyStyle; + protected int field_222_fcPlgosl; + protected int field_223_lcbPlgosl; + protected int field_224_fcPlcocx; + protected int field_225_lcbPlcocx; + protected int field_226_fcPlcfbteLvc; + protected int field_227_lcbPlcfbteLvc; + protected int field_228_dwLowDateTime; + protected int field_229_dwHighDateTime; + protected int field_230_fcPlcflvc; + protected int field_231_lcbPlcflvc; + protected int field_232_fcPlcasumy; + protected int field_233_lcbPlcasumy; + protected int field_234_fcPlcfgram; + protected int field_235_lcbPlcfgram; + protected int field_236_fcSttbListNames; + protected int field_237_lcbSttbListNames; + protected int field_238_fcSttbfUssr; + protected int field_239_lcbSttbfUssr; public FIBAbstractType() @@ -340,7 +341,7 @@ public abstract class FIBAbstractType } - protected void fillFields(byte [] data, short size, int offset) + protected void fillFields(byte [] data, int offset) { field_1_wIdent = LittleEndian.getShort(data, 0x0 + offset); field_2_nFib = LittleEndian.getShort(data, 0x2 + offset); @@ -835,33 +836,21 @@ public abstract class FIBAbstractType buffer.append("[FIB]\n"); buffer.append(" .wIdent = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getWIdent())); buffer.append(" (").append(getWIdent()).append(" )\n"); buffer.append(" .nFib = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getNFib())); buffer.append(" (").append(getNFib()).append(" )\n"); buffer.append(" .nProduct = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getNProduct())); buffer.append(" (").append(getNProduct()).append(" )\n"); buffer.append(" .lid = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLid())); buffer.append(" (").append(getLid()).append(" )\n"); buffer.append(" .pnNext = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnNext())); buffer.append(" (").append(getPnNext()).append(" )\n"); buffer.append(" .options = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getOptions())); buffer.append(" (").append(getOptions()).append(" )\n"); buffer.append(" .fDot = ").append(isFDot()).append('\n'); buffer.append(" .fGlsy = ").append(isFGlsy()).append('\n'); @@ -878,23 +867,15 @@ public abstract class FIBAbstractType buffer.append(" .fCrypto = ").append(isFCrypto()).append('\n'); buffer.append(" .nFibBack = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getNFibBack())); buffer.append(" (").append(getNFibBack()).append(" )\n"); buffer.append(" .lKey = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLKey())); buffer.append(" (").append(getLKey()).append(" )\n"); buffer.append(" .envr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getEnvr())); buffer.append(" (").append(getEnvr()).append(" )\n"); buffer.append(" .history = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((short)getHistory())); buffer.append(" (").append(getHistory()).append(" )\n"); buffer.append(" .fMac = ").append(isFMac()).append('\n'); buffer.append(" .fEmptySpecial = ").append(isFEmptySpecial()).append('\n'); @@ -904,1148 +885,690 @@ public abstract class FIBAbstractType buffer.append(" .fSpare0 = ").append(getFSpare0()).append('\n'); buffer.append(" .chs = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getChs())); buffer.append(" (").append(getChs()).append(" )\n"); buffer.append(" .chsTables = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getChsTables())); buffer.append(" (").append(getChsTables()).append(" )\n"); buffer.append(" .fcMin = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcMin())); buffer.append(" (").append(getFcMin()).append(" )\n"); buffer.append(" .fcMac = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcMac())); buffer.append(" (").append(getFcMac()).append(" )\n"); buffer.append(" .csw = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCsw())); buffer.append(" (").append(getCsw()).append(" )\n"); buffer.append(" .wMagicCreated = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getWMagicCreated())); buffer.append(" (").append(getWMagicCreated()).append(" )\n"); buffer.append(" .wMagicRevised = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getWMagicRevised())); buffer.append(" (").append(getWMagicRevised()).append(" )\n"); buffer.append(" .wMagicCreatedPrivate = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getWMagicCreatedPrivate())); buffer.append(" (").append(getWMagicCreatedPrivate()).append(" )\n"); buffer.append(" .wMagicRevisedPrivate = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getWMagicRevisedPrivate())); buffer.append(" (").append(getWMagicRevisedPrivate()).append(" )\n"); buffer.append(" .pnFbpChpFirst_W6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnFbpChpFirst_W6())); buffer.append(" (").append(getPnFbpChpFirst_W6()).append(" )\n"); buffer.append(" .pnChpFirst_W6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnChpFirst_W6())); buffer.append(" (").append(getPnChpFirst_W6()).append(" )\n"); buffer.append(" .cpnBteChp_W6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCpnBteChp_W6())); buffer.append(" (").append(getCpnBteChp_W6()).append(" )\n"); buffer.append(" .pnFbpPapFirst_W6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnFbpPapFirst_W6())); buffer.append(" (").append(getPnFbpPapFirst_W6()).append(" )\n"); buffer.append(" .pnPapFirst_W6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnPapFirst_W6())); buffer.append(" (").append(getPnPapFirst_W6()).append(" )\n"); buffer.append(" .cpnBtePap_W6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCpnBtePap_W6())); buffer.append(" (").append(getCpnBtePap_W6()).append(" )\n"); buffer.append(" .pnFbpLvcFirst_W6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnFbpLvcFirst_W6())); buffer.append(" (").append(getPnFbpLvcFirst_W6()).append(" )\n"); buffer.append(" .pnLvcFirst_W6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnLvcFirst_W6())); buffer.append(" (").append(getPnLvcFirst_W6()).append(" )\n"); buffer.append(" .cpnBteLvc_W6 = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCpnBteLvc_W6())); buffer.append(" (").append(getCpnBteLvc_W6()).append(" )\n"); buffer.append(" .lidFE = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLidFE())); buffer.append(" (").append(getLidFE()).append(" )\n"); buffer.append(" .clw = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getClw())); buffer.append(" (").append(getClw()).append(" )\n"); buffer.append(" .cbMac = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCbMac())); buffer.append(" (").append(getCbMac()).append(" )\n"); buffer.append(" .lProductCreated = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLProductCreated())); buffer.append(" (").append(getLProductCreated()).append(" )\n"); buffer.append(" .lProductRevised = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLProductRevised())); buffer.append(" (").append(getLProductRevised()).append(" )\n"); buffer.append(" .ccpText = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCcpText())); buffer.append(" (").append(getCcpText()).append(" )\n"); buffer.append(" .ccpFtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCcpFtn())); buffer.append(" (").append(getCcpFtn()).append(" )\n"); buffer.append(" .ccpHdd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCcpHdd())); buffer.append(" (").append(getCcpHdd()).append(" )\n"); buffer.append(" .ccpMcr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCcpMcr())); buffer.append(" (").append(getCcpMcr()).append(" )\n"); buffer.append(" .ccpAtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCcpAtn())); buffer.append(" (").append(getCcpAtn()).append(" )\n"); buffer.append(" .ccpEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCcpEdn())); buffer.append(" (").append(getCcpEdn()).append(" )\n"); buffer.append(" .ccpTxbx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCcpTxbx())); buffer.append(" (").append(getCcpTxbx()).append(" )\n"); buffer.append(" .ccpHdrTxbx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCcpHdrTxbx())); buffer.append(" (").append(getCcpHdrTxbx()).append(" )\n"); buffer.append(" .pnFbpChpFirst = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnFbpChpFirst())); buffer.append(" (").append(getPnFbpChpFirst()).append(" )\n"); buffer.append(" .pnChpFirst = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnChpFirst())); buffer.append(" (").append(getPnChpFirst()).append(" )\n"); buffer.append(" .cpnBteChp = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCpnBteChp())); buffer.append(" (").append(getCpnBteChp()).append(" )\n"); buffer.append(" .pnFbpPapFirst = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnFbpPapFirst())); buffer.append(" (").append(getPnFbpPapFirst()).append(" )\n"); buffer.append(" .pnPapFirst = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnPapFirst())); buffer.append(" (").append(getPnPapFirst()).append(" )\n"); buffer.append(" .cpnBtePap = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCpnBtePap())); buffer.append(" (").append(getCpnBtePap()).append(" )\n"); buffer.append(" .pnFbpLvcFirst = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnFbpLvcFirst())); buffer.append(" (").append(getPnFbpLvcFirst()).append(" )\n"); buffer.append(" .pnLvcFirst = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getPnLvcFirst())); buffer.append(" (").append(getPnLvcFirst()).append(" )\n"); buffer.append(" .cpnBteLvc = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCpnBteLvc())); buffer.append(" (").append(getCpnBteLvc()).append(" )\n"); buffer.append(" .fcIslandFirst = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcIslandFirst())); buffer.append(" (").append(getFcIslandFirst()).append(" )\n"); buffer.append(" .fcIslandLim = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcIslandLim())); buffer.append(" (").append(getFcIslandLim()).append(" )\n"); buffer.append(" .cfclcb = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCfclcb())); buffer.append(" (").append(getCfclcb()).append(" )\n"); buffer.append(" .fcStshfOrig = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcStshfOrig())); buffer.append(" (").append(getFcStshfOrig()).append(" )\n"); buffer.append(" .lcbStshfOrig = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbStshfOrig())); buffer.append(" (").append(getLcbStshfOrig()).append(" )\n"); buffer.append(" .fcStshf = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcStshf())); buffer.append(" (").append(getFcStshf()).append(" )\n"); buffer.append(" .lcbStshf = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbStshf())); buffer.append(" (").append(getLcbStshf()).append(" )\n"); buffer.append(" .fcPlcffndRef = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffndRef())); buffer.append(" (").append(getFcPlcffndRef()).append(" )\n"); buffer.append(" .lcbPlcffndRef = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffndRef())); buffer.append(" (").append(getLcbPlcffndRef()).append(" )\n"); buffer.append(" .fcPlcffndTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffndTxt())); buffer.append(" (").append(getFcPlcffndTxt()).append(" )\n"); buffer.append(" .lcbPlcffndTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffndTxt())); buffer.append(" (").append(getLcbPlcffndTxt()).append(" )\n"); buffer.append(" .fcPlcfandRef = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfandRef())); buffer.append(" (").append(getFcPlcfandRef()).append(" )\n"); buffer.append(" .lcbPlcfandRef = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfandRef())); buffer.append(" (").append(getLcbPlcfandRef()).append(" )\n"); buffer.append(" .fcPlcfandTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfandTxt())); buffer.append(" (").append(getFcPlcfandTxt()).append(" )\n"); buffer.append(" .lcbPlcfandTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfandTxt())); buffer.append(" (").append(getLcbPlcfandTxt()).append(" )\n"); buffer.append(" .fcPlcfsed = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfsed())); buffer.append(" (").append(getFcPlcfsed()).append(" )\n"); buffer.append(" .lcbPlcfsed = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfsed())); buffer.append(" (").append(getLcbPlcfsed()).append(" )\n"); buffer.append(" .fcPlcpad = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcpad())); buffer.append(" (").append(getFcPlcpad()).append(" )\n"); buffer.append(" .lcbPlcpad = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcpad())); buffer.append(" (").append(getLcbPlcpad()).append(" )\n"); buffer.append(" .fcPlcfphe = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfphe())); buffer.append(" (").append(getFcPlcfphe()).append(" )\n"); buffer.append(" .lcbPlcfphe = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfphe())); buffer.append(" (").append(getLcbPlcfphe()).append(" )\n"); buffer.append(" .fcSttbfglsy = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbfglsy())); buffer.append(" (").append(getFcSttbfglsy()).append(" )\n"); buffer.append(" .lcbSttbfglsy = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbfglsy())); buffer.append(" (").append(getLcbSttbfglsy()).append(" )\n"); buffer.append(" .fcPlcfglsy = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfglsy())); buffer.append(" (").append(getFcPlcfglsy()).append(" )\n"); buffer.append(" .lcbPlcfglsy = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfglsy())); buffer.append(" (").append(getLcbPlcfglsy()).append(" )\n"); buffer.append(" .fcPlcfhdd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfhdd())); buffer.append(" (").append(getFcPlcfhdd()).append(" )\n"); buffer.append(" .lcbPlcfhdd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfhdd())); buffer.append(" (").append(getLcbPlcfhdd()).append(" )\n"); buffer.append(" .fcPlcfbteChpx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfbteChpx())); buffer.append(" (").append(getFcPlcfbteChpx()).append(" )\n"); buffer.append(" .lcbPlcfbteChpx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfbteChpx())); buffer.append(" (").append(getLcbPlcfbteChpx()).append(" )\n"); buffer.append(" .fcPlcfbtePapx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfbtePapx())); buffer.append(" (").append(getFcPlcfbtePapx()).append(" )\n"); buffer.append(" .lcbPlcfbtePapx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfbtePapx())); buffer.append(" (").append(getLcbPlcfbtePapx()).append(" )\n"); buffer.append(" .fcPlcfsea = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfsea())); buffer.append(" (").append(getFcPlcfsea()).append(" )\n"); buffer.append(" .lcbPlcfsea = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfsea())); buffer.append(" (").append(getLcbPlcfsea()).append(" )\n"); buffer.append(" .fcSttbfffn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbfffn())); buffer.append(" (").append(getFcSttbfffn()).append(" )\n"); buffer.append(" .lcbSttbfffn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbfffn())); buffer.append(" (").append(getLcbSttbfffn()).append(" )\n"); buffer.append(" .fcPlcffldMom = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffldMom())); buffer.append(" (").append(getFcPlcffldMom()).append(" )\n"); buffer.append(" .lcbPlcffldMom = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffldMom())); buffer.append(" (").append(getLcbPlcffldMom()).append(" )\n"); buffer.append(" .fcPlcffldHdr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffldHdr())); buffer.append(" (").append(getFcPlcffldHdr()).append(" )\n"); buffer.append(" .lcbPlcffldHdr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffldHdr())); buffer.append(" (").append(getLcbPlcffldHdr()).append(" )\n"); buffer.append(" .fcPlcffldFtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffldFtn())); buffer.append(" (").append(getFcPlcffldFtn()).append(" )\n"); buffer.append(" .lcbPlcffldFtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffldFtn())); buffer.append(" (").append(getLcbPlcffldFtn()).append(" )\n"); buffer.append(" .fcPlcffldAtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffldAtn())); buffer.append(" (").append(getFcPlcffldAtn()).append(" )\n"); buffer.append(" .lcbPlcffldAtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffldAtn())); buffer.append(" (").append(getLcbPlcffldAtn()).append(" )\n"); buffer.append(" .fcPlcffldMcr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffldMcr())); buffer.append(" (").append(getFcPlcffldMcr()).append(" )\n"); buffer.append(" .lcbPlcffldMcr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffldMcr())); buffer.append(" (").append(getLcbPlcffldMcr()).append(" )\n"); buffer.append(" .fcSttbfbkmk = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbfbkmk())); buffer.append(" (").append(getFcSttbfbkmk()).append(" )\n"); buffer.append(" .lcbSttbfbkmk = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbfbkmk())); buffer.append(" (").append(getLcbSttbfbkmk()).append(" )\n"); buffer.append(" .fcPlcfbkf = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfbkf())); buffer.append(" (").append(getFcPlcfbkf()).append(" )\n"); buffer.append(" .lcbPlcfbkf = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfbkf())); buffer.append(" (").append(getLcbPlcfbkf()).append(" )\n"); buffer.append(" .fcPlcfbkl = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfbkl())); buffer.append(" (").append(getFcPlcfbkl()).append(" )\n"); buffer.append(" .lcbPlcfbkl = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfbkl())); buffer.append(" (").append(getLcbPlcfbkl()).append(" )\n"); buffer.append(" .fcCmds = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcCmds())); buffer.append(" (").append(getFcCmds()).append(" )\n"); buffer.append(" .lcbCmds = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbCmds())); buffer.append(" (").append(getLcbCmds()).append(" )\n"); buffer.append(" .fcPlcmcr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcmcr())); buffer.append(" (").append(getFcPlcmcr()).append(" )\n"); buffer.append(" .lcbPlcmcr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcmcr())); buffer.append(" (").append(getLcbPlcmcr()).append(" )\n"); buffer.append(" .fcSttbfmcr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbfmcr())); buffer.append(" (").append(getFcSttbfmcr()).append(" )\n"); buffer.append(" .lcbSttbfmcr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbfmcr())); buffer.append(" (").append(getLcbSttbfmcr()).append(" )\n"); buffer.append(" .fcPrDrvr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPrDrvr())); buffer.append(" (").append(getFcPrDrvr()).append(" )\n"); buffer.append(" .lcbPrDrvr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPrDrvr())); buffer.append(" (").append(getLcbPrDrvr()).append(" )\n"); buffer.append(" .fcPrEnvPort = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPrEnvPort())); buffer.append(" (").append(getFcPrEnvPort()).append(" )\n"); buffer.append(" .lcbPrEnvPort = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPrEnvPort())); buffer.append(" (").append(getLcbPrEnvPort()).append(" )\n"); buffer.append(" .fcPrEnvLand = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPrEnvLand())); buffer.append(" (").append(getFcPrEnvLand()).append(" )\n"); buffer.append(" .lcbPrEnvLand = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPrEnvLand())); buffer.append(" (").append(getLcbPrEnvLand()).append(" )\n"); buffer.append(" .fcWss = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcWss())); buffer.append(" (").append(getFcWss()).append(" )\n"); buffer.append(" .lcbWss = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbWss())); buffer.append(" (").append(getLcbWss()).append(" )\n"); buffer.append(" .fcDop = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcDop())); buffer.append(" (").append(getFcDop()).append(" )\n"); buffer.append(" .lcbDop = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbDop())); buffer.append(" (").append(getLcbDop()).append(" )\n"); buffer.append(" .fcSttbfAssoc = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbfAssoc())); buffer.append(" (").append(getFcSttbfAssoc()).append(" )\n"); buffer.append(" .lcbSttbfAssoc = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbfAssoc())); buffer.append(" (").append(getLcbSttbfAssoc()).append(" )\n"); buffer.append(" .fcClx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcClx())); buffer.append(" (").append(getFcClx()).append(" )\n"); buffer.append(" .lcbClx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbClx())); buffer.append(" (").append(getLcbClx()).append(" )\n"); buffer.append(" .fcPlcfpgdFtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfpgdFtn())); buffer.append(" (").append(getFcPlcfpgdFtn()).append(" )\n"); buffer.append(" .lcbPlcfpgdFtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfpgdFtn())); buffer.append(" (").append(getLcbPlcfpgdFtn()).append(" )\n"); buffer.append(" .fcAutosaveSource = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcAutosaveSource())); buffer.append(" (").append(getFcAutosaveSource()).append(" )\n"); buffer.append(" .lcbAutosaveSource = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbAutosaveSource())); buffer.append(" (").append(getLcbAutosaveSource()).append(" )\n"); buffer.append(" .fcGrpXstAtnOwners = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcGrpXstAtnOwners())); buffer.append(" (").append(getFcGrpXstAtnOwners()).append(" )\n"); buffer.append(" .lcbGrpXstAtnOwners = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbGrpXstAtnOwners())); buffer.append(" (").append(getLcbGrpXstAtnOwners()).append(" )\n"); buffer.append(" .fcSttbfAtnbkmk = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbfAtnbkmk())); buffer.append(" (").append(getFcSttbfAtnbkmk()).append(" )\n"); buffer.append(" .lcbSttbfAtnbkmk = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbfAtnbkmk())); buffer.append(" (").append(getLcbSttbfAtnbkmk()).append(" )\n"); buffer.append(" .fcPlcdoaMom = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcdoaMom())); buffer.append(" (").append(getFcPlcdoaMom()).append(" )\n"); buffer.append(" .lcbPlcdoaMom = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcdoaMom())); buffer.append(" (").append(getLcbPlcdoaMom()).append(" )\n"); buffer.append(" .fcPlcdoaHdr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcdoaHdr())); buffer.append(" (").append(getFcPlcdoaHdr()).append(" )\n"); buffer.append(" .lcbPlcdoaHdr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcdoaHdr())); buffer.append(" (").append(getLcbPlcdoaHdr()).append(" )\n"); buffer.append(" .fcPlcspaMom = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcspaMom())); buffer.append(" (").append(getFcPlcspaMom()).append(" )\n"); buffer.append(" .lcbPlcspaMom = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcspaMom())); buffer.append(" (").append(getLcbPlcspaMom()).append(" )\n"); buffer.append(" .fcPlcspaHdr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcspaHdr())); buffer.append(" (").append(getFcPlcspaHdr()).append(" )\n"); buffer.append(" .lcbPlcspaHdr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcspaHdr())); buffer.append(" (").append(getLcbPlcspaHdr()).append(" )\n"); buffer.append(" .fcPlcfAtnbkf = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfAtnbkf())); buffer.append(" (").append(getFcPlcfAtnbkf()).append(" )\n"); buffer.append(" .lcbPlcfAtnbkf = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfAtnbkf())); buffer.append(" (").append(getLcbPlcfAtnbkf()).append(" )\n"); buffer.append(" .fcPlcfAtnbkl = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfAtnbkl())); buffer.append(" (").append(getFcPlcfAtnbkl()).append(" )\n"); buffer.append(" .lcbPlcfAtnbkl = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfAtnbkl())); buffer.append(" (").append(getLcbPlcfAtnbkl()).append(" )\n"); buffer.append(" .fcPms = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPms())); buffer.append(" (").append(getFcPms()).append(" )\n"); buffer.append(" .lcbPms = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPms())); buffer.append(" (").append(getLcbPms()).append(" )\n"); buffer.append(" .fcFormFldSttbs = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcFormFldSttbs())); buffer.append(" (").append(getFcFormFldSttbs()).append(" )\n"); buffer.append(" .lcbFormFldSttbs = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbFormFldSttbs())); buffer.append(" (").append(getLcbFormFldSttbs()).append(" )\n"); buffer.append(" .fcPlcfendRef = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfendRef())); buffer.append(" (").append(getFcPlcfendRef()).append(" )\n"); buffer.append(" .lcbPlcfendRef = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfendRef())); buffer.append(" (").append(getLcbPlcfendRef()).append(" )\n"); buffer.append(" .fcPlcfendTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfendTxt())); buffer.append(" (").append(getFcPlcfendTxt()).append(" )\n"); buffer.append(" .lcbPlcfendTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfendTxt())); buffer.append(" (").append(getLcbPlcfendTxt()).append(" )\n"); buffer.append(" .fcPlcffldEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffldEdn())); buffer.append(" (").append(getFcPlcffldEdn()).append(" )\n"); buffer.append(" .lcbPlcffldEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffldEdn())); buffer.append(" (").append(getLcbPlcffldEdn()).append(" )\n"); buffer.append(" .fcPlcfpgdEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfpgdEdn())); buffer.append(" (").append(getFcPlcfpgdEdn()).append(" )\n"); buffer.append(" .lcbPlcfpgdEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfpgdEdn())); buffer.append(" (").append(getLcbPlcfpgdEdn()).append(" )\n"); buffer.append(" .fcDggInfo = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcDggInfo())); buffer.append(" (").append(getFcDggInfo()).append(" )\n"); buffer.append(" .lcbDggInfo = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbDggInfo())); buffer.append(" (").append(getLcbDggInfo()).append(" )\n"); buffer.append(" .fcSttbfRMark = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbfRMark())); buffer.append(" (").append(getFcSttbfRMark()).append(" )\n"); buffer.append(" .lcbSttbfRMark = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbfRMark())); buffer.append(" (").append(getLcbSttbfRMark()).append(" )\n"); buffer.append(" .fcSttbCaption = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbCaption())); buffer.append(" (").append(getFcSttbCaption()).append(" )\n"); buffer.append(" .lcbSttbCaption = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbCaption())); buffer.append(" (").append(getLcbSttbCaption()).append(" )\n"); buffer.append(" .fcSttbAutoCaption = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbAutoCaption())); buffer.append(" (").append(getFcSttbAutoCaption()).append(" )\n"); buffer.append(" .lcbSttbAutoCaption = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbAutoCaption())); buffer.append(" (").append(getLcbSttbAutoCaption()).append(" )\n"); buffer.append(" .fcPlcfwkb = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfwkb())); buffer.append(" (").append(getFcPlcfwkb()).append(" )\n"); buffer.append(" .lcbPlcfwkb = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfwkb())); buffer.append(" (").append(getLcbPlcfwkb()).append(" )\n"); buffer.append(" .fcPlcfspl = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfspl())); buffer.append(" (").append(getFcPlcfspl()).append(" )\n"); buffer.append(" .lcbPlcfspl = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfspl())); buffer.append(" (").append(getLcbPlcfspl()).append(" )\n"); buffer.append(" .fcPlcftxbxTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcftxbxTxt())); buffer.append(" (").append(getFcPlcftxbxTxt()).append(" )\n"); buffer.append(" .lcbPlcftxbxTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcftxbxTxt())); buffer.append(" (").append(getLcbPlcftxbxTxt()).append(" )\n"); buffer.append(" .fcPlcffldTxbx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffldTxbx())); buffer.append(" (").append(getFcPlcffldTxbx()).append(" )\n"); buffer.append(" .lcbPlcffldTxbx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffldTxbx())); buffer.append(" (").append(getLcbPlcffldTxbx()).append(" )\n"); buffer.append(" .fcPlcfhdrtxbxTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfhdrtxbxTxt())); buffer.append(" (").append(getFcPlcfhdrtxbxTxt()).append(" )\n"); buffer.append(" .lcbPlcfhdrtxbxTxt = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfhdrtxbxTxt())); buffer.append(" (").append(getLcbPlcfhdrtxbxTxt()).append(" )\n"); buffer.append(" .fcPlcffldHdrTxbx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcffldHdrTxbx())); buffer.append(" (").append(getFcPlcffldHdrTxbx()).append(" )\n"); buffer.append(" .lcbPlcffldHdrTxbx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcffldHdrTxbx())); buffer.append(" (").append(getLcbPlcffldHdrTxbx()).append(" )\n"); buffer.append(" .fcStwUser = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcStwUser())); buffer.append(" (").append(getFcStwUser()).append(" )\n"); buffer.append(" .lcbStwUser = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbStwUser())); buffer.append(" (").append(getLcbStwUser()).append(" )\n"); buffer.append(" .fcSttbttmbd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbttmbd())); buffer.append(" (").append(getFcSttbttmbd()).append(" )\n"); buffer.append(" .cbSttbttmbd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getCbSttbttmbd())); buffer.append(" (").append(getCbSttbttmbd()).append(" )\n"); buffer.append(" .fcUnused = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcUnused())); buffer.append(" (").append(getFcUnused()).append(" )\n"); buffer.append(" .lcbUnused = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbUnused())); buffer.append(" (").append(getLcbUnused()).append(" )\n"); buffer.append(" .fcPgdMother = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPgdMother())); buffer.append(" (").append(getFcPgdMother()).append(" )\n"); buffer.append(" .lcbPgdMother = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPgdMother())); buffer.append(" (").append(getLcbPgdMother()).append(" )\n"); buffer.append(" .fcBkdMother = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcBkdMother())); buffer.append(" (").append(getFcBkdMother()).append(" )\n"); buffer.append(" .lcbBkdMother = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbBkdMother())); buffer.append(" (").append(getLcbBkdMother()).append(" )\n"); buffer.append(" .fcPgdFtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPgdFtn())); buffer.append(" (").append(getFcPgdFtn()).append(" )\n"); buffer.append(" .lcbPgdFtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPgdFtn())); buffer.append(" (").append(getLcbPgdFtn()).append(" )\n"); buffer.append(" .fcBkdFtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcBkdFtn())); buffer.append(" (").append(getFcBkdFtn()).append(" )\n"); buffer.append(" .lcbBkdFtn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbBkdFtn())); buffer.append(" (").append(getLcbBkdFtn()).append(" )\n"); buffer.append(" .fcPgdEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPgdEdn())); buffer.append(" (").append(getFcPgdEdn()).append(" )\n"); buffer.append(" .lcbPgdEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPgdEdn())); buffer.append(" (").append(getLcbPgdEdn()).append(" )\n"); buffer.append(" .fcBkdEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcBkdEdn())); buffer.append(" (").append(getFcBkdEdn()).append(" )\n"); buffer.append(" .lcbBkdEdn = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbBkdEdn())); buffer.append(" (").append(getLcbBkdEdn()).append(" )\n"); buffer.append(" .fcSttbfIntlFld = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbfIntlFld())); buffer.append(" (").append(getFcSttbfIntlFld()).append(" )\n"); buffer.append(" .lcbSttbfIntlFld = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbfIntlFld())); buffer.append(" (").append(getLcbSttbfIntlFld()).append(" )\n"); buffer.append(" .fcRouteSlip = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcRouteSlip())); buffer.append(" (").append(getFcRouteSlip()).append(" )\n"); buffer.append(" .lcbRouteSlip = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbRouteSlip())); buffer.append(" (").append(getLcbRouteSlip()).append(" )\n"); buffer.append(" .fcSttbSavedBy = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbSavedBy())); buffer.append(" (").append(getFcSttbSavedBy()).append(" )\n"); buffer.append(" .lcbSttbSavedBy = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbSavedBy())); buffer.append(" (").append(getLcbSttbSavedBy()).append(" )\n"); buffer.append(" .fcSttbFnm = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbFnm())); buffer.append(" (").append(getFcSttbFnm()).append(" )\n"); buffer.append(" .lcbSttbFnm = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbFnm())); buffer.append(" (").append(getLcbSttbFnm()).append(" )\n"); buffer.append(" .fcPlcfLst = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfLst())); buffer.append(" (").append(getFcPlcfLst()).append(" )\n"); buffer.append(" .lcbPlcfLst = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfLst())); buffer.append(" (").append(getLcbPlcfLst()).append(" )\n"); buffer.append(" .fcPlfLfo = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlfLfo())); buffer.append(" (").append(getFcPlfLfo()).append(" )\n"); buffer.append(" .lcbPlfLfo = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlfLfo())); buffer.append(" (").append(getLcbPlfLfo()).append(" )\n"); buffer.append(" .fcPlcftxbxBkd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcftxbxBkd())); buffer.append(" (").append(getFcPlcftxbxBkd()).append(" )\n"); buffer.append(" .lcbPlcftxbxBkd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcftxbxBkd())); buffer.append(" (").append(getLcbPlcftxbxBkd()).append(" )\n"); buffer.append(" .fcPlcftxbxHdrBkd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcftxbxHdrBkd())); buffer.append(" (").append(getFcPlcftxbxHdrBkd()).append(" )\n"); buffer.append(" .lcbPlcftxbxHdrBkd = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcftxbxHdrBkd())); buffer.append(" (").append(getLcbPlcftxbxHdrBkd()).append(" )\n"); buffer.append(" .fcDocUndo = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcDocUndo())); buffer.append(" (").append(getFcDocUndo()).append(" )\n"); buffer.append(" .lcbDocUndo = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbDocUndo())); buffer.append(" (").append(getLcbDocUndo()).append(" )\n"); buffer.append(" .fcRgbuse = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcRgbuse())); buffer.append(" (").append(getFcRgbuse()).append(" )\n"); buffer.append(" .lcbRgbuse = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbRgbuse())); buffer.append(" (").append(getLcbRgbuse()).append(" )\n"); buffer.append(" .fcUsp = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcUsp())); buffer.append(" (").append(getFcUsp()).append(" )\n"); buffer.append(" .lcbUsp = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbUsp())); buffer.append(" (").append(getLcbUsp()).append(" )\n"); buffer.append(" .fcUskf = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcUskf())); buffer.append(" (").append(getFcUskf()).append(" )\n"); buffer.append(" .lcbUskf = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbUskf())); buffer.append(" (").append(getLcbUskf()).append(" )\n"); buffer.append(" .fcPlcupcRgbuse = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcupcRgbuse())); buffer.append(" (").append(getFcPlcupcRgbuse()).append(" )\n"); buffer.append(" .lcbPlcupcRgbuse = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcupcRgbuse())); buffer.append(" (").append(getLcbPlcupcRgbuse()).append(" )\n"); buffer.append(" .fcPlcupcUsp = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcupcUsp())); buffer.append(" (").append(getFcPlcupcUsp()).append(" )\n"); buffer.append(" .lcbPlcupcUsp = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcupcUsp())); buffer.append(" (").append(getLcbPlcupcUsp()).append(" )\n"); buffer.append(" .fcSttbGlsyStyle = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbGlsyStyle())); buffer.append(" (").append(getFcSttbGlsyStyle()).append(" )\n"); buffer.append(" .lcbSttbGlsyStyle = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbGlsyStyle())); buffer.append(" (").append(getLcbSttbGlsyStyle()).append(" )\n"); buffer.append(" .fcPlgosl = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlgosl())); buffer.append(" (").append(getFcPlgosl()).append(" )\n"); buffer.append(" .lcbPlgosl = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlgosl())); buffer.append(" (").append(getLcbPlgosl()).append(" )\n"); buffer.append(" .fcPlcocx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcocx())); buffer.append(" (").append(getFcPlcocx()).append(" )\n"); buffer.append(" .lcbPlcocx = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcocx())); buffer.append(" (").append(getLcbPlcocx()).append(" )\n"); buffer.append(" .fcPlcfbteLvc = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfbteLvc())); buffer.append(" (").append(getFcPlcfbteLvc()).append(" )\n"); buffer.append(" .lcbPlcfbteLvc = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfbteLvc())); buffer.append(" (").append(getLcbPlcfbteLvc()).append(" )\n"); buffer.append(" .dwLowDateTime = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getDwLowDateTime())); buffer.append(" (").append(getDwLowDateTime()).append(" )\n"); buffer.append(" .dwHighDateTime = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getDwHighDateTime())); buffer.append(" (").append(getDwHighDateTime()).append(" )\n"); buffer.append(" .fcPlcflvc = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcflvc())); buffer.append(" (").append(getFcPlcflvc()).append(" )\n"); buffer.append(" .lcbPlcflvc = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcflvc())); buffer.append(" (").append(getLcbPlcflvc()).append(" )\n"); buffer.append(" .fcPlcasumy = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcasumy())); buffer.append(" (").append(getFcPlcasumy()).append(" )\n"); buffer.append(" .lcbPlcasumy = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcasumy())); buffer.append(" (").append(getLcbPlcasumy()).append(" )\n"); buffer.append(" .fcPlcfgram = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcPlcfgram())); buffer.append(" (").append(getFcPlcfgram()).append(" )\n"); buffer.append(" .lcbPlcfgram = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbPlcfgram())); buffer.append(" (").append(getLcbPlcfgram()).append(" )\n"); buffer.append(" .fcSttbListNames = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbListNames())); buffer.append(" (").append(getFcSttbListNames()).append(" )\n"); buffer.append(" .lcbSttbListNames = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbListNames())); buffer.append(" (").append(getLcbSttbListNames()).append(" )\n"); buffer.append(" .fcSttbfUssr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getFcSttbfUssr())); buffer.append(" (").append(getFcSttbfUssr()).append(" )\n"); buffer.append(" .lcbSttbfUssr = "); - buffer.append("0x"); - buffer.append(HexDump.toHex((int)getLcbSttbfUssr())); buffer.append(" (").append(getLcbSttbfUssr()).append(" )\n"); buffer.append("[/FIB]\n"); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/PAPAbstractType.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/PAPAbstractType.java index f84fc682f..67a5f3522 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/PAPAbstractType.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/PAPAbstractType.java @@ -63,6 +63,7 @@ import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; import org.apache.poi.util.HexDump; import org.apache.poi.hdf.model.hdftypes.HDFType; +import org.apache.poi.hwpf.usermodel.*; /** * Paragraph Properties. @@ -75,76 +76,76 @@ public abstract class PAPAbstractType implements HDFType { - private int field_1_istd; - private byte field_2_jc; - private byte field_3_fKeep; - private byte field_4_fKeepFollow; - private byte field_5_fPageBreakBefore; - private byte field_6_fBrLnAbove; - private byte field_7_fBrLnBelow; - private byte field_8_pcVert; - private byte field_9_pcHorz; - private byte field_10_brcp; - private byte field_11_brcl; - private byte field_12_ilvl; - private byte field_13_fNoLnn; - private int field_14_ilfo; - private byte field_15_fSideBySide; - private byte field_16_fNoAutoHyph; - private byte field_17_fWidowControl; - private int field_18_dxaRight; - private int field_19_dxaLeft; - private int field_20_dxaLeft1; - private short[] field_21_lspd; - private int field_22_dyaBefore; - private int field_23_dyaAfter; - private byte[] field_24_phe; - private byte field_25_fCrLf; - private byte field_26_fUsePgsuSettings; - private byte field_27_fAdjustRight; - private byte field_28_fKinsoku; - private byte field_29_fWordWrap; - private byte field_30_fOverflowPunct; - private byte field_31_fTopLinePunct; - private byte field_32_fAutoSpaceDE; - private byte field_33_fAutoSpaceDN; - private int field_34_wAlignFont; - private short field_35_fontAlign; + protected int field_1_istd; + protected byte field_2_jc; + protected byte field_3_fKeep; + protected byte field_4_fKeepFollow; + protected byte field_5_fPageBreakBefore; + protected byte field_6_fBrLnAbove; + protected byte field_7_fBrLnBelow; + protected byte field_8_pcVert; + protected byte field_9_pcHorz; + protected byte field_10_brcp; + protected byte field_11_brcl; + protected byte field_12_ilvl; + protected byte field_13_fNoLnn; + protected int field_14_ilfo; + protected byte field_15_fSideBySide; + protected byte field_16_fNoAutoHyph; + protected byte field_17_fWidowControl; + protected int field_18_dxaRight; + protected int field_19_dxaLeft; + protected int field_20_dxaLeft1; + protected LineSpacingDescriptor field_21_lspd; + protected int field_22_dyaBefore; + protected int field_23_dyaAfter; + protected byte[] field_24_phe; + protected byte field_25_fCrLf; + protected byte field_26_fUsePgsuSettings; + protected byte field_27_fAdjustRight; + protected byte field_28_fKinsoku; + protected byte field_29_fWordWrap; + protected byte field_30_fOverflowPunct; + protected byte field_31_fTopLinePunct; + protected byte field_32_fAutoSpaceDE; + protected byte field_33_fAutoSpaceDN; + protected int field_34_wAlignFont; + protected short field_35_fontAlign; private static BitField fVertical = new BitField(0x0001); private static BitField fBackward = new BitField(0x0002); private static BitField fRotateFont = new BitField(0x0004); - private byte field_36_fBackward; - private byte field_37_fRotateFont; - private byte field_38_fInTable; - private byte field_39_fTtp; - private byte field_40_wr; - private byte field_41_fLocked; - private byte[] field_42_ptap; - private int field_43_dxaAbs; - private int field_44_dyaAbs; - private int field_45_dxaWidth; - private short[] field_46_brcTop; - private short[] field_47_brcLeft; - private short[] field_48_brcBottom; - private short[] field_49_brcRight; - private short[] field_50_brcBetween; - private short[] field_51_brcBar; - private int field_52_dxaFromText; - private int field_53_dyaFromText; - private int field_54_dyaHeight; - private byte field_55_fMinHeight; - private short field_56_shd; - private short field_57_dcs; - private byte field_58_lvl; - private byte field_59_fNumRMIns; - private byte[] field_60_anld; - private int field_61_fPropRMark; - private int field_62_ibstPropRMark; - private byte[] field_63_dttmPropRMark; - private byte[] field_64_numrm; - private int field_65_itbdMac; - private byte[] field_66_rgdxaTab; - private byte[] field_67_rgtbd; + protected byte field_36_fBackward; + protected byte field_37_fRotateFont; + protected byte field_38_fInTable; + protected byte field_39_fTtp; + protected byte field_40_wr; + protected byte field_41_fLocked; + protected byte[] field_42_ptap; + protected int field_43_dxaAbs; + protected int field_44_dyaAbs; + protected int field_45_dxaWidth; + protected BorderCode field_46_brcTop; + protected BorderCode field_47_brcLeft; + protected BorderCode field_48_brcBottom; + protected BorderCode field_49_brcRight; + protected BorderCode field_50_brcBetween; + protected BorderCode field_51_brcBar; + protected int field_52_dxaFromText; + protected int field_53_dyaFromText; + protected int field_54_dyaHeight; + protected byte field_55_fMinHeight; + protected short field_56_shd; + protected short field_57_dcs; + protected byte field_58_lvl; + protected byte field_59_fNumRMIns; + protected byte[] field_60_anld; + protected int field_61_fPropRMark; + protected int field_62_ibstPropRMark; + protected DateAndTime field_63_dttmPropRMark; + protected byte[] field_64_numrm; + protected int field_65_itbdMac; + protected int[] field_66_rgdxaTab; + protected byte[] field_67_rgtbd; public PAPAbstractType() @@ -485,7 +486,7 @@ public abstract class PAPAbstractType /** * Get the lspd field for the PAP record. */ - public short[] getLspd() + public LineSpacingDescriptor getLspd() { return field_21_lspd; } @@ -493,7 +494,7 @@ public abstract class PAPAbstractType /** * Set the lspd field for the PAP record. */ - public void setLspd(short[] field_21_lspd) + public void setLspd(LineSpacingDescriptor field_21_lspd) { this.field_21_lspd = field_21_lspd; } @@ -885,7 +886,7 @@ public abstract class PAPAbstractType /** * Get the brcTop field for the PAP record. */ - public short[] getBrcTop() + public BorderCode getBrcTop() { return field_46_brcTop; } @@ -893,7 +894,7 @@ public abstract class PAPAbstractType /** * Set the brcTop field for the PAP record. */ - public void setBrcTop(short[] field_46_brcTop) + public void setBrcTop(BorderCode field_46_brcTop) { this.field_46_brcTop = field_46_brcTop; } @@ -901,7 +902,7 @@ public abstract class PAPAbstractType /** * Get the brcLeft field for the PAP record. */ - public short[] getBrcLeft() + public BorderCode getBrcLeft() { return field_47_brcLeft; } @@ -909,7 +910,7 @@ public abstract class PAPAbstractType /** * Set the brcLeft field for the PAP record. */ - public void setBrcLeft(short[] field_47_brcLeft) + public void setBrcLeft(BorderCode field_47_brcLeft) { this.field_47_brcLeft = field_47_brcLeft; } @@ -917,7 +918,7 @@ public abstract class PAPAbstractType /** * Get the brcBottom field for the PAP record. */ - public short[] getBrcBottom() + public BorderCode getBrcBottom() { return field_48_brcBottom; } @@ -925,7 +926,7 @@ public abstract class PAPAbstractType /** * Set the brcBottom field for the PAP record. */ - public void setBrcBottom(short[] field_48_brcBottom) + public void setBrcBottom(BorderCode field_48_brcBottom) { this.field_48_brcBottom = field_48_brcBottom; } @@ -933,7 +934,7 @@ public abstract class PAPAbstractType /** * Get the brcRight field for the PAP record. */ - public short[] getBrcRight() + public BorderCode getBrcRight() { return field_49_brcRight; } @@ -941,7 +942,7 @@ public abstract class PAPAbstractType /** * Set the brcRight field for the PAP record. */ - public void setBrcRight(short[] field_49_brcRight) + public void setBrcRight(BorderCode field_49_brcRight) { this.field_49_brcRight = field_49_brcRight; } @@ -949,7 +950,7 @@ public abstract class PAPAbstractType /** * Get the brcBetween field for the PAP record. */ - public short[] getBrcBetween() + public BorderCode getBrcBetween() { return field_50_brcBetween; } @@ -957,7 +958,7 @@ public abstract class PAPAbstractType /** * Set the brcBetween field for the PAP record. */ - public void setBrcBetween(short[] field_50_brcBetween) + public void setBrcBetween(BorderCode field_50_brcBetween) { this.field_50_brcBetween = field_50_brcBetween; } @@ -965,7 +966,7 @@ public abstract class PAPAbstractType /** * Get the brcBar field for the PAP record. */ - public short[] getBrcBar() + public BorderCode getBrcBar() { return field_51_brcBar; } @@ -973,7 +974,7 @@ public abstract class PAPAbstractType /** * Set the brcBar field for the PAP record. */ - public void setBrcBar(short[] field_51_brcBar) + public void setBrcBar(BorderCode field_51_brcBar) { this.field_51_brcBar = field_51_brcBar; } @@ -1157,7 +1158,7 @@ public abstract class PAPAbstractType /** * Get the dttmPropRMark field for the PAP record. */ - public byte[] getDttmPropRMark() + public DateAndTime getDttmPropRMark() { return field_63_dttmPropRMark; } @@ -1165,7 +1166,7 @@ public abstract class PAPAbstractType /** * Set the dttmPropRMark field for the PAP record. */ - public void setDttmPropRMark(byte[] field_63_dttmPropRMark) + public void setDttmPropRMark(DateAndTime field_63_dttmPropRMark) { this.field_63_dttmPropRMark = field_63_dttmPropRMark; } @@ -1205,7 +1206,7 @@ public abstract class PAPAbstractType /** * Get the rgdxaTab field for the PAP record. */ - public byte[] getRgdxaTab() + public int[] getRgdxaTab() { return field_66_rgdxaTab; } @@ -1213,7 +1214,7 @@ public abstract class PAPAbstractType /** * Set the rgdxaTab field for the PAP record. */ - public void setRgdxaTab(byte[] field_66_rgdxaTab) + public void setRgdxaTab(int[] field_66_rgdxaTab) { this.field_66_rgdxaTab = field_66_rgdxaTab; } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/SEPAbstractType.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/SEPAbstractType.java index f458441d3..b35053483 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/SEPAbstractType.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/SEPAbstractType.java @@ -63,6 +63,7 @@ import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; import org.apache.poi.util.HexDump; import org.apache.poi.hdf.model.hdftypes.HDFType; +import org.apache.poi.hwpf.usermodel.*; /** * Section Properties. @@ -75,65 +76,65 @@ public abstract class SEPAbstractType implements HDFType { - private byte field_1_bkc; - private boolean field_2_fTitlePage; - private boolean field_3_fAutoPgn; - private byte field_4_nfcPgn; - private boolean field_5_fUnlocked; - private byte field_6_cnsPgn; - private boolean field_7_fPgnRestart; - private boolean field_8_fEndNote; - private byte field_9_lnc; - private byte field_10_grpfIhdt; - private int field_11_nLnnMod; - private int field_12_dxaLnn; - private int field_13_dxaPgn; - private int field_14_dyaPgn; - private boolean field_15_fLBetween; - private byte field_16_vjc; - private int field_17_dmBinFirst; - private int field_18_dmBinOther; - private int field_19_dmPaperReq; - private short[] field_20_brcTop; - private short[] field_21_brcLeft; - private short[] field_22_brcBottom; - private short[] field_23_brcRight; - private boolean field_24_fPropMark; - private int field_25_ibstPropRMark; - private int field_26_dttmPropRMark; - private int field_27_dxtCharSpace; - private int field_28_dyaLinePitch; - private int field_29_clm; - private int field_30_unused2; - private byte field_31_dmOrientPage; - private byte field_32_iHeadingPgn; - private int field_33_pgnStart; - private int field_34_lnnMin; - private int field_35_wTextFlow; - private short field_36_unused3; - private int field_37_pgbProp; - private short field_38_unused4; - private int field_39_xaPage; - private int field_40_yaPage; - private int field_41_xaPageNUp; - private int field_42_yaPageNUp; - private int field_43_dxaLeft; - private int field_44_dxaRight; - private int field_45_dyaTop; - private int field_46_dyaBottom; - private int field_47_dzaGutter; - private int field_48_dyaHdrTop; - private int field_49_dyaHdrBottom; - private int field_50_ccolM1; - private boolean field_51_fEvenlySpaced; - private byte field_52_unused5; - private int field_53_dxaColumns; - private int[] field_54_rgdxaColumn; - private int field_55_dxaColumnWidth; - private byte field_56_dmOrientFirst; - private byte field_57_fLayout; - private short field_58_unused6; - private byte[] field_59_olstAnm; + protected byte field_1_bkc; + protected boolean field_2_fTitlePage; + protected boolean field_3_fAutoPgn; + protected byte field_4_nfcPgn; + protected boolean field_5_fUnlocked; + protected byte field_6_cnsPgn; + protected boolean field_7_fPgnRestart; + protected boolean field_8_fEndNote; + protected byte field_9_lnc; + protected byte field_10_grpfIhdt; + protected int field_11_nLnnMod; + protected int field_12_dxaLnn; + protected int field_13_dxaPgn; + protected int field_14_dyaPgn; + protected boolean field_15_fLBetween; + protected byte field_16_vjc; + protected int field_17_dmBinFirst; + protected int field_18_dmBinOther; + protected int field_19_dmPaperReq; + protected BorderCode field_20_brcTop; + protected BorderCode field_21_brcLeft; + protected BorderCode field_22_brcBottom; + protected BorderCode field_23_brcRight; + protected boolean field_24_fPropMark; + protected int field_25_ibstPropRMark; + protected DateAndTime field_26_dttmPropRMark; + protected int field_27_dxtCharSpace; + protected int field_28_dyaLinePitch; + protected int field_29_clm; + protected int field_30_unused2; + protected byte field_31_dmOrientPage; + protected byte field_32_iHeadingPgn; + protected int field_33_pgnStart; + protected int field_34_lnnMin; + protected int field_35_wTextFlow; + protected short field_36_unused3; + protected int field_37_pgbProp; + protected short field_38_unused4; + protected int field_39_xaPage; + protected int field_40_yaPage; + protected int field_41_xaPageNUp; + protected int field_42_yaPageNUp; + protected int field_43_dxaLeft; + protected int field_44_dxaRight; + protected int field_45_dyaTop; + protected int field_46_dyaBottom; + protected int field_47_dzaGutter; + protected int field_48_dyaHdrTop; + protected int field_49_dyaHdrBottom; + protected int field_50_ccolM1; + protected boolean field_51_fEvenlySpaced; + protected byte field_52_unused5; + protected int field_53_dxaColumns; + protected int[] field_54_rgdxaColumn; + protected int field_55_dxaColumnWidth; + protected byte field_56_dmOrientFirst; + protected byte field_57_fLayout; + protected short field_58_unused6; + protected byte[] field_59_olstAnm; public SEPAbstractType() @@ -458,7 +459,7 @@ public abstract class SEPAbstractType /** * Get the brcTop field for the SEP record. */ - public short[] getBrcTop() + public BorderCode getBrcTop() { return field_20_brcTop; } @@ -466,7 +467,7 @@ public abstract class SEPAbstractType /** * Set the brcTop field for the SEP record. */ - public void setBrcTop(short[] field_20_brcTop) + public void setBrcTop(BorderCode field_20_brcTop) { this.field_20_brcTop = field_20_brcTop; } @@ -474,7 +475,7 @@ public abstract class SEPAbstractType /** * Get the brcLeft field for the SEP record. */ - public short[] getBrcLeft() + public BorderCode getBrcLeft() { return field_21_brcLeft; } @@ -482,7 +483,7 @@ public abstract class SEPAbstractType /** * Set the brcLeft field for the SEP record. */ - public void setBrcLeft(short[] field_21_brcLeft) + public void setBrcLeft(BorderCode field_21_brcLeft) { this.field_21_brcLeft = field_21_brcLeft; } @@ -490,7 +491,7 @@ public abstract class SEPAbstractType /** * Get the brcBottom field for the SEP record. */ - public short[] getBrcBottom() + public BorderCode getBrcBottom() { return field_22_brcBottom; } @@ -498,7 +499,7 @@ public abstract class SEPAbstractType /** * Set the brcBottom field for the SEP record. */ - public void setBrcBottom(short[] field_22_brcBottom) + public void setBrcBottom(BorderCode field_22_brcBottom) { this.field_22_brcBottom = field_22_brcBottom; } @@ -506,7 +507,7 @@ public abstract class SEPAbstractType /** * Get the brcRight field for the SEP record. */ - public short[] getBrcRight() + public BorderCode getBrcRight() { return field_23_brcRight; } @@ -514,7 +515,7 @@ public abstract class SEPAbstractType /** * Set the brcRight field for the SEP record. */ - public void setBrcRight(short[] field_23_brcRight) + public void setBrcRight(BorderCode field_23_brcRight) { this.field_23_brcRight = field_23_brcRight; } @@ -554,7 +555,7 @@ public abstract class SEPAbstractType /** * Get the dttmPropRMark field for the SEP record. */ - public int getDttmPropRMark() + public DateAndTime getDttmPropRMark() { return field_26_dttmPropRMark; } @@ -562,7 +563,7 @@ public abstract class SEPAbstractType /** * Set the dttmPropRMark field for the SEP record. */ - public void setDttmPropRMark(int field_26_dttmPropRMark) + public void setDttmPropRMark(DateAndTime field_26_dttmPropRMark) { this.field_26_dttmPropRMark = field_26_dttmPropRMark; } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/TAPAbstractType.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/TAPAbstractType.java index c5ab8e3f3..aef5f1e52 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/TAPAbstractType.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/TAPAbstractType.java @@ -63,6 +63,7 @@ import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; import org.apache.poi.util.HexDump; import org.apache.poi.hdf.model.hdftypes.HDFType; +import org.apache.poi.hwpf.usermodel.*; /** * Table Properties. @@ -75,22 +76,22 @@ public abstract class TAPAbstractType implements HDFType { - private int field_1_jc; - private int field_2_dxaGapHalf; - private int field_3_dyaRowHeight; - private boolean field_4_fCantSplit; - private boolean field_5_fTableHeader; - private int field_6_tlp; - private short field_7_itcMac; - private short[] field_8_rgdxaCenter; - private TCAbstractType[] field_9_rgtc; - private byte[] field_10_rgshd; - private short[] field_11_brcBottom; - private short[] field_12_brcTop; - private short[] field_13_brcLeft; - private short[] field_14_brcRight; - private short[] field_15_brcVertical; - private short[] field_16_brcHorizontal; + protected int field_1_jc; + protected int field_2_dxaGapHalf; + protected int field_3_dyaRowHeight; + protected boolean field_4_fCantSplit; + protected boolean field_5_fTableHeader; + protected int field_6_tlp; + protected short field_7_itcMac; + protected short[] field_8_rgdxaCenter; + protected TableCellDescriptor[] field_9_rgtc; + protected ShadingDescriptor[] field_10_rgshd; + protected BorderCode field_11_brcBottom; + protected BorderCode field_12_brcTop; + protected BorderCode field_13_brcLeft; + protected BorderCode field_14_brcRight; + protected BorderCode field_15_brcVertical; + protected BorderCode field_16_brcHorizontal; public TAPAbstractType() @@ -239,7 +240,7 @@ public abstract class TAPAbstractType /** * Get the rgtc field for the TAP record. */ - public TCAbstractType[] getRgtc() + public TableCellDescriptor[] getRgtc() { return field_9_rgtc; } @@ -247,7 +248,7 @@ public abstract class TAPAbstractType /** * Set the rgtc field for the TAP record. */ - public void setRgtc(TCAbstractType[] field_9_rgtc) + public void setRgtc(TableCellDescriptor[] field_9_rgtc) { this.field_9_rgtc = field_9_rgtc; } @@ -255,7 +256,7 @@ public abstract class TAPAbstractType /** * Get the rgshd field for the TAP record. */ - public byte[] getRgshd() + public ShadingDescriptor[] getRgshd() { return field_10_rgshd; } @@ -263,7 +264,7 @@ public abstract class TAPAbstractType /** * Set the rgshd field for the TAP record. */ - public void setRgshd(byte[] field_10_rgshd) + public void setRgshd(ShadingDescriptor[] field_10_rgshd) { this.field_10_rgshd = field_10_rgshd; } @@ -271,7 +272,7 @@ public abstract class TAPAbstractType /** * Get the brcBottom field for the TAP record. */ - public short[] getBrcBottom() + public BorderCode getBrcBottom() { return field_11_brcBottom; } @@ -279,7 +280,7 @@ public abstract class TAPAbstractType /** * Set the brcBottom field for the TAP record. */ - public void setBrcBottom(short[] field_11_brcBottom) + public void setBrcBottom(BorderCode field_11_brcBottom) { this.field_11_brcBottom = field_11_brcBottom; } @@ -287,7 +288,7 @@ public abstract class TAPAbstractType /** * Get the brcTop field for the TAP record. */ - public short[] getBrcTop() + public BorderCode getBrcTop() { return field_12_brcTop; } @@ -295,7 +296,7 @@ public abstract class TAPAbstractType /** * Set the brcTop field for the TAP record. */ - public void setBrcTop(short[] field_12_brcTop) + public void setBrcTop(BorderCode field_12_brcTop) { this.field_12_brcTop = field_12_brcTop; } @@ -303,7 +304,7 @@ public abstract class TAPAbstractType /** * Get the brcLeft field for the TAP record. */ - public short[] getBrcLeft() + public BorderCode getBrcLeft() { return field_13_brcLeft; } @@ -311,7 +312,7 @@ public abstract class TAPAbstractType /** * Set the brcLeft field for the TAP record. */ - public void setBrcLeft(short[] field_13_brcLeft) + public void setBrcLeft(BorderCode field_13_brcLeft) { this.field_13_brcLeft = field_13_brcLeft; } @@ -319,7 +320,7 @@ public abstract class TAPAbstractType /** * Get the brcRight field for the TAP record. */ - public short[] getBrcRight() + public BorderCode getBrcRight() { return field_14_brcRight; } @@ -327,7 +328,7 @@ public abstract class TAPAbstractType /** * Set the brcRight field for the TAP record. */ - public void setBrcRight(short[] field_14_brcRight) + public void setBrcRight(BorderCode field_14_brcRight) { this.field_14_brcRight = field_14_brcRight; } @@ -335,7 +336,7 @@ public abstract class TAPAbstractType /** * Get the brcVertical field for the TAP record. */ - public short[] getBrcVertical() + public BorderCode getBrcVertical() { return field_15_brcVertical; } @@ -343,7 +344,7 @@ public abstract class TAPAbstractType /** * Set the brcVertical field for the TAP record. */ - public void setBrcVertical(short[] field_15_brcVertical) + public void setBrcVertical(BorderCode field_15_brcVertical) { this.field_15_brcVertical = field_15_brcVertical; } @@ -351,7 +352,7 @@ public abstract class TAPAbstractType /** * Get the brcHorizontal field for the TAP record. */ - public short[] getBrcHorizontal() + public BorderCode getBrcHorizontal() { return field_16_brcHorizontal; } @@ -359,7 +360,7 @@ public abstract class TAPAbstractType /** * Set the brcHorizontal field for the TAP record. */ - public void setBrcHorizontal(short[] field_16_brcHorizontal) + public void setBrcHorizontal(BorderCode field_16_brcHorizontal) { this.field_16_brcHorizontal = field_16_brcHorizontal; } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/TCAbstractType.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/TCAbstractType.java index 585fd0638..0ffdce968 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/TCAbstractType.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/definitions/TCAbstractType.java @@ -63,6 +63,7 @@ import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; import org.apache.poi.util.HexDump; import org.apache.poi.hdf.model.hdftypes.HDFType; +import org.apache.poi.hwpf.usermodel.*; /** * Table Cell Descriptor. @@ -75,7 +76,7 @@ public abstract class TCAbstractType implements HDFType { - private short field_1_rgf; + protected short field_1_rgf; private static BitField fFirstMerged = new BitField(0x0001); private static BitField fMerged = new BitField(0x0002); private static BitField fVertical = new BitField(0x0004); @@ -84,11 +85,11 @@ public abstract class TCAbstractType private static BitField fVertMerge = new BitField(0x0020); private static BitField fVertRestart = new BitField(0x0040); private static BitField vertAlign = new BitField(0x0180); - private short field_2_unused; - private short[] field_3_brcTop; - private short[] field_4_brcLeft; - private short[] field_5_brcBottom; - private short[] field_6_brcRight; + protected short field_2_unused; + protected BorderCode field_3_brcTop; + protected BorderCode field_4_brcLeft; + protected BorderCode field_5_brcBottom; + protected BorderCode field_6_brcRight; public TCAbstractType() @@ -96,6 +97,64 @@ public abstract class TCAbstractType } + protected void fillFields(byte [] data, int offset) + { + field_1_rgf = LittleEndian.getShort(data, 0x0 + offset); + field_2_unused = LittleEndian.getShort(data, 0x2 + offset); + field_3_brcTop = new BorderCode(data, 0x4 + offset); + field_4_brcLeft = new BorderCode(data, 0x8 + offset); + field_5_brcBottom = new BorderCode(data, 0xc + offset); + field_6_brcRight = new BorderCode(data, 0x10 + offset); + + } + + public void serialize(byte[] data, int offset) + { + LittleEndian.putShort(data, 0x0 + offset, (short)field_1_rgf);; + LittleEndian.putShort(data, 0x2 + offset, (short)field_2_unused);; + field_3_brcTop.serialize(data, 0x4 + offset);; + field_4_brcLeft.serialize(data, 0x8 + offset);; + field_5_brcBottom.serialize(data, 0xc + offset);; + field_6_brcRight.serialize(data, 0x10 + offset);; + + } + + public String toString() + { + StringBuffer buffer = new StringBuffer(); + + buffer.append("[TC]\n"); + + buffer.append(" .rgf = "); + buffer.append(" (").append(getRgf()).append(" )\n"); + buffer.append(" .fFirstMerged = ").append(isFFirstMerged()).append('\n'); + buffer.append(" .fMerged = ").append(isFMerged()).append('\n'); + buffer.append(" .fVertical = ").append(isFVertical()).append('\n'); + buffer.append(" .fBackward = ").append(isFBackward()).append('\n'); + buffer.append(" .fRotateFont = ").append(isFRotateFont()).append('\n'); + buffer.append(" .fVertMerge = ").append(isFVertMerge()).append('\n'); + buffer.append(" .fVertRestart = ").append(isFVertRestart()).append('\n'); + buffer.append(" .vertAlign = ").append(getVertAlign()).append('\n'); + + buffer.append(" .unused = "); + buffer.append(" (").append(getUnused()).append(" )\n"); + + buffer.append(" .brcTop = "); + buffer.append(" (").append(getBrcTop()).append(" )\n"); + + buffer.append(" .brcLeft = "); + buffer.append(" (").append(getBrcLeft()).append(" )\n"); + + buffer.append(" .brcBottom = "); + buffer.append(" (").append(getBrcBottom()).append(" )\n"); + + buffer.append(" .brcRight = "); + buffer.append(" (").append(getBrcRight()).append(" )\n"); + + buffer.append("[/TC]\n"); + return buffer.toString(); + } + /** * Size of record (exluding 4 byte header) */ @@ -141,7 +200,7 @@ public abstract class TCAbstractType /** * Get the brcTop field for the TC record. */ - public short[] getBrcTop() + public BorderCode getBrcTop() { return field_3_brcTop; } @@ -149,7 +208,7 @@ public abstract class TCAbstractType /** * Set the brcTop field for the TC record. */ - public void setBrcTop(short[] field_3_brcTop) + public void setBrcTop(BorderCode field_3_brcTop) { this.field_3_brcTop = field_3_brcTop; } @@ -157,7 +216,7 @@ public abstract class TCAbstractType /** * Get the brcLeft field for the TC record. */ - public short[] getBrcLeft() + public BorderCode getBrcLeft() { return field_4_brcLeft; } @@ -165,7 +224,7 @@ public abstract class TCAbstractType /** * Set the brcLeft field for the TC record. */ - public void setBrcLeft(short[] field_4_brcLeft) + public void setBrcLeft(BorderCode field_4_brcLeft) { this.field_4_brcLeft = field_4_brcLeft; } @@ -173,7 +232,7 @@ public abstract class TCAbstractType /** * Get the brcBottom field for the TC record. */ - public short[] getBrcBottom() + public BorderCode getBrcBottom() { return field_5_brcBottom; } @@ -181,7 +240,7 @@ public abstract class TCAbstractType /** * Set the brcBottom field for the TC record. */ - public void setBrcBottom(short[] field_5_brcBottom) + public void setBrcBottom(BorderCode field_5_brcBottom) { this.field_5_brcBottom = field_5_brcBottom; } @@ -189,7 +248,7 @@ public abstract class TCAbstractType /** * Get the brcRight field for the TC record. */ - public short[] getBrcRight() + public BorderCode getBrcRight() { return field_6_brcRight; } @@ -197,7 +256,7 @@ public abstract class TCAbstractType /** * Set the brcRight field for the TC record. */ - public void setBrcRight(short[] field_6_brcRight) + public void setBrcRight(BorderCode field_6_brcRight) { this.field_6_brcRight = field_6_brcRight; } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmCompresser.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmCompresser.java index de577c670..004923c82 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmCompresser.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmCompresser.java @@ -319,18 +319,7 @@ public class CharacterSprmCompresser size += SprmUtils.addSprm((short)0x2859, newCHP.getSfxtText(), null, sprmList); } - // spit out the final grpprl - byte[] grpprl = new byte[size]; - int listSize = sprmList.size() - 1; - int index = 0; - for (; listSize >= 0; listSize--) - { - byte[] sprm = (byte[])sprmList.remove(0); - System.arraycopy(sprm, 0, grpprl, index, sprm.length); - index += sprm.length; - } - - return grpprl; + return SprmUtils.getGrpprl(sprmList, size); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java index f0cb6941b..71a2bcf2a 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmCompressor.java @@ -329,18 +329,7 @@ public class ParagraphSprmCompressor size += SprmUtils.addSprm((short)0xC645, 0, newPAP.getNumrm(), sprmList); } - // spit out the final grpprl - byte[] grpprl = new byte[size]; - int listSize = sprmList.size() - 1; - int index = 0; - for (; listSize >= 0; listSize--) - { - byte[] sprm = (byte[])sprmList.remove(0); - System.arraycopy(sprm, 0, grpprl, index, sprm.length); - index += sprm.length; - } - - return grpprl; + return SprmUtils.getGrpprl(sprmList, size); } } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java index 17bf95c34..f83b810c9 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java @@ -123,6 +123,23 @@ public class SprmUtils return sprm.length; } + public static byte[] getGrpprl(List sprmList, int size) + { + // spit out the final grpprl + byte[] grpprl = new byte[size]; + int listSize = sprmList.size() - 1; + int index = 0; + for (; listSize >= 0; listSize--) + { + byte[] sprm = (byte[])sprmList.remove(0); + System.arraycopy(sprm, 0, grpprl, index, sprm.length); + index += sprm.length; + } + + return grpprl; + + } + public static int convertBrcToInt(short[] brc) { byte[] buf = new byte[4]; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java index ffce3e36e..f57cce641 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java @@ -55,12 +55,281 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.hwpf.model.hdftypes.definitions.CHPAbstractType; +import org.apache.poi.hwpf.model.hdftypes.StyleDescription; +import org.apache.poi.hwpf.sprm.SprmBuffer; -public class CharacterProperties extends CHPAbstractType +public class CharacterProperties + extends CHPAbstractType implements Cloneable { + public final static short SPRM_FRMARKDEL = (short)0x0800; + public final static short SPRM_FRMARK = 0x0801; + public final static short SPRM_FFLDVANISH = 0x0802; + public final static short SPRM_PICLOCATION = 0x6A03; + public final static short SPRM_IBSTRMARK = 0x4804; + public final static short SPRM_DTTMRMARK = 0x6805; + public final static short SPRM_FDATA = 0x0806; + public final static short SPRM_SYMBOL = 0x6A09; + public final static short SPRM_FOLE2 = 0x080A; + public final static short SPRM_HIGHLIGHT = 0x2A0C; + public final static short SPRM_OBJLOCATION = 0x680E; + public final static short SPRM_ISTD = 0x4A30; + public final static short SPRM_FBOLD = 0x0835; + public final static short SPRM_FITALIC = 0x0836; + public final static short SPRM_FSTRIKE = 0x0837; + public final static short SPRM_FOUTLINE = 0x0838; + public final static short SPRM_FSHADOW = 0x0839; + public final static short SPRM_FSMALLCAPS = 0x083A; + public final static short SPRM_FCAPS = 0x083B; + public final static short SPRM_FVANISH = 0x083C; + public final static short SPRM_KUL = 0x2A3E; + public final static short SPRM_DXASPACE = (short)0x8840; + public final static short SPRM_LID = 0x4A41; + public final static short SPRM_ICO = 0x2A42; + public final static short SPRM_HPS = 0x4A43; + public final static short SPRM_HPSPOS = 0x4845; + public final static short SPRM_ISS = 0x2A48; + public final static short SPRM_HPSKERN = 0x484B; + public final static short SPRM_YSRI = 0x484E; + public final static short SPRM_RGFTCASCII = 0x4A4F; + public final static short SPRM_RGFTCFAREAST = 0x4A50; + public final static short SPRM_RGFTCNOTFAREAST = 0x4A51; + public final static short SPRM_CHARSCALE = 0x4852; + public final static short SPRM_FDSTRIKE = 0x2A53; + public final static short SPRM_FIMPRINT = 0x0854; + public final static short SPRM_FSPEC = 0x0855; + public final static short SPRM_FOBJ = 0x0856; + public final static short SPRM_PROPRMARK = (short)0xCA57; + public final static short SPRM_FEMBOSS = 0x0858; + public final static short SPRM_SFXTEXT = 0x2859; + public final static short SPRM_DISPFLDRMARK = (short)0xCA62; + public final static short SPRM_IBSTRMARKDEL = 0x4863; + public final static short SPRM_DTTMRMARKDEL = 0x6864; + public final static short SPRM_BRC = 0x6865; + public final static short SPRM_SHD = 0x4866; + public final static short SPRM_IDSIRMARKDEL = 0x4867; + public final static short SPRM_CPG = 0x486B; + public final static short SPRM_NONFELID = 0x486D; + public final static short SPRM_FELID = 0x486E; + public final static short SPRM_IDCTHINT = 0x286F; + + + StyleDescription _baseStyle; + SprmBuffer _chpx; + public CharacterProperties() { + field_17_fcPic = -1; + field_22_dttmRMark = new DateAndTime(); + field_23_dttmRMarkDel = new DateAndTime(); + field_36_dttmPropRMark = new DateAndTime(); + field_40_dttmDispFldRMark = new DateAndTime(); + field_41_xstDispFldRMark = new byte[36]; + field_42_shd = new ShadingDescriptor(); + field_43_brc = new BorderCode(); + field_7_hps = 20; + field_24_istd = 10; + field_16_wCharScale = 100; + field_13_lidDefault = 0x0400; + field_14_lidFE = 0x0400; } + public boolean isMarkedDeleted() + { + return isFRMarkDel(); + } + + public void markDeleted(boolean mark) + { + if (mark != isFRMarkDel() && mark != _baseStyle.getCHP().isFRMarkDel()) + { + byte newVal = (byte)(mark ? 1 : 0); + _chpx.addSprm(SPRM_FRMARKDEL, newVal); + super.setFRMarkDel(mark); + } + } + + public boolean isBold() + { + return isFBold(); + } + + public void setBold(boolean bold) + { + if (bold != isFBold() && bold != _baseStyle.getCHP().isFBold()) + { + byte newVal = (byte)(bold ? 1 : 0); + _chpx.addSprm(SPRM_FBOLD, newVal); + super.setFBold(bold); + } + } + + public boolean isItalic() + { + return isFItalic(); + } + + public void setItalic(boolean italic) + { + if (italic != isFItalic() && italic != _baseStyle.getCHP().isFItalic()) + { + byte newVal = (byte)(italic ? 1 : 0); + _chpx.addSprm(SPRM_FITALIC, newVal); + super.setFItalic(italic); + } + } + + public boolean isOutlined() + { + return isFOutline(); + } + + public void setOutline(boolean outlined) + { + if (outlined != isFOutline() && outlined != _baseStyle.getCHP().isFOutline()) + { + byte newVal = (byte)(outlined ? 1 : 0); + _chpx.addSprm(SPRM_FOUTLINE, newVal); + super.setFOutline(outlined); + } + + } + + public boolean isFldVanished() + { + return isFFldVanish(); + } + + public void setFldVanish(boolean fldVanish) + { + if (fldVanish != isFFldVanish() && fldVanish != _baseStyle.getCHP().isFFldVanish()) + { + byte newVal = (byte)(fldVanish ? 1 : 0); + _chpx.addSprm(SPRM_FFLDVANISH, newVal); + super.setFFldVanish(fldVanish); + } + + } + public boolean isSmallCaps() + { + return isFSmallCaps(); + } + + public void setSmallCaps(boolean smallCaps) + { + if (smallCaps != isFSmallCaps() && smallCaps != _baseStyle.getCHP().isFSmallCaps()) + { + byte newVal = (byte)(smallCaps ? 1 : 0); + _chpx.addSprm(SPRM_FSMALLCAPS, newVal); + super.setFSmallCaps(smallCaps); + } + } + public boolean isCapitalized() + { + return isFCaps(); + } + + public void setCapitalized(boolean caps) + { + if (caps != isFCaps() && caps != _baseStyle.getCHP().isFCaps()) + { + byte newVal = (byte)(caps ? 1 : 0); + _chpx.addSprm(SPRM_FCAPS, newVal); + super.setFCaps(caps); + } + } + + public boolean isVanished() + { + return isFVanish(); + } + + public void setVanished(boolean vanish) + { + if (vanish != isFVanish() && vanish != _baseStyle.getCHP().isFVanish()) + { + byte newVal = (byte)(vanish ? 1 : 0); + _chpx.addSprm(SPRM_FVANISH, newVal); + super.setFVanish(vanish); + } + + } + public boolean isMarkedInserted() + { + return isFRMark(); + } + + public void markInserted(boolean mark) + { + if (mark != isFRMark() && mark != _baseStyle.getCHP().isFRMark()) + { + byte newVal = (byte)(mark ? 1 : 0); + _chpx.addSprm(SPRM_FRMARK, newVal); + super.setFRMark(mark); + } + } + + public boolean isStrikeThrough() + { + return isFStrike(); + } + + public void strikeThrough(boolean strike) + { + if (strike != isFStrike() && strike != _baseStyle.getCHP().isFStrike()) + { + byte newVal = (byte)(strike ? 1 : 0); + _chpx.addSprm(SPRM_FSTRIKE, newVal); + super.setFStrike(strike); + } + + } + public boolean isShadowed() + { + return isFShadow(); + } + + public void setShadow(boolean shadow) + { + if (shadow != isFShadow() && shadow != _baseStyle.getCHP().isFShadow()) + { + byte newVal = (byte)(shadow ? 1 : 0); + _chpx.addSprm(SPRM_FSHADOW, newVal); + super.setFShadow(shadow); + } + + } + + public boolean isEmbossed() + { + return isFEmboss(); + } + + public void setEmbossed(boolean emboss) + { + if (emboss != isFEmboss() && emboss != _baseStyle.getCHP().isFEmboss()) + { + byte newVal = (byte)(emboss ? 1 : 0); + _chpx.addSprm(SPRM_FEMBOSS, newVal); + super.setFEmboss(emboss); + } + + } + + + public Object clone() + throws CloneNotSupportedException + { + CharacterProperties cp = (CharacterProperties)super.clone(); + cp.field_22_dttmRMark = (DateAndTime)field_22_dttmRMark.clone(); + cp.field_23_dttmRMarkDel = (DateAndTime)field_23_dttmRMarkDel.clone(); + cp.field_36_dttmPropRMark = (DateAndTime)field_36_dttmPropRMark.clone(); + cp.field_40_dttmDispFldRMark = (DateAndTime)field_40_dttmDispFldRMark.clone(); + cp.field_41_xstDispFldRMark = (byte[])field_41_xstDispFldRMark.clone(); + cp.field_42_shd = (ShadingDescriptor)field_42_shd.clone(); + + return cp; + } + + } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java index 4564a79f2..9d947f416 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java @@ -55,13 +55,107 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.hwpf.model.hdftypes.definitions.PAPAbstractType; +import org.apache.poi.hwpf.model.hdftypes.StyleDescription; +import org.apache.poi.hwpf.sprm.SprmBuffer; - -public class ParagraphProperties extends PAPAbstractType +public class ParagraphProperties + extends PAPAbstractType + implements Cloneable { + public final static short SPRM_JC = 0x2403; + public final static short SPRM_FSIDEBYSIDE = 0x2404; + public final static short SPRM_FKEEP = 0x2405; + public final static short SPRM_FKEEPFOLLOW = 0x2406; + public final static short SPRM_FPAGEBREAKBEFORE = 0x2407; + public final static short SPRM_BRCL = 0x2408; + public final static short SPRM_BRCP = 0x2409; + public final static short SPRM_ILVL = 0x260A; + public final static short SPRM_ILFO = 0x460B; + public final static short SPRM_FNOLINENUMB = 0x240C; + public final static short SPRM_CHGTABSPAPX = (short)0xC60D; + public final static short SPRM_DXARIGHT = (short)0x840E; + public final static short SPRM_DXALEFT = (short)0x840F; + public final static short SPRM_DXALEFT1 = (short)0x8411; + public final static short SPRM_DYALINE = 0x6412; + public final static short SPRM_DYABEFORE = (short)0xA413; + public final static short SPRM_DYAAFTER = (short)0xA414; + public final static short SPRM_CHGTABS = (short)0xC615; + public final static short SPRM_FINTABLE = 0x2416; + public final static short SPRM_FTTP = 0x2417; + public final static short SPRM_DXAABS = (short)0x8418; + public final static short SPRM_DYAABS = (short)0x8419; + public final static short SPRM_DXAWIDTH = (short)0x841A; + public final static short SPRM_PC = 0x261B; + public final static short SPRM_WR = 0x2423; + public final static short SPRM_BRCTOP = 0x6424; + public final static short SPRM_BRCLEFT = 0x6425; + public final static short SPRM_BRCBOTTOM = 0x6426; + public final static short SPRM_BRCRIGHT = 0x6427; + public final static short SPRM_BRCBAR = 0x6629; + public final static short SPRM_FNOAUTOHYPH = 0x242A; + public final static short SPRM_WHEIGHTABS = 0x442B; + public final static short SPRM_DCS = 0x442C; + public final static short SPRM_SHD = 0x442D; + public final static short SPRM_DYAFROMTEXT = (short)0x842E; + public final static short SPRM_DXAFROMTEXT = (short)0x842F; + public final static short SPRM_FLOCKED = 0x2430; + public final static short SPRM_FWIDOWCONTROL = 0x2431; + public final static short SPRM_RULER = (short)0xC632; + public final static short SPRM_FKINSOKU = 0x2433; + public final static short SPRM_FWORDWRAP = 0x2434; + public final static short SPRM_FOVERFLOWPUNCT = 0x2435; + public final static short SPRM_FTOPLINEPUNCT = 0x2436; + public final static short SPRM_AUTOSPACEDE = 0x2437; + public final static short SPRM_AUTOSPACEDN = 0x2438; + public final static short SPRM_WALIGNFONT = 0x4439; + public final static short SPRM_FRAMETEXTFLOW = 0x443A; + public final static short SPRM_ANLD = (short)0xC63E; + public final static short SPRM_PROPRMARK = (short)0xC63F; + public final static short SPRM_OUTLVL = 0x2640; + public final static short SPRM_FBIDI = 0x2441; + public final static short SPRM_FNUMRMLNS = 0x2443; + public final static short SPRM_CRLF = 0x2444; + public final static short SPRM_NUMRM = (short)0xC645; + public final static short SPRM_USEPGSUSETTINGS = 0x2447; + public final static short SPRM_FADJUSTRIGHT = 0x2448; + + + private StyleDescription _baseStyle; + private SprmBuffer _papx; + public ParagraphProperties() { + field_21_lspd = new LineSpacingDescriptor(); + field_24_phe = new byte[12]; + field_46_brcTop = new BorderCode(); + field_47_brcLeft = new BorderCode(); + field_48_brcBottom = new BorderCode(); + field_49_brcRight = new BorderCode(); + field_50_brcBetween = new BorderCode(); + field_51_brcBar = new BorderCode(); + field_60_anld = new byte[84]; + this.field_17_fWidowControl = 1; + this.field_21_lspd.setMultiLinespace((short)1); + this.field_21_lspd.setDyaLine((short)240); + this.field_12_ilvl = (byte)9; + + } + + public Object clone() + throws CloneNotSupportedException + { + ParagraphProperties pp = (ParagraphProperties)super.clone(); + pp.field_21_lspd = (LineSpacingDescriptor)field_21_lspd.clone(); + pp.field_24_phe = (byte[])field_24_phe.clone(); + pp.field_46_brcTop = (BorderCode)field_46_brcTop.clone(); + pp.field_47_brcLeft = (BorderCode)field_47_brcLeft.clone(); + pp.field_48_brcBottom = (BorderCode)field_48_brcBottom.clone(); + pp.field_49_brcRight = (BorderCode)field_49_brcRight.clone(); + pp.field_50_brcBetween = (BorderCode)field_50_brcBetween.clone(); + pp.field_51_brcBar = (BorderCode)field_51_brcBar.clone(); + pp.field_60_anld = (byte[])field_60_anld.clone(); + return pp; } } diff --git a/src/types/definitions/chp_type.xml b/src/types/definitions/chp_type.xml index 2f2d9c5a4..e2e57f0e8 100644 --- a/src/types/definitions/chp_type.xml +++ b/src/types/definitions/chp_type.xml @@ -47,8 +47,8 @@ - - + + @@ -69,13 +69,13 @@ - + - + - - + + diff --git a/src/types/definitions/pap_type.xml b/src/types/definitions/pap_type.xml index c20df2b46..89500352e 100644 --- a/src/types/definitions/pap_type.xml +++ b/src/types/definitions/pap_type.xml @@ -24,7 +24,7 @@ - + @@ -53,12 +53,12 @@ - - - - - - + + + + + + @@ -70,10 +70,10 @@ - + - + diff --git a/src/types/definitions/sep_type.xml b/src/types/definitions/sep_type.xml index a781102b2..5b07b8b53 100644 --- a/src/types/definitions/sep_type.xml +++ b/src/types/definitions/sep_type.xml @@ -23,13 +23,13 @@ - - - - + + + + - + diff --git a/src/types/definitions/tap_type.xml b/src/types/definitions/tap_type.xml index d4fb4e8db..156d15f5c 100644 --- a/src/types/definitions/tap_type.xml +++ b/src/types/definitions/tap_type.xml @@ -12,13 +12,13 @@ - - - - - - - - + + + + + + + + diff --git a/src/types/definitions/tc_type.xml b/src/types/definitions/tc_type.xml index 4ff0016cc..653d28064 100644 --- a/src/types/definitions/tc_type.xml +++ b/src/types/definitions/tc_type.xml @@ -1,4 +1,4 @@ - + AbstractType HDFType Table Cell Descriptor. @@ -15,9 +15,9 @@ - - - - + + + + diff --git a/src/types/styles/hdftype.xsl b/src/types/styles/hdftype.xsl index e7dcdcd47..dca574db4 100644 --- a/src/types/styles/hdftype.xsl +++ b/src/types/styles/hdftype.xsl @@ -69,6 +69,7 @@ import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; import org.apache.poi.util.HexDump; import org.apache.poi.hdf.model.hdftypes.HDFType; +import org.apache.poi.hwpf.usermodel.*; /** * @@ -80,7 +81,7 @@ public abstract class AbstractType implements HDFType { - private field__; + protected field__; @@ -92,7 +93,7 @@ public abstract class AbstractType } - protected void fillFields(byte [] data, short size, int offset) + protected void fillFields(byte [] data, int offset) { @@ -200,9 +201,7 @@ public abstract class AbstractType - buffer.append(" . = "); - buffer.append("0x"); - buffer.append(HexDump.toHex(()get())); + buffer.append(" . = "); buffer.append(" (").append(get()).append(" )\n");