Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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