Skip to content

Commit

Permalink
Drop needless SetCalcEngineCacheExpressions as it uses inaccessible f…
Browse files Browse the repository at this point in the history
…ield
  • Loading branch information
Pankraty committed Jul 27, 2023
1 parent 7200db5 commit 97756f6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion ClosedXML.Report/Excel/TempSheetBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ private void Init()
if (!_wb.TryGetWorksheet(SheetName, out _sheet))
{
_sheet = _wb.AddWorksheet(SheetName);
_sheet.SetCalcEngineCacheExpressions(false);
}
_sheet.Visibility = XLWorksheetVisibility.VeryHidden;
}
Expand Down
7 changes: 0 additions & 7 deletions ClosedXML.Report/Excel/XlExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,6 @@ public static IXLCell Offset(this IXLAddress addr, IXLAddress offset)
addr.ColumnNumber + offset.ColumnNumber - 1);
}

public static void SetCalcEngineCacheExpressions(this IXLWorksheet worksheet, bool value)
{
var wsType = worksheet.GetType();
var calcEngine = wsType.GetProperty("CalcEngine", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(worksheet, new object[] { });
calcEngine.GetType().GetProperty("CacheExpressions").SetValue(calcEngine, value, new object[] { });
}

/* ClosedXML issue #686 */
public static void ReplaceCFFormulaeToR1C1(this IXLWorksheet worksheet)
{
Expand Down

0 comments on commit 97756f6

Please sign in to comment.