Bug 63998 - [PATCH] Support commas, exclamation marks correctly in AreaReference
Summary: [PATCH] Support commas, exclamation marks correctly in AreaReference
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 4.1.x-dev
Hardware: Macintosh All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2019-12-11 16:05 UTC by hzwhuang
Modified: 2020-01-09 21:20 UTC (History)
1 user (show)



Attachments
Proposed patch to fix this issue (11.29 KB, patch)
2020-01-03 11:01 UTC, hzwhuang
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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