Bug 63998

Summary: [PATCH] Support commas, exclamation marks correctly in AreaReference
Product: POI Reporter: hzwhuang
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: hzwhuang
Priority: P2 Keywords: PatchAvailable
Version: 4.1.x-dev   
Target Milestone: ---   
Hardware: Macintosh   
OS: All   
Attachments: Proposed patch to fix this issue

Description hzwhuang 2019-12-11 16:05:33 UTC
Functions in this class are not aware of special characters such as exclamation mark ! and comma , at all.

AreaReference.generateContiguous and AreaReference.isContiguous are implemented naively in this sense, which is simply looking for commas as delimiters.


References like these are all valid, but they'll fail unit tests:

'A,Sheet'!$A$1:$A$1
'!and,Sheet'!$A$1:$A$1

The first one fails AreaReference.generateContiguous, and the second one also fails AreaReference.isContiguous

Sheet name is quoted with single quotation marks (luckily enough, it seems Excel doesn't allow escaping single quotation marks)


This bug exists in the latest trunk code
Comment 1 hzwhuang 2020-01-03 11:01:43 UTC
Created attachment 36947 [details]
Proposed patch to fix this issue
Comment 2 PJ Fanning 2020-01-09 21:20:21 UTC
Patch applied with https://svn.apache.org/repos/asf/poi/trunk@1872567 - thanks