incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "orgoo (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ODFTOOLKIT-364) cell range only has one cell will throw array index out of bound exception
Date Wed, 08 May 2013 10:47:16 GMT

     [ https://issues.apache.org/jira/browse/ODFTOOLKIT-364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

orgoo updated ODFTOOLKIT-364:
-----------------------------

    Environment: windows7, simple-ods 0.5  (was: windows7)
    
> cell range only has one cell will throw array index out of bound exception
> --------------------------------------------------------------------------
>
>                 Key: ODFTOOLKIT-364
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-364
>             Project: ODF Toolkit
>          Issue Type: Bug
>          Components: simple api
>    Affects Versions: 0.5-incubating
>         Environment: windows7, simple-ods 0.5
>            Reporter: orgoo
>
> for class "Table" : 
> public CellRange getCellRangeByName(String name) {
> 		NodeList nameRanges;
> 		try {
> 			nameRanges = mTableElement.getOwnerDocument().getElementsByTagNameNS(OdfDocumentNamespace.TABLE.getUri(),
> 					"named-range");
> 			for (int i = 0; i < nameRanges.getLength(); i++) {
> 				TableNamedRangeElement nameRange = (TableNamedRangeElement) nameRanges.item(i);
> 				if (nameRange.getTableNameAttribute().equals(name)) {
> 					String cellRange = nameRange.getTableCellRangeAddressAttribute();
> 					String[] addresses = cellRange.split(":");
> 					return getCellRangeByPosition(addresses[0], addresses[1]);
> 				}
> 			}
> 		} catch (Exception e) {
> 			Logger.getLogger(Table.class.getName()).log(Level.SEVERE, e.getMessage(), e);
> 		}
> 		return null;
> 	}
> if this cell range only has one cell, then : 
> String cellRange = nameRange.getTableCellRangeAddressAttribute();
> String[] addresses = cellRange.split(":");
> return getCellRangeByPosition(addresses[0], addresses[1]);
> will throw exception because String[] addresses only has addresses[0].

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message