* for their rules.</p>
*/
public abstract class CFRuleBase extends StandardRecord implements Cloneable {
+ // FIXME: Merge with org.apache.poi.ss.usermodel.ComparisonOperator and rewrite as an enum
public static final class ComparisonOperator {
public static final byte NO_COMPARISON = 0;
public static final byte BETWEEN = 1;
recordData = in.readRemainder();
}
+ /**
+ * @deprecated POI 3.9
+ */
@Deprecated
public void processContinueRecord(byte[] record) {
//don't merge continue record with the drawing record, it must be serialized separately
return sid;
}
- @Deprecated
- public byte[] getData() {
- return recordData;
- }
-
public byte[] getRecordData(){
return recordData;
}
return _list.get(i);
}
- /**
- * @deprecated Was prevously used for removing sheets, which we now do differently
- */
- @Deprecated
- public void adjustIndex(int extRefIndex, int offset) {
- getRef(extRefIndex).adjustIndex(offset);
- }
-
public void removeSheet(int sheetIdx) {
int nItems = _list.size();
for (int i = 0; i < nItems; i++) {
}
return rc4;
}
-
- /**
- * @deprecated use getRc4KeyData().getSalt()
- * @return the rc4 salt
- */
- public byte[] getDocId() {
- return checkRc4().getSalt();
- }
-
- /**
- * @deprecated use getRc4KeyData().setSalt()
- * @param docId the new rc4 salt
- */
- public void setDocId(byte[] docId) {
- checkRc4().setSalt(docId);
- }
-
- /**
- * @deprecated use getRc4KeyData().getEncryptedVerifier()
- * @return the rc4 encrypted verifier
- */
- public byte[] getSaltData() {
- return checkRc4().getEncryptedVerifier();
- }
-
- /**
- * @deprecated use getRc4KeyData().setEncryptedVerifier()
- * @param saltData the new rc4 encrypted verifier
- */
- public void setSaltData(byte[] saltData) {
- getRc4KeyData().setEncryptedVerifier(saltData);
- }
-
- /**
- * @deprecated use getRc4KeyData().getEncryptedVerifierHash()
- * @return the rc4 encrypted verifier hash
- */
- public byte[] getSaltHash() {
- return getRc4KeyData().getEncryptedVerifierHash();
- }
-
- /**
- * @deprecated use getRc4KeyData().setEncryptedVerifierHash()
- * @param saltHash the new rc4 encrypted verifier
- */
- public void setSaltHash(byte[] saltHash) {
- getRc4KeyData().setEncryptedVerifierHash(saltHash);
- }
public short getSid() {
return sid;
public final static short ACTIVE_PANE_LOWER_RIGHT = 0;
public final static short ACTIVE_PANE_UPPER_RIGHT = 1;
public final static short ACTIVE_PANE_LOWER_LEFT = 2;
- // TODO - remove obsolete field (it was deprecated May-2008 v3.1)
- /** @deprecated use ACTIVE_PANE_UPPER_LEFT */
- public final static short ACTIVE_PANE_UPER_LEFT = 3;
public final static short ACTIVE_PANE_UPPER_LEFT = 3;
field_1_password = in.readShort();
}
- /**
- * Return the password hash
- *
- * @deprecated use {@link CryptoFunctions#createXorVerifier1(String)}
- */
- public static short hashPassword(String password) {
- return (short)CryptoFunctions.createXorVerifier1(password);
- }
-
/**
* set the password
*
import org.apache.poi.hssf.record.crypto.Biff8RC4Key;
import org.apache.poi.hssf.record.crypto.Biff8XORKey;
import org.apache.poi.poifs.crypt.Decryptor;
-import org.apache.poi.util.POILogFactory;
-import org.apache.poi.util.POILogger;
/**
* A stream based way to get at complete records, with
/** Reads all byte data for the current record, including any
* that overlaps into any following continue records.
*
- * @deprecated Best to write a input stream that wraps this one where there is
+ * @deprecated POI 2.0 Best to write a input stream that wraps this one where there is
* special sub record that may overlap continue records.
*/
public byte[] readAllContinuedRemainder() {
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.hssf.record;
-/**
- * @deprecated Use {@link org.apache.poi.hssf.record.common.UnicodeString} instead
- */
-public final class UnicodeString extends org.apache.poi.hssf.record.common.UnicodeString {
- /**
- * @deprecated Use {@link org.apache.poi.hssf.record.common.UnicodeString} instead
- */
- public UnicodeString(RecordInputStream in) {
- super(in);
- }
- /**
- * @deprecated Use {@link org.apache.poi.hssf.record.common.UnicodeString} instead
- */
- public UnicodeString(String str) {
- super(str);
- }
-}
public void setActiveSheetIndex(int index) {
field_6_active_sheet = index;
}
- /**
- * deprecated May 2008
- * @deprecated - Misleading name - use setActiveSheetIndex()
- */
- public void setSelectedTab(short s)
- {
- setActiveSheetIndex(s);
- }
/**
* Sets the first visible sheet in the worksheet tab-bar. This method does <b>not</b>
field_7_first_visible_tab = t;
}
- /**
- * deprecated May 2008
- * @deprecated - Misleading name - use setFirstVisibleTab()
- */
- public void setDisplayedTab(short t) {
- setFirstVisibleTab(t);
- }
-
/**
* set the number of selected tabs
* @param n number of tabs
public int getActiveSheetIndex() {
return field_6_active_sheet;
}
- /**
- * deprecated May 2008
- * @deprecated - Misleading name - use getActiveSheetIndex()
- */
- public short getSelectedTab()
- {
- return (short) getActiveSheetIndex();
- }
/**
* @return the first visible sheet in the worksheet tab-bar.
public int getFirstVisibleTab() {
return field_7_first_visible_tab;
}
- /**
- * deprecated May 2008
- * @deprecated - Misleading name - use getFirstVisibleTab()
- */
- public short getDisplayedTab()
- {
- return (short) getFirstVisibleTab();
- }
/**
* get the number of selected tabs
public void setActive(boolean p) {
field_1_options = active.setShortBoolean(field_1_options, p);
}
- /**
- * deprecated May 2008
- * @deprecated use setActive()
- */
- public void setPaged(boolean p) {
- setActive(p);
- }
+
/**
* was the sheet saved in page break view
* @param p pagebreaksaved or not
public boolean isActive() {
return active.isSet(field_1_options);
}
- /**
- * deprecated May 2008
- * @deprecated use isActive()
- */
- public boolean getPaged() {
- return isActive();
- }
/**
* was the sheet saved in page break view
return _valuesAgg.iterator();
}
- /**
- * @deprecated use {@link #getCellValueIterator()} instead
- */
- public CellValueRecordInterface[] getValueRecords() {
- //noinspection deprecation
- return _valuesAgg.getValueRecords();
- }
-
public IndexRecord createIndexRecord(int indexRecordOffset, int sizeOfInitialSheetRecords) {
IndexRecord result = new IndexRecord();
result.setFirstRow(_firstrow);
return new ValueIterator();
}
- /**
- * Gets all the cell records contained in this aggregate.
- * Note {@link BlankRecord}s appear separate (not in {@link MulBlankRecord}s).
- * @deprecated use {@link #iterator()} instead
- */
- @Deprecated
- public CellValueRecordInterface[] getValueRecords() {
- List<CellValueRecordInterface> temp = new ArrayList<CellValueRecordInterface>();
-
- for (int rowIx = 0; rowIx < records.length; rowIx++) {
- CellValueRecordInterface[] rowCells = records[rowIx];
- if (rowCells == null) {
- continue;
- }
- for (int colIx = 0; colIx < rowCells.length; colIx++) {
- CellValueRecordInterface cell = rowCells[colIx];
- if (cell != null) {
- temp.add(cell);
- }
- }
- }
-
- CellValueRecordInterface[] result = new CellValueRecordInterface[temp.size()];
- temp.toArray(result);
- return result;
- }
-
public Object clone() {
throw new RuntimeException("clone() should not be called. ValueRecordsAggregate should be copied via Sheet.cloneSheet()");
}
* @param row - the row of this cell
* @param col - the column for this cell
*
- * @see org.apache.poi.hssf.usermodel.HSSFRow#createCell(short)
+ * @see org.apache.poi.hssf.usermodel.HSSFRow#createCell(int)
*/
protected HSSFCell(HSSFWorkbook book, HSSFSheet sheet, int row, short col)
{
* @param type - CELL_TYPE_NUMERIC, CELL_TYPE_STRING, CELL_TYPE_FORMULA, CELL_TYPE_BLANK,
* CELL_TYPE_BOOLEAN, CELL_TYPE_ERROR
* Type of cell
- * @see org.apache.poi.hssf.usermodel.HSSFRow#createCell(short,int)
+ * @see org.apache.poi.hssf.usermodel.HSSFRow#createCell(int,int)
*/
protected HSSFCell(HSSFWorkbook book, HSSFSheet sheet, int row, short col,
int type)
/**
* @return - the conditiontype for the cfrule
*/
- public byte getConditionType() {
- return cfRuleRecord.getConditionType();
- }
- /**
- * @return - the conditiontype for the cfrule
- */
- public ConditionType getConditionTypeType() {
- return ConditionType.forId(getConditionType());
+ @Override
+ public ConditionType getConditionType() {
+ byte code = cfRuleRecord.getConditionType();
+ return ConditionType.forId(code);
}
/**
* @return - the comparisionoperatation for the cfrule
*/
+ @Override
public byte getComparisonOperation() {
return cfRuleRecord.getComparisonOperation();
}
private WorkbookEvaluator _bookEvaluator;
private HSSFWorkbook _book;
- /**
- * @deprecated (Sep 2008) HSSFSheet parameter is ignored
- */
- @Deprecated
- public HSSFFormulaEvaluator(HSSFSheet sheet, HSSFWorkbook workbook) {
- this(workbook);
-// if (false) {
-// sheet.toString(); // suppress unused parameter compiler warning
-// }
- this._book = workbook;
- }
public HSSFFormulaEvaluator(HSSFWorkbook workbook) {
this(workbook, null);
this._book = workbook;
}
}
- /**
- * Returns the formula that the name is defined to refer to.
- *
- * @deprecated (Nov 2008) Misleading name. Use {@link #getRefersToFormula()} instead.
- */
- public String getReference() {
- return getRefersToFormula();
- }
-
- /**
- * Sets the formula that the name is defined to refer to.
- *
- * @deprecated (Nov 2008) Misleading name. Use {@link #setRefersToFormula(String)} instead.
- */
- public void setReference(String ref){
- setRefersToFormula(ref);
- }
-
public void setRefersToFormula(String formulaText) {
Ptg[] ptgs = HSSFFormulaParser.parse(formulaText, _book, FormulaType.NAMEDRANGE, getSheetIndex());
_definedNameRec.setNameDefinition(ptgs);
// subsequent calls to createCellFromRecord() will update the colIx boundaries properly
}
- /**
- * @deprecated (Aug 2008) use {@link HSSFRow#createCell(int) }
- */
- public HSSFCell createCell(short columnIndex) {
- return createCell((int)columnIndex);
- }
- /**
- * @deprecated (Aug 2008) use {@link HSSFRow#createCell(int, int) }
- */
- public HSSFCell createCell(short columnIndex, int type) {
- return createCell((int)columnIndex, type);
- }
/**
* Use this to create new cells within the row and return it.
* <p>
return cells[cellIndex];
}
- /**
- * @deprecated (Aug 2008) use {@link #getCell(int)}
- */
- public HSSFCell getCell(short cellnum) {
- int ushortCellNum = cellnum & 0x0000FFFF; // avoid sign extension
- return getCell(ushortCellNum);
- }
-
/**
* Get the hssfcell representing a given column (logical cell)
* 0-based. If you ask for a cell that is not defined then
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
}
workbook.getWindowOne().setNumSelectedTabs((short)1);
}
+
/**
- * deprecated May 2008
- * @deprecated use setSelectedTab(int)
+ * Selects multiple sheets as a group. This is distinct from
+ * the 'active' sheet (which is the sheet with focus).
+ *
+ * @param indexes
*/
- @Deprecated
- public void setSelectedTab(short index) {
- setSelectedTab((int)index);
- }
public void setSelectedTabs(int[] indexes) {
for (int index : indexes) {
}
workbook.getWindowOne().setNumSelectedTabs((short)indexes.length);
}
+
+ /**
+ * Gets the selected sheets (if more than one, Excel calls these a [Group]).
+ *
+ * @return indices of selected sheets
+ */
+ public Collection<Integer> getSelectedTabs() {
+ Collection<Integer> indexes = new ArrayList<Integer>();
+ int nSheets = _sheets.size();
+ for (int i=0; i<nSheets; i++) {
+ HSSFSheet sheet = getSheetAt(i);
+ if (sheet.isSelected()) {
+ indexes.add(i);
+ }
+ }
+ return Collections.unmodifiableCollection(indexes);
+ }
+
/**
* Convenience method to set the active sheet. The active sheet is is the sheet
* which is currently displayed when the workbook is viewed in Excel.
public int getActiveSheetIndex() {
return workbook.getWindowOne().getActiveSheetIndex();
}
- /**
- * deprecated May 2008
- * @deprecated - Misleading name - use getActiveSheetIndex()
- */
- @Deprecated
- public short getSelectedTab() {
- return (short) getActiveSheetIndex();
- }
/**
public void setFirstVisibleTab(int index) {
workbook.getWindowOne().setFirstVisibleTab(index);
}
- /**
- * deprecated May 2008
- * @deprecated - Misleading name - use setFirstVisibleTab()
- */
- @Deprecated
- public void setDisplayedTab(short index) {
- setFirstVisibleTab(index);
- }
/**
* sets the first tab that is displayed in the list of tabs in excel.
public int getFirstVisibleTab() {
return workbook.getWindowOne().getFirstVisibleTab();
}
- /**
- * deprecated May 2008
- * @deprecated - Misleading name - use getFirstVisibleTab()
- */
- @Deprecated
- public short getDisplayedTab() {
- return (short) getFirstVisibleTab();
- }
/**
* Set the sheet name.
return -1;
}
- /**
- * Returns the external sheet index of the sheet
- * with the given internal index, creating one
- * if needed.
- * Used by some of the more obscure formula and
- * named range things.
- * @deprecated for POI internal use only (formula parsing). This method is likely to
- * be removed in future versions of POI.
- */
- @Deprecated
- public int getExternalSheetIndex(int internalSheetIndex) {
- return workbook.checkExternSheet(internalSheetIndex);
- }
- /**
- * @deprecated for POI internal use only (formula rendering). This method is likely to
- * be removed in future versions of POI.
- */
- @Deprecated
- public String findSheetNameFromExternSheet(int externSheetIndex){
- // TODO - don't expose internal ugliness like externSheet indexes to the user model API
- return workbook.findSheetFirstNameFromExternSheet(externSheetIndex);
- }
- /**
- * @deprecated for POI internal use only (formula rendering). This method is likely to
- * be removed in future versions of POI.
- *
- * @param refIndex Index to REF entry in EXTERNSHEET record in the Link Table
- * @param definedNameIndex zero-based to DEFINEDNAME or EXTERNALNAME record
- * @return the string representation of the defined or external name
- */
- @Deprecated
- public String resolveNameXText(int refIndex, int definedNameIndex) {
- // TODO - make this less cryptic / move elsewhere
- return workbook.resolveNameXText(refIndex, definedNameIndex);
- }
-
/**
* create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns
* the high level representation. Use this to create new sheets.
return _sheets.size();
}
- /**
- * @deprecated for POI internal use only (formula parsing). This method is likely to
- * be removed in future versions of POI.
- */
- @Deprecated
- public int getSheetIndexFromExternSheetIndex(int externSheetNumber) {
- // TODO - don't expose internal ugliness like externSheet indexes to the user model API
- return workbook.getFirstSheetIndexFromExternSheetIndex(externSheetNumber);
- }
-
private HSSFSheet[] getSheets() {
HSSFSheet[] result = new HSSFSheet[_sheets.size()];
_sheets.toArray(result);
return retval;
}
- /** @deprecated Do not call this method from your applications. Use the methods
- * available in the HSSFRow to add string HSSFCells
- */
- @Deprecated
- public int addSSTString(String string)
- {
- return workbook.addSSTString(new UnicodeString(string));
- }
-
- /** @deprecated Do not call this method from your applications. Use the methods
- * available in the HSSFRow to get string HSSFCells
- */
- @Deprecated
- public String getSSTString(int index)
- {
- return workbook.getSSTString(index).getString();
- }
-
- InternalWorkbook getWorkbook() {
+ /*package*/ InternalWorkbook getWorkbook() {
return workbook;
}
protected EncryptionHeader() {}
- /**
- * @deprecated use getChainingMode().ecmaId
- */
- public int getCipherMode() {
- return chainingMode.ecmaId;
- }
-
public ChainingMode getChainingMode() {
return chainingMode;
}
this.sizeExtra = sizeExtra;
}
- /**
- * @deprecated use getCipherAlgorithm()
- */
- public int getAlgorithm() {
- return cipherAlgorithm.ecmaId;
- }
-
public CipherAlgorithm getCipherAlgorithm() {
return cipherAlgorithm;
}
this.cipherAlgorithm = cipherAlgorithm;
}
- /**
- * @deprecated use getHashAlgorithmEx()
- */
- public int getHashAlgorithm() {
- return hashAlgorithm.ecmaId;
- }
-
public HashAlgorithm getHashAlgorithmEx() {
return hashAlgorithm;
}
this.keySalt = (salt == null) ? null : salt.clone();
}
- /**
- * @deprecated use getCipherProvider()
- */
- public int getProviderType() {
- return providerType.ecmaId;
- }
-
public CipherProvider getCipherProvider() {
return providerType;
}
encryptor = eib.getEncryptor();
}
- /**
- * @deprecated Use {@link #EncryptionInfo(EncryptionMode)} (fs parameter no longer required)
- */
- @Deprecated
- public EncryptionInfo(POIFSFileSystem fs, EncryptionMode encryptionMode) {
- this(encryptionMode);
- }
-
- /**
- * @deprecated Use {@link #EncryptionInfo(EncryptionMode)} (fs parameter no longer required)
- */
- @Deprecated
- public EncryptionInfo(NPOIFSFileSystem fs, EncryptionMode encryptionMode) {
- this(encryptionMode);
- }
-
- /**
- * @deprecated Use {@link #EncryptionInfo(EncryptionMode)} (dir parameter no longer required)
- */
- @Deprecated
- public EncryptionInfo(DirectoryNode dir, EncryptionMode encryptionMode) {
- this(encryptionMode);
- }
-
- /**
- * @deprecated use {@link #EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)}
- */
- @Deprecated
- public EncryptionInfo(
- POIFSFileSystem fs
- , EncryptionMode encryptionMode
- , CipherAlgorithm cipherAlgorithm
- , HashAlgorithm hashAlgorithm
- , int keyBits
- , int blockSize
- , ChainingMode chainingMode
- ) {
- this(encryptionMode, cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode);
- }
-
- /**
- * @deprecated use {@link #EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)}
- */
- @Deprecated
- public EncryptionInfo(
- NPOIFSFileSystem fs
- , EncryptionMode encryptionMode
- , CipherAlgorithm cipherAlgorithm
- , HashAlgorithm hashAlgorithm
- , int keyBits
- , int blockSize
- , ChainingMode chainingMode
- ) {
- this(encryptionMode, cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode);
- }
-
- /**
- * @deprecated use {@link #EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)}
- */
- @Deprecated
- public EncryptionInfo(
- DirectoryNode dir
- , EncryptionMode encryptionMode
- , CipherAlgorithm cipherAlgorithm
- , HashAlgorithm hashAlgorithm
- , int keyBits
- , int blockSize
- , ChainingMode chainingMode
- ) {
- this(encryptionMode, cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode);
- }
-
/**
* Prepares for encryption, using the given Encryption Mode, and
* all other parameters as default.
return salt;
}
- /**
- * The method name is misleading - you'll get the encrypted verifier, not the plain verifier
- * @deprecated use getEncryptedVerifier()
- */
- @Deprecated
- public byte[] getVerifier() {
- return encryptedVerifier;
- }
-
public byte[] getEncryptedVerifier() {
return encryptedVerifier;
}
- /**
- * The method name is misleading - you'll get the encrypted verifier hash, not the plain verifier hash
- * @deprecated use getEnryptedVerifierHash
- */
- @Deprecated
- public byte[] getVerifierHash() {
- return encryptedVerifierHash;
- }
-
public byte[] getEncryptedVerifierHash() {
return encryptedVerifierHash;
}
return cipherAlgorithm.ecmaId;
}
- /**
- * @deprecated use getCipherAlgorithm().jceId
- */
- @Deprecated
- public String getAlgorithmName() {
- return cipherAlgorithm.jceId;
- }
-
public byte[] getEncryptedKey() {
return encryptedKey;
}
* is the target Directory to copy to
* @param excepts
* is a list of Strings specifying what nodes NOT to copy
- * @deprecated use {@link FilteringDirectoryNode} instead
+ * @deprecated POI 3.8 beta 5. Use {@link FilteringDirectoryNode} instead
*/
public static void copyNodes( DirectoryEntry sourceRoot,
DirectoryEntry targetRoot, List<String> excepts )
setDataBuffer(data);\r
mode = EncodingMode.parsed;\r
}\r
-\r
- /**\r
- * Creates an instance and fills the fields based on the data in the given buffer.\r
- *\r
- * @param data The buffer containing the Ole10Native record\r
- * @param offset The start offset of the record in the buffer\r
- * @param plain as of POI 3.11 this parameter is ignored\r
- * @throws Ole10NativeException on invalid or unexcepted data format\r
- * \r
- * @deprecated parameter plain is ignored, use {@link #Ole10Native(byte[],int)}\r
- */\r
- public Ole10Native(byte[] data, int offset, boolean plain) throws Ole10NativeException {\r
- this(data, offset);\r
- }\r
\r
/**\r
* Creates an instance and fills the fields based on the data in the given buffer.\r
_evaluator = sre;
}
- @Deprecated
- public ValueEval getInnerValueEval() {
- return getInnerValueEval(_evaluator.getFirstSheetIndex());
- }
public ValueEval getInnerValueEval(int sheetIndex) {
return _evaluator.getEvalForCell(sheetIndex, getRow(), getColumn());
}
public final class BlankEval implements ValueEval {
public static final BlankEval instance = new BlankEval();
- /**
- * @deprecated (Nov 2009) use {@link #instance}
- */
- public static final BlankEval INSTANCE = instance;
private BlankEval() {
// enforce singleton
\r
package org.apache.poi.ss.usermodel;\r
\r
-import static org.apache.poi.ss.usermodel.ConditionType.*;\r
-\r
/**\r
* Represents a description of a conditional formatting rule\r
*/\r
public interface ConditionalFormattingRule {\r
- /**\r
- * This conditional formatting rule compares a cell value\r
- * to a formula calculated result, using an operator\r
- * @deprecated Use {@link ConditionType#CELL_VALUE_IS}\r
- */\r
- public static final byte CONDITION_TYPE_CELL_VALUE_IS = CELL_VALUE_IS.id;\r
-\r
- /**\r
- * This conditional formatting rule contains a formula to evaluate.\r
- * When the formula result is true, the cell is highlighted.\r
- * @deprecated Use {@link ConditionType#FORMULA}\r
- */\r
- public static final byte CONDITION_TYPE_FORMULA = FORMULA.id;\r
-\r
/**\r
* Create a new border formatting structure if it does not exist,\r
* otherwise just return existing object.\r
*/\r
ColorScaleFormatting getColorScaleFormatting();\r
\r
- /**\r
- * Type of conditional formatting rule.\r
- * <p>\r
- * MUST be one of the IDs of a {@link ConditionType}\r
- * </p>\r
- *\r
- * @return the type of condition\r
- * @deprecated Use {@link #getConditionTypeType()}\r
- */\r
- byte getConditionType();\r
- \r
/**\r
* Type of conditional formatting rule.\r
*\r
* @return the type of condition\r
*/\r
- ConditionType getConditionTypeType();\r
+ ConditionType getConditionType();\r
\r
/**\r
* The comparison function used when the type of conditional formatting is set to\r
- * {@link #CONDITION_TYPE_CELL_VALUE_IS}\r
+ * {@link ConditionType#CELL_VALUE_IS}\r
* <p>\r
* MUST be a constant from {@link ComparisonOperator}\r
* </p>\r
/**\r
* The formula used to evaluate the first operand for the conditional formatting rule.\r
* <p>\r
- * If the condition type is {@link #CONDITION_TYPE_CELL_VALUE_IS},\r
+ * If the condition type is {@link ConditionType#CELL_VALUE_IS},\r
* this field is the first operand of the comparison.\r
- * If type is {@link #CONDITION_TYPE_FORMULA}, this formula is used\r
+ * If type is {@link ConditionType#FORMULA}, this formula is used\r
* to determine if the conditional formatting is applied.\r
* </p>\r
* <p>\r
- * If comparison type is {@link #CONDITION_TYPE_FORMULA} the formula MUST be a Boolean function\r
+ * If comparison type is {@link ConditionType#FORMULA} the formula MUST be a Boolean function\r
* </p>\r
*\r
* @return the first formula\r
\r
/**\r
* The formula used to evaluate the second operand of the comparison when\r
- * comparison type is {@link #CONDITION_TYPE_CELL_VALUE_IS} and operator\r
+ * comparison type is {@link ConditionType#CELL_VALUE_IS} and operator\r
* is either {@link ComparisonOperator#BETWEEN} or {@link ComparisonOperator#NOT_BETWEEN}\r
*\r
* @return the second formula\r
throw new IllegalArgumentException("lastRow < firstRow || lastCol < firstCol");
}
- /**
- * @deprecated use {@link #serialize(LittleEndianOutput)}
- */
- @Deprecated
- public int serialize(int offset, byte[] data) {
- serialize(new LittleEndianByteArrayOutputStream(data, offset, ENCODED_SIZE));
- return ENCODED_SIZE;
- }
public void serialize(LittleEndianOutput out) {
out.writeShort(getFirstRow());
out.writeShort(getLastRow());
}\r
}\r
\r
- /**\r
- * Type of conditional formatting rule.\r
- * <p>\r
- * MUST be one of the IDs of a {@link ConditionType}\r
- * </p>\r
- *\r
- * @return the type of condition\r
- */\r
- public byte getConditionType(){\r
- ConditionType type = getConditionTypeType();\r
- if (type != null) return type.id;\r
- return 0;\r
- }\r
- \r
/**\r
* Type of conditional formatting rule.\r
*/\r
- public ConditionType getConditionTypeType() {\r
+ @Override\r
+ public ConditionType getConditionType() {\r
return typeLookup.get(_cfRule.getType());\r
}\r
\r
/**\r
* The comparison function used when the type of conditional formatting is set to\r
- * {@link ConditionalFormattingRule#CONDITION_TYPE_CELL_VALUE_IS}\r
+ * {@link ConditionType#CELL_VALUE_IS}\r
* <p>\r
* MUST be a constant from {@link org.apache.poi.ss.usermodel.ComparisonOperator}\r
* </p>\r
*\r
* @return the conditional format operator\r
*/\r
+ @Override\r
public byte getComparisonOperation(){\r
STConditionalFormattingOperator.Enum op = _cfRule.getOperator();\r
if(op == null) return ComparisonOperator.NO_COMPARISON;\r
/**\r
* The formula used to evaluate the first operand for the conditional formatting rule.\r
* <p>\r
- * If the condition type is {@link ConditionalFormattingRule#CONDITION_TYPE_CELL_VALUE_IS},\r
+ * If the condition type is {@link ConditionType#CELL_VALUE_IS},\r
* this field is the first operand of the comparison.\r
- * If type is {@link ConditionalFormattingRule#CONDITION_TYPE_FORMULA}, this formula is used\r
+ * If type is {@link ConditionType#FORMULA}, this formula is used\r
* to determine if the conditional formatting is applied.\r
* </p>\r
* <p>\r
- * If comparison type is {@link ConditionalFormattingRule#CONDITION_TYPE_FORMULA} the formula MUST be a Boolean function\r
+ * If comparison type is {@link ConditionType#FORMULA} the formula MUST be a Boolean function\r
* </p>\r
*\r
* @return the first formula\r
\r
/**\r
* The formula used to evaluate the second operand of the comparison when\r
- * comparison type is {@link ConditionalFormattingRule#CONDITION_TYPE_CELL_VALUE_IS} and operator\r
+ * comparison type is {@link ConditionType#CELL_VALUE_IS} and operator\r
* is either {@link org.apache.poi.ss.usermodel.ComparisonOperator#BETWEEN} or {@link org.apache.poi.ss.usermodel.ComparisonOperator#NOT_BETWEEN}\r
*\r
* @return the second formula\r
@Test\r
public void testCertificateEncryption() throws Exception {\r
POIFSFileSystem fs = new POIFSFileSystem();\r
- EncryptionInfo info = new EncryptionInfo(fs, EncryptionMode.agile, CipherAlgorithm.aes128, HashAlgorithm.sha1, -1, -1, ChainingMode.cbc);\r
+ EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile, CipherAlgorithm.aes128, HashAlgorithm.sha1, -1, -1, ChainingMode.cbc);\r
AgileEncryptionVerifier aev = (AgileEncryptionVerifier)info.getVerifier();\r
CertData certData = loadKeystore();\r
aev.addCertificate(certData.x509);\r
* Check that RecordFactoryInputStream properly handles continued DrawingRecords
* See Bugzilla #47548
*/
- @SuppressWarnings("deprecation")
public void testReadContinued() throws IOException {
//simulate a continues drawing record
assertTrue(rec.get(0) instanceof DrawingRecord);
assertTrue(rec.get(1) instanceof ContinueRecord);
- assertArrayEquals(data1, ((DrawingRecord)rec.get(0)).getData());
+ assertArrayEquals(data1, ((DrawingRecord)rec.get(0)).getRecordData());
assertArrayEquals(data2, ((ContinueRecord)rec.get(1)).getData());
}
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.zip.CRC32;
public final class TestValueRecordsAggregate {
private static final String ABNORMAL_SHARED_FORMULA_FLAG_TEST_FILE = "AbnormalSharedFormulaFlag.xls";
private final ValueRecordsAggregate valueRecord = new ValueRecordsAggregate();
+
+ private List<CellValueRecordInterface> getValueRecords() {
+ List<CellValueRecordInterface> list = new ArrayList<CellValueRecordInterface>();
+ for ( CellValueRecordInterface rec : valueRecord ) {
+ list.add(rec);
+ }
+ return Collections.unmodifiableList(list);
+ }
/**
* Make sure the shared formula DOESNT makes it to the FormulaRecordAggregate when being parsed
* as part of the value records
*/
- @SuppressWarnings("deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()}
@Test
public void testSharedFormula() {
List<Record> records = new ArrayList<Record>();
records.add(new WindowTwoRecord());
constructValueRecord(records);
- CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
+ List<CellValueRecordInterface> cvrs = getValueRecords();
//Ensure that the SharedFormulaRecord has been converted
- assertEquals(1, cvrs.length);
+ assertEquals(1, cvrs.size());
- CellValueRecordInterface record = cvrs[0];
+ CellValueRecordInterface record = cvrs.get(0);
assertNotNull( "Row contains a value", record );
assertTrue( "First record is a FormulaRecordsAggregate", ( record instanceof FormulaRecordAggregate ) );
}
return records;
}
- @SuppressWarnings("deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()}
@Test
public void testInsertCell() {
- CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
- assertEquals(0, cvrs.length);
+ assertEquals(0, getValueRecords().size());
BlankRecord blankRecord = newBlankRecord();
valueRecord.insertCell( blankRecord );
- cvrs = valueRecord.getValueRecords();
- assertEquals(1, cvrs.length);
+ assertEquals(1, getValueRecords().size());
}
- @SuppressWarnings("deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()}
@Test
public void testRemoveCell() {
BlankRecord blankRecord1 = newBlankRecord();
valueRecord.insertCell( blankRecord1 );
BlankRecord blankRecord2 = newBlankRecord();
valueRecord.removeCell( blankRecord2 );
- CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
- assertEquals(0, cvrs.length);
+ assertEquals(0, getValueRecords().size());
// removing an already empty cell just falls through
valueRecord.removeCell( blankRecord2 );
b6.close();
}
- @SuppressWarnings("deprecation")
@Test
public void selectedSheet_bug44523() throws IOException {
HSSFWorkbook wb=new HSSFWorkbook();
wb.setSelectedTab(1);
- // see Javadoc, in this case selected means "active"
- assertEquals(wb.getActiveSheetIndex(), wb.getSelectedTab());
-
// Demonstrate bug 44525:
// Well... not quite, since isActive + isSelected were also added in the same bug fix
assertFalse("Identified bug 44523 a", sheet1.isSelected());
}
}
- @SuppressWarnings("deprecation")
@Test
public void selectedSheetShort() throws IOException {
HSSFWorkbook wb=new HSSFWorkbook();
wb.setSelectedTab((short)1);
- // see Javadoc, in this case selected means "active"
- assertEquals(wb.getActiveSheetIndex(), wb.getSelectedTab());
-
// Demonstrate bug 44525:
// Well... not quite, since isActive + isSelected were also added in the same bug fix
assertFalse("Identified bug 44523 a", sheet1.isSelected());
confirmActiveSelected(sheet4, false);
assertEquals(0, wb.getFirstVisibleTab());
- wb.setDisplayedTab((short)2);
+ wb.setFirstVisibleTab((short)2);
assertEquals(2, wb.getFirstVisibleTab());
- assertEquals(2, wb.getDisplayedTab());
-
- wb.close();
- }
-
- @SuppressWarnings("deprecation")
- @Test
- public void getExternSheetIndex() throws IOException {
- HSSFWorkbook wb=new HSSFWorkbook();
- wb.createSheet("Sheet1");
- wb.createSheet("Sheet2");
-
- assertEquals(0, wb.getExternalSheetIndex(0));
- assertEquals(1, wb.getExternalSheetIndex(1));
- assertEquals("Sheet1", wb.findSheetNameFromExternSheet(0));
- assertEquals("Sheet2", wb.findSheetNameFromExternSheet(1));
- //assertEquals(null, wb.findSheetNameFromExternSheet(2));
-
- assertEquals(0, wb.getSheetIndexFromExternSheetIndex(0));
- assertEquals(1, wb.getSheetIndexFromExternSheetIndex(1));
- assertEquals(-1, wb.getSheetIndexFromExternSheetIndex(2));
- assertEquals(-1, wb.getSheetIndexFromExternSheetIndex(100));
-
- wb.close();
- }
-
- @SuppressWarnings("deprecation")
- @Test
- public void sstString() throws IOException {
- HSSFWorkbook wb=new HSSFWorkbook();
-
- int sst = wb.addSSTString("somestring");
- assertEquals("somestring", wb.getSSTString(sst));
- //assertNull(wb.getSSTString(sst+1));
-
wb.close();
}
* Test format conditions based on a boolean formula\r
*/\r
@Test\r
- @SuppressWarnings("deprecation")\r
public void testBooleanFormulaConditions() throws IOException {\r
Workbook wb = _testDataProvider.createWorkbook();\r
Sheet sh = wb.createSheet();\r
SheetConditionalFormatting sheetCF = sh.getSheetConditionalFormatting();\r
\r
ConditionalFormattingRule rule1 = sheetCF.createConditionalFormattingRule("SUM(A1:A5)>10");\r
- assertEquals(ConditionType.FORMULA.id, rule1.getConditionType());\r
- assertEquals(ConditionType.FORMULA, rule1.getConditionTypeType());\r
+ assertEquals(ConditionType.FORMULA, rule1.getConditionType());\r
assertEquals("SUM(A1:A5)>10", rule1.getFormula1());\r
int formatIndex1 = sheetCF.addConditionalFormatting(\r
new CellRangeAddress[]{\r
}\r
\r
@Test\r
- @SuppressWarnings("deprecation")\r
public void testSingleFormulaConditions() throws IOException {\r
Workbook wb = _testDataProvider.createWorkbook();\r
Sheet sh = wb.createSheet();\r
\r
ConditionalFormattingRule rule1 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.EQUAL, "SUM(A1:A5)+10");\r
- assertEquals(ConditionType.CELL_VALUE_IS.id, rule1.getConditionType());\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionType());\r
assertEquals("SUM(A1:A5)+10", rule1.getFormula1());\r
assertEquals(ComparisonOperator.EQUAL, rule1.getComparisonOperation());\r
\r
ConditionalFormattingRule rule2 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.NOT_EQUAL, "15");\r
- assertEquals(ConditionType.CELL_VALUE_IS.id, rule2.getConditionType());\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionType());\r
assertEquals("15", rule2.getFormula1());\r
assertEquals(ComparisonOperator.NOT_EQUAL, rule2.getComparisonOperation());\r
\r
ConditionalFormattingRule rule3 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.NOT_EQUAL, "15");\r
- assertEquals(ConditionType.CELL_VALUE_IS.id, rule3.getConditionType());\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule3.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule3.getConditionType());\r
assertEquals("15", rule3.getFormula1());\r
assertEquals(ComparisonOperator.NOT_EQUAL, rule3.getComparisonOperation());\r
\r
ConditionalFormattingRule rule4 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.GT, "0");\r
- assertEquals(ConditionType.CELL_VALUE_IS.id, rule4.getConditionType());\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionType());\r
assertEquals("0", rule4.getFormula1());\r
assertEquals(ComparisonOperator.GT, rule4.getComparisonOperation());\r
\r
ConditionalFormattingRule rule5 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.LT, "0");\r
- assertEquals(ConditionType.CELL_VALUE_IS.id, rule5.getConditionType());\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionType());\r
assertEquals("0", rule5.getFormula1());\r
assertEquals(ComparisonOperator.LT, rule5.getComparisonOperation());\r
\r
ConditionalFormattingRule rule6 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.GE, "0");\r
- assertEquals(ConditionType.CELL_VALUE_IS.id, rule6.getConditionType());\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule6.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule6.getConditionType());\r
assertEquals("0", rule6.getFormula1());\r
assertEquals(ComparisonOperator.GE, rule6.getComparisonOperation());\r
\r
ConditionalFormattingRule rule7 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.LE, "0");\r
- assertEquals(ConditionType.CELL_VALUE_IS.id, rule7.getConditionType());\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule7.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule7.getConditionType());\r
assertEquals("0", rule7.getFormula1());\r
assertEquals(ComparisonOperator.LE, rule7.getComparisonOperation());\r
\r
ConditionalFormattingRule rule8 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.BETWEEN, "0", "5");\r
- assertEquals(ConditionType.CELL_VALUE_IS.id, rule8.getConditionType());\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule8.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule8.getConditionType());\r
assertEquals("0", rule8.getFormula1());\r
assertEquals("5", rule8.getFormula2());\r
assertEquals(ComparisonOperator.BETWEEN, rule8.getComparisonOperation());\r
\r
ConditionalFormattingRule rule9 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.NOT_BETWEEN, "0", "5");\r
- assertEquals(ConditionType.CELL_VALUE_IS.id, rule9.getConditionType());\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule9.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule9.getConditionType());\r
assertEquals("0", rule9.getFormula1());\r
assertEquals("5", rule9.getFormula2());\r
assertEquals(ComparisonOperator.NOT_BETWEEN, rule9.getComparisonOperation());\r
}\r
\r
@Test\r
- @SuppressWarnings("deprecation")\r
public void testCopy() throws IOException {\r
Workbook wb = _testDataProvider.createWorkbook();\r
Sheet sheet1 = wb.createSheet();\r
assertEquals(2, sheet2cf.getNumberOfRules());\r
assertEquals("SUM(A1:A5)+10", sheet2cf.getRule(0).getFormula1());\r
assertEquals(ComparisonOperator.EQUAL, sheet2cf.getRule(0).getComparisonOperation());\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, sheet2cf.getRule(0).getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, sheet2cf.getRule(0).getConditionType());\r
assertEquals("15", sheet2cf.getRule(1).getFormula1());\r
assertEquals(ComparisonOperator.NOT_EQUAL, sheet2cf.getRule(1).getComparisonOperation());\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, sheet2cf.getRule(1).getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, sheet2cf.getRule(1).getConditionType());\r
\r
wb.close();\r
}\r
\r
// CF1 has two rules: values less than -3 are bold-italic red, values greater than 3 are green\r
ConditionalFormattingRule rule1 = cf1.getRule(0);\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionType());\r
assertEquals(ComparisonOperator.GT, rule1.getComparisonOperation());\r
assertEquals("3", rule1.getFormula1());\r
assertNull(rule1.getFormula2());\r
assertFalse(fmt1.isItalic());\r
\r
ConditionalFormattingRule rule2 = cf1.getRule(1);\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionType());\r
assertEquals(ComparisonOperator.LT, rule2.getComparisonOperation());\r
assertEquals("-3", rule2.getFormula1());\r
assertNull(rule2.getFormula2());\r
assertEquals("B9", regions2[0].formatAsString());\r
\r
ConditionalFormattingRule rule3 = cf2.getRule(0);\r
- assertEquals(ConditionType.FORMULA, rule3.getConditionTypeType());\r
+ assertEquals(ConditionType.FORMULA, rule3.getConditionType());\r
assertEquals(ComparisonOperator.NO_COMPARISON, rule3.getComparisonOperation());\r
assertEquals("$A$8>5", rule3.getFormula1());\r
assertNull(rule3.getFormula2());\r
assertEquals(2, cf3.getNumberOfRules());\r
\r
ConditionalFormattingRule rule4 = cf3.getRule(0);\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionType());\r
assertEquals(ComparisonOperator.LE, rule4.getComparisonOperation());\r
assertEquals("\"AAA\"", rule4.getFormula1());\r
assertNull(rule4.getFormula2());\r
\r
ConditionalFormattingRule rule5 = cf3.getRule(1);\r
- assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionType());\r
assertEquals(ComparisonOperator.BETWEEN, rule5.getComparisonOperation());\r
assertEquals("\"A\"", rule5.getFormula1());\r
assertEquals("\"AAA\"", rule5.getFormula2());\r
if (str.contains("[CF12]")) fCF12++;\r
if (str.contains("[CFEX]")) fCFEX++;\r
} else {\r
- ConditionType type = cf.getRule(cf.getNumberOfRules()-1).getConditionTypeType();\r
+ ConditionType type = cf.getRule(cf.getNumberOfRules()-1).getConditionType();\r
if (type == ConditionType.CELL_VALUE_IS ||\r
type == ConditionType.FORMULA) {\r
fCF++;\r
\r
assertEquals(1, cf.getNumberOfRules());\r
cr = cf.getRule(0);\r
- assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionType());\r
assertEquals(ComparisonOperator.GT, cr.getComparisonOperation());\r
assertEquals("0", cr.getFormula1());\r
assertEquals(null, cr.getFormula2());\r
\r
assertEquals(1, cf.getNumberOfRules());\r
cr = cf.getRule(0);\r
- assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionTypeType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionType());\r
assertEquals(ComparisonOperator.BETWEEN, cr.getComparisonOperation());\r
assertEquals("10", cr.getFormula1());\r
assertEquals("30", cr.getFormula2());\r
// cr = cf.getRule(0);\r
// assertIconSetPercentages(cr, IconSet.GYR_3_TRAFFIC_LIGHTS_BOX, 0d, 33d, 67d);\r
// cr = cf.getRule(1);\r
-// assertEquals(ConditionType.FORMULA, cr.getConditionTypeType());\r
+// assertEquals(ConditionType.FORMULA, cr.getConditionType());\r
// assertEquals(ComparisonOperator.NO_COMPARISON, cr.getComparisonOperation());\r
// // TODO Why aren't these two the same between formats?\r
// if (cr instanceof HSSFConditionalFormattingRule) {\r
assertDataBar(cr, color);\r
}\r
private void assertDataBar(ConditionalFormattingRule cr, String color) {\r
- assertEquals(ConditionType.DATA_BAR, cr.getConditionTypeType());\r
+ assertEquals(ConditionType.DATA_BAR, cr.getConditionType());\r
assertEquals(ComparisonOperator.NO_COMPARISON, cr.getComparisonOperation());\r
assertEquals(null, cr.getFormula1());\r
assertEquals(null, cr.getFormula2());\r
assertIconSetPercentages(cr, iconset, vals);\r
} \r
private void assertIconSetPercentages(ConditionalFormattingRule cr, IconSet iconset, Double...vals) {\r
- assertEquals(ConditionType.ICON_SET, cr.getConditionTypeType());\r
+ assertEquals(ConditionType.ICON_SET, cr.getConditionType());\r
assertEquals(ComparisonOperator.NO_COMPARISON, cr.getComparisonOperation());\r
assertEquals(null, cr.getFormula1());\r
assertEquals(null, cr.getFormula2());\r
assertColorScale(cr, colors);\r
} \r
private void assertColorScale(ConditionalFormattingRule cr, String... colors) {\r
- assertEquals(ConditionType.COLOR_SCALE, cr.getConditionTypeType());\r
+ assertEquals(ConditionType.COLOR_SCALE, cr.getConditionType());\r
assertEquals(ComparisonOperator.NO_COMPARISON, cr.getComparisonOperation());\r
assertEquals(null, cr.getFormula1());\r
assertEquals(null, cr.getFormula2());\r
ConditionalFormatting cf = sheetCF.getConditionalFormattingAt(0);\r
assertEquals(1, cf.getNumberOfRules());\r
rule1 = cf.getRule(0);\r
- assertEquals(ConditionType.ICON_SET, rule1.getConditionTypeType());\r
+ assertEquals(ConditionType.ICON_SET, rule1.getConditionType());\r
iconFmt = rule1.getMultiStateFormatting();\r
\r
assertEquals(IconSet.GYRB_4_TRAFFIC_LIGHTS, iconFmt.getIconSet());\r
assertEquals(1, cf.getNumberOfRules());\r
rule1 = cf.getRule(0);\r
clrFmt = rule1.getColorScaleFormatting();\r
- assertEquals(ConditionType.COLOR_SCALE, rule1.getConditionTypeType());\r
+ assertEquals(ConditionType.COLOR_SCALE, rule1.getConditionType());\r
\r
assertEquals(3, clrFmt.getNumControlPoints());\r
assertEquals(3, clrFmt.getColors().length);\r
assertEquals(1, cf.getNumberOfRules());\r
rule1 = cf.getRule(0);\r
dbFmt = rule1.getDataBarFormatting();\r
- assertEquals(ConditionType.DATA_BAR, rule1.getConditionTypeType());\r
+ assertEquals(ConditionType.DATA_BAR, rule1.getConditionType());\r
\r
assertEquals(false, dbFmt.isIconOnly());\r
assertEquals(true, dbFmt.isLeftToRight());\r
import java.io.IOException;
import org.apache.poi.hssf.record.TestcaseRecordInputStream;
+import org.apache.poi.util.LittleEndianByteArrayOutputStream;
import org.apache.poi.util.LittleEndianOutputStream;
+
//TODO: replace junit3 with junit4 code
import junit.framework.TestCase; //junit3
out.close();
}
}
-
- @SuppressWarnings("deprecation")
- public void testStoreDeprecated() throws IOException {
- CellRangeAddress ref = new CellRangeAddress(0, 0, 0, 0);
-
- byte[] recordBytes = new byte[CellRangeAddress.ENCODED_SIZE];
- // With nothing set
- ref.serialize(0, recordBytes);
- assertEquals(recordBytes.length, data.length);
- for (int i = 0; i < data.length; i++) {
- assertEquals("At offset " + i, 0, recordBytes[i]);
- }
-
- // Now set the flags
- ref.setFirstRow((short) 2);
- ref.setLastRow((short) 4);
- ref.setFirstColumn((short) 0);
- ref.setLastColumn((short) 3);
-
- // Re-test
- ref.serialize(0, recordBytes);
-
- assertEquals(recordBytes.length, data.length);
- for (int i = 0; i < data.length; i++) {
- assertEquals("At offset " + i, data[i], recordBytes[i]);
- }
- }
public void testCreateIllegal() throws IOException {
// for some combinations we expected exceptions