You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by jo...@apache.org on 2009/08/18 18:50:28 UTC

svn commit: r805492 [3/5] - in /poi/trunk/src: contrib/src/org/apache/poi/contrib/poibrowser/ contrib/src/org/apache/poi/hssf/contrib/view/ java/org/apache/poi/hpsf/ java/org/apache/poi/hpsf/wellknown/ java/org/apache/poi/hssf/eventmodel/ java/org/apac...

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java Tue Aug 18 16:50:24 2009
@@ -33,8 +33,6 @@
 import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.xssf.model.StylesTable;
 import org.apache.poi.xssf.model.SharedStringsTable;
-import org.apache.poi.util.POILogger;
-import org.apache.poi.util.POILogFactory;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellType;
@@ -55,7 +53,6 @@
  * </p>
  */
 public final class XSSFCell implements Cell {
-    private static POILogger logger = POILogFactory.getLogger(XSSFCell.class);
 
     private static final String FALSE_AS_STRING = "0";
     private static final String TRUE_AS_STRING  = "1";
@@ -64,28 +61,28 @@
      * the xml bean containing information about the cell's location, value,
      * data type, formatting, and formula
      */
-    private final CTCell cell;
+    private final CTCell _cell;
 
     /**
      * the XSSFRow this cell belongs to
      */
-    private final XSSFRow row;
+    private final XSSFRow _row;
 
     /**
      * 0-based column index
      */
-    private int cellNum;
+    private int _cellNum;
 
     /**
      * Table of strings shared across this workbook.
      * If two cells contain the same string, then the cell value is the same index into SharedStringsTable
      */
-    private SharedStringsTable sharedStringSource;
+    private SharedStringsTable _sharedStringSource;
 
     /**
      * Table of cell styles shared across all cells in a workbook.
      */
-    private StylesTable stylesSource;
+    private StylesTable _stylesSource;
 
     /**
      * Construct a XSSFCell.
@@ -94,27 +91,27 @@
      * @param cell the xml bean containing information about the cell.
      */
     protected XSSFCell(XSSFRow row, CTCell cell) {
-        this.cell = cell;
-        this.row = row;
+        _cell = cell;
+        _row = row;
         if (cell.getR() != null) {
-            this.cellNum = new CellReference(cell.getR()).getCol();
+            _cellNum = new CellReference(cell.getR()).getCol();
         }
-        this.sharedStringSource = row.getSheet().getWorkbook().getSharedStringSource();
-        this.stylesSource = row.getSheet().getWorkbook().getStylesSource();
+        _sharedStringSource = row.getSheet().getWorkbook().getSharedStringSource();
+        _stylesSource = row.getSheet().getWorkbook().getStylesSource();
     }
 
     /**
      * @return table of strings shared across this workbook
      */
     protected SharedStringsTable getSharedStringSource() {
-        return sharedStringSource;
+        return _sharedStringSource;
     }
 
     /**
      * @return table of cell styles shared across this workbook
      */
     protected StylesTable getStylesSource() {
-        return stylesSource;
+        return _stylesSource;
     }
 
     /**
@@ -132,7 +129,7 @@
      * @return the row this cell belongs to
      */
     public XSSFRow getRow() {
-        return row;
+        return _row;
     }
 
     /**
@@ -150,10 +147,10 @@
             case CELL_TYPE_BLANK:
                 return false;
             case CELL_TYPE_BOOLEAN:
-                return cell.isSetV() && TRUE_AS_STRING.equals(cell.getV());
+                return _cell.isSetV() && TRUE_AS_STRING.equals(_cell.getV());
             case CELL_TYPE_FORMULA:
                 //YK: should throw an exception if requesting boolean value from a non-boolean formula
-                return cell.isSetV() && TRUE_AS_STRING.equals(cell.getV());
+                return _cell.isSetV() && TRUE_AS_STRING.equals(_cell.getV());
             default:
                 throw typeMismatch(CELL_TYPE_BOOLEAN, cellType, false);
         }
@@ -167,8 +164,8 @@
      *        will change the cell to a boolean cell and set its value.
      */
     public void setCellValue(boolean value) {
-        cell.setT(STCellType.B);
-        cell.setV(value ? TRUE_AS_STRING : FALSE_AS_STRING);
+        _cell.setT(STCellType.B);
+        _cell.setV(value ? TRUE_AS_STRING : FALSE_AS_STRING);
     }
 
     /**
@@ -189,7 +186,7 @@
                 return 0.0;
             case CELL_TYPE_FORMULA:
             case CELL_TYPE_NUMERIC:
-                return cell.isSetV() ? Double.parseDouble(cell.getV()) : 0.0;
+                return _cell.isSetV() ? Double.parseDouble(_cell.getV()) : 0.0;
             default:
                 throw typeMismatch(CELL_TYPE_NUMERIC, cellType, false);
         }
@@ -205,11 +202,11 @@
      */
     public void setCellValue(double value) {
         if(Double.isInfinite(value) || Double.isNaN(value)) {
-            cell.setT(STCellType.E);
-            cell.setV(FormulaError.NUM.getString());
+            _cell.setT(STCellType.E);
+            _cell.setV(FormulaError.NUM.getString());
         } else {
-            cell.setT(STCellType.N);
-            cell.setV(String.valueOf(value));
+            _cell.setT(STCellType.N);
+            _cell.setV(String.valueOf(value));
         }
     }
 
@@ -242,20 +239,20 @@
                 rt = new XSSFRichTextString("");
                 break;
             case CELL_TYPE_STRING:
-                if (cell.getT() == STCellType.INLINE_STR) {
-                    if(cell.isSetIs()) {
+                if (_cell.getT() == STCellType.INLINE_STR) {
+                    if(_cell.isSetIs()) {
                         //string is expressed directly in the cell definition instead of implementing the shared string table.
-                        rt = new XSSFRichTextString(cell.getIs());
-                    } else if (cell.isSetV()) {
+                        rt = new XSSFRichTextString(_cell.getIs());
+                    } else if (_cell.isSetV()) {
                         //cached result of a formula
-                        rt = new XSSFRichTextString(cell.getV());
+                        rt = new XSSFRichTextString(_cell.getV());
                     } else {
                         rt = new XSSFRichTextString("");
                     }
                 } else {
-                    if (cell.isSetV()) {
-                        int idx = Integer.parseInt(cell.getV());
-                        rt = new XSSFRichTextString(sharedStringSource.getEntryAt(idx));
+                    if (_cell.isSetV()) {
+                        int idx = Integer.parseInt(_cell.getV());
+                        rt = new XSSFRichTextString(_sharedStringSource.getEntryAt(idx));
                     }
                     else {
                         rt = new XSSFRichTextString("");
@@ -263,12 +260,12 @@
                 }
                 break;
             case CELL_TYPE_FORMULA:
-                rt = new XSSFRichTextString(cell.isSetV() ? cell.getV() : "");
+                rt = new XSSFRichTextString(_cell.isSetV() ? _cell.getV() : "");
                 break;
             default:
                 throw typeMismatch(CELL_TYPE_STRING, cellType, false);
         }
-        rt.setStylesTableReference(stylesSource);
+        rt.setStylesTableReference(_stylesSource);
         return rt;
     }
 
@@ -300,19 +297,19 @@
         int cellType = getCellType();
         switch(cellType){
             case Cell.CELL_TYPE_FORMULA:
-                cell.setV(str.getString());
-                cell.setT(STCellType.STR);
+                _cell.setV(str.getString());
+                _cell.setT(STCellType.STR);
                 break;
             default:
-                if(cell.getT() == STCellType.INLINE_STR) {
+                if(_cell.getT() == STCellType.INLINE_STR) {
                     //set the 'pre-evaluated result
-                    cell.setV(str.getString());
+                    _cell.setV(str.getString());
                 } else {
-                    cell.setT(STCellType.S);
+                    _cell.setT(STCellType.S);
                     XSSFRichTextString rt = (XSSFRichTextString)str;
-                    rt.setStylesTableReference(stylesSource);
-                    int sRef = sharedStringSource.addEntry(rt.getCTRst());
-                    cell.setV(Integer.toString(sRef));
+                    rt.setStylesTableReference(_stylesSource);
+                    int sRef = _sharedStringSource.addEntry(rt.getCTRst());
+                    _cell.setV(Integer.toString(sRef));
                 }
                 break;
         }
@@ -328,12 +325,11 @@
         int cellType = getCellType();
         if(cellType != CELL_TYPE_FORMULA) throw typeMismatch(CELL_TYPE_FORMULA, cellType, false);
 
-        CTCellFormula f = cell.getF();
+        CTCellFormula f = _cell.getF();
         if(f.getT() == STCellFormulaType.SHARED){
             return convertSharedFormula((int)f.getSi());
-        } else {
-            return f.getStringValue();
         }
+        return f.getStringValue();
     }
 
     /**
@@ -368,10 +364,10 @@
      * @throws IllegalArgumentException if the formula is invalid
      */
     public void setCellFormula(String formula) {
-        XSSFWorkbook wb = row.getSheet().getWorkbook();
+        XSSFWorkbook wb = _row.getSheet().getWorkbook();
         if (formula == null) {
             wb.onDeleteFormula(this);
-            if(cell.isSetF()) cell.unsetF();
+            if(_cell.isSetF()) _cell.unsetF();
             return;
         }
 
@@ -381,8 +377,8 @@
 
         CTCellFormula f =  CTCellFormula.Factory.newInstance();
         f.setStringValue(formula);
-        cell.setF(f);
-        if(cell.isSetV()) cell.unsetV();
+        _cell.setF(f);
+        if(_cell.isSetV()) _cell.unsetV();
     }
 
     /**
@@ -391,7 +387,7 @@
      * @return zero-based column index of a column in a sheet.
      */
     public int getColumnIndex() {
-        return this.cellNum;
+        return this._cellNum;
     }
 
     /**
@@ -400,7 +396,7 @@
      * @return zero-based row index of a row in the sheet that contains this cell
      */
     public int getRowIndex() {
-        return row.getRowNum();
+        return _row.getRowNum();
     }
 
     /**
@@ -409,7 +405,7 @@
      * @return A1 style reference to the location of this cell
      */
     public String getReference() {
-        return cell.getR();
+        return _cell.getR();
     }
 
     /**
@@ -419,8 +415,8 @@
      * <code>workbook.getCellStyleAt(0)</code>
      */
     public XSSFCellStyle getCellStyle() {
-        long idx = cell.isSetS() ? cell.getS() : 0;
-        return stylesSource.getStyleAt((int)idx);
+        long idx = _cell.isSetS() ? _cell.getS() : 0;
+        return _stylesSource.getStyleAt((int)idx);
     }
 
     /**
@@ -432,13 +428,13 @@
      */
     public void setCellStyle(CellStyle style) {
         if(style == null) {
-            if(cell.isSetS()) cell.unsetS();
+            if(_cell.isSetS()) _cell.unsetS();
         } else {
             XSSFCellStyle xStyle = (XSSFCellStyle)style;
-            xStyle.verifyBelongsToStylesSource(stylesSource);
+            xStyle.verifyBelongsToStylesSource(_stylesSource);
 
-            long idx = stylesSource.putStyle(xStyle);
-            cell.setS(idx);
+            long idx = _stylesSource.putStyle(xStyle);
+            _cell.setS(idx);
         }
     }
 
@@ -455,7 +451,7 @@
      */
     public int getCellType() {
 
-        if (cell.getF() != null) {
+        if (_cell.getF() != null) {
             return CELL_TYPE_FORMULA;
         }
 
@@ -469,7 +465,7 @@
      * on the cached value of the formula
      */
     public int getCachedFormulaResultType() {
-        if (cell.getF() == null) {
+        if (_cell.getF() == null) {
             throw new IllegalStateException("Only formula cells have cached results");
         }
 
@@ -480,11 +476,11 @@
      * Detect cell type based on the "t" attribute of the CTCell bean
      */
     private int getBaseCellType(boolean blankCells) {
-        switch (cell.getT().intValue()) {
+        switch (_cell.getT().intValue()) {
             case STCellType.INT_B:
                 return CELL_TYPE_BOOLEAN;
             case STCellType.INT_N:
-                if (!cell.isSetV() && blankCells) {
+                if (!_cell.isSetV() && blankCells) {
                     // ooxml does have a separate cell type of 'blank'.  A blank cell gets encoded as
                     // (either not present or) a numeric cell with no value set.
                     // The formula evaluator (and perhaps other clients of this interface) needs to
@@ -500,7 +496,7 @@
             case STCellType.INT_STR:
                  return CELL_TYPE_STRING;
             default:
-                throw new IllegalStateException("Illegal cell type: " + this.cell.getT());
+                throw new IllegalStateException("Illegal cell type: " + this._cell.getT());
         }
     }
 
@@ -570,7 +566,7 @@
         int cellType = getCellType();
         if(cellType != CELL_TYPE_ERROR) throw typeMismatch(CELL_TYPE_ERROR, cellType, false);
 
-        return cell.getV();
+        return _cell.getV();
     }
     /**
      * Get the value of the cell as an error code.
@@ -615,15 +611,15 @@
      *        cell and set its value.
      */
     public void setCellErrorValue(FormulaError error) {
-        cell.setT(STCellType.E);
-        cell.setV(error.getString());
+        _cell.setT(STCellType.E);
+        _cell.setV(error.getString());
     }
 
     /**
      * Sets this cell as the active cell for the worksheet.
      */
     public void setAsActiveCell() {
-        getSheet().setActiveCell(cell.getR());
+        getSheet().setActiveCell(_cell.getR());
     }
 
     /**
@@ -632,9 +628,9 @@
      */
     private void setBlank(){
         CTCell blank = CTCell.Factory.newInstance();
-        blank.setR(cell.getR());
-        blank.setS(cell.getS());
-        cell.set(blank);
+        blank.setR(_cell.getR());
+        blank.setS(_cell.getS());
+        _cell.set(blank);
     }
 
     /**
@@ -644,9 +640,9 @@
      */
     protected void setCellNum(int num) {
         checkBounds(num);
-        cellNum = num;
+        _cellNum = num;
         String ref = new CellReference(getRowIndex(), getColumnIndex()).formatAsString();
-        cell.setR(ref);
+        _cell.setR(ref);
     }
 
     /**
@@ -668,31 +664,31 @@
                 break;
             case CELL_TYPE_BOOLEAN:
                 String newVal = convertCellValueToBoolean() ? TRUE_AS_STRING : FALSE_AS_STRING;
-                cell.setT(STCellType.B);
-                cell.setV(newVal);
+                _cell.setT(STCellType.B);
+                _cell.setV(newVal);
                 break;
             case CELL_TYPE_NUMERIC:
-                cell.setT(STCellType.N);
+                _cell.setT(STCellType.N);
                 break;
             case CELL_TYPE_ERROR:
-                cell.setT(STCellType.E);
+                _cell.setT(STCellType.E);
                 break;
             case CELL_TYPE_STRING:
                 if(prevType != CELL_TYPE_STRING){
                     String str = convertCellValueToString();
                     XSSFRichTextString rt = new XSSFRichTextString(str);
-                    rt.setStylesTableReference(stylesSource);
-                    int sRef = sharedStringSource.addEntry(rt.getCTRst());
-                    cell.setV(Integer.toString(sRef));
+                    rt.setStylesTableReference(_stylesSource);
+                    int sRef = _sharedStringSource.addEntry(rt.getCTRst());
+                    _cell.setV(Integer.toString(sRef));
                 }
-                cell.setT(STCellType.S);
+                _cell.setT(STCellType.S);
                 break;
             case CELL_TYPE_FORMULA:
-                if(!cell.isSetF()){
+                if(!_cell.isSetF()){
                     CTCellFormula f =  CTCellFormula.Factory.newInstance();
                     f.setStringValue("0");
-                    cell.setF(f);
-                    if(cell.isSetT()) cell.unsetT();
+                    _cell.setF(f);
+                    if(_cell.isSetT()) _cell.unsetT();
                 }
                 break;
             default:
@@ -722,9 +718,8 @@
                 if (DateUtil.isCellDateFormatted(this)) {
                     DateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy");
                     return sdf.format(getDateCellValue());
-                } else {
-                    return getNumericCellValue() + "";
                 }
+                return getNumericCellValue() + "";
             case CELL_TYPE_STRING:
                 return getRichStringCellValue().toString();
             default:
@@ -745,7 +740,7 @@
      *     <code>null</code> for blank cells.
      */
     public String getRawValue() {
-        return cell.getV();
+        return _cell.getV();
     }
 
     /**
@@ -792,7 +787,7 @@
      * @return the cell comment associated with this cell or <code>null</code>
      */
     public XSSFComment getCellComment() {
-        return getSheet().getCellComment(row.getRowNum(), getColumnIndex());
+        return getSheet().getCellComment(_row.getRowNum(), getColumnIndex());
     }
 
     /**
@@ -802,7 +797,7 @@
      * @param comment comment associated with this cell
      */
     public void setCellComment(Comment comment) {
-        String cellRef = new CellReference(row.getRowNum(), getColumnIndex()).formatAsString();
+        String cellRef = new CellReference(_row.getRowNum(), getColumnIndex()).formatAsString();
         getSheet().setCellComment(cellRef, (XSSFComment)comment);
     }
 
@@ -812,7 +807,7 @@
      * @return hyperlink associated with this cell or <code>null</code> if not found
      */
     public XSSFHyperlink getHyperlink() {
-        return getSheet().getHyperlink(row.getRowNum(), cellNum);
+        return getSheet().getHyperlink(_row.getRowNum(), _cellNum);
     }
 
     /**
@@ -824,7 +819,7 @@
         XSSFHyperlink link = (XSSFHyperlink)hyperlink;
 
         // Assign to us
-        link.setCellReference( new CellReference(row.getRowNum(), cellNum).formatAsString() );
+        link.setCellReference( new CellReference(_row.getRowNum(), _cellNum).formatAsString() );
 
         // Add to the lists
         getSheet().setCellHyperlink(link);
@@ -837,7 +832,7 @@
      * @return the xml bean containing information about this cell
      */
     public CTCell getCTCell(){
-        return cell;
+        return _cell;
     }
 
     /**
@@ -857,14 +852,14 @@
 
         switch (cellType) {
             case CELL_TYPE_BOOLEAN:
-                return TRUE_AS_STRING.equals(cell.getV());
+                return TRUE_AS_STRING.equals(_cell.getV());
             case CELL_TYPE_STRING:
-                int sstIndex = Integer.parseInt(cell.getV());
-                XSSFRichTextString rt = new XSSFRichTextString(sharedStringSource.getEntryAt(sstIndex));
+                int sstIndex = Integer.parseInt(_cell.getV());
+                XSSFRichTextString rt = new XSSFRichTextString(_sharedStringSource.getEntryAt(sstIndex));
                 String text = rt.getString();
-                return Boolean.valueOf(text);
+                return Boolean.valueOf(text).booleanValue();
             case CELL_TYPE_NUMERIC:
-                return Double.parseDouble(cell.getV()) != 0;
+                return Double.parseDouble(_cell.getV()) != 0;
 
             case CELL_TYPE_ERROR:
             case CELL_TYPE_BLANK:
@@ -880,15 +875,15 @@
             case CELL_TYPE_BLANK:
                 return "";
             case CELL_TYPE_BOOLEAN:
-                return TRUE_AS_STRING.equals(cell.getV()) ? "TRUE" : "FALSE";
+                return TRUE_AS_STRING.equals(_cell.getV()) ? "TRUE" : "FALSE";
             case CELL_TYPE_STRING:
-                int sstIndex = Integer.parseInt(cell.getV());
-                XSSFRichTextString rt = new XSSFRichTextString(sharedStringSource.getEntryAt(sstIndex));
+                int sstIndex = Integer.parseInt(_cell.getV());
+                XSSFRichTextString rt = new XSSFRichTextString(_sharedStringSource.getEntryAt(sstIndex));
                 return rt.getString();
             case CELL_TYPE_NUMERIC:
-                return String.valueOf(Double.parseDouble(cell.getV()));
+                return String.valueOf(Double.parseDouble(_cell.getV()));
             case CELL_TYPE_ERROR:
-                   return cell.getV();
+                   return _cell.getV();
             case CELL_TYPE_FORMULA:
                 // should really evaluate, but HSSFCell can't call HSSFFormulaEvaluator
                 return "";

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java Tue Aug 18 16:50:24 2009
@@ -37,12 +37,12 @@
  */
 public class XSSFCellStyle implements CellStyle {
 
-    private int cellXfId;
-    private StylesTable stylesSource;
-    private CTXf cellXf;
-    private CTXf cellStyleXf;
-    private XSSFFont font;
-    private XSSFCellAlignment cellAlignment;
+    private int _cellXfId;
+    private StylesTable _stylesSource;
+    private CTXf _cellXf;
+    private CTXf _cellStyleXf;
+    private XSSFFont _font;
+    private XSSFCellAlignment _cellAlignment;
 
     /**
      * Creates a Cell Style from the supplied parts
@@ -51,35 +51,35 @@
      * @param stylesSource Styles Source to work off
      */
     public XSSFCellStyle(int cellXfId, int cellStyleXfId, StylesTable stylesSource) {
-        this.cellXfId = cellXfId;
-        this.stylesSource = stylesSource;
-        this.cellXf = stylesSource.getCellXfAt(this.cellXfId);
-        this.cellStyleXf = stylesSource.getCellStyleXfAt(cellStyleXfId);
+        _cellXfId = cellXfId;
+        _stylesSource = stylesSource;
+        _cellXf = stylesSource.getCellXfAt(this._cellXfId);
+        _cellStyleXf = stylesSource.getCellStyleXfAt(cellStyleXfId);
     }
 
     /**
      * Used so that StylesSource can figure out our location
      */
     public CTXf getCoreXf() {
-        return cellXf;
+        return _cellXf;
     }
 
     /**
      * Used so that StylesSource can figure out our location
      */
     public CTXf getStyleXf() {
-        return cellStyleXf;
+        return _cellStyleXf;
     }
 
     /**
      * Creates an empty Cell Style
      */
     public XSSFCellStyle(StylesTable stylesSource) {
-        this.stylesSource = stylesSource;
+        _stylesSource = stylesSource;
         // We need a new CTXf for the main styles
         // TODO decide on a style ctxf
-        cellXf = CTXf.Factory.newInstance();
-        cellStyleXf = null;
+        _cellXf = CTXf.Factory.newInstance();
+        _cellStyleXf = null;
     }
 
     /**
@@ -92,7 +92,7 @@
      * @throws IllegalArgumentException if there's a workbook mis-match
      */
     public void verifyBelongsToStylesSource(StylesTable src) {
-        if(this.stylesSource != src) {
+        if(this._stylesSource != src) {
             throw new IllegalArgumentException("This Style does not belong to the supplied Workbook Stlyes Source. Are you trying to assign a style from one workbook to the cell of a differnt workbook?");
         }
     }
@@ -112,8 +112,8 @@
     public void cloneStyleFrom(CellStyle source) {
         if(source instanceof XSSFCellStyle) {
             XSSFCellStyle src = (XSSFCellStyle)source;
-            cellXf.set(src.getCoreXf());
-            cellStyleXf.set(src.getStyleXf());
+            _cellXf.set(src.getCoreXf());
+            _cellStyleXf.set(src.getStyleXf());
         } else {
             throw new IllegalArgumentException("Can only clone from one XSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle");
         }
@@ -142,7 +142,7 @@
      * @see org.apache.poi.ss.usermodel.HorizontalAlignment
      */
     public HorizontalAlignment getAlignmentEnum() {
-        CTCellAlignment align = cellXf.getAlignment();
+        CTCellAlignment align = _cellXf.getAlignment();
         if(align != null && align.isSetHorizontal()) {
             return HorizontalAlignment.values()[align.getHorizontal().intValue()-1];
         }
@@ -169,10 +169,10 @@
      * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_SLANTED_DASH_DOT
      */
     public short getBorderBottom() {
-        if(!cellXf.getApplyBorder()) return BORDER_NONE;
+        if(!_cellXf.getApplyBorder()) return BORDER_NONE;
 
-        int idx = (int)cellXf.getBorderId();
-        CTBorder ct = stylesSource.getBorderAt(idx).getCTBorder();
+        int idx = (int)_cellXf.getBorderId();
+        CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder();
         STBorderStyle.Enum ptrn = ct.isSetBottom() ? ct.getBottom().getStyle() : null;
         return ptrn == null ? BORDER_NONE : (short)(ptrn.intValue() - 1);
     }
@@ -208,10 +208,10 @@
      * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_SLANTED_DASH_DOT
      */
     public short getBorderLeft() {
-        if(!cellXf.getApplyBorder()) return BORDER_NONE;
+        if(!_cellXf.getApplyBorder()) return BORDER_NONE;
 
-        int idx = (int)cellXf.getBorderId();
-        CTBorder ct = stylesSource.getBorderAt(idx).getCTBorder();
+        int idx = (int)_cellXf.getBorderId();
+        CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder();
         STBorderStyle.Enum ptrn = ct.isSetLeft() ? ct.getLeft().getStyle() : null;
         return ptrn == null ? BORDER_NONE : (short)(ptrn.intValue() - 1);
     }
@@ -246,10 +246,10 @@
      * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_SLANTED_DASH_DOT
      */
     public short getBorderRight() {
-        if(!cellXf.getApplyBorder()) return BORDER_NONE;
+        if(!_cellXf.getApplyBorder()) return BORDER_NONE;
 
-        int idx = (int)cellXf.getBorderId();
-        CTBorder ct = stylesSource.getBorderAt(idx).getCTBorder();
+        int idx = (int)_cellXf.getBorderId();
+        CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder();
         STBorderStyle.Enum ptrn = ct.isSetRight() ? ct.getRight().getStyle() : null;
         return ptrn == null ? BORDER_NONE : (short)(ptrn.intValue() - 1);
     }
@@ -284,10 +284,10 @@
      * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_SLANTED_DASH_DOT
      */
     public short getBorderTop() {
-        if(!cellXf.getApplyBorder()) return BORDER_NONE;
+        if(!_cellXf.getApplyBorder()) return BORDER_NONE;
 
-        int idx = (int)cellXf.getBorderId();
-        CTBorder ct = stylesSource.getBorderAt(idx).getCTBorder();
+        int idx = (int)_cellXf.getBorderId();
+        CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder();
         STBorderStyle.Enum ptrn = ct.isSetTop() ? ct.getTop().getStyle() : null;
         return ptrn == null ? BORDER_NONE : (short)(ptrn.intValue() - 1);
     }
@@ -320,10 +320,10 @@
      * @return the used color or <code>null</code> if not set
      */
     public XSSFColor getBottomBorderXSSFColor() {
-        if(!cellXf.getApplyBorder()) return null;
+        if(!_cellXf.getApplyBorder()) return null;
 
-        int idx = (int)cellXf.getBorderId();
-        XSSFCellBorder border = stylesSource.getBorderAt(idx);
+        int idx = (int)_cellXf.getBorderId();
+        XSSFCellBorder border = _stylesSource.getBorderAt(idx);
 
         return border.getBorderColor(BorderSide.BOTTOM);
     }
@@ -334,7 +334,7 @@
      * @return the index of the number format
      */
     public short getDataFormat() {
-        return (short)cellXf.getNumFmtId();
+        return (short)_cellXf.getNumFmtId();
     }
 
     /**
@@ -345,7 +345,7 @@
      */
     public String getDataFormatString() {
         int idx = getDataFormat();
-        return new XSSFDataFormat(stylesSource).getFormat((short)idx);
+        return new XSSFDataFormat(_stylesSource).getFormat((short)idx);
     }
 
     /**
@@ -372,10 +372,10 @@
      * @return XSSFColor - fill color or <code>null</code> if not set
      */
     public XSSFColor getFillBackgroundXSSFColor() {
-        if(!cellXf.getApplyFill()) return null;
+        if(!_cellXf.getApplyFill()) return null;
 
-        int fillIndex = (int)cellXf.getFillId();
-        XSSFCellFill fg = stylesSource.getFillAt(fillIndex);
+        int fillIndex = (int)_cellXf.getFillId();
+        XSSFCellFill fg = _stylesSource.getFillAt(fillIndex);
 
         return fg.getFillBackgroundColor();
     }
@@ -400,10 +400,10 @@
      * @return XSSFColor - fill color or <code>null</code> if not set
      */
     public XSSFColor getFillForegroundXSSFColor() {
-        if(!cellXf.getApplyFill()) return null;
+        if(!_cellXf.getApplyFill()) return null;
 
-        int fillIndex = (int)cellXf.getFillId();
-        XSSFCellFill fg = stylesSource.getFillAt(fillIndex);
+        int fillIndex = (int)_cellXf.getFillId();
+        XSSFCellFill fg = _stylesSource.getFillAt(fillIndex);
 
         return fg.getFillForegroundColor();
     }
@@ -431,10 +431,10 @@
      * @see org.apache.poi.ss.usermodel.CellStyle#DIAMONDS
      */
     public short getFillPattern() {
-        if(!cellXf.getApplyFill()) return 0;
+        if(!_cellXf.getApplyFill()) return 0;
 
-        int fillIndex = (int)cellXf.getFillId();
-        XSSFCellFill fill = stylesSource.getFillAt(fillIndex);
+        int fillIndex = (int)_cellXf.getFillId();
+        XSSFCellFill fill = _stylesSource.getFillAt(fillIndex);
 
         STPatternType.Enum ptrn = fill.getPatternType();
         if(ptrn == null) return CellStyle.NO_FILL;
@@ -456,10 +456,10 @@
     * @return Font - font
     */
     public XSSFFont getFont() {
-        if (font == null) {
-            font = stylesSource.getFontAt(getFontId());
+        if (_font == null) {
+            _font = _stylesSource.getFontAt(getFontId());
         }
-        return font;
+        return _font;
     }
 
     /**
@@ -487,7 +487,7 @@
      * @return indent - number of spaces
      */
     public short getIndention() {
-        CTCellAlignment align = cellXf.getAlignment();
+        CTCellAlignment align = _cellXf.getAlignment();
         return (short)(align == null ? 0 : align.getIndent());
     }
 
@@ -497,7 +497,7 @@
      * @return unique index number of the underlying record this style represents
      */
     public short getIndex() {
-        return (short)this.cellXfId;
+        return (short)this._cellXfId;
     }
 
     /**
@@ -518,10 +518,10 @@
      * @see org.apache.poi.ss.usermodel.IndexedColors
      */
     public XSSFColor getLeftBorderXSSFColor() {
-        if(!cellXf.getApplyBorder()) return null;
+        if(!_cellXf.getApplyBorder()) return null;
 
-        int idx = (int)cellXf.getBorderId();
-        XSSFCellBorder border = stylesSource.getBorderAt(idx);
+        int idx = (int)_cellXf.getBorderId();
+        XSSFCellBorder border = _stylesSource.getBorderAt(idx);
 
         return border.getBorderColor(BorderSide.LEFT);
     }
@@ -551,10 +551,10 @@
      * @return the used color or <code>null</code> if not set
      */
     public XSSFColor getRightBorderXSSFColor() {
-        if(!cellXf.getApplyBorder()) return null;
+        if(!_cellXf.getApplyBorder()) return null;
 
-        int idx = (int)cellXf.getBorderId();
-        XSSFCellBorder border = stylesSource.getBorderAt(idx);
+        int idx = (int)_cellXf.getBorderId();
+        XSSFCellBorder border = _stylesSource.getBorderAt(idx);
 
         return border.getBorderColor(BorderSide.RIGHT);
     }
@@ -574,7 +574,7 @@
      * @return rotation degrees (between 0 and 180 degrees)
      */
     public short getRotation() {
-        CTCellAlignment align = cellXf.getAlignment();
+        CTCellAlignment align = _cellXf.getAlignment();
         return (short)(align == null ? 0 : align.getTextRotation());
     }
 
@@ -595,10 +595,10 @@
      * @return the used color or <code>null</code> if not set
      */
     public XSSFColor getTopBorderXSSFColor() {
-        if(!cellXf.getApplyBorder()) return null;
+        if(!_cellXf.getApplyBorder()) return null;
 
-        int idx = (int)cellXf.getBorderId();
-        XSSFCellBorder border = stylesSource.getBorderAt(idx);
+        int idx = (int)_cellXf.getBorderId();
+        XSSFCellBorder border = _stylesSource.getBorderAt(idx);
 
         return border.getBorderColor(BorderSide.TOP);
     }
@@ -623,12 +623,11 @@
      * @see org.apache.poi.ss.usermodel.VerticalAlignment
      */
     public VerticalAlignment getVerticalAlignmentEnum() {
-        CTCellAlignment align = cellXf.getAlignment();
+        CTCellAlignment align = _cellXf.getAlignment();
         if(align != null && align.isSetVertical()) {
             return VerticalAlignment.values()[align.getVertical().intValue()-1];
-        } else {
-            return VerticalAlignment.BOTTOM;
         }
+        return VerticalAlignment.BOTTOM;
     }
 
     /**
@@ -637,7 +636,7 @@
      * @return  a boolean value indicating if the text in a cell should be line-wrapped within the cell.
      */
     public boolean getWrapText() {
-        CTCellAlignment align = cellXf.getAlignment();
+        CTCellAlignment align = _cellXf.getAlignment();
         return align != null && align.getWrapText();
     }
 
@@ -692,10 +691,10 @@
         if(border == BORDER_NONE) ct.unsetBottom();
         else pr.setStyle(STBorderStyle.Enum.forInt(border + 1));
 
-        int idx = stylesSource.putBorder(new XSSFCellBorder(ct));
+        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));
 
-        cellXf.setBorderId(idx);
-        cellXf.setApplyBorder(true);
+        _cellXf.setBorderId(idx);
+        _cellXf.setApplyBorder(true);
     }
 
     /**
@@ -732,10 +731,10 @@
         if(border == BORDER_NONE) ct.unsetLeft();
         else pr.setStyle(STBorderStyle.Enum.forInt(border + 1));
 
-        int idx = stylesSource.putBorder(new XSSFCellBorder(ct));
+        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));
 
-        cellXf.setBorderId(idx);
-        cellXf.setApplyBorder(true);
+        _cellXf.setBorderId(idx);
+        _cellXf.setApplyBorder(true);
     }
 
      /**
@@ -772,10 +771,10 @@
         if(border == BORDER_NONE) ct.unsetRight();
         else pr.setStyle(STBorderStyle.Enum.forInt(border + 1));
 
-        int idx = stylesSource.putBorder(new XSSFCellBorder(ct));
+        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));
 
-        cellXf.setBorderId(idx);
-        cellXf.setApplyBorder(true);
+        _cellXf.setBorderId(idx);
+        _cellXf.setApplyBorder(true);
     }
 
      /**
@@ -812,10 +811,10 @@
         if(border == BORDER_NONE) ct.unsetTop();
         else pr.setStyle(STBorderStyle.Enum.forInt(border + 1));
 
-        int idx = stylesSource.putBorder(new XSSFCellBorder(ct));
+        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));
 
-        cellXf.setBorderId(idx);
-        cellXf.setApplyBorder(true);
+        _cellXf.setBorderId(idx);
+        _cellXf.setApplyBorder(true);
     }
 
     /**
@@ -851,10 +850,10 @@
         if(color != null)  pr.setColor(color.getCTColor());
         else pr.unsetColor();
 
-        int idx = stylesSource.putBorder(new XSSFCellBorder(ct));
+        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));
 
-        cellXf.setBorderId(idx);
-        cellXf.setApplyBorder(true);
+        _cellXf.setBorderId(idx);
+        _cellXf.setApplyBorder(true);
     }
 
     /**
@@ -863,8 +862,8 @@
      * @param fmt the index of a data format
      */
     public void setDataFormat(short fmt) {
-        cellXf.setApplyNumberFormat(true);
-        cellXf.setNumFmtId(fmt);
+        _cellXf.setApplyNumberFormat(true);
+        _cellXf.setNumFmtId(fmt);
     }
 
     /**
@@ -902,10 +901,10 @@
             ptrn.setBgColor(color.getCTColor());
         }
 
-        int idx = stylesSource.putFill(new XSSFCellFill(ct));
+        int idx = _stylesSource.putFill(new XSSFCellFill(ct));
 
-        cellXf.setFillId(idx);
-        cellXf.setApplyFill(true);
+        _cellXf.setFillId(idx);
+        _cellXf.setApplyFill(true);
     }
 
     /**
@@ -958,10 +957,10 @@
             ptrn.setFgColor(color.getCTColor());
         }
 
-        int idx = stylesSource.putFill(new XSSFCellFill(ct));
+        int idx = _stylesSource.putFill(new XSSFCellFill(ct));
 
-        cellXf.setFillId(idx);
-        cellXf.setApplyFill(true);
+        _cellXf.setFillId(idx);
+        _cellXf.setApplyFill(true);
     }
 
     /**
@@ -982,9 +981,9 @@
      */
     private CTFill getCTFill(){
         CTFill ct;
-        if(cellXf.getApplyFill()) {
-            int fillIndex = (int)cellXf.getFillId();
-            XSSFCellFill cf = stylesSource.getFillAt(fillIndex);
+        if(_cellXf.getApplyFill()) {
+            int fillIndex = (int)_cellXf.getFillId();
+            XSSFCellFill cf = _stylesSource.getFillAt(fillIndex);
 
             ct = (CTFill)cf.getCTFill().copy();
         } else {
@@ -998,9 +997,9 @@
      */
     private CTBorder getCTBorder(){
         CTBorder ct;
-        if(cellXf.getApplyBorder()) {
-            int idx = (int)cellXf.getBorderId();
-            XSSFCellBorder cf = stylesSource.getBorderAt(idx);
+        if(_cellXf.getApplyBorder()) {
+            int idx = (int)_cellXf.getBorderId();
+            XSSFCellBorder cf = _stylesSource.getBorderAt(idx);
 
             ct = (CTBorder)cf.getCTBorder().copy();
         } else {
@@ -1041,10 +1040,10 @@
         if(fp == NO_FILL && ptrn.isSetPatternType()) ptrn.unsetPatternType();
         else ptrn.setPatternType(STPatternType.Enum.forInt(fp + 1));
 
-        int idx = stylesSource.putFill(new XSSFCellFill(ct));
+        int idx = _stylesSource.putFill(new XSSFCellFill(ct));
 
-        cellXf.setFillId(idx);
-        cellXf.setApplyFill(true);
+        _cellXf.setFillId(idx);
+        _cellXf.setApplyFill(true);
     }
 
     /**
@@ -1070,10 +1069,10 @@
     public void setFont(Font font) {
         if(font != null){
             long index = font.getIndex();
-            this.cellXf.setFontId(index);
-            this.cellXf.setApplyFont(true);
+            this._cellXf.setFontId(index);
+            this._cellXf.setApplyFont(true);
         } else {
-            this.cellXf.setApplyFont(false);
+            this._cellXf.setApplyFont(false);
         }
     }
 
@@ -1120,10 +1119,10 @@
         if(color != null)  pr.setColor(color.getCTColor());
         else pr.unsetColor();
 
-        int idx = stylesSource.putBorder(new XSSFCellBorder(ct));
+        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));
 
-        cellXf.setBorderId(idx);
-        cellXf.setApplyBorder(true);
+        _cellXf.setBorderId(idx);
+        _cellXf.setApplyBorder(true);
     }
 
     /**
@@ -1160,10 +1159,10 @@
         if(color != null)  pr.setColor(color.getCTColor());
         else pr.unsetColor();
 
-        int idx = stylesSource.putBorder(new XSSFCellBorder(ct));
+        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));
 
-        cellXf.setBorderId(idx);
-        cellXf.setApplyBorder(true);
+        _cellXf.setBorderId(idx);
+        _cellXf.setApplyBorder(true);
     }
 
     /**
@@ -1210,10 +1209,10 @@
         if(color != null)  pr.setColor(color.getCTColor());
         else pr.unsetColor();
 
-        int idx = stylesSource.putBorder(new XSSFCellBorder(ct));
+        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));
 
-        cellXf.setBorderId(idx);
-        cellXf.setApplyBorder(true);
+        _cellXf.setBorderId(idx);
+        _cellXf.setApplyBorder(true);
     }
 
     /**
@@ -1296,10 +1295,10 @@
         }
     }
     private int getFontId() {
-        if (cellXf.isSetFontId()) {
-            return (int) cellXf.getFontId();
+        if (_cellXf.isSetFontId()) {
+            return (int) _cellXf.getFontId();
         }
-        return (int) cellStyleXf.getFontId();
+        return (int) _cellStyleXf.getFontId();
     }
 
     /**
@@ -1307,10 +1306,10 @@
      * @return CTCellProtection
      */
     private CTCellProtection getCellProtection() {
-        if (cellXf.getProtection() == null) {
-            cellXf.addNewProtection();
+        if (_cellXf.getProtection() == null) {
+            _cellXf.addNewProtection();
         }
-        return cellXf.getProtection();
+        return _cellXf.getProtection();
     }
 
     /**
@@ -1318,10 +1317,10 @@
      * @return XSSFCellAlignment - cell alignment
      */
     protected XSSFCellAlignment getCellAlignment() {
-        if (this.cellAlignment == null) {
-            this.cellAlignment = new XSSFCellAlignment(getCTCellAlignment());
+        if (this._cellAlignment == null) {
+            this._cellAlignment = new XSSFCellAlignment(getCTCellAlignment());
         }
-        return this.cellAlignment;
+        return this._cellAlignment;
     }
 
     /**
@@ -1330,10 +1329,10 @@
      * @return CTCellAlignment
      */
     private CTCellAlignment getCTCellAlignment() {
-        if (cellXf.getAlignment() == null) {
-            cellXf.setAlignment(CTCellAlignment.Factory.newInstance());
+        if (_cellXf.getAlignment() == null) {
+            _cellXf.setAlignment(CTCellAlignment.Factory.newInstance());
         }
-        return cellXf.getAlignment();
+        return _cellXf.getAlignment();
     }
 
     /**
@@ -1342,7 +1341,7 @@
      * @return the hash code value for this style
      */
     public int hashCode(){
-        return cellXf.toString().hashCode();
+        return _cellXf.toString().hashCode();
     }
 
     /**
@@ -1355,7 +1354,7 @@
         if(o == null || !(o instanceof XSSFCellStyle)) return false;
 
         XSSFCellStyle cf = (XSSFCellStyle)o;
-        return cellXf.toString().equals(cf.getCoreXf().toString());
+        return _cellXf.toString().equals(cf.getCoreXf().toString());
     }
 
     /**
@@ -1365,11 +1364,11 @@
      * @return a copy of this style
      */
     public Object clone(){
-        CTXf xf = (CTXf)cellXf.copy();
+        CTXf xf = (CTXf)_cellXf.copy();
 
-        int xfSize = stylesSource._getStyleXfsSize();
-        int indexXf = stylesSource.putCellXf(xf);
-        return new XSSFCellStyle(indexXf-1, xfSize-1, stylesSource);
+        int xfSize = _stylesSource._getStyleXfsSize();
+        int indexXf = _stylesSource.putCellXf(xf);
+        return new XSSFCellStyle(indexXf-1, xfSize-1, _stylesSource);
     }
 
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java Tue Aug 18 16:50:24 2009
@@ -42,8 +42,8 @@
      */
     public static final short DEFAULT_FONT_COLOR = IndexedColors.BLACK.getIndex();
 
-    private CTFont ctFont;
-    private short index;
+    private CTFont _ctFont;
+    private short _index;
 
     /**
      * Create a new XSSFFont
@@ -51,20 +51,20 @@
      * @param font the underlying CTFont bean
      */
     public XSSFFont(CTFont font) {
-        this.ctFont = font;
-        this.index = 0;
+        _ctFont = font;
+        _index = 0;
     }
 
     public XSSFFont(CTFont font, int index) {
-        this.ctFont = font;
-        this.index = (short)index;
+        _ctFont = font;
+        _index = (short)index;
     }
 
     /**
      * Create a new XSSFont. This method is protected to be used only by XSSFWorkbook
      */
     protected XSSFFont() {
-        this.ctFont = CTFont.Factory.newInstance();
+        this._ctFont = CTFont.Factory.newInstance();
         setFontName(DEFAULT_FONT_NAME);
         setFontHeight((double)DEFAULT_FONT_SIZE);
     }
@@ -73,7 +73,7 @@
      * get the underlying CTFont font
      */
     public CTFont getCTFont() {
-        return ctFont;
+        return _ctFont;
     }
 
     /**
@@ -82,7 +82,7 @@
      * @return boolean - bold
      */
     public boolean getBold() {
-        CTBooleanProperty bold = ctFont.sizeOfBArray() == 0 ? null : ctFont.getBArray(0);
+        CTBooleanProperty bold = _ctFont.sizeOfBArray() == 0 ? null : _ctFont.getBArray(0);
         return (bold != null && bold.getVal());
     }
 
@@ -93,7 +93,7 @@
      * @see org.apache.poi.ss.usermodel.FontCharset
      */
     public byte getCharSet() {
-        CTIntProperty charset = ctFont.sizeOfCharsetArray() == 0 ? null : ctFont.getCharsetArray(0);
+        CTIntProperty charset = _ctFont.sizeOfCharsetArray() == 0 ? null : _ctFont.getCharsetArray(0);
         int val = charset == null ? FontCharset.ANSI.getValue() : FontCharset.valueOf(charset.getVal()).getValue();
         return (byte)val;
     }
@@ -107,7 +107,7 @@
      * @see IndexedColors
      */
     public short getColor() {
-        CTColor color = ctFont.sizeOfColorArray() == 0 ? null : ctFont.getColorArray(0);
+        CTColor color = _ctFont.sizeOfColorArray() == 0 ? null : _ctFont.getColorArray(0);
         if (color == null) return IndexedColors.BLACK.getIndex();
 
         long index = color.getIndexed();
@@ -128,7 +128,7 @@
      * @return XSSFColor - rgb color to use
      */
     public XSSFColor getXSSFColor() {
-        CTColor ctColor = ctFont.sizeOfColorArray() == 0 ? null : ctFont.getColorArray(0);
+        CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? null : _ctFont.getColorArray(0);
         return ctColor == null ? null : new XSSFColor(ctColor);
     }
 
@@ -140,7 +140,7 @@
      * @return short - theme defined to use
      */
     public short getThemeColor() {
-        CTColor color = ctFont.sizeOfColorArray() == 0 ? null : ctFont.getColorArray(0);
+        CTColor color = _ctFont.sizeOfColorArray() == 0 ? null : _ctFont.getColorArray(0);
         long index = color == null ? 0 : color.getTheme();
         return (short) index;
     }
@@ -151,12 +151,12 @@
      * @return short - height in point
      */
     public short getFontHeight() {
-        CTFontSize size = ctFont.sizeOfSzArray() == 0 ? null : ctFont.getSzArray(0);
+        CTFontSize size = _ctFont.sizeOfSzArray() == 0 ? null : _ctFont.getSzArray(0);
         if (size != null) {
             double fontHeight = size.getVal();
             return (short)(fontHeight*20);
-        } else
-            return (short)(DEFAULT_FONT_SIZE*20);
+        }
+        return (short)(DEFAULT_FONT_SIZE*20);
     }
 
     /**
@@ -172,7 +172,7 @@
      * @return String - a string representing the name of the font to use
      */
     public String getFontName() {
-        CTFontName name = ctFont.sizeOfNameArray() == 0 ? null : ctFont.getNameArray(0);
+        CTFontName name = _ctFont.sizeOfNameArray() == 0 ? null : _ctFont.getNameArray(0);
         return name == null ? DEFAULT_FONT_NAME : name.getVal();
     }
 
@@ -182,7 +182,7 @@
      * @return boolean - value for italic
      */
     public boolean getItalic() {
-        CTBooleanProperty italic = ctFont.sizeOfIArray() == 0 ? null : ctFont.getIArray(0);
+        CTBooleanProperty italic = _ctFont.sizeOfIArray() == 0 ? null : _ctFont.getIArray(0);
         return italic != null && italic.getVal();
     }
 
@@ -192,7 +192,7 @@
      * @return boolean - value for strikeout
      */
     public boolean getStrikeout() {
-        CTBooleanProperty strike = ctFont.sizeOfStrikeArray() == 0 ? null : ctFont.getStrikeArray(0);
+        CTBooleanProperty strike = _ctFont.sizeOfStrikeArray() == 0 ? null : _ctFont.getStrikeArray(0);
         return strike != null && strike.getVal();
     }
 
@@ -205,21 +205,21 @@
      * @see Font#SS_SUB
      */
     public short getTypeOffset() {
-        CTVerticalAlignFontProperty vAlign = ctFont.sizeOfVertAlignArray() == 0 ? null : ctFont.getVertAlignArray(0);
-        if (vAlign != null) {
-            int val = vAlign.getVal().intValue();
-            switch (val) {
-                case STVerticalAlignRun.INT_BASELINE:
-                    return Font.SS_NONE;
-                case STVerticalAlignRun.INT_SUBSCRIPT:
-                    return Font.SS_SUB;
-                case STVerticalAlignRun.INT_SUPERSCRIPT:
-                    return Font.SS_SUPER;
-                default:
-                    throw new POIXMLException("Wrong offset value " + val);
-            }
-        } else
+        CTVerticalAlignFontProperty vAlign = _ctFont.sizeOfVertAlignArray() == 0 ? null : _ctFont.getVertAlignArray(0);
+        if (vAlign == null) {
             return Font.SS_NONE;
+        }
+        int val = vAlign.getVal().intValue();
+        switch (val) {
+            case STVerticalAlignRun.INT_BASELINE:
+                return Font.SS_NONE;
+            case STVerticalAlignRun.INT_SUBSCRIPT:
+                return Font.SS_SUB;
+            case STVerticalAlignRun.INT_SUPERSCRIPT:
+                return Font.SS_SUPER;
+            default:
+                throw new POIXMLException("Wrong offset value " + val);
+        }
     }
 
     /**
@@ -229,7 +229,7 @@
      * @see org.apache.poi.ss.usermodel.FontUnderline
      */
     public byte getUnderline() {
-        CTUnderlineProperty underline = ctFont.sizeOfUArray() == 0 ? null : ctFont.getUArray(0);
+        CTUnderlineProperty underline = _ctFont.sizeOfUArray() == 0 ? null : _ctFont.getUArray(0);
         if (underline != null) {
             FontUnderline val = FontUnderline.valueOf(underline.getVal().intValue());
             return val.getByteValue();
@@ -244,10 +244,10 @@
      */
     public void setBold(boolean bold) {
         if(bold){
-            CTBooleanProperty ctBold = ctFont.sizeOfBArray() == 0 ? ctFont.addNewB() : ctFont.getBArray(0);
+            CTBooleanProperty ctBold = _ctFont.sizeOfBArray() == 0 ? _ctFont.addNewB() : _ctFont.getBArray(0);
             ctBold.setVal(bold);
         } else {
-            ctFont.setBArray(null);
+            _ctFont.setBArray(null);
         }
     }
 
@@ -275,7 +275,7 @@
      * @see FontCharset
      */
     public void setCharSet(byte charset) {
-        CTIntProperty charsetProperty = ctFont.sizeOfCharsetArray() == 0 ? ctFont.addNewCharset() : ctFont.getCharsetArray(0);
+        CTIntProperty charsetProperty = _ctFont.sizeOfCharsetArray() == 0 ? _ctFont.addNewCharset() : _ctFont.getCharsetArray(0);
         switch (charset) {
             case Font.ANSI_CHARSET:
                 charsetProperty.setVal(FontCharset.ANSI.getValue());
@@ -308,7 +308,7 @@
      * @see IndexedColors
      */
     public void setColor(short color) {
-        CTColor ctColor = ctFont.sizeOfColorArray() == 0 ? ctFont.addNewColor() : ctFont.getColorArray(0);
+        CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0);
         switch (color) {
             case Font.COLOR_NORMAL: {
                 ctColor.setIndexed(XSSFFont.DEFAULT_FONT_COLOR);
@@ -329,9 +329,9 @@
      * @param color - color to use
      */
     public void setColor(XSSFColor color) {
-        if(color == null) ctFont.setColorArray(null);
+        if(color == null) _ctFont.setColorArray(null);
         else {
-            CTColor ctColor = ctFont.sizeOfColorArray() == 0 ? ctFont.addNewColor() : ctFont.getColorArray(0);
+            CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0);
             ctColor.setRgb(color.getRgb());
         }
     }
@@ -351,7 +351,7 @@
      * @param height - height in points
      */
     public void setFontHeight(double height) {
-        CTFontSize fontSize = ctFont.sizeOfSzArray() == 0 ? ctFont.addNewSz() : ctFont.getSzArray(0);
+        CTFontSize fontSize = _ctFont.sizeOfSzArray() == 0 ? _ctFont.addNewSz() : _ctFont.getSzArray(0);
         fontSize.setVal(height);
     }
 
@@ -370,7 +370,7 @@
      * @param theme - theme color to use
      */
     public void setThemeColor(short theme) {
-        CTColor ctColor = ctFont.sizeOfColorArray() == 0 ? ctFont.addNewColor() : ctFont.getColorArray(0);
+        CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0);
         ctColor.setTheme(theme);
     }
 
@@ -386,7 +386,7 @@
      * @see #DEFAULT_FONT_NAME
      */
     public void setFontName(String name) {
-        CTFontName fontName = ctFont.sizeOfNameArray() == 0 ? ctFont.addNewName() : ctFont.getNameArray(0);
+        CTFontName fontName = _ctFont.sizeOfNameArray() == 0 ? _ctFont.addNewName() : _ctFont.getNameArray(0);
         fontName.setVal(name == null ? DEFAULT_FONT_NAME : name);
     }
 
@@ -399,10 +399,10 @@
      */
     public void setItalic(boolean italic) {
         if(italic){
-            CTBooleanProperty bool = ctFont.sizeOfIArray() == 0 ? ctFont.addNewI() : ctFont.getIArray(0);
+            CTBooleanProperty bool = _ctFont.sizeOfIArray() == 0 ? _ctFont.addNewI() : _ctFont.getIArray(0);
             bool.setVal(italic);
         } else {
-            ctFont.setIArray(null);
+            _ctFont.setIArray(null);
         }
     }
 
@@ -414,9 +414,9 @@
      * @param strikeout - value for strikeout or not
      */
     public void setStrikeout(boolean strikeout) {
-        if(!strikeout) ctFont.setStrikeArray(null);
+        if(!strikeout) _ctFont.setStrikeArray(null);
         else {
-            CTBooleanProperty strike = ctFont.sizeOfStrikeArray() == 0 ? ctFont.addNewStrike() : ctFont.getStrikeArray(0);
+            CTBooleanProperty strike = _ctFont.sizeOfStrikeArray() == 0 ? _ctFont.addNewStrike() : _ctFont.getStrikeArray(0);
             strike.setVal(strikeout);
         }
     }
@@ -433,9 +433,9 @@
      */
     public void setTypeOffset(short offset) {
         if(offset == Font.SS_NONE){
-            ctFont.setVertAlignArray(null);
+            _ctFont.setVertAlignArray(null);
         } else {
-            CTVerticalAlignFontProperty offsetProperty = ctFont.sizeOfVertAlignArray() == 0 ? ctFont.addNewVertAlign() : ctFont.getVertAlignArray(0);
+            CTVerticalAlignFontProperty offsetProperty = _ctFont.sizeOfVertAlignArray() == 0 ? _ctFont.addNewVertAlign() : _ctFont.getVertAlignArray(0);
             switch (offset) {
                 case Font.SS_NONE:
                     offsetProperty.setVal(STVerticalAlignRun.BASELINE);
@@ -469,10 +469,10 @@
      * @param underline - FontUnderline enum value
      */
     public void setUnderline(FontUnderline underline) {
-        if(underline == FontUnderline.NONE && ctFont.sizeOfUArray() > 0){
-            ctFont.setUArray(null);
+        if(underline == FontUnderline.NONE && _ctFont.sizeOfUArray() > 0){
+            _ctFont.setUArray(null);
         } else {
-            CTUnderlineProperty ctUnderline = ctFont.sizeOfUArray() == 0 ? ctFont.addNewU() : ctFont.getUArray(0);
+            CTUnderlineProperty ctUnderline = _ctFont.sizeOfUArray() == 0 ? _ctFont.addNewU() : _ctFont.getUArray(0);
             STUnderlineValues.Enum val = STUnderlineValues.Enum.forInt(underline.getValue());
             ctUnderline.setVal(val);
         }
@@ -480,7 +480,7 @@
 
 
     public String toString() {
-        return ctFont.toString();
+        return _ctFont.toString();
     }
 
 
@@ -489,7 +489,7 @@
      */
     public long putFont(StylesTable styles) {
         short idx = (short)styles.putFont(this);
-        this.index = idx;
+        this._index = idx;
         return idx;
     }
 
@@ -501,7 +501,7 @@
      * @see org.apache.poi.xssf.model.StylesTable#createDefaultFont()
      */
     public FontScheme getScheme() {
-        CTFontScheme scheme = ctFont.sizeOfSchemeArray() == 0 ? null : ctFont.getSchemeArray(0);
+        CTFontScheme scheme = _ctFont.sizeOfSchemeArray() == 0 ? null : _ctFont.getSchemeArray(0);
         return scheme == null ? FontScheme.NONE : FontScheme.valueOf(scheme.getVal().intValue());
     }
 
@@ -512,7 +512,7 @@
      * @see FontScheme
      */
     public void setScheme(FontScheme scheme) {
-        CTFontScheme ctFontScheme = ctFont.sizeOfSchemeArray() == 0 ? ctFont.addNewScheme() : ctFont.getSchemeArray(0);
+        CTFontScheme ctFontScheme = _ctFont.sizeOfSchemeArray() == 0 ? _ctFont.addNewScheme() : _ctFont.getSchemeArray(0);
         STFontScheme.Enum val = STFontScheme.Enum.forInt(scheme.getValue());
         ctFontScheme.setVal(val);
     }
@@ -524,7 +524,7 @@
      * @see org.apache.poi.ss.usermodel.FontFamily
      */
     public int getFamily() {
-        CTIntProperty family = ctFont.sizeOfFamilyArray() == 0 ? ctFont.addNewFamily() : ctFont.getFamilyArray(0);
+        CTIntProperty family = _ctFont.sizeOfFamilyArray() == 0 ? _ctFont.addNewFamily() : _ctFont.getFamilyArray(0);
         return family == null ? FontFamily.NOT_APPLICABLE.getValue() : FontFamily.valueOf(family.getVal()).getValue();
     }
 
@@ -537,7 +537,7 @@
      * @see FontFamily
      */
     public void setFamily(int value) {
-        CTIntProperty family = ctFont.sizeOfFamilyArray() == 0 ? ctFont.addNewFamily() : ctFont.getFamilyArray(0);
+        CTIntProperty family = _ctFont.sizeOfFamilyArray() == 0 ? _ctFont.addNewFamily() : _ctFont.getFamilyArray(0);
         family.setVal(value);
     }
 
@@ -560,18 +560,18 @@
 
     public short getIndex()
     {
-        return index;
+        return _index;
     }
 
     public int hashCode(){
-        return ctFont.toString().hashCode();
+        return _ctFont.toString().hashCode();
     }
 
     public boolean equals(Object o){
         if(!(o instanceof XSSFFont)) return false;
 
         XSSFFont cf = (XSSFFont)o;
-        return ctFont.toString().equals(cf.getCTFont().toString());
+        return _ctFont.toString().equals(cf.getCTFont().toString());
     }
 
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java Tue Aug 18 16:50:24 2009
@@ -32,10 +32,10 @@
  * are largely stored as relations of the sheet
  */
 public class XSSFHyperlink implements Hyperlink {
-    private int type;
-    private PackageRelationship externalRel;
-    private CTHyperlink ctHyperlink;
-    private String location;
+    private int _type;
+    private PackageRelationship _externalRel;
+    private CTHyperlink _ctHyperlink;
+    private String _location;
 
     /**
      * Create a new XSSFHyperlink. This method is protected to be used only by XSSFCreationHelper
@@ -43,8 +43,8 @@
      * @param type - the type of hyperlink to create
      */
     protected XSSFHyperlink(int type) {
-        this.type = type;
-        this.ctHyperlink = CTHyperlink.Factory.newInstance();
+        _type = type;
+        _ctHyperlink = CTHyperlink.Factory.newInstance();
     }
 
     /**
@@ -54,37 +54,36 @@
      * @param hyperlinkRel the relationship in the underlying OPC package which stores the actual link's address
      */
     protected XSSFHyperlink(CTHyperlink ctHyperlink, PackageRelationship hyperlinkRel) {
-        this.ctHyperlink = ctHyperlink;
-        this.externalRel = hyperlinkRel;
+        _ctHyperlink = ctHyperlink;
+        _externalRel = hyperlinkRel;
 
         // Figure out the Hyperlink type and distination
 
         // If it has a location, it's internal
         if (ctHyperlink.getLocation() != null) {
-            type = Hyperlink.LINK_DOCUMENT;
-            location = ctHyperlink.getLocation();
+            _type = Hyperlink.LINK_DOCUMENT;
+            _location = ctHyperlink.getLocation();
         } else {
             // Otherwise it's somehow external, check
             //  the relation to see how
-            if (externalRel == null) {
+            if (_externalRel == null) {
                 if (ctHyperlink.getId() != null) {
                     throw new IllegalStateException("The hyperlink for cell " + ctHyperlink.getRef() + " references relation " + ctHyperlink.getId() + ", but that didn't exist!");
-                } else {
-                    throw new IllegalStateException("A sheet hyperlink must either have a location, or a relationship. Found:\n" + ctHyperlink);
                 }
+                throw new IllegalStateException("A sheet hyperlink must either have a location, or a relationship. Found:\n" + ctHyperlink);
             }
 
-            URI target = externalRel.getTargetURI();
-            location = target.toString();
+            URI target = _externalRel.getTargetURI();
+            _location = target.toString();
 
             // Try to figure out the type
-            if (location.startsWith("http://") || location.startsWith("https://")
-                    || location.startsWith("ftp://")) {
-                type = Hyperlink.LINK_URL;
-            } else if (location.startsWith("mailto:")) {
-                type = Hyperlink.LINK_EMAIL;
+            if (_location.startsWith("http://") || _location.startsWith("https://")
+                    || _location.startsWith("ftp://")) {
+                _type = Hyperlink.LINK_URL;
+            } else if (_location.startsWith("mailto:")) {
+                _type = Hyperlink.LINK_EMAIL;
             } else {
-                type = Hyperlink.LINK_FILE;
+                _type = Hyperlink.LINK_FILE;
             }
         }
     }
@@ -93,7 +92,7 @@
      * Returns the underlying hyperlink object
      */
     protected CTHyperlink getCTHyperlink() {
-        return ctHyperlink;
+        return _ctHyperlink;
     }
 
     /**
@@ -101,7 +100,7 @@
      * this hyperlink?
      */
     public boolean needsRelationToo() {
-        return (type != Hyperlink.LINK_DOCUMENT);
+        return (_type != Hyperlink.LINK_DOCUMENT);
     }
 
     /**
@@ -111,10 +110,10 @@
         if (needsRelationToo()) {
             // Generate the relation
             PackageRelationship rel =
-                    sheetPart.addExternalRelationship(location, XSSFRelation.SHEET_HYPERLINKS.getRelation());
+                    sheetPart.addExternalRelationship(_location, XSSFRelation.SHEET_HYPERLINKS.getRelation());
 
             // Update the r:id
-            ctHyperlink.setId(rel.getId());
+            _ctHyperlink.setId(rel.getId());
         }
     }
 
@@ -124,7 +123,7 @@
      * @return the type of this hyperlink
      */
     public int getType() {
-        return type;
+        return _type;
     }
 
     /**
@@ -132,7 +131,7 @@
      * es A55
      */
     public String getCellRef() {
-        return ctHyperlink.getRef();
+        return _ctHyperlink.getRef();
     }
 
     /**
@@ -141,7 +140,7 @@
      * @return the address of this hyperlink
      */
     public String getAddress() {
-        return location;
+        return _location;
     }
 
     /**
@@ -150,7 +149,7 @@
      * @return text to display
      */
     public String getLabel() {
-        return ctHyperlink.getDisplay();
+        return _ctHyperlink.getDisplay();
     }
 
     /**
@@ -160,7 +159,7 @@
      * @return location
      */
     public String getLocation() {
-        return ctHyperlink.getLocation();
+        return _ctHyperlink.getLocation();
     }
 
     /**
@@ -169,7 +168,7 @@
      * @param label text label for this hyperlink
      */
     public void setLabel(String label) {
-        ctHyperlink.setDisplay(label);
+        _ctHyperlink.setDisplay(label);
     }
 
     /**
@@ -179,7 +178,7 @@
      * @param location - string representing a location of this hyperlink
      */
     public void setLocation(String location) {
-        ctHyperlink.setLocation(location);
+        _ctHyperlink.setLocation(location);
     }
 
     /**
@@ -188,9 +187,9 @@
      * @param address - the address of this hyperlink
      */
     public void setAddress(String address) {
-        location = address;
-        //we must set location for internal hyperlinks 
-        if (type == Hyperlink.LINK_DOCUMENT) {
+        _location = address;
+        //we must set location for internal hyperlinks
+        if (_type == Hyperlink.LINK_DOCUMENT) {
             setLocation(address);
         }
     }
@@ -199,11 +198,11 @@
      * Assigns this hyperlink to the given cell reference
      */
     protected void setCellReference(String ref) {
-        ctHyperlink.setRef(ref);
+        _ctHyperlink.setRef(ref);
     }
 
     private CellReference buildCellReference() {
-        return new CellReference(ctHyperlink.getRef());
+        return new CellReference(_ctHyperlink.getRef());
     }
 
 
@@ -251,7 +250,7 @@
      * @param col the 0-based column of the first cell that contains the hyperlink
      */
     public void setFirstColumn(int col) {
-        ctHyperlink.setRef(
+        _ctHyperlink.setRef(
                 new CellReference(
                         getFirstRow(), col
                 ).formatAsString()
@@ -273,7 +272,7 @@
      * @param row the 0-based row of the first cell that contains the hyperlink
      */
     public void setFirstRow(int row) {
-        ctHyperlink.setRef(
+        _ctHyperlink.setRef(
                 new CellReference(
                         row, getFirstColumn()
                 ).formatAsString()

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFName.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFName.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFName.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFName.java Tue Aug 18 16:50:24 2009
@@ -102,8 +102,8 @@
      */
     public final static String BUILTIN_SHEET_TITLE = "_xlnm.Sheet_Title";
 
-    private XSSFWorkbook workbook;
-    private CTDefinedName ctName;
+    private XSSFWorkbook _workbook;
+    private CTDefinedName _ctName;
 
     /**
      * Creates an XSSFName object - called internally by XSSFWorkbook.
@@ -113,15 +113,15 @@
      * @see org.apache.poi.xssf.usermodel.XSSFWorkbook#createName()
      */
     protected XSSFName(CTDefinedName name, XSSFWorkbook workbook) {
-        this.workbook = workbook;
-        this.ctName = name;
+        _workbook = workbook;
+        _ctName = name;
     }
 
     /**
      * Returns the underlying named range object
      */
     protected CTDefinedName getCTName() {
-        return ctName;
+        return _ctName;
     }
 
     /**
@@ -130,7 +130,7 @@
      * @return text name of this defined name
      */
     public String getNameName() {
-        return ctName.getName();
+        return _ctName.getName();
     }
 
     /**
@@ -169,8 +169,8 @@
         int sheetIndex = getSheetIndex();
 
         //Check to ensure no other names have the same case-insensitive name
-        for (int i = 0; i < workbook.getNumberOfNames(); i++) {
-            XSSFName nm = workbook.getNameAt(i);
+        for (int i = 0; i < _workbook.getNumberOfNames(); i++) {
+            XSSFName nm = _workbook.getNameAt(i);
             if (nm != this) {
                 if(name.equalsIgnoreCase(nm.getNameName()) && sheetIndex == nm.getSheetIndex()){
                     String msg = "The "+(sheetIndex == -1 ? "workbook" : "sheet")+" already contains this name: " + name;
@@ -178,11 +178,11 @@
                }
             }
         }
-        ctName.setName(name);
+        _ctName.setName(name);
     }
 
     public String getRefersToFormula() {
-        String result = ctName.getStringValue();
+        String result = _ctName.getStringValue();
         if (result == null || result.length() < 1) {
             return null;
         }
@@ -190,11 +190,11 @@
     }
 
     public void setRefersToFormula(String formulaText) {
-        XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(workbook);
+        XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(_workbook);
         //validate through the FormulaParser
         FormulaParser.parse(formulaText, fpb, FormulaType.NAMEDRANGE, getSheetIndex());
 
-        ctName.setStringValue(formulaText);
+        _ctName.setStringValue(formulaText);
     }
 
     public boolean isDeleted(){
@@ -202,7 +202,7 @@
         if (formulaText == null) {
             return false;
         }
-        XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(workbook);
+        XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(_workbook);
         Ptg[] ptgs = FormulaParser.parse(formulaText, fpb, FormulaType.NAMEDRANGE, getSheetIndex());
         return Ptg.doesFormulaReferToDeletedCell(ptgs);
     }
@@ -213,16 +213,16 @@
      * @param index the sheet index this name applies to, -1 unsets this property making the name workbook-global
      */
     public void setSheetIndex(int index) {
-        int lastSheetIx = workbook.getNumberOfSheets() - 1;
+        int lastSheetIx = _workbook.getNumberOfSheets() - 1;
         if (index < -1 || index > lastSheetIx) {
             throw new IllegalArgumentException("Sheet index (" + index +") is out of range" +
                     (lastSheetIx == -1 ? "" : (" (0.." +    lastSheetIx + ")")));
         }
 
         if(index == -1) {
-            if(ctName.isSetLocalSheetId()) ctName.unsetLocalSheetId();
+            if(_ctName.isSetLocalSheetId()) _ctName.unsetLocalSheetId();
         } else {
-            ctName.setLocalSheetId(index);
+            _ctName.setLocalSheetId(index);
         }
     }
 
@@ -232,7 +232,7 @@
      * @return the sheet index this name applies to, -1 if this name applies to the entire workbook
      */
     public int getSheetIndex() {
-        return ctName.isSetLocalSheetId() ? (int) ctName.getLocalSheetId() : -1;
+        return _ctName.isSetLocalSheetId() ? (int) _ctName.getLocalSheetId() : -1;
     }
 
     /**
@@ -242,7 +242,7 @@
      * @param value <code>true</code> indicates the name refers to a function.
      */
     public void setFunction(boolean value) {
-        ctName.setFunction(value);
+        _ctName.setFunction(value);
     }
 
     /**
@@ -252,7 +252,7 @@
      * @return <code>true</code> indicates the name refers to a function.
      */
     public boolean getFunction() {
-        return ctName.getFunction();
+        return _ctName.getFunction();
     }
 
     /**
@@ -263,7 +263,7 @@
      * @param functionGroupId the function group index that defines the general category for the function
      */
     public void setFunctionGroupId(int functionGroupId) {
-        ctName.setFunctionGroupId(functionGroupId);
+        _ctName.setFunctionGroupId(functionGroupId);
     }
 
     /**
@@ -274,7 +274,7 @@
      * @return the function group index that defines the general category for the function
      */
     public int getFunctionGroupId() {
-        return (int) ctName.getFunctionGroupId();
+        return (int) _ctName.getFunctionGroupId();
     }
 
     /**
@@ -284,15 +284,14 @@
      * Empty string if the referenced sheet name weas not found.
      */
     public String getSheetName() {
-        if (ctName.isSetLocalSheetId()) {
+        if (_ctName.isSetLocalSheetId()) {
             // Given as explicit sheet id
-            int sheetId = (int)ctName.getLocalSheetId();
-            return workbook.getSheetName(sheetId);
-        } else {
-            String ref = getRefersToFormula();
-            AreaReference areaRef = new AreaReference(ref);
-            return areaRef.getFirstCell().getSheetName();
+            int sheetId = (int)_ctName.getLocalSheetId();
+            return _workbook.getSheetName(sheetId);
         }
+        String ref = getRefersToFormula();
+        AreaReference areaRef = new AreaReference(ref);
+        return areaRef.getFirstCell().getSheetName();
     }
 
     /**
@@ -310,7 +309,7 @@
      * @return the user comment for this named range
      */
     public String getComment() {
-        return ctName.getComment();
+        return _ctName.getComment();
     }
 
     /**
@@ -319,12 +318,12 @@
      * @param comment  the user comment for this named range
      */
     public void setComment(String comment) {
-        ctName.setComment(comment);
+        _ctName.setComment(comment);
     }
 
     @Override
     public int hashCode() {
-        return ctName.toString().hashCode();
+        return _ctName.toString().hashCode();
     }
 
     /**
@@ -343,7 +342,7 @@
         if (!(o instanceof XSSFName)) return false;
 
         XSSFName cf = (XSSFName) o;
-        return ctName.toString().equals(cf.getCTName().toString());
+        return _ctName.toString().equals(cf.getCTName().toString());
     }
 
     private static void validateName(String name){

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java Tue Aug 18 16:50:24 2009
@@ -42,7 +42,7 @@
 import org.apache.poi.openxml4j.opc.PackagingURIHelper;
 
 /**
- * 
+ *
  */
 public final class XSSFRelation extends POIXMLRelation {
 
@@ -114,28 +114,28 @@
 			"/xl/drawings/vmlDrawing#.vml",
 			null
 	);
-	
+
 	public static final XSSFRelation CUSTOM_XML_MAPPINGS = new XSSFRelation(
 			"application/xml",
 			"http://schemas.openxmlformats.org/officeDocument/2006/relationships/xmlMaps",
 			"/xl/xmlMaps.xml",
 			MapInfo.class
 	);
-	
+
 	public static final XSSFRelation SINGLE_XML_CELLS = new XSSFRelation(
 			"application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml",
 			"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableSingleCells",
 			"/tables/tableSingleCells#.xml",
 			SingleXmlCells.class
 	);
-	
+
 	public static final XSSFRelation TABLE = new XSSFRelation(
 			"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",
 			"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
 			"/tables/table#.xml",
 			Table.class
 	);
-	
+
     public static final XSSFRelation IMAGES = new XSSFRelation(
             null,
      		"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
@@ -234,7 +234,7 @@
             "/xl/calcChain.xml",
             CalculationChain.class
     );
-	
+
 
 	private XSSFRelation(String type, String rel, String defaultName, Class<? extends POIXMLDocumentPart> cls) {
         super(type, rel, defaultName, cls);
@@ -256,10 +256,9 @@
             PackagePartName relName = PackagingURIHelper.createPartName(rel.getTargetURI());
             PackagePart part = corePart.getPackage().getPart(relName);
             return part.getInputStream();
-        } else {
-        	log.log(POILogger.WARN, "No part " + _defaultName + " found");
-        	return null;
         }
+        log.log(POILogger.WARN, "No part " + _defaultName + " found");
+        return null;
 	}
 
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java Tue Aug 18 16:50:24 2009
@@ -324,14 +324,14 @@
      * Returns the plain string representation.
      */
     public String getString() {
-        if(st.sizeOfRArray() == 0) return st.getT();
-        else {
-            StringBuffer buf = new StringBuffer();
-            for(CTRElt r : st.getRArray()){
-                buf.append(r.getT());
-            }
-            return buf.toString();
+        if(st.sizeOfRArray() == 0) {
+            return st.getT();
+        }
+        StringBuffer buf = new StringBuffer();
+        for(CTRElt r : st.getRArray()){
+            buf.append(r.getT());
         }
+        return buf.toString();
     }
 
     /**

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java Tue Aug 18 16:50:24 2009
@@ -38,18 +38,18 @@
     /**
      * the xml bean containing all cell definitions for this row
      */
-    private final CTRow row;
+    private final CTRow _row;
 
     /**
      * Cells of this row keyed by their column indexes.
      * The TreeMap ensures that the cells are ordered by columnIndex in the ascending order.
      */
-    private final TreeMap<Integer, Cell> cells;
+    private final TreeMap<Integer, Cell> _cells;
 
     /**
      * the parent sheet
      */
-    private final XSSFSheet sheet;
+    private final XSSFSheet _sheet;
 
     /**
      * Construct a XSSFRow.
@@ -58,12 +58,12 @@
      * @param sheet the parent sheet.
      */
     protected XSSFRow(CTRow row, XSSFSheet sheet) {
-        this.row = row;
-        this.sheet = sheet;
-        this.cells = new TreeMap<Integer, Cell>();
+        _row = row;
+        _sheet = sheet;
+        _cells = new TreeMap<Integer, Cell>();
         for (CTCell c : row.getCArray()) {
             XSSFCell cell = new XSSFCell(this, c);
-            cells.put(cell.getColumnIndex(), cell);
+            _cells.put(cell.getColumnIndex(), cell);
             sheet.onReadCell(cell);
         }
     }
@@ -74,7 +74,7 @@
      * @return the XSSFSheet that owns this row
      */
     public XSSFSheet getSheet() {
-        return this.sheet;
+        return this._sheet;
     }
 
     /**
@@ -89,7 +89,7 @@
      * @return an iterator over cells in this row.
      */
     public Iterator<Cell> cellIterator() {
-        return cells.values().iterator();
+        return _cells.values().iterator();
     }
 
     /**
@@ -164,7 +164,7 @@
         if (type != Cell.CELL_TYPE_BLANK) {
         	xcell.setCellType(type);
         }
-        cells.put(columnIndex, xcell);
+        _cells.put(columnIndex, xcell);
         return xcell;
     }
 
@@ -175,7 +175,7 @@
      * @return the cell at the given (0 based) index
      */
     public XSSFCell getCell(int cellnum) {
-    	return getCell(cellnum, sheet.getWorkbook().getMissingCellPolicy());
+    	return getCell(cellnum, _sheet.getWorkbook().getMissingCellPolicy());
     }
 
     /**
@@ -190,7 +190,7 @@
     public XSSFCell getCell(int cellnum, MissingCellPolicy policy) {
     	if(cellnum < 0) throw new IllegalArgumentException("Cell index must be >= 0");
 
-        XSSFCell cell = (XSSFCell)cells.get(cellnum);
+        XSSFCell cell = (XSSFCell)_cells.get(cellnum);
     	if(policy == RETURN_NULL_AND_BLANK) {
     		return cell;
     	}
@@ -217,7 +217,7 @@
      *  or -1 if the row does not contain any cells.
      */
     public short getFirstCellNum() {
-    	return (short)(cells.size() == 0 ? -1 : cells.firstKey());
+    	return (short)(_cells.size() == 0 ? -1 : _cells.firstKey());
     }
 
     /**
@@ -240,7 +240,7 @@
      *   or -1 if the row does not contain any cells.
      */
     public short getLastCellNum() {
-    	return (short)(cells.size() == 0 ? -1 : (cells.lastKey() + 1));
+    	return (short)(_cells.size() == 0 ? -1 : (_cells.lastKey() + 1));
     }
 
     /**
@@ -261,11 +261,10 @@
      * @see org.apache.poi.xssf.usermodel.XSSFSheet#getDefaultRowHeightInPoints()
      */
     public float getHeightInPoints() {
-    	if (this.row.isSetHt()) {
-    		return (float) this.row.getHt();
-    	} else {
-            return sheet.getDefaultRowHeightInPoints();
+        if (this._row.isSetHt()) {
+            return (float) this._row.getHt();
         }
+        return _sheet.getDefaultRowHeightInPoints();
     }
 
     /**
@@ -275,11 +274,11 @@
      */
     public void setHeight(short height) {
         if (height == -1) {
-            if (row.isSetHt()) row.unsetHt();
-            if (row.isSetCustomHeight()) row.unsetCustomHeight();
+            if (_row.isSetHt()) _row.unsetHt();
+            if (_row.isSetCustomHeight()) _row.unsetCustomHeight();
         } else {
-            row.setHt((double) height / 20);
-            row.setCustomHeight(true);
+            _row.setHt((double) height / 20);
+            _row.setCustomHeight(true);
 
         }
     }
@@ -300,7 +299,7 @@
      * @return int representing the number of defined cells in the row.
      */
     public int getPhysicalNumberOfCells() {
-    	return cells.size();
+    	return _cells.size();
     }
 
     /**
@@ -309,7 +308,7 @@
      * @return the row number (0 based)
      */
     public int getRowNum() {
-        return (int) (row.getR() - 1);
+        return (int) (_row.getR() - 1);
     }
 
     /**
@@ -321,10 +320,10 @@
     public void setRowNum(int rowIndex) {
         int maxrow = SpreadsheetVersion.EXCEL2007.getLastRowIndex();
         if (rowIndex < 0 || rowIndex > maxrow) {
-            throw new IllegalArgumentException("Invalid row number (" + rowIndex 
+            throw new IllegalArgumentException("Invalid row number (" + rowIndex
                     + ") outside allowable range (0.." + maxrow + ")");
         }
-        row.setR(rowIndex + 1);
+        _row.setR(rowIndex + 1);
     }
 
     /**
@@ -333,7 +332,7 @@
      * @return - height is zero or not.
      */
     public boolean getZeroHeight() {
-    	return this.row.getHidden();
+    	return this._row.getHidden();
     }
 
     /**
@@ -342,7 +341,7 @@
      * @param height  height is zero or not.
      */
     public void setZeroHeight(boolean height) {
-    	this.row.setHidden(height);
+    	this._row.setHidden(height);
 
     }
 
@@ -352,7 +351,7 @@
      * @param cell the cell to remove
      */
     public void removeCell(Cell cell) {
-    	cells.remove(cell.getColumnIndex());
+    	_cells.remove(cell.getColumnIndex());
     }
 
     /**
@@ -361,7 +360,7 @@
      * @return the underlying CTRow xml bean
      */
     public CTRow getCTRow(){
-    	return row;
+    	return _row;
     }
 
     /**
@@ -372,14 +371,14 @@
      * @see org.apache.poi.xssf.usermodel.XSSFSheet#commit()
      */
     protected void onDocumentWrite(){
-        ArrayList<CTCell> cArray = new ArrayList<CTCell>(cells.size());
+        ArrayList<CTCell> cArray = new ArrayList<CTCell>(_cells.size());
         //create array of CTCell objects.
         //TreeMap's value iterator ensures that the cells are ordered by columnIndex in the ascending order
-        for (Cell cell : cells.values()) {
+        for (Cell cell : _cells.values()) {
             XSSFCell c = (XSSFCell)cell;
             cArray.add(c.getCTCell());
         }
-        row.setCArray(cArray.toArray(new CTCell[cArray.size()]));
+        _row.setCArray(cArray.toArray(new CTCell[cArray.size()]));
     }
 
     /**
@@ -387,7 +386,7 @@
      */
     @Override
     public String toString(){
-        return row.toString();
+        return _row.toString();
     }
 
     /**
@@ -397,8 +396,8 @@
      */
     protected void shift(int n) {
         int rownum = getRowNum() + n;
-        CalculationChain calcChain = sheet.getWorkbook().getCalculationChain();
-        int sheetId = (int)sheet.sheet.getSheetId();
+        CalculationChain calcChain = _sheet.getWorkbook().getCalculationChain();
+        int sheetId = (int)_sheet.sheet.getSheetId();
         for(Cell c : this){
             XSSFCell cell = (XSSFCell)c;
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Tue Aug 18 16:50:24 2009
@@ -434,8 +434,10 @@
     }
 
     public XSSFComment getCellComment(int row, int column) {
-        if (sheetComments == null) return null;
-        else return sheetComments.findCellComment(row, column);
+        if (sheetComments == null) {
+            return null;
+        }
+        return sheetComments.findCellComment(row, column);
     }
 
     public XSSFHyperlink getHyperlink(int row, int column) {
@@ -1915,9 +1917,8 @@
     	}
     	if (endLevel > startLevel) {
     		return endHidden;
-    	} else {
-    		return startHidden;
     	}
+    	return startHidden;
     }
 
     /**
@@ -1925,10 +1926,10 @@
      */
     private boolean isRowGroupCollapsed(int row) {
     	int collapseRow = findEndOfRowOutlineGroup(row) + 1;
-    	if (getRow(collapseRow) == null)
-    		return false;
-    	else
-    		return getRow(collapseRow).getCTRow().getCollapsed();
+    	if (getRow(collapseRow) == null) {
+			return false;
+		}
+    	return getRow(collapseRow).getCTRow().getCollapsed();
     }
 
     /**

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java Tue Aug 18 16:50:24 2009
@@ -89,7 +89,7 @@
                     if (o instanceof CTFtnEdnRef) {
                         CTFtnEdnRef ftn = (CTFtnEdnRef) o;
                         footnoteText.append("[").append(ftn.getId()).append(": ");
-                        XWPFFootnote footnote = 
+                        XWPFFootnote footnote =
                                 ftn.getDomNode().getLocalName().equals("footnoteReference") ?
                                         document.getFootnoteByID(ftn.getId().intValue()) :
                                         document.getEndnoteByID(ftn.getId().intValue());
@@ -582,10 +582,10 @@
         CTOnOff ct_pageBreak = ppr.isSetPageBreakBefore() ? ppr
                 .getPageBreakBefore() : null;
         if (ct_pageBreak != null
-                && ct_pageBreak.getVal().intValue() == STOnOff.INT_TRUE)
+                && ct_pageBreak.getVal().intValue() == STOnOff.INT_TRUE) {
             return true;
-        else
-            return false;
+        }
+        return false;
     }
 
     /**
@@ -934,8 +934,8 @@
             return (wordWrap.getVal() == STOnOff.ON
                     || wordWrap.getVal() == STOnOff.TRUE || wordWrap.getVal() == STOnOff.X_1) ? true
                     : false;
-        } else
-            return false;
+        }
+        return false;
     }
 
     /**

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java Tue Aug 18 16:50:24 2009
@@ -155,10 +155,10 @@
      * @return the row at the position specified or null if no rows is defined or if the position is greather than the max size of rows array
      */
     public XWPFTableRow getRow(int pos) {
-        if (pos >= 0 && pos < ctTbl.sizeOfTrArray())
+        if (pos >= 0 && pos < ctTbl.sizeOfTrArray()) {
             return new XWPFTableRow(ctTbl.getTrArray(pos));
-        else
-            return null;
+        }
+        return null;
     }
 
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java?rev=805492&r1=805491&r2=805492&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java Tue Aug 18 16:50:24 2009
@@ -44,10 +44,10 @@
     }
 
     public XWPFTableCell getCell(int pos) {
-        if (pos >= 0 && pos < ctRow.sizeOfTcArray())
+        if (pos >= 0 && pos < ctRow.sizeOfTcArray()) {
             return new XWPFTableCell(ctRow.getTcArray(pos));
-        else
-            return null;
+        }
+        return null;
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org