Skip to content

Commit

Permalink
Some more tweeks for #1748
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKallman committed Dec 10, 2024
1 parent bd1c731 commit a595d2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/EPPlus/ExcelCellBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ internal static string UpdateFormulaReferences(string formula, int rowIncrement,

if (address == null || (!address.IsValidRowCol() && address.IsName==false))
{
if(i > 0 && GetPrevToken(tokens,i)==")") //Previous token is a function, add the colon.
if(i > 0 && t.TokenType==TokenType.Operator && t.Value==":" && GetPrevToken(tokens,i).TokenType==TokenType.ClosingParenthesis) //Previous token is a function, add the colon.
{
f += t.Value;
}
Expand Down Expand Up @@ -1125,10 +1125,10 @@ internal static string UpdateFormulaReferences(string formula, int rowIncrement,
}
}

private static string GetPrevToken(IList<Token> tokens, int i)
private static Token GetPrevToken(IList<Token> tokens, int i)
{
while (i > 0 && tokens[--i].TokenType == TokenType.WhiteSpace);
return tokens[i].Value;
return tokens[i];
}

private static ExcelAddressBase GetFullAddressFromToken(IList<Token> tokens, ref int i)
Expand Down

0 comments on commit a595d2d

Please sign in to comment.