Michael Kabdebo created ODFTOOLKIT-360:
------------------------------------------

             Summary: comparison of tablnames on setting data to the dataset is 
wrong and fails
                 Key: ODFTOOLKIT-360
                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-360
             Project: ODF Toolkit
          Issue Type: Bug
          Components: simple api
    Affects Versions: 0.7-incubating
            Reporter: Michael Kabdebo
            Priority: Blocker


I'm using a cell range address like this:  'TableName'.A1:'TableName.EN4' 
This is a valid format and matches the regex in the class 
CellRangeAddress.class.

In DataSet:618 you are going through a NodeList to find the table by a given 
name. The given table name has been extracted from the cell range address.

The problem: the extracted table name contains the quotes chars and no table 
will be found in this case, because: 'Tablename' != TableName


possible solution:

private boolean matchingTable(String extractedName, String tableName){
    if(extractedName != null && extractedName.startsWith("'")&& 
extractedName.endsWith("'")){
       extractedName = extractedName.substring(1, extractedName.length()-1);
     }
    if(tableName != null && tableName.startsWith("'")&& 
tableName.endsWith("'")){
        tableName = tableName.substring(1, tableName.length()-1);
    }
    return extractedName.equals(tableName);
}

--
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

Reply via email to