diff options
author | Yegor Kozlov <yegor@apache.org> | 2008-11-21 09:22:07 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2008-11-21 09:22:07 +0000 |
commit | d3dd1fbbcd814db8d0b8b1534796f795730b5c53 (patch) | |
tree | 41c0b7dbbad410d57e932fda7fa9965f44076de8 /src/ooxml/java/org | |
parent | 1c556150f75de460d9c65b9a847fee50c1c2659c (diff) | |
download | poi-d3dd1fbbcd814db8d0b8b1534796f795730b5c53.tar.gz poi-d3dd1fbbcd814db8d0b8b1534796f795730b5c53.zip |
renamed Name.setFormula to more descriptive setRefersToFormula, also misc improvements in the site docs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@719547 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org')
4 files changed, 12 insertions, 25 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java index 35b947ae44..fdcebbcc99 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java @@ -152,7 +152,7 @@ public final class XSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E public Ptg[] getNameDefinition() {
- return FormulaParser.parse(_nameRecord.getReference(), _fpBook);
+ return FormulaParser.parse(_nameRecord.getRefersToFormula(), _fpBook);
}
public String getNameText() {
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFName.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFName.java index 2be7cffa59..1813892ba9 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFName.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFName.java @@ -37,14 +37,14 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDefinedName; * //applies to the entire workbook * XSSFName name1 = wb.createName(); * name1.setNameName("FMLA"); - * name1.setReference("Sheet1!$B$3"); + * name1.setRefersToFormula("Sheet1!$B$3"); * * //applies to Sheet1 * XSSFName name2 = wb.createName(); * name2.setNameName("SheetLevelName"); * name2.setComment("This name is scoped to Sheet1"); * name2.setLocalSheetId(0); - * name2.setReference("Sheet1!$B$3"); + * name2.setRefersToFormula("Sheet1!$B$3"); * * </blockquote></pre> * @@ -154,24 +154,11 @@ public final class XSSFName implements Name { } /** - * @deprecated (Nov 2008) Misleading name. Use {@link #getFormula()} instead. - */ - public String getReference() { - return getFormula(); - } - - /** - * @deprecated (Nov 2008) Misleading name. Use {@link #setFormula(String)} instead. - */ - public void setReference(String ref){ - setFormula(ref); - } - /** * Returns the reference of this named range, such as Sales!C20:C30. * * @return the reference of this named range */ - public String getFormula() { + public String getRefersToFormula() { return ctName.getStringValue(); } @@ -181,7 +168,7 @@ public final class XSSFName implements Name { * @param formulaText the reference to set * @throws IllegalArgumentException if the specified reference is unparsable */ - public void setFormula(String formulaText) { + public void setRefersToFormula(String formulaText) { XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(workbook); Ptg[] ptgs; try { @@ -201,7 +188,7 @@ public final class XSSFName implements Name { * @return true if the name refers to a deleted cell, false otherwise */ public boolean isDeleted(){ - String ref = getReference(); + String ref = getRefersToFormula(); return ref != null && ref.indexOf("#REF!") != -1; } @@ -278,7 +265,7 @@ public final class XSSFName implements Name { int sheetId = (int)ctName.getLocalSheetId(); return workbook.getSheetName(sheetId); } else { - String ref = getReference(); + String ref = getRefersToFormula(); AreaReference areaRef = new AreaReference(ref); return areaRef.getFirstCell().getSheetName(); } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index 63f9152b89..0597f677b0 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -617,7 +617,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Iterable<X XSSFName name = getBuiltInName(XSSFName.BUILTIN_PRINT_AREA, sheetIndex); if (name == null) return null; //adding one here because 0 indicates a global named region; doesnt make sense for print areas - return name.getReference(); + return name.getRefersToFormula(); } @@ -871,7 +871,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Iterable<X sb.append("!"); sb.append(parts[i]); } - name.setFormula(sb.toString()); + name.setRefersToFormula(sb.toString()); } /** @@ -931,7 +931,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Iterable<X if (name == null) { name = createBuiltInName(XSSFName.BUILTIN_PRINT_TITLE, sheetIndex); String reference = getReferenceBuiltInRecord(name.getSheetName(), startColumn, endColumn, startRow, endRow); - name.setReference(reference); + name.setRefersToFormula(reference); namedRanges.add(name); } diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java index e5e7fd4f58..450686b835 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java @@ -657,7 +657,7 @@ public class XWPFParagraph { * Specifies the spacing that should be added above the first line in this * paragraph in the document in absolute units. * - * @return + * @return the spacing that should be added above the first line * @see #setSpacingBefore(BigInteger) */ public BigInteger getSpacingBefore() { @@ -687,7 +687,7 @@ public class XWPFParagraph { * document in line units. * The value of this attribute is specified in one hundredths of a line. * - * @return + * @return the spacing that should be added before the first line in this paragraph * @see #setSpacingBeforeLines(BigInteger) */ public BigInteger getSpacingBeforeLines() { |