Bug 66855 - [PATCH] Formula parser incorrectly handles sheet name containing multiple single quotes in a row
Summary: [PATCH] Formula parser incorrectly handles sheet name containing multiple sin...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 5.3.x-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-05 17:58 UTC by Kirill Lebedev
Modified: 2023-08-18 08:54 UTC (History)
0 users



Attachments
FormulaParser.java (74.05 KB, text/x-csrc)
2023-08-05 17:58 UTC, Kirill Lebedev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill Lebedev 2023-08-05 17:58:07 UTC
Created attachment 38724 [details]
FormulaParser.java

I have a workbook with a sheet whose name contains multiple single quotes. And I ran into a problem when I try to refer to it from a formula.

I found a similar issue that was already fixed, it was about the case where the sheet name contains only one single quote, but unfortunately in my case the issue still exists.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66401

I investigated this problem and now I have a solution, please review my Pull Request with a simple fix.

Example of the problem:
Sheet name - Sh''t1 (contains two single quotes).
In the formula it will be - 'Sh''''t1'
After parsing it will become - Sh''
Comment 1 Kirill Lebedev 2023-08-05 18:44:02 UTC
Pull Request link:
https://github.com/apache/poi/pull/496
Comment 2 PJ Fanning 2023-08-18 08:54:30 UTC
PR was merged