Skip to content

Commit

Permalink
merged with trunk r657726
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/poi/tags/REL_3_1_BETA2@657731 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Yegor Kozlov committed May 19, 2008
1 parent 28b6f4e commit 294932a
Show file tree
Hide file tree
Showing 85 changed files with 3,119 additions and 2,799 deletions.
Expand Up @@ -55,30 +55,31 @@ public class HSSFCellUtil
*/
public static HSSFRow getRow( int rowCounter, HSSFSheet sheet )
{
HSSFRow row = sheet.getRow( (short) rowCounter );
HSSFRow row = sheet.getRow( rowCounter );
if ( row == null )
{
row = sheet.createRow( (short) rowCounter );
row = sheet.createRow( rowCounter );
}

return row;
}


/**
* Get a specific cell from a row. If the cell doesn't exist, then create it.
* Get a specific cell from a row. If the cell doesn't exist,
* then create it.
*
*@param row The row that the cell is part of
*@param column The column index that the cell is in.
*@return The cell indicated by the column.
*/
public static HSSFCell getCell( HSSFRow row, int column )
{
HSSFCell cell = row.getCell( (short) column );
HSSFCell cell = row.getCell( column );

if ( cell == null )
{
cell = row.createCell( (short) column );
cell = row.createCell( (short)column );
}
return cell;
}
Expand All @@ -98,7 +99,7 @@ public static HSSFCell createCell( HSSFRow row, int column, String value, HSSFCe
{
HSSFCell cell = getCell( row, column );

cell.setCellValue( value );
cell.setCellValue(new HSSFRichTextString(value));
if ( style != null )
{
cell.setCellStyle( style );
Expand Down Expand Up @@ -222,7 +223,7 @@ public static void setCellStyleProperty( HSSFCell cell, HSSFWorkbook workbook, S
public static HSSFCell translateUnicodeValues( HSSFCell cell )
{

String s = cell.getStringCellValue();
String s = cell.getRichStringCellValue().getString();
boolean foundUnicode = false;

for ( Iterator i = unicodeMappings.entrySet().iterator(); i.hasNext(); )
Expand Down
11 changes: 11 additions & 0 deletions src/documentation/content/xdocs/changes.xml
Expand Up @@ -37,6 +37,17 @@

<!-- Don't forget to update status.xml too! -->
<release version="3.1-beta2" date="2008-05-??">
<action dev="POI-DEVELOPERS" type="fix">44306 - fixed reading/writing of AttrPtg(type=choose) and method toFormulaString() for CHOOSE formulas</action>
<action dev="POI-DEVELOPERS" type="fix">24207 - added HSSFName.isDeleted() to check if the name points to cell that no longer exists</action>
<action dev="POI-DEVELOPERS" type="fix">40414 - fixed selected/active sheet after removing sheet from workbook</action>
<action dev="POI-DEVELOPERS" type="fix">44523 - fixed workbook sheet selection and focus</action>
<action dev="POI-DEVELOPERS" type="fix">45000 - Fixed NPE in ListLevel when numberText is null</action>
<action dev="POI-DEVELOPERS" type="fix">44985 - Properly update TextSpecInfoAtom when the parent text is changed</action>
<action dev="POI-DEVELOPERS" type="fix">41187 - fixed HSSFSheet to properly read xls files without ROW records</action>
<action dev="POI-DEVELOPERS" type="fix">44950 - fixed HSSFFormulaEvaluator.evaluateInCell() and Area3DEval.getValue() also added validation for number of elements in AreaEvals</action>
<action dev="POI-DEVELOPERS" type="fix">42570 - fixed LabelRecord to use empty string instead of null when the length is zero.</action>
<action dev="POI-DEVELOPERS" type="fix">42564 - fixed ArrayPtg to use ConstantValueParser. Fixed a few other ArrayPtg encoding issues.</action>
<action dev="POI-DEVELOPERS" type="fix">Follow-on from 28754 - StringPtg.toFormulaString() should escape double quotes</action>
<action dev="POI-DEVELOPERS" type="fix">44929 - Improved error handling in HSSFWorkbook when attempting to read a BIFF5 file</action>
<action dev="POI-DEVELOPERS" type="fix">44675 - Parameter operand classes (function metadata) required to encode SUM() etc properly. Added parse validation for number of parameters</action>
<action dev="POI-DEVELOPERS" type="fix">44921 - allow Ptg.writeBytes() to be called on relative ref Ptgs (RefN* and AreaN*)</action>
Expand Down
14 changes: 13 additions & 1 deletion src/documentation/content/xdocs/hssf/quick-guide.xml
Expand Up @@ -1225,7 +1225,19 @@ Examples:
// Do something with this corner cell
}
}
</source>
</source>
<p>
Note, when a cell is deleted, Excel does not delete the attached named range.
As result, workbook can contain named ranges that point to cells that no longer exist.
You should check the validity of a reference before constructing AreaReference
</p>
<source>
if(hssfName.isDeleted()){
//named range points to a deleted cell.
} else {
AreaReference ref = new AreaReference(hssfName.getReference());
}
</source>
</section>
<anchor id="CellComments"/>
<section><title>Cell Comments</title>
Expand Down
11 changes: 11 additions & 0 deletions src/documentation/content/xdocs/status.xml
Expand Up @@ -34,6 +34,17 @@
<!-- Don't forget to update changes.xml too! -->
<changes>
<release version="3.1-beta2" date="2008-05-??">
<action dev="POI-DEVELOPERS" type="fix">44306 - fixed reading/writing of AttrPtg(type=choose) and method toFormulaString() for CHOOSE formulas</action>
<action dev="POI-DEVELOPERS" type="fix">24207 - added HSSFName.isDeleted() to check if the name points to cell that no longer exists</action>
<action dev="POI-DEVELOPERS" type="fix">40414 - fixed selected/active sheet after removing sheet from workbook</action>
<action dev="POI-DEVELOPERS" type="fix">44523 - fixed workbook sheet selection and focus</action>
<action dev="POI-DEVELOPERS" type="fix">45000 - Fixed NPE in ListLevel when numberText is null</action>
<action dev="POI-DEVELOPERS" type="fix">44985 - Properly update TextSpecInfoAtom when the parent text is changed</action>
<action dev="POI-DEVELOPERS" type="fix">41187 - fixed HSSFSheet to properly read xls files without ROW records</action>
<action dev="POI-DEVELOPERS" type="fix">44950 - fixed HSSFFormulaEvaluator.evaluateInCell() and Area3DEval.getValue() also added validation for number of elements in AreaEvals</action>
<action dev="POI-DEVELOPERS" type="fix">42570 - fixed LabelRecord to use empty string instead of null when the length is zero.</action>
<action dev="POI-DEVELOPERS" type="fix">42564 - fixed ArrayPtg to use ConstantValueParser. Fixed a few other ArrayPtg encoding issues.</action>
<action dev="POI-DEVELOPERS" type="fix">Follow-on from 28754 - StringPtg.toFormulaString() should escape double quotes</action>
<action dev="POI-DEVELOPERS" type="fix">44929 - Improved error handling in HSSFWorkbook when attempting to read a BIFF5 file</action>
<action dev="POI-DEVELOPERS" type="fix">44675 - Parameter operand classes (function metadata) required to encode SUM() etc properly. Added parse validation for number of parameters</action>
<action dev="POI-DEVELOPERS" type="fix">44921 - allow Ptg.writeBytes() to be called on relative ref Ptgs (RefN* and AreaN*)</action>
Expand Down
4 changes: 2 additions & 2 deletions src/documentation/release-guide.txt
Expand Up @@ -37,14 +37,14 @@ where $TAG is the release tag, for example, REL_3_1_BETA1
3. Checkout the tagged version
{code}
cd tags
svn checkout https://svn.apache.org/repos/asf/poi/tags/TAG
svn checkout https://svn.apache.org/repos/asf/poi/tags/$TAG
{code}

4. Merge (if required)

{code}
cd $TAG
$ svn merge https://svn.apache.org/repos/asf/poi/tags/TAG \
$ svn merge https://svn.apache.org/repos/asf/poi/tags/$TAG \
https://svn.apache.org/repos/asf/poi/trunk
{code}

Expand Down

0 comments on commit 294932a

Please sign in to comment.