Skip to content

Commit

Permalink
Merge pull request #1214 from TimLee88/T2
Browse files Browse the repository at this point in the history
Update XSSFRowColShifter.cs
  • Loading branch information
tonyqus authored Nov 19, 2023
2 parents ec269eb + e9ae2d1 commit f1ecc1e
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions ooxml/XSSF/UserModel/Helpers/XSSFRowColShifter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,26 @@ public static void UpdateRowFormulas(IRow row, FormulaShifter Shifter)
int si = (int)f.si;
CT_CellFormula sf = sheet.GetSharedFormula(si);
sf.Value = ShiftedFormula;
UpdateRefInCTCellFormula(row, Shifter, sf);
}
}
}

if (f.isSetRef())
{ //Range of cells which the formula applies to.
string ref1 = f.@ref;
string ShiftedRef = ShiftFormula(row, ref1, Shifter);
if (ShiftedRef != null)
{
f.@ref = ShiftedRef;
}
//Range of cells which the formula applies to.
UpdateRefInCTCellFormula(row, Shifter, f);
}
}
}


private static void UpdateRefInCTCellFormula(IRow row, FormulaShifter Shifter, CT_CellFormula f)
{
if (f.isSetRef())
{
string ref1 = f.@ref;
string shiftedRef = ShiftFormula(row, ref1, Shifter);
if (shiftedRef != null) f.@ref = shiftedRef;
}
}

/// <summary>
Expand Down

0 comments on commit f1ecc1e

Please sign in to comment.