aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2018-02-26 20:26:48 +0000
committerPJ Fanning <fanningpj@apache.org>2018-02-26 20:26:48 +0000
commit314f7f53eada5e40c2c06f383d10fe53abb615a1 (patch)
tree3881fa3627605a0a44fc13d18710a767af55df80 /src
parent4ad4d76241eae44386e52c3a23ca1b7ca28d1458 (diff)
downloadpoi-314f7f53eada5e40c2c06f383d10fe53abb615a1.tar.gz
poi-314f7f53eada5e40c2c06f383d10fe53abb615a1.zip
tidy up API for font index
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825409 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java2
-rw-r--r--src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java2
-rw-r--r--src/examples/src/org/apache/poi/ss/examples/CellStyleDetails.java2
-rw-r--r--src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java2
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java8
-rw-r--r--src/java/org/apache/poi/ss/usermodel/CellStyle.java4
-rw-r--r--src/java/org/apache/poi/ss/util/CellUtil.java2
-rw-r--r--src/java/org/apache/poi/ss/util/SheetUtil.java2
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java2
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/streaming/TestAutoSizeColumnTracker.java2
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java2
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java2
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java4
-rw-r--r--src/testcases/org/apache/poi/ss/usermodel/BaseTestFont.java2
14 files changed, 19 insertions, 19 deletions
diff --git a/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java b/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java
index f80b073a0e..484df3b9e4 100644
--- a/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java
+++ b/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java
@@ -138,7 +138,7 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd
HSSFCell cell = (HSSFCell) value;
if (cell != null) {
HSSFCellStyle style = cell.getCellStyle();
- HSSFFont f = wb.getFontAt(style.getFontIntIndex());
+ HSSFFont f = wb.getFontAt(style.getFontIndexAsInt());
boolean isbold = f.getBold();
boolean isitalics = f.getItalic();
diff --git a/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java b/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java
index 1b9a621458..b2bc4a6484 100644
--- a/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java
+++ b/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java
@@ -148,7 +148,7 @@ public class SVTableCellRenderer extends JLabel
if (c != null) {
HSSFCellStyle s = c.getCellStyle();
- HSSFFont f = wb.getFontAt(s.getFontIntIndex());
+ HSSFFont f = wb.getFontAt(s.getFontIndexAsInt());
setFont(SVTableUtils.makeFont(f));
if (s.getFillPattern() == FillPatternType.SOLID_FOREGROUND) {
diff --git a/src/examples/src/org/apache/poi/ss/examples/CellStyleDetails.java b/src/examples/src/org/apache/poi/ss/examples/CellStyleDetails.java
index b2e7e0b94f..e66e6b4c56 100644
--- a/src/examples/src/org/apache/poi/ss/examples/CellStyleDetails.java
+++ b/src/examples/src/org/apache/poi/ss/examples/CellStyleDetails.java
@@ -63,7 +63,7 @@ public class CellStyleDetails {
System.out.print("FG=" + renderColor(style.getFillForegroundColorColor()) + " ");
System.out.print("BG=" + renderColor(style.getFillBackgroundColorColor()) + " ");
- Font font = wb.getFontAt(style.getFontIntIndex());
+ Font font = wb.getFontAt(style.getFontIndexAsInt());
System.out.print("Font=" + font.getFontName() + " ");
System.out.print("FontColor=");
if (font instanceof HSSFFont) {
diff --git a/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java b/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
index 8c97993f46..4c11fcf445 100644
--- a/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
+++ b/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
@@ -300,7 +300,7 @@ public class ToHtml {
}
private void fontStyle(CellStyle style) {
- Font font = wb.getFontAt(style.getFontIntIndex());
+ Font font = wb.getFontAt(style.getFontIndexAsInt());
if (font.getBold()) {
out.format(" font-weight: bold;%n");
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
index fde539c6ef..a3879a9194 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
@@ -198,7 +198,7 @@ public final class HSSFCellStyle implements CellStyle {
* @since 4.0.0
*/
@Override
- public int getFontIntIndex()
+ public int getFontIndexAsInt()
{
return _format.getFontIndex();
}
@@ -206,11 +206,11 @@ public final class HSSFCellStyle implements CellStyle {
/**
* gets the font for this style
* @param parentWorkbook The HSSFWorkbook that this style belongs to
- * @see org.apache.poi.hssf.usermodel.HSSFCellStyle#getFontIntIndex()
+ * @see org.apache.poi.hssf.usermodel.HSSFCellStyle#getFontIndexAsInt()
* @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(int)
*/
public HSSFFont getFont(org.apache.poi.ss.usermodel.Workbook parentWorkbook) {
- return ((HSSFWorkbook) parentWorkbook).getFontAt(getFontIntIndex());
+ return ((HSSFWorkbook) parentWorkbook).getFontAt(getFontIndexAsInt());
}
/**
@@ -849,7 +849,7 @@ public final class HSSFCellStyle implements CellStyle {
FontRecord fr = _workbook.createNewFont();
fr.cloneStyleFrom(
source._workbook.getFontRecordAt(
- source.getFontIntIndex()
+ source.getFontIndexAsInt()
)
);
diff --git a/src/java/org/apache/poi/ss/usermodel/CellStyle.java b/src/java/org/apache/poi/ss/usermodel/CellStyle.java
index 3e9f374396..a809458af0 100644
--- a/src/java/org/apache/poi/ss/usermodel/CellStyle.java
+++ b/src/java/org/apache/poi/ss/usermodel/CellStyle.java
@@ -56,7 +56,7 @@ public interface CellStyle {
/**
* gets the index of the font for this style
* @see Workbook#getFontAt(short)
- * @deprecated use <code>getFontIntIndex()</code> instead
+ * @deprecated use <code>getFontIndexAsInt()</code> instead
*/
@Removal(version = "4.2")
short getFontIndex();
@@ -66,7 +66,7 @@ public interface CellStyle {
* @see Workbook#getFontAt(int)
* @since 4.0.0
*/
- int getFontIntIndex();
+ int getFontIndexAsInt();
/**
* set the cell's using this style to be hidden
diff --git a/src/java/org/apache/poi/ss/util/CellUtil.java b/src/java/org/apache/poi/ss/util/CellUtil.java
index ce72bd88e7..70dcffc289 100644
--- a/src/java/org/apache/poi/ss/util/CellUtil.java
+++ b/src/java/org/apache/poi/ss/util/CellUtil.java
@@ -346,7 +346,7 @@ public final class CellUtil {
put(properties, FILL_PATTERN, style.getFillPattern());
put(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
put(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
- put(properties, FONT, style.getFontIntIndex());
+ put(properties, FONT, style.getFontIndexAsInt());
put(properties, HIDDEN, style.getHidden());
put(properties, INDENTION, style.getIndention());
put(properties, LEFT_BORDER_COLOR, style.getLeftBorderColor());
diff --git a/src/java/org/apache/poi/ss/util/SheetUtil.java b/src/java/org/apache/poi/ss/util/SheetUtil.java
index 2293ebcb1c..e5c2a31ba9 100644
--- a/src/java/org/apache/poi/ss/util/SheetUtil.java
+++ b/src/java/org/apache/poi/ss/util/SheetUtil.java
@@ -144,7 +144,7 @@ public class SheetUtil {
if (cellType == CellType.FORMULA)
cellType = cell.getCachedFormulaResultType();
- Font font = wb.getFontAt(style.getFontIntIndex());
+ Font font = wb.getFontAt(style.getFontIndexAsInt());
double width = -1;
if (cellType == CellType.STRING) {
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
index df64296033..668079c381 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
@@ -482,7 +482,7 @@ public class XSSFCellStyle implements CellStyle {
* @since 4.0.0
*/
@Override
- public int getFontIntIndex() {
+ public int getFontIndexAsInt() {
return getFontId();
}
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestAutoSizeColumnTracker.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestAutoSizeColumnTracker.java
index 6afcdd8d95..f3ba519651 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestAutoSizeColumnTracker.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestAutoSizeColumnTracker.java
@@ -210,7 +210,7 @@ public class TestAutoSizeColumnTracker {
private static void assumeRequiredFontsAreInstalled(final Workbook workbook, final Cell cell) {
// autoSize will fail if required fonts are not installed, skip this test then
- Font font = workbook.getFontAt(cell.getCellStyle().getFontIntIndex());
+ Font font = workbook.getFontAt(cell.getCellStyle().getFontIndexAsInt());
Assume.assumeTrue("Cannot verify autoSizeColumn() because the necessary Fonts are not installed on this machine: " + font,
SheetUtil.canComputeColumnWidth(font));
}
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java
index 04dd83ed57..58d2f3772e 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java
@@ -350,7 +350,7 @@ public class TestSXSSFSheetAutoSizeColumn {
private static void assumeRequiredFontsAreInstalled(final Workbook workbook, final Cell cell) {
// autoSize will fail if required fonts are not installed, skip this test then
- Font font = workbook.getFontAt(cell.getCellStyle().getFontIntIndex());
+ Font font = workbook.getFontAt(cell.getCellStyle().getFontIndexAsInt());
Assume.assumeTrue("Cannot verify autoSizeColumn() because the necessary Fonts are not installed on this machine: " + font,
SheetUtil.canComputeColumnWidth(font));
}
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
index b26d177df6..ed22dd3ecd 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
@@ -324,7 +324,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
cellXf.setXfId(1);
stylesTable.putCellXf(cellXf);
XSSFCellStyle cellStyle = new XSSFCellStyle(1, 1, stylesTable, null);
- assertEquals(1, cellStyle.getFontIntIndex());
+ assertEquals(1, cellStyle.getFontIndexAsInt());
sheet.setDefaultColumnStyle(3, cellStyle);
assertEquals(1, ctWorksheet.getColsArray(0).getColArray(0).getStyle());
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
index ca96f0d7c4..46a84b61a6 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
@@ -3130,12 +3130,12 @@ public final class TestBugs extends BaseTestBugzillaIssues {
Cell cell = row.getCell(1);
CellStyle style = cell.getCellStyle();
- assertEquals(26, style.getFontIntIndex());
+ assertEquals(26, style.getFontIndexAsInt());
row = sheet.getRow(3);
cell = row.getCell(1);
style = cell.getCellStyle();
- assertEquals(28, style.getFontIntIndex());
+ assertEquals(28, style.getFontIndexAsInt());
// check the two fonts
HSSFFont font = wb.getFontAt(26);
diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestFont.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestFont.java
index 889b72caf2..bd8c74032b 100644
--- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestFont.java
+++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestFont.java
@@ -115,7 +115,7 @@ public abstract class BaseTestFont {
s1 = wb2.getSheetAt(0);
assertEquals(num0 + 1, wb2.getNumberOfFontsAsInt());
- int idx = s1.getRow(0).getCell(0).getCellStyle().getFontIntIndex();
+ int idx = s1.getRow(0).getCell(0).getCellStyle().getFontIndexAsInt();
Font fnt = wb2.getFontAt(idx);
assertNotNull(fnt);
assertEquals(IndexedColors.YELLOW.getIndex(), fnt.getColor());