*/
public class ClientAnchorDetail {
- public int fromIndex = 0;
- public int toIndex = 0;
- public int inset = 0;
+ public int fromIndex;
+ public int toIndex;
+ public int inset;
/**
* Create a new instance of the ClientAnchorDetail class using the
*/
public final class MultiLevelListItem {
- private String itemText = null;
- private ArrayList<String> lowerLevelItems = null;
+ private String itemText;
+ private ArrayList<String> lowerLevelItems;
/**
* Create a new instance of the MultiLevelListItem class using the
* @author Jason Height
*/
public class SVBorder extends AbstractBorder {
- private Color northColor = null;
- private Color eastColor = null;
- private Color southColor = null;
- private Color westColor = null;
+ private Color northColor;
+ private Color eastColor;
+ private Color southColor;
+ private Color westColor;
private BorderStyle northBorderType = BorderStyle.NONE;
private BorderStyle eastBorderType = BorderStyle.NONE;
private BorderStyle southBorderType = BorderStyle.NONE;
private BorderStyle westBorderType = BorderStyle.NONE;
- private boolean northBorder=false;
- private boolean eastBorder=false;
- private boolean southBorder=false;
- private boolean westBorder=false;
- private boolean selected = false;
+ private boolean northBorder;
+ private boolean eastBorder;
+ private boolean southBorder;
+ private boolean westBorder;
+ private boolean selected;
public void setBorder(Color northColor, Color eastColor,
Color southColor, Color westColor,
protected SVBorder cellBorder = new SVBorder();
- private HSSFWorkbook wb = null;
+ private HSSFWorkbook wb;
/** This class holds the references to the predefined cell formats.
*/
*/
public class SVTableModel extends AbstractTableModel {
- private HSSFSheet st = null;
- int maxcol = 0;
+ private HSSFSheet st;
+ int maxcol;
public SVTableModel(HSSFSheet st, int maxcol) {
this.st = st;
*/
public class SViewer extends JApplet {
private SViewerPanel panel;
- boolean isStandalone = false;
- String filename = null;
+ boolean isStandalone;
+ String filename;
/**Get a parameter value*/
public String getParameter(String key, String def) {
*/
public class ClientAnchorDetail {
- public int fromIndex = 0;
- public int toIndex = 0;
- public int inset = 0;
+ public int fromIndex;
+ public int toIndex;
+ public int inset;
/**
* Create a new instance of the ClientAnchorDetail class using the
*/
public class ToCSV {
- private Workbook workbook = null;
- private ArrayList<ArrayList<String>> csvData = null;
- private int maxRowWidth = 0;
- private int formattingConvention = 0;
- private DataFormatter formatter = null;
- private FormulaEvaluator evaluator = null;
- private String separator = null;
+ private Workbook workbook;
+ private ArrayList<ArrayList<String>> csvData;
+ private int maxRowWidth;
+ private int formattingConvention;
+ private DataFormatter formatter;
+ private FormulaEvaluator evaluator;
+ private String separator;
private static final String CSV_FILE_EXTENSION = ".csv";
private static final String DEFAULT_SEPARATOR = ",";
* as a (basic) CSV.
*/
private class SheetToCSV implements SheetContentsHandler {
- private boolean firstCellOfRow = false;
+ private boolean firstCellOfRow;
private int currentRow = -1;
private int currentCol = -1;
*/
public class UpdateEmbeddedDoc {
- private XWPFDocument doc = null;
- private File docFile = null;
+ private XWPFDocument doc;
+ private File docFile;
private static final int SHEET_NUM = 0;
private static final int ROW_NUM = 0;
private double precision ;
private double precisionToUse ;
private double globalPrecision ;
- private boolean requiredToPass = false ;
+ private boolean requiredToPass;
private ExcelAntEvaluationResult result ;
private ExcelAntWorkbookUtil wbUtil ;
- private boolean showDelta = false ;
+ private boolean showDelta;
public ExcelAntEvaluateCell() {}
private String excelFileName ;
- private boolean failOnError = false ;
+ private boolean failOnError;
private ExcelAntWorkbookUtil workbookUtil ;
private double globalPrecision;
- private boolean showSuccessDetails = false;
+ private boolean showSuccessDetails;
- private boolean showFailureDetail = false;
+ private boolean showFailureDetail;
LinkedList<String> failureMessages;
import org.apache.poi.ss.usermodel.Workbook;
public class MockExcelAntWorkbookHandler implements IExcelAntWorkbookHandler {
- public static boolean executed = false;
- public static Workbook workbook = null;
+ public static boolean executed;
+ public static Workbook workbook;
@Override
public class TestExcelAntEvaluationResult {
private ExcelAntEvaluationResult fixture;
- private boolean completedWithError = false;
- private boolean passed = false;
+ private boolean completedWithError;
+ private boolean passed;
private double retValue = 1.1;
private String errMessage = "error message";
private double delta = 2.2;
public class HPSFFileHandler extends POIFSFileHandler {
private static final String NL = System.getProperty("line.separator");
- private static File copyOutput = null;
+ private static File copyOutput;
static final Set<String> EXCLUDES_HANDLE_ADD = unmodifiableHashSet(
"spreadsheet/45290.xls",
try {
return PropertySet.isPropertySetStream(dis);
} finally {
- dis.close();;
- }
+ dis.close();
+ }
}
@Override
* @see org.apache.poi.hwpf.extractor.WordExtractor
*/
public abstract class POITextExtractor implements Closeable {
- private Closeable fsToClose = null;
+ private Closeable fsToClose;
/**
* Retrieves all the text from the document.
private short field_8_row2;
private short field_9_dy2;
private byte[] remainingData = new byte[0];
- private boolean shortRecord = false;
+ private boolean shortRecord;
@Override
public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) {
public class EscherColorRef {
@SuppressWarnings("unused")
private int opid = -1;
- private int colorRef = 0;
+ private int colorRef;
public enum SysIndexSource {
/** Use the fill color of the shape. */
class ClipboardData {
private static final POILogger LOG = POILogFactory.getLogger( ClipboardData.class );
- private int _format = 0;
+ private int _format;
private byte[] _value;
ClipboardData() {}
* <p>A <code>byte[]</code> to hold a thumbnail image in ({@link
* Variant#VT_CF VT_CF}) format.</p>
*/
- private byte[] _thumbnailData = null;
+ private byte[] _thumbnailData;
public class FormulaViewer
{
private String file;
- private boolean list=false;
+ private boolean list;
/** Creates new FormulaViewer */
private final HSSFListener childListener;
private final List<BoundSheetRecord> boundSheetRecords = new ArrayList<BoundSheetRecord>();
private final List<ExternSheetRecord> externSheetRecords = new ArrayList<ExternSheetRecord>();
- private SSTRecord sstRecord = null;
+ private SSTRecord sstRecord;
public SheetRecordCollectingListener(HSSFListener childListener) {
this.childListener = childListener;
public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements org.apache.poi.ss.extractor.ExcelExtractor {
private DirectoryNode _dir;
boolean _includeSheetNames = true;
- boolean _formulasNotResults = false;
+ boolean _formulasNotResults;
public EventBasedExcelExtractor( DirectoryNode dir )
{
private int sheetNum = -1;
private int rowNum;
- private boolean outputNextStringValue = false;
+ private boolean outputNextStringValue;
private int nextRow = -1;
public TextListener() {
private final HSSFDataFormatter _formatter;
private boolean _includeSheetNames = true;
private boolean _shouldEvaluateFormulas = true;
- private boolean _includeCellComments = false;
- private boolean _includeBlankCells = false;
+ private boolean _includeCellComments;
+ private boolean _includeBlankCells;
private boolean _includeHeadersFooters = true;
public ExcelExtractor(HSSFWorkbook wb) {
private static POILogger log = POILogFactory.getLogger(InternalSheet.class);
private List<RecordBase> _records;
- protected PrintGridlinesRecord printGridlines = null;
- protected PrintHeadersRecord printHeaders = null;
- protected GridsetRecord gridset = null;
+ protected PrintGridlinesRecord printGridlines;
+ protected PrintHeadersRecord printHeaders;
+ protected GridsetRecord gridset;
private GutsRecord _gutsRecord;
protected DefaultColWidthRecord defaultcolwidth = new DefaultColWidthRecord();
protected DefaultRowHeightRecord defaultrowheight = new DefaultRowHeightRecord();
*/
private final WorksheetProtectionBlock _protectionBlock = new WorksheetProtectionBlock();
- protected WindowTwoRecord windowTwo = null;
- protected SelectionRecord _selection = null;
+ protected WindowTwoRecord windowTwo;
+ protected SelectionRecord _selection;
/** java object always present, but if empty no BIFF records are written */
private final MergedCellsTable _mergedCellsTable;
/** always present in this POI object, not always written to Excel file */
private DimensionsRecord _dimensions;
/** always present */
protected final RowRecordsAggregate _rowsAggregate;
- private DataValidityTable _dataValidityTable= null;
+ private DataValidityTable _dataValidityTable;
private ConditionalFormattingTable condFormatting;
- private Iterator<RowRecord> rowRecIterator = null;
+ private Iterator<RowRecord> rowRecIterator;
/** Add an UncalcedRecord if not true indicating formulas have not been calculated */
- protected boolean _isUncalced = false;
+ protected boolean _isUncalced;
public static final byte PANE_LOWER_RIGHT = (byte)0;
public static final byte PANE_UPPER_RIGHT = (byte)1;
private List<Record> records = new ArrayList<Record>();
/** holds the position of the protect record */
- private int protpos = 0;
+ private int protpos;
/** holds the position of the last bound sheet */
- private int bspos = 0;
+ private int bspos;
/** holds the position of the tabid record */
- private int tabpos = 0;
+ private int tabpos;
/** hold the position of the last font record */
- private int fontpos = 0;
+ private int fontpos;
/** hold the position of the last extended font record */
- private int xfpos = 0;
+ private int xfpos;
/** holds the position of the backup record */
- private int backuppos = 0;
+ private int backuppos;
/** holds the position of last name record */
- private int namepos = 0;
+ private int namepos;
/** holds the position of sup book */
- private int supbookpos = 0;
+ private int supbookpos;
/** holds the position of the extern sheet */
- private int externsheetPos = 0;
+ private int externsheetPos;
/** hold the position of the palette, if applicable */
private int palettepos = -1;
private byte field_6_underline; // 00none/01single/02double/21singleaccounting/22doubleaccounting
private byte field_7_family; // ?? defined by windows api logfont structure?
private byte field_8_charset; // ?? defined by windows api logfont structure?
- private byte field_9_zero = 0; // must be 0
+ private byte field_9_zero; // must be 0
/** possibly empty string never <code>null</code> */
private String field_11_font_name;
*/
public static final short UNSPECIFIED_BIT = (short)0xFFFF;
- private short flags = 0;
+ private short flags;
/**
* Construct a new <code>FtPioGrbitSubRecord</code> and
public static final int AUTO_LOAD_BIT = 1 << 9;
- private short flags = 0;
+ private short flags;
/**
* Construct a new <code>FtPioGrbitSubRecord</code> and
/**
* The most recent record that we gave to the user
*/
- private Record _lastRecord = null;
+ private Record _lastRecord;
/**
* The most recent DrawingRecord seen
*/
// Cache values to speed up performance of
// getStartRowNumberForBlock / getEndRowNumberForBlock, see Bugzilla 47405
- private RowRecord[] _rowRecordValues = null;
+ private RowRecord[] _rowRecordValues;
/** Creates a new instance of ValueRecordsAggregate */
public RowRecordsAggregate() {
*/
class ValueIterator implements Iterator<CellValueRecordInterface> {
- int curRowIndex = 0, curColIndex = -1;
- int nextRowIndex = 0, nextColIndex = -1;
+ int curRowIndex, curColIndex = -1;
+ int nextRowIndex, nextColIndex = -1;
public ValueIterator() {
getNextPos();
public final class ColorGradientFormatting implements Cloneable {
private static POILogger log = POILogFactory.getLogger(ColorGradientFormatting.class);
- private byte options = 0;
+ private byte options;
private ColorGradientThreshold[] thresholds;
private ExtendedColor[] colors;
public final class DataBarFormatting implements Cloneable {
private static POILogger log = POILogFactory.getLogger(DataBarFormatting.class);
- private byte options = 0;
- private byte percentMin = 0;
- private byte percentMax = 0;
+ private byte options;
+ private byte percentMin;
+ private byte percentMax;
private ExtendedColor color;
private DataBarThreshold thresholdMin;
private DataBarThreshold thresholdMax;
private final EncryptionInfo info;
private ChunkedCipherInputStream ccis;
private final byte buffer[] = new byte[LittleEndianConsts.LONG_SIZE];
- private boolean shouldSkipEncryptionOnCurrentRecord = false;
+ private boolean shouldSkipEncryptionOnCurrentRecord;
public Biff8DecryptingStream(InputStream in, int initialOffset, EncryptionInfo info) throws RecordFormatException {
try {
*/
public abstract class HSSFAnchor implements ChildAnchor {
- protected boolean _isHorizontallyFlipped = false;
- protected boolean _isVerticallyFlipped = false;
+ protected boolean _isHorizontallyFlipped;
+ protected boolean _isVerticallyFlipped;
public HSSFAnchor() {
createEscherAnchor();
public static HSSFAnchor createAnchorFromEscher(EscherContainerRecord container){
if (null != container.getChildById(EscherChildAnchorRecord.RECORD_ID)){
- return new HSSFChildAnchor((EscherChildAnchorRecord) container.getChildById(EscherChildAnchorRecord.RECORD_ID));
+ return new HSSFChildAnchor(container.getChildById(EscherChildAnchorRecord.RECORD_ID));
} else {
if (null != container.getChildById(EscherClientAnchorRecord.RECORD_ID)){
- return new HSSFClientAnchor((EscherClientAnchorRecord) container.getChildById(EscherClientAnchorRecord.RECORD_ID));
+ return new HSSFClientAnchor(container.getChildById(EscherClientAnchorRecord.RECORD_ID));
}
return null;
}
private final Vector<String> _formats = new Vector<String>();
private final InternalWorkbook _workbook;
- private boolean _movedBuiltins = false; // Flag to see if need to
+ private boolean _movedBuiltins; // Flag to see if need to
// check the built in list
// or if the regular list
// has all entries.
private int _errorStyle = ErrorStyle.STOP;
private boolean _emptyCellAllowed = true;
- private boolean _suppress_dropdown_arrow = false;
+ private boolean _suppress_dropdown_arrow;
private boolean _showPromptBox = true;
private boolean _showErrorBox = true;
private CellRangeAddressList _regions;
private final class SheetIterator<T extends Sheet> implements Iterator<T> {
final private Iterator<T> it;
- private T cursor = null;
+ private T cursor;
@SuppressWarnings("unchecked")
public SheetIterator() {
it = (Iterator<T>) _sheets.iterator();
private int lastIndex;
private long pos;
- private boolean chunkIsValid = false;
+ private boolean chunkIsValid;
public ChunkedCipherInputStream(InputStream stream, long size, int chunkSize)
throws GeneralSecurityException {
// the cipher can't be final, because for the last chunk we change the padding
// and therefore need to change the cipher too
private Cipher cipher;
- private boolean isClosed = false;
+ private boolean isClosed;
public ChunkedCipherOutputStream(DirectoryNode dir, int chunkSize) throws IOException, GeneralSecurityException {
super(null);
int transformType;
String transformerId;
String transformerName;
- int readerVersionMajor = 1, readerVersionMinor = 0;
- int updaterVersionMajor = 1, updaterVersionMinor = 0;
- int writerVersionMajor = 1, writerVersionMinor = 0;
+ int readerVersionMajor = 1, readerVersionMinor;
+ int updaterVersionMajor = 1, updaterVersionMinor;
+ int writerVersionMajor = 1, writerVersionMinor;
public TransformInfoHeader(
int transformType,
public static class DataSpaceVersionInfo implements EncryptionRecord {
String featureIdentifier;
- int readerVersionMajor = 1, readerVersionMinor = 0;
- int updaterVersionMajor = 1, updaterVersionMinor = 0;
- int writerVersionMajor = 1, writerVersionMinor = 0;
+ int readerVersionMajor = 1, readerVersionMinor;
+ int updaterVersionMajor = 1, updaterVersionMinor;
+ int writerVersionMajor = 1, writerVersionMinor;
public DataSpaceVersionInfo(LittleEndianInput is) {
featureIdentifier = readUnicodeLPP4(is);
private class XORCipherInputStream extends ChunkedCipherInputStream {
private final int initialOffset;
- private int recordStart = 0;
- private int recordEnd = 0;
+ private int recordStart;
+ private int recordEnd;
public XORCipherInputStream(InputStream stream, int initialPos)
throws GeneralSecurityException {
}
private class XORCipherOutputStream extends ChunkedCipherOutputStream {
- private int recordStart = 0;
- private int recordEnd = 0;
+ private int recordStart;
+ private int recordEnd;
public XORCipherOutputStream(OutputStream stream, int initialPos) throws IOException, GeneralSecurityException {
super(stream, -1);
{
private final POIFSReaderRegistry registry;
private boolean registryClosed;
- private boolean notifyEmptyDirectories = false;
+ private boolean notifyEmptyDirectories;
/**
* Create a POIFSReader
{
private POIFSDocumentPath path;
private String name;
- private int hashcode = 0;
+ private int hashcode;
/**
* Trivial constructor
private short flags1 = 2; // 2 bytes, unknown, mostly [02 00]
private String label; // ASCIIZ, stored in this field without the terminating zero
private String fileName; // ASCIIZ, stored in this field without the terminating zero
- private short flags2 = 0; // 2 bytes, unknown, mostly [00 00]
+ private short flags2; // 2 bytes, unknown, mostly [00 00]
private short unknown1 = 3; // see below
private String command; // ASCIIZ, stored in this field without the terminating zero
private byte[] dataBuffer; // varying size, the actual native data
- private short flags3 = 0; // some final flags? or zero terminators?, sometimes not there
+ private short flags3; // some final flags? or zero terminators?, sometimes not there
/**
* the field encoding mode - merely a try-and-error guess ...
private static final POILogger log = POILogFactory.getLogger(POIFSDocumentPath.class);
private final String[] components;
- private int hashcode = 0; //lazy-compute hashCode
+ private int hashcode; //lazy-compute hashCode
/**
* constructor for the path of a document that is not in the root
private final Calendar EXCEL_EPOCH_CAL =
LocaleUtil.getLocaleCalendar(1904, 0, 1);
- private static /* final */ CellDateFormatter SIMPLE_DATE = null;
+ private static /* final */ CellDateFormatter SIMPLE_DATE;
private class DatePartHandler implements CellFormatPart.PartHandler {
private int mStart = -1;
private final Workbook workbook;
private final Object[][] cells;
- private boolean shouldCreateEmptyCells = false;
- private String sheetName = null;
+ private boolean shouldCreateEmptyCells;
+ private String sheetName;
public SheetBuilder(Workbook workbook, Object[][] cells) {
this.workbook = workbook;
* @author Roman Kashitsyn
*/
private static class SimpleCellWalkContext implements CellWalkContext {
- public long ordinalNumber = 0;
- public int rowNumber = 0;
- public int colNumber = 0;
+ public long ordinalNumber;
+ public int rowNumber;
+ public int colNumber;
public long getOrdinalNumber() {
return ordinalNumber;
private final long max;
/** the number of bytes already returned */
- private long pos = 0;
+ private long pos;
/** the marked position */
private long mark = -1;
public class CommonsLogger extends POILogger
{
private static final LogFactory _creator = LogFactory.getFactory();
- private Log log = null;
+ private Log log;
@Override
public void initialize(final String cat)
{
private int[] _array;
private int _limit;
- private int fillval = 0;
+ private int fillval;
private static final int _default_size = 128;
/**
private int offset;
private int trailing;
private int leading;
- int cnt = 0;
+ int cnt;
//the char that is logically trailing in Big5 encoding
//however in LittleEndian order, this is the first encountered.
public LittleEndianCP950Reader(byte[] data) {
* The name of the class to use. Initialised the
* first time we need it
*/
- static String _loggerClassName = null;
+ static String _loggerClassName;
/**
* Construct a POILogFactory.
// while matching, this is where the bytes go.
final int[] buf;
- private int matchedIndex=0;
- private int unbufferIndex=0;
- private int replacedIndex=0;
+ private int matchedIndex;
+ private int unbufferIndex;
+ private int replacedIndex;
private final byte[] pattern;
private final byte[] replacement;
*/
public static class StringsIterator implements Iterator<String> {
private String[] strings = {};
- private int position = 0;
+ private int position;
public StringsIterator(String[] strings) {
if (strings != null) {
this.strings = strings.clone();
* Counter that provides the amount of incoming relations from other parts
* to this part.
*/
- private int relationCounter = 0;
+ private int relationCounter;
int incrementRelationCounter() {
relationCounter++;
/**
* Flag if a modification is done to the document.
*/
- protected boolean isDirty = false;
+ protected boolean isDirty;
/**
* File path of this package.
PackagePropertiesPart propsPart;
// The document
- Document xmlDoc = null;
+ Document xmlDoc;
/**
* Marshall package core properties to an XML document. Always return
}
public static class ThresholdInputStream extends PushbackInputStream {
- long counter = 0;
- long markPos = 0;
+ long counter;
+ long markPos;
ThresholdInputStream cis;
public ThresholdInputStream(InputStream is, ThresholdInputStream cis) {
* the optional signature policy service used for XAdES-EPES.
*/
private SignaturePolicyService signaturePolicyService;
- private URIDereferencer uriDereferencer = null;
+ private URIDereferencer uriDereferencer;
private String canonicalizationMethod = CanonicalizationMethod.INCLUSIVE;
private boolean includeEntireCertificateChain = true;
- private boolean includeIssuerSerial = false;
- private boolean includeKeyValue = false;
+ private boolean includeIssuerSerial;
+ private boolean includeKeyValue;
/**
* the time-stamp service used for XAdES-T and XAdES-X.
* timestamp service provider URL
*/
private String tspUrl;
- private boolean tspOldProtocol = false;
+ private boolean tspOldProtocol;
/**
* if not defined, it's the same as the main digest
*/
- private HashAlgorithm tspDigestAlgo = null;
+ private HashAlgorithm tspDigestAlgo;
private String tspUser;
private String tspPass;
private TimeStampServiceValidator tspValidator;
/**
* if not defined, it's the same as the main digest
*/
- private HashAlgorithm xadesDigestAlgo = null;
- private String xadesRole = null;
+ private HashAlgorithm xadesDigestAlgo;
+ private String xadesRole;
private String xadesSignatureId = "idSignedProperties";
private boolean xadesSignaturePolicyImplied = true;
private String xadesCanonicalizationMethod = CanonicalizationMethod.EXCLUSIVE;
* with certain namespaces, so this EventListener is used to interfere
* with the marshalling process.
*/
- EventListener signatureMarshalListener = null;
+ EventListener signatureMarshalListener;
/**
* Map of namespace uris to prefix
public class SignatureInfo implements SignatureConfigurable {
private static final POILogger LOG = POILogFactory.getLogger(SignatureInfo.class);
- private static boolean isInitialized = false;
+ private static boolean isInitialized;
private SignatureConfig signatureConfig;
OPCPackage pkg = signatureConfig.getOpcPackage();
Iterator<PackageRelationship> sigOrigRels =
pkg.getRelationshipsByType(PackageRelationshipTypes.DIGITAL_SIGNATURE_ORIGIN).iterator();
- Iterator<PackageRelationship> sigRels = null;
- PackagePart sigPart = null;
+ Iterator<PackageRelationship> sigRels;
+ PackagePart sigPart;
public boolean hasNext() {
while (sigRels == null || !sigRels.hasNext()) {
Map<Long, XDGFStyleSheet> _styleSheets = new HashMap<Long, XDGFStyleSheet>();
// defaults
- long _defaultFillStyle = 0;
- long _defaultGuideStyle = 0;
- long _defaultLineStyle = 0;
- long _defaultTextStyle = 0;
+ long _defaultFillStyle;
+ long _defaultGuideStyle;
+ long _defaultLineStyle;
+ long _defaultTextStyle;
public XDGFDocument(VisioDocumentType document) {
private MasterType _master;
protected XDGFMasterContents _content;
- protected XDGFSheet _pageSheet = null;
+ protected XDGFSheet _pageSheet;
public XDGFMaster(MasterType master, XDGFMasterContents content,
XDGFDocument document) {
private PageType _page;
protected XDGFPageContents _content;
protected XDGFPages _pages;
- protected XDGFSheet _pageSheet = null;
+ protected XDGFSheet _pageSheet;
public XDGFPage(PageType page, XDGFPageContents content,
XDGFDocument document, XDGFPages pages) {
XDGFBaseContents _parentPage;
XDGFShape _parent; // only non-null if a subshape
- XDGFMaster _master = null;
- XDGFShape _masterShape = null;
+ XDGFMaster _master;
+ XDGFShape _masterShape;
- XDGFText _text = null;
+ XDGFText _text;
// subshapes if they exist
- List<XDGFShape> _shapes = null;
+ List<XDGFShape> _shapes;
// properties specific to shapes
// center of rotation relative to origin of parent
- Double _pinX = null;
- Double _pinY = null;
+ Double _pinX;
+ Double _pinY;
- Double _width = null;
- Double _height = null;
+ Double _width;
+ Double _height;
// center of rotation relative to self
- Double _locPinX = null;
- Double _locPinY = null;
+ Double _locPinX;
+ Double _locPinY;
// start x coordinate, relative to parent
// -> one dimensional shapes only
- Double _beginX = null;
- Double _beginY = null;
+ Double _beginX;
+ Double _beginY;
// end x coordinate, relative to parent
// -> one dimensional shapes only
- Double _endX = null;
- Double _endY = null;
+ Double _endX;
+ Double _endY;
- Double _angle = null;
- Double _rotationXAngle = null;
- Double _rotationYAngle = null;
- Double _rotationZAngle = null;
+ Double _angle;
+ Double _rotationXAngle;
+ Double _rotationYAngle;
+ Double _rotationZAngle;
// end x coordinate, relative to parent
- Boolean _flipX = null;
- Boolean _flipY = null;
+ Boolean _flipX;
+ Boolean _flipY;
// center of text relative to this shape
- Double _txtPinX = null;
- Double _txtPinY = null;
+ Double _txtPinX;
+ Double _txtPinY;
// center of text relative to text block
- Double _txtLocPinX = null;
- Double _txtLocPinY = null;
+ Double _txtLocPinX;
+ Double _txtLocPinY;
- Double _txtAngle = null;
+ Double _txtAngle;
- Double _txtWidth = null;
- Double _txtHeight = null;
+ Double _txtWidth;
+ Double _txtHeight;
public XDGFShape(ShapeSheetType shapeSheet, XDGFBaseContents parentPage,
XDGFDocument document) {
protected SortedMap<Long, GeometrySection> _geometry = new TreeMap<Long, GeometrySection>();
// special: character section
- protected CharacterSection _character = null;
+ protected CharacterSection _character;
public XDGFSheet(SheetType sheet, XDGFDocument document) {
try {
public class CharacterSection extends XDGFSection {
- Double _fontSize = null;
- Color _fontColor = null;
+ Double _fontSize;
+ Color _fontColor;
Map<String, XDGFCell> _characterCells = new HashMap<String, XDGFCell>();
Long lastI = Long.MIN_VALUE;
- Entry<Long, T> currentBase = null;
- Entry<Long, T> currentMaster = null;
+ Entry<Long, T> currentBase;
+ Entry<Long, T> currentMaster;
// grab the iterator for both
Iterator<Entry<Long, T>> baseI = _baseItems.entrySet().iterator();
public class GeometrySection extends XDGFSection {
- GeometrySection _master = null;
+ GeometrySection _master;
// rows
SortedMap<Long, GeometryRow> _rows = new TreeMap<Long, GeometryRow>();
public class ArcTo implements GeometryRow {
- ArcTo _master = null;
+ ArcTo _master;
// The x-coordinate of the ending vertex of an arc.
- Double x = null;
+ Double x;
// The y-coordinate of the ending vertex of an arc.
- Double y = null;
+ Double y;
// The distance from the arc's midpoint to the midpoint of its chord.
- Double a = null;
+ Double a;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
public class Ellipse implements GeometryRow {
- Ellipse _master = null;
+ Ellipse _master;
// x coordinate of center point
- Double x = null;
+ Double x;
// y coordinate of center point
- Double y = null;
+ Double y;
// x coordinate of first point on ellipse
- Double a = null;
+ Double a;
// y coordinate of first point on ellipse
- Double b = null;
+ Double b;
// x coordinate of second point on ellipse
- Double c = null;
+ Double c;
// y coordinate of second point on ellipse
- Double d = null;
+ Double d;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
public class EllipticalArcTo implements GeometryRow {
- EllipticalArcTo _master = null;
+ EllipticalArcTo _master;
// The x-coordinate of the ending vertex on an arc.
- Double x = null;
+ Double x;
// The y-coordinate of the ending vertex on an arc.
- Double y = null;
+ Double y;
// The x-coordinate of the arc's control point; a point on the arc. The
// control point is best located about halfway between the beginning and
// ending vertices of the arc. Otherwise, the arc may grow to an extreme
// size in order to pass through the control point, with unpredictable
// results.
- Double a = null;
+ Double a;
// The y-coordinate of an arc's control point.
- Double b = null;
+ Double b;
// The angle of an arc's major axis relative to the x-axis of its parent
// shape.
- Double c = null;
+ Double c;
// The ratio of an arc's major axis to its minor axis. Despite the usual
// meaning of these words, the "major" axis does not have to be greater than
// the "minor" axis, so this ratio does not have to be greater than 1.
// Setting this cell to a value less than or equal to 0 or greater than 1000
// can lead to unpredictable results.
- Double d = null;
+ Double d;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
_master = (EllipticalArcTo) row;
}
- public static int draw = 0;
+ public static int draw;
@Override
public void addToPath(java.awt.geom.Path2D.Double path, XDGFShape parent) {
*/
public class InfiniteLine implements GeometryRow {
- InfiniteLine _master = null;
+ InfiniteLine _master;
// An x-coordinate of a point on the infinite line; paired with y-coordinate
// represented by the Y cell.
- Double x = null;
+ Double x;
// A y-coordinate of a point on the infinite line; paired with x-coordinate
// represented by the X cell.
- Double y = null;
+ Double y;
// An x-coordinate of a point on the infinite line; paired with y-coordinate
// represented by the B cell.
- Double a = null;
+ Double a;
// A y-coordinate of a point on an infinite line; paired with x-coordinate
// represented by the A cell.
- Double b = null;
+ Double b;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
public class LineTo implements GeometryRow {
- LineTo _master = null;
+ LineTo _master;
- Double x = null;
- Double y = null;
+ Double x;
+ Double y;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
*/
public class MoveTo implements GeometryRow {
- MoveTo _master = null;
+ MoveTo _master;
- Double x = null;
- Double y = null;
+ Double x;
+ Double y;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
public class NURBSTo implements GeometryRow {
- NURBSTo _master = null;
+ NURBSTo _master;
// The x-coordinate of the last control point of a NURBS.
- Double x = null;
+ Double x;
// The y-coordinate of the last control point of a NURBS.
- Double y = null;
+ Double y;
// The second to the last knot of the NURBS.
- Double a = null;
+ Double a;
// The last weight of the NURBS.
- Double b = null;
+ Double b;
// The first knot of the NURBS.
- Double c = null;
+ Double c;
// The first weight of the NURBS.
- Double d = null;
+ Double d;
// A NURBS formula.
- String e = null;
+ String e;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
public class PolyLineTo implements GeometryRow {
- PolyLineTo _master = null;
+ PolyLineTo _master;
// The x-coordinate of the ending vertex of a polyline.
- Double x = null;
+ Double x;
// The y-coordinate of the ending vertex of a polyline.
- Double y = null;
+ Double y;
// The polyline formula
- String a = null;
+ String a;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
public class RelCubBezTo implements GeometryRow {
- RelCubBezTo _master = null;
+ RelCubBezTo _master;
// The x-coordinate of the ending vertex of a cubic Bezier curve relative to
// the width of the shape.
- Double x = null;
+ Double x;
// The y-coordinate of the ending vertex of a cubic Bezier curve relative to
// the height of the shape.
- Double y = null;
+ Double y;
// The x-coordinate of the curve's beginning control point relative to the
// shape's width; a point on the arc. The control point is best located
// between the beginning and ending vertices of the arc.
- Double a = null;
+ Double a;
// The y-coordinate of a curve's beginning control point relative to the
// shape's height.
- Double b = null;
+ Double b;
// The x-coordinate of the curve's ending control point relative to the
// shape's width; a point on the arc. The control point is best located
// between the beginning control point and ending vertices of the arc.
- Double c = null;
+ Double c;
// The y-coordinate of a curve's ending control point relative to the
// shape's height.
- Double d = null;
+ Double d;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
public class RelEllipticalArcTo implements GeometryRow {
- RelEllipticalArcTo _master = null;
+ RelEllipticalArcTo _master;
// The x-coordinate of the ending vertex on an arc relative to the width of
// the shape.
- Double x = null;
+ Double x;
// The y-coordinate of the ending vertex on an arc relative to the height of
// the shape.
- Double y = null;
+ Double y;
// The x-coordinate of the arc's control point relative to the shape's
// width; a point on the arc.
- Double a = null;
+ Double a;
// The y-coordinate of an arc's control point relative to the shape's width.
- Double b = null;
+ Double b;
// The angle of an arc's major axis relative to the x-axis of its parent.
- Double c = null;
+ Double c;
// The ratio of an arc's major axis to its minor axis. Despite the usual
// meaning of these words, the "major" axis does not have to be greater than
// the "minor" axis, so this ratio does not have to be greater than 1.
- Double d = null;
+ Double d;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
*/
public class RelLineTo implements GeometryRow {
- RelLineTo _master = null;
+ RelLineTo _master;
- Double x = null;
- Double y = null;
+ Double x;
+ Double y;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
public class RelMoveTo implements GeometryRow {
- RelMoveTo _master = null;
+ RelMoveTo _master;
- Double x = null;
- Double y = null;
+ Double x;
+ Double y;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
*/
public class RelQuadBezTo implements GeometryRow {
- RelQuadBezTo _master = null;
+ RelQuadBezTo _master;
// The x-coordinate of the ending vertex of a quadratic Bezier curve
// relative to the width of the shape.
- Double x = null;
+ Double x;
// The y-coordinate of the ending vertex of a quadratic Bezier curve
// relative to the height of the shape.
- Double y = null;
+ Double y;
// The x-coordinate of the curve's control point relative to the shape's
// width; a point on the arc. The control point is best located about
// halfway between the beginning and ending vertices of the arc.
- Double a = null;
+ Double a;
// The y-coordinate of a curve's control point relative to the shape's
// height.
- Double b = null;
+ Double b;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
*/
public class SplineKnot implements GeometryRow {
- SplineKnot _master = null;
+ SplineKnot _master;
// The x-coordinate of a control point.
- Double x = null;
+ Double x;
// The y-coordinate of a control point.
- Double y = null;
+ Double y;
// One of the spline's knots (other than the last one or the first two).
- Double a = null;
+ Double a;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
*/
public class SplineStart implements GeometryRow {
- SplineStart _master = null;
+ SplineStart _master;
// The x-coordinate of a spline's second control point.
- Double x = null;
+ Double x;
// The y-coordinate of a spline's second control point.
- Double y = null;
+ Double y;
// The second knot of the spline.
- Double a = null;
+ Double a;
// The first knot of a spline.
- Double b = null;
+ Double b;
// The last knot of a spline.
- Double c = null;
+ Double c;
// The degree of a spline (an integer from 1 to 25).
- Integer d = null;
+ Integer d;
- Boolean deleted = null;
+ Boolean deleted;
// TODO: support formulas
public class ShapeDebuggerRenderer extends ShapeRenderer {
- ShapeVisitorAcceptor _debugAcceptor = null;
+ ShapeVisitorAcceptor _debugAcceptor;
public ShapeDebuggerRenderer() {
super();
private XMLSlideShow slideshow;
private boolean slidesByDefault = true;
- private boolean notesByDefault = false;
- private boolean masterByDefault = false;
+ private boolean notesByDefault;
+ private boolean masterByDefault;
public XSLFPowerPointExtractor(XMLSlideShow slideshow) {
super(slideshow);
*/
@Beta
public final class XSLFPictureData extends POIXMLDocumentPart implements PictureData {
- private Long checksum = null;
+ private Long checksum;
// original image dimensions (for formats supported by BufferedImage)
- private Dimension origSize = null;
+ private Dimension origSize;
private int index = -1;
/**
* Represents a cell of a table in a .pptx presentation
*/
public class XSLFTableCell extends XSLFTextShape implements TableCell<XSLFShape,XSLFTextParagraph> {
- private CTTableCellProperties _tcPr = null;
+ private CTTableCellProperties _tcPr;
private final XSLFTable table;
- private int row = 0, col = 0;
+ private int row, col;
/**
* Volatile/temporary anchor - e.g. for rendering
*/
- private Rectangle2D anchor = null;
+ private Rectangle2D anchor;
/*package*/ XSLFTableCell(CTTableCell cell, XSLFTable table){
super(cell, table.getSheet());
//these are all used only during parsing, and they are mutable!
private int authorId = -1;
- private CellAddress cellAddress = null;
- private XSSFBCellRange cellRange = null;
- private String comment = null;
+ private CellAddress cellAddress;
+ private XSSFBCellRange cellRange;
+ private String comment;
private StringBuilder authorBuffer = new StringBuilder();
private int lastEndedRow = -1;
private int lastStartedRow = -1;
- private int currentRow = 0;
+ private int currentRow;
private byte[] rkBuffer = new byte[8];
- private XSSFBCellRange hyperlinkCellRange = null;
+ private XSSFBCellRange hyperlinkCellRange;
private StringBuilder xlWideStringBuffer = new StringBuilder();
private final XSSFBCellHeader cellBuffer = new XSSFBCellHeader();
private final SortedMap<Short, String> numberFormats = new TreeMap<Short,String>();
private final List<Short> styleIds = new ArrayList<Short>();
- private boolean inCellXFS = false;
- private boolean inFmts = false;
+ private boolean inCellXFS;
+ private boolean inFmts;
public XSSFBStylesTable(InputStream is) throws IOException {
super(is);
parse();
static {
RECORDS.set(XSSFBRecordType.BrtAbsPath15.getId());
}
- private String path = null;
+ private String path;
public PathExtractor(InputStream is) {
super(is, RECORDS);
}
XSSFRelation.XLSB_BINARY_WORKBOOK
};
- private boolean handleHyperlinksInCells = false;
+ private boolean handleHyperlinksInCells;
public XSSFBEventBasedExcelExtractor(String path) throws XmlException, OpenXML4JException, IOException {
super(path);
private Locale locale;
private boolean includeTextBoxes = true;
private boolean includeSheetNames = true;
- private boolean includeCellComments = false;
+ private boolean includeCellComments;
private boolean includeHeadersFooters = true;
- private boolean formulasNotResults = false;
+ private boolean formulasNotResults;
private boolean concatenatePhoneticRuns = true;
public XSSFEventBasedExcelExtractor(String path) throws XmlException, OpenXML4JException, IOException {
// untrackedColumns stores columns have been explicitly untracked so they aren't implicitly re-tracked by trackAllColumns
// Using a HashSet instead of a TreeSet because we don't care about order.
private final Set<Integer> untrackedColumns = new HashSet<Integer>();
- private boolean trackAllColumns = false;
+ private boolean trackAllColumns;
/**
* Tuple to store the column widths considering and not considering merged cells
private final SortedMap<Integer, SXSSFCell> _cells = new TreeMap<Integer, SXSSFCell>();
private short _style = -1; // index of cell style in style table
private short _height = -1; // row height in twips (1/20 point)
- private boolean _zHeight = false; // row zero-height (this is somehow different than being hidden)
- private int _outlineLevel = 0; // Outlining level of the row, when outlining is on
+ private boolean _zHeight; // row zero-height (this is somehow different than being hidden)
+ private int _outlineLevel; // Outlining level of the row, when outlining is on
// use Boolean to have a tri-state for on/off/undefined
private Boolean _hidden = UNDEFINED;
private Boolean _collapsed = UNDEFINED;
public class CellIterator implements Iterator<Cell>
{
final int maxColumn = getLastCellNum(); //last column PLUS ONE
- int pos = 0;
+ int pos;
@Override
public boolean hasNext()
private final SheetDataWriter _writer;
private int _randomAccessWindowSize = SXSSFWorkbook.DEFAULT_WINDOW_SIZE;
private final AutoSizeColumnTracker _autoSizeColumnTracker;
- private int outlineLevelRow = 0;
+ private int outlineLevelRow;
private int lastFlushedRowNumber = -1;
- private boolean allFlushed = false;
+ private boolean allFlushed;
public SXSSFSheet(SXSSFWorkbook workbook, XSSFSheet xSheet) throws IOException {
_workbook = workbook;
// lazily populated. This should only be accessed through getTableCache
// keys are lower-case to make this a quasi-case-insensitive map
- private Map<String, XSSFTable> _tableCache = null;
+ private Map<String, XSSFTable> _tableCache;
protected BaseXSSFEvaluationWorkbook(XSSFWorkbook book) {
*/
public final class XSSFConnector extends XSSFShape {
- private static CTConnector prototype = null;
+ private static CTConnector prototype;
private CTConnector ctShape;
* Root element of the SpreadsheetML Drawing part
*/
private CTDrawing drawing;
- private long numOfGraphicFrames = 0L;
+ private long numOfGraphicFrames;
protected static final String NAMESPACE_A = XSSFRelation.NS_DRAWINGML;
protected static final String NAMESPACE_C = XSSFRelation.NS_CHART;
*/
public final class XSSFGraphicFrame extends XSSFShape {
- private static CTGraphicalObjectFrame prototype = null;
+ private static CTGraphicalObjectFrame prototype;
private CTGraphicalObjectFrame graphicFrame;
/**
* A default instance of CTShape used for creating new shapes.
*/
- private static CTShape prototype = null;
+ private static CTShape prototype;
private CTOleObject oleObject;
/**
* A default instance of CTShape used for creating new shapes.
*/
- private static CTPicture prototype = null;
+ private static CTPicture prototype;
/**
* This object specifies a picture object and all its properties
* specified just as they normally would.
*/
public final class XSSFShapeGroup extends XSSFShape implements ShapeContainer<XSSFShape> {
- private static CTGroupShape prototype = null;
+ private static CTGroupShape prototype;
private CTGroupShape ctGroup;
/**
* A default instance of CTShape used for creating new shapes.
*/
- private static CTShape prototype = null;
+ private static CTShape prototype;
/**
* Xml bean that stores properties of this shape
private HeaderFooterHelper helper;
private CTHeaderFooter headerFooter;
- private boolean stripFields = false;
+ private boolean stripFields;
/**
* Create an instance of XSSFHeaderFooter from the supplied XML bean
};
private XWPFDocument document;
- private boolean fetchHyperlinks = false;
+ private boolean fetchHyperlinks;
private boolean concatenatePhoneticRuns = true;
public XWPFWordExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException {
* 3rd CharacterPosition
*/
public class PositionInParagraph {
- private int posRun = 0, posText = 0, posChar = 0;
+ private int posRun, posText, posChar;
public PositionInParagraph() {
}
}
private final CTTc ctTc;
- protected List<XWPFParagraph> paragraphs = null;
- protected List<XWPFTable> tables = null;
- protected List<IBodyElement> bodyElements = null;
+ protected List<XWPFParagraph> paragraphs;
+ protected List<XWPFTable> tables;
+ protected List<IBodyElement> bodyElements;
protected IBody part;
- private XWPFTableRow tableRow = null;
+ private XWPFTableRow tableRow;
/**
* If a table cell does not include at least one block-level element, then this document shall be considered corrupt
private static final POIDataSamples testdata = POIDataSamples.getXmlDSignInstance();
private static Calendar cal;
- private KeyPair keyPair = null;
- private X509Certificate x509 = null;
+ private KeyPair keyPair;
+ private X509Certificate x509;
@AfterClass
public static void removeUserLocale() {
public class TestDrawPictureShape {
final static POIDataSamples ssSamples = POIDataSamples.getSlideShowInstance();
- private static boolean xslfOnly = false;
+ private static boolean xslfOnly;
@BeforeClass
public static void checkHslf() {
*/
@RunWith(Parameterized.class)
public class TestPPTX2PNG {
- private static boolean xslfOnly = false;
+ private static boolean xslfOnly;
private static final POIDataSamples samples = POIDataSamples.getSlideShowInstance();
private static final File basedir = null;
private static final String files =
import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType;
public class TestXSLFTextShape {
- private static boolean xslfOnly = false;
+ private static boolean xslfOnly;
@BeforeClass
public static void checkHslf() {
// And how long it is
// (Un-compressed codes are 1 byte each, compressed codes
// are two)
- private int bufferLen = 0;
+ private int bufferLen;
// The raw length of a code is limited to 4 bits + 2
private byte[] rawCode = new byte[18];
// And how much we're using
- private int rawCodeLen = 0;
+ private int rawCodeLen;
// How far through the input and output streams we are
- private int posInp = 0;
- private int posOut = 0;
+ private int posInp;
+ private int posOut;
// What the next mask byte to output will be
- private int nextMask = 0;
+ private int nextMask;
// And how many bits we've already set
- private int maskBitsSet = 0;
+ private int maskBitsSet;
public HDGFLZWCompressor() {}
* real contents in the de-compressed data
*/
private byte[] blockHeader = new byte[4];
- private boolean blockHeaderInContents = false;
+ private boolean blockHeaderInContents;
protected byte[] _getCompressedContents() { return compressedContents; }
protected byte[] _getBlockHeader() { return blockHeader; }
private class HemfRecordIterator implements Iterator<HemfRecord> {
- private HemfRecord currentRecord = null;
+ private HemfRecord currentRecord;
HemfRecordIterator() {
//queue the first non-header record
*/
public final class PublisherTextExtractor extends POIOLE2TextExtractor {
private HPBFDocument doc;
- private boolean hyperlinksByDefault = false;
+ private boolean hyperlinksByDefault;
public PublisherTextExtractor(HPBFDocument doc) {
super(doc);
/**
* Reserved. Always 0.
*/
- private int compression = 0;
+ private int compression;
/**
* Reserved. Always 254.
private final List<HSLFSlide> _slides;
private boolean _slidesByDefault = true;
- private boolean _notesByDefault = false;
- private boolean _commentsByDefault = false;
- private boolean _masterByDefault = false;
+ private boolean _notesByDefault;
+ private boolean _commentsByDefault;
+ private boolean _masterByDefault;
/**
* Basic extractor. Returns all the text, and optionally all the notes
// indentLevel is only valid for paragraph collection
// if it's set to -1, it must be omitted - see 2.9.36 TextMasterStyleLevel
- private short indentLevel = 0;
+ private short indentLevel;
private final Map<String,TextProp> textProps = new HashMap<String,TextProp>();
- private int maskSpecial = 0;
+ private int maskSpecial;
private final TextPropType textPropType;
/**
public static final String RECORD_DESCRIPTION = "msofbtClientTextboxPlaceholder";
private int position = -1;
- private byte placementId = 0;
- private byte size = 0;
- private short unused = 0;
+ private byte placementId;
+ private byte size;
+ private short unused;
public EscherPlaceholder() {}
private int placementId;
private int placeholderId;
private int placeholderSize;
- private short unusedShort = 0;
+ private short unusedShort;
/**
* before advancing to the next presentation slide. It MUST be greater than or equal to 0 and
* less than or equal to 86399000. It MUST be ignored unless AUTO_ADVANCE_BIT is TRUE.
*/
- private int _slideTime = 0;
+ private int _slideTime;
/**
* A SoundIdRef that specifies which sound to play when the transition starts.
*/
- private int _soundIdRef = 0;
+ private int _soundIdRef;
/**
* A byte that specifies the variant of effectType. In combination of the effectType
* there are further restriction and specification of this field.
*/
- private short _effectDirection = 0; // byte
+ private short _effectDirection; // byte
/**
* A byte that specifies which transition is used when transitioning to the
* determined by the rendering application. As such, the same transition can have
* many variations depending on the implementation.
*/
- private short _effectType = 0; // byte
+ private short _effectType; // byte
/**
* Various flags - see bitmask for more details
*/
- private short _effectTransitionFlags = 0;
+ private short _effectTransitionFlags;
/**
* A byte value that specifies how long the transition takes to run.
* (0x00 = 0.75 seconds, 0x01 = 0.5 seconds, 0x02 = 0.25 seconds)
*/
- private short _speed = 0; // byte
+ private short _speed; // byte
private byte[] _unused; // 3-byte
public SSSlideInfoAtom() {
* Only set to true once setParentTextSize(int) is called.
* Until then, no stylings will have been decoded
*/
- private boolean initialised = false;
+ private boolean initialised;
/**
* The list of all the different paragraph stylings we code for.
private short bidi = -1;
private int pp10extMask = -1;
- private byte[] smartTagsBytes = null;
+ private byte[] smartTagsBytes;
/**
* Inits a TextSpecInfoRun with default values
public class HSLFFontInfo implements FontInfo {
public enum FontRenderType {
- raster, device, truetype;
+ raster, device, truetype
}
/** A bit that specifies whether a subset of this font is embedded. */
private FontRenderType renderType = FontRenderType.truetype;
private FontFamily family = FontFamily.FF_SWISS;
private FontPitch pitch = FontPitch.VARIABLE;
- private boolean isSubsetted = false;
+ private boolean isSubsetted;
private boolean isSubstitutable = true;
/**
DocumentEncryptionAtom dea;
EncryptionInfo _encryptionInfo;
// Cipher cipher = null;
- ChunkedCipherOutputStream cyos = null;
+ ChunkedCipherOutputStream cyos;
private static final BitField fieldRecInst = new BitField(0xFFF0);
}
private static class CountingOS extends OutputStream {
- int count = 0;
+ int count;
@Override
public void write(int b) throws IOException {
private StyleTextProp9Atom styleTextProp9Atom;
- private boolean _dirty = false;
+ private boolean _dirty;
private final List<HSLFTextParagraph> parentList;
private RecipientChunks[] recipientChunks;
private AttachmentChunks[] attachmentChunks;
- private boolean returnNullOnMissingChunk = false;
+ private boolean returnNullOnMissingChunk;
/**
* Constructor for creating new files.
private boolean outputColumnHeaders = true;
- private boolean outputHiddenColumns = false;
+ private boolean outputHiddenColumns;
- private boolean outputHiddenRows = false;
+ private boolean outputHiddenRows;
private boolean outputLeadingSpacesAsNonBreaking = true;
return doc;
}
- private String cssClassContainerCell = null;
+ private String cssClassContainerCell;
- private String cssClassContainerDiv = null;
+ private String cssClassContainerDiv;
private String cssClassPrefixCell = "c";
private final HtmlDocumentFacade htmlDocumentFacade;
- private boolean useDivsToSpan = false;
+ private boolean useDivsToSpan;
public ExcelToHtmlConverter( Document doc )
{
public class HwmfDrawProperties {
private final Rectangle2D window;
- private Rectangle2D viewport = null;
+ private Rectangle2D viewport;
private final Point2D location;
private HwmfMapMode mapMode = HwmfMapMode.MM_ANISOTROPIC;
private HwmfColorRef backgroundColor = new HwmfColorRef(Color.BLACK);
private HwmfBrushStyle brushStyle = HwmfBrushStyle.BS_SOLID;
private HwmfColorRef brushColor = new HwmfColorRef(Color.BLACK);
private HwmfHatchStyle brushHatch = HwmfHatchStyle.HS_HORIZONTAL;
- private BufferedImage brushBitmap = null;
+ private BufferedImage brushBitmap;
private double penWidth = 1;
private HwmfPenStyle penStyle = HwmfPenStyle.valueOf(0);
private HwmfColorRef penColor = new HwmfColorRef(Color.BLACK);
private double penMiterLimit = 10;
private HwmfBkMode bkMode = HwmfBkMode.OPAQUE;
private HwmfPolyfillMode polyfillMode = HwmfPolyfillMode.WINDING;
- private Shape region = null;
- private List<PaletteEntry> palette = null;
- private int paletteOffset = 0;
- private HwmfFont font = null;
+ private Shape region;
+ private List<PaletteEntry> palette;
+ private int paletteOffset;
+ private HwmfFont font;
private HwmfColorRef textColor = new HwmfColorRef(Color.BLACK);
private HwmfTextAlignment textAlignLatin = HwmfTextAlignment.LEFT;
private HwmfTextVerticalAlignment textVAlignLatin = HwmfTextVerticalAlignment.TOP;
* via reflection
*/
public class HwmfSLImageRenderer implements ImageRenderer {
- HwmfPicture image = null;
- double alpha = 0;
+ HwmfPicture image;
+ double alpha;
@Override
public void loadImage(InputStream data, String contentType) throws IOException {
private long headerColorImportant = -1;
private Color colorTable[];
@SuppressWarnings("unused")
- private int colorMaskR=0,colorMaskG=0,colorMaskB=0;
+ private int colorMaskR,colorMaskG,colorMaskB;
// size of header and color table, for start of image data calculation
private int introSize;
private AtomicInteger internalLinkCounter = new AtomicInteger( 0 );
- private boolean outputCharactersLanguage = false;
+ private boolean outputCharactersLanguage;
private Set<String> usedIds = new LinkedHashSet<String>();
private AtomicInteger noteCounters = new AtomicInteger( 1 );
- private Element notes = null;
+ private Element notes;
- private boolean outputSummaryInformation = false;
+ private boolean outputSummaryInformation;
private final TextDocumentFacade textDocumentFacade;
private int fcSttbfffn;// table stream offset for sttbfffn
// FFN structure containing strings of font names
- private Ffn[] _fontNames = null;
+ private Ffn[] _fontNames;
public FontTable(byte[] buf, int offset, int lcbSttbfffn)
private final BookmarksTables bookmarksTables;
- private Map<Integer, List<GenericPropertyNode>> sortedDescriptors = null;
+ private Map<Integer, List<GenericPropertyNode>> sortedDescriptors;
- private int[] sortedStartPositions = null;
+ private int[] sortedStartPositions;
public BookmarksImpl( BookmarksTables bookmarksTables )
{
*/
public final class HWPFList
{
- private boolean _ignoreLogicalLeftIdentation = false;
+ private boolean _ignoreLogicalLeftIdentation;
private LFO _lfo;
private LFOData _lfoData;
private ListData _listData;
private Range headerStories;
private PlexOfCps plcfHdd;
- private boolean stripFields = false;
+ private boolean stripFields;
public HeaderStories(HWPFDocument doc) {
this.headerStories = doc.getHeaderStoryRange();
*/
public class NotesImpl implements Notes
{
- private Map<Integer, Integer> anchorToIndexMap = null;
+ private Map<Integer, Integer> anchorToIndexMap;
private final NotesTables notesTables;
Cloneable
{
- private boolean jcLogical = false;
+ private boolean jcLogical;
public ParagraphProperties()
{
private Map<Integer, Picture> lookup;
private List<Picture> nonU1based;
private List<Picture> all;
- private int pn = 0;
+ private int pn;
public PictureRunMapper(HWPFDocument doc) {
picturesTable = doc.getPicturesTable();
{
private ArrayList<TableRow> _rows;
- private boolean _rowsFound = false;
+ private boolean _rowsFound;
private int _tableLevel;
private final static char TABLE_CELL_MARK = '\u0007';
private TableCell[] _cells;
- private boolean _cellsFound = false;
+ private boolean _cellsFound;
int _levelNum;
private SprmBuffer _papx;
public abstract class StreamTest {
public static class TestPointer extends Pointer {
private final boolean compressed;
- protected boolean hasPointers = false;
+ protected boolean hasPointers;
public TestPointer(boolean compressed, int offset, int length, int type, short format) {
this.compressed = compressed;
setOffset(offset);
outdir.mkdirs();
final String startFile = "";
File files[] = indir.listFiles(new FileFilter() {
- boolean foundStartFile = false;
+ boolean foundStartFile;
@Override
public boolean accept(File pathname) {
foundStartFile |= startFile.isEmpty() || pathname.getName().contains(startFile);
public final class TestCHPBinTable
extends TestCase
{
- private CHPBinTable _cHPBinTable = null;
+ private CHPBinTable _cHPBinTable;
private HWPFDocFixture _hWPFDocFixture;
private final TextPieceTable fakeTPT = new TextPieceTable() {
// TODO: Add DocumentProperties#equals ???
public final class TestDocumentProperties {
- private DocumentProperties _documentProperties = null;
+ private DocumentProperties _documentProperties;
private HWPFDocFixture _hWPFDocFixture;
@Test
import org.junit.Test;
public final class TestFileInformationBlock {
- private FileInformationBlock _fileInformationBlock = null;
+ private FileInformationBlock _fileInformationBlock;
private HWPFDocFixture _hWPFDocFixture;
@Test
import org.junit.Test;
public final class TestFontTable {
- private FontTable _fontTable = null;
+ private FontTable _fontTable;
private HWPFDocFixture _hWPFDocFixture;
@Test
public final class TestPlexOfCps
extends TestCase
{
- private PlexOfCps _plexOfCps = null;
+ private PlexOfCps _plexOfCps;
private HWPFDocFixture _hWPFDocFixture;
public void testWriteRead() {
import org.junit.Test;
public final class TestStyleSheet {
- private StyleSheet _styleSheet = null;
+ private StyleSheet _styleSheet;
private HWPFDocFixture _hWPFDocFixture;
@Test
*/
public final class TestBorderCode extends TestCase {
- private int pos = 0;
+ private int pos;
private Range range;
public void test() {
private static class CellFormatBugExample extends Thread {
private final String fileName;
- private Throwable exception = null;
+ private Throwable exception;
public CellFormatBugExample(String fileName) {
this.fileName = fileName;
*
*/
public final class TestFormulaEvaluatorBugs {
- private static boolean OUTPUT_TEST_FILES = false;
+ private static boolean OUTPUT_TEST_FILES;
private static String tmpDirName;
@BeforeClass
private final Random rnd = new Random();
private final byte[] data;
private final int chunkSize;
- private int pos = 0;
+ private int pos;
public SlowInputStream(byte[] data, int chunkSize) {
this.chunkSize = chunkSize;
private static class CountCellHandler implements CellHandler {
- private int cellsVisited = 0;
- private long ordinalNumberSum = 0L;
+ private int cellsVisited;
+ private long ordinalNumberSum;
@Override
public void onCell(Cell cell, CellWalkContext ctx) {
*/
public final class TestIOUtils {
- static File TMP = null;
+ static File TMP;
static final long LENGTH = new Random().nextInt(10000);
@BeforeClass
* as requested. This tests that the fallback to read() works.
*/
private static class WonkyInputStream extends InputStream {
- int skipCalled = 0;
- int readCalled = 0;
+ int skipCalled;
+ int readCalled;
@Override
public int read() throws IOException {
*/
public final class TestPOILogger extends POILogger {
private String lastLog = "";
- private Throwable lastEx = null;
+ private Throwable lastEx;
/**
* Test different types of log output.