Skip to content

Commit

Permalink
[SE] [pivot] fix bug 45567
Browse files Browse the repository at this point in the history
  • Loading branch information
SanDiegoss committed Dec 13, 2024
1 parent c24b653 commit 07c731f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cell/model/PivotTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -10123,7 +10123,7 @@ PivotFormatsManager.prototype.checkReferenceValues = function(referenceInfo, val
*/
CT_pivotTableDefinition.prototype.asc_convertNameToFormula = function(name) {
let result = '';
const reg = /^\w+$/;
const reg = new XRegExp('^[\\p{L}_][\\p{L}\\p{N}_]*$');
result = name.replace(/\'/g, "''");
if (!reg.test(result)) {
result = "'" + result + "'";
Expand Down
11 changes: 10 additions & 1 deletion common/editorscommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3860,7 +3860,16 @@
this._reset();
}
const subSTR = formula.substring(start_pos);
const reg = /^(\w+|(?:\'.+?\'(?!\')))\[(\w+|(?:\'.+?\'(?!\')))\]/;
const reg = XRegExp.build('(?x) ^({{fieldName}})\\[({{itemName}})\\]', {
'fieldName': XRegExp.build('{{simple}}|{{quotes}}', {
'simple': '[\\p{L}_][\\p{L}\\p{N}_]*',
'quotes': "\\'.+?\\'(?!\\')",
}),
'itemName': XRegExp.build('{{simple}}|{{quotes}}', {
'simple': '[\\p{L}\\p{N}_]+',
'quotes': "\\'.+?\\'(?!\\')",
})
});
const match = reg.exec(subSTR);
if (match !== null && match[1] && match[2]) {
this.operand_str = match[0];
Expand Down

0 comments on commit 07c731f

Please sign in to comment.