File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ export class RangeAdapter implements CommandHandler<CoreCommand> {
357357 let sheetName : string = "" ;
358358 if ( prefixSheet ) {
359359 if ( rangeImpl . invalidSheetName ) {
360- sheetName = rangeImpl . invalidSheetName ;
360+ sheetName = getCanonicalSheetName ( rangeImpl . invalidSheetName ) ;
361361 } else {
362362 sheetName = getCanonicalSheetName ( this . getters . getSheetName ( rangeImpl . sheetId ) ) ;
363363 }
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ describe("Migrations", () => {
287287
288288 const cfs = data . sheets [ 1 ] . conditionalFormats ;
289289 const rule1 = cfs [ 0 ] . rule as ColorScaleRule ;
290- expect ( cfs [ 0 ] . ranges ) . toEqual ( [ "=sheetName_!A1:A2" ] ) ;
290+ expect ( cfs [ 0 ] . ranges ) . toEqual ( [ "' =sheetName_' !A1:A2" ] ) ;
291291 expect ( rule1 . minimum . value ) . toEqual ( "=sheetName_!B1" ) ;
292292 expect ( rule1 . midpoint ?. value ) . toEqual ( "=sheetName_!B1" ) ;
293293 expect ( rule1 . maximum . value ) . toEqual ( "=sheetName_!B1" ) ;
@@ -298,7 +298,7 @@ describe("Migrations", () => {
298298 expect ( rule2 . upperInflectionPoint . value ) . toEqual ( "=sheetName_!B1" ) ;
299299
300300 const rule3 = cfs [ 2 ] . rule as ColorScaleRule ;
301- expect ( cfs [ 2 ] . ranges ) . toEqual ( [ "=sheetName_!A1:A2" ] ) ;
301+ expect ( cfs [ 2 ] . ranges ) . toEqual ( [ "' =sheetName_' !A1:A2" ] ) ;
302302 expect ( rule3 . minimum . value ) . toEqual ( "33" ) ;
303303 expect ( rule3 . midpoint ?. value ) . toEqual ( "13" ) ;
304304 expect ( rule3 . maximum . value ) . toBeUndefined ( ) ;
Original file line number Diff line number Diff line change @@ -551,11 +551,16 @@ describe("range plugin", () => {
551551 }
552552 ) ;
553553
554+ test ( "invalid sheet name with special character" , ( ) => {
555+ const range = m . getters . getRangeFromSheetXC ( "s1" , "'Invalid Sheet Name'!A1" ) ;
556+ expect ( m . getters . getRangeString ( range , "s1" ) ) . toBe ( "'Invalid Sheet Name'!A1" ) ;
557+ } ) ;
558+
554559 test . each ( [
555560 [ "s1!!!A1:A9" , "'s1!!'!A1:A9" ] ,
556561 [ "'s1!!'!A1:A9" , "'s1!!'!A1:A9" ] ,
557- [ "s1!!!A1:s1!!!A9" , "s1!!!A1:s1!!!A9" ] ,
558- [ "s1!!!A1:s1!!!A9" , "s1!!!A1:s1!!!A9" ] ,
562+ [ "s1!!!A1:s1!!!A9" , "' s1!!!A1:s1!!' !A9" ] ,
563+ [ "s1!!!A1:s1!!!A9" , "' s1!!!A1:s1!!' !A9" ] ,
559564 ] ) (
560565 "xc with more than one exclamation mark does not throw error" ,
561566 ( rangeString , expectedString ) => {
You can’t perform that action at this time.
0 commit comments