From 97756f615756963591642ea9e5b441e5fcf08350 Mon Sep 17 00:00:00 2001 From: Aleksei Date: Thu, 27 Jul 2023 23:35:53 +0400 Subject: [PATCH] Drop needless SetCalcEngineCacheExpressions as it uses inaccessible field --- ClosedXML.Report/Excel/TempSheetBuffer.cs | 1 - ClosedXML.Report/Excel/XlExtensions.cs | 7 ------- 2 files changed, 8 deletions(-) diff --git a/ClosedXML.Report/Excel/TempSheetBuffer.cs b/ClosedXML.Report/Excel/TempSheetBuffer.cs index 53e6a1c..173a004 100644 --- a/ClosedXML.Report/Excel/TempSheetBuffer.cs +++ b/ClosedXML.Report/Excel/TempSheetBuffer.cs @@ -33,7 +33,6 @@ private void Init() if (!_wb.TryGetWorksheet(SheetName, out _sheet)) { _sheet = _wb.AddWorksheet(SheetName); - _sheet.SetCalcEngineCacheExpressions(false); } _sheet.Visibility = XLWorksheetVisibility.VeryHidden; } diff --git a/ClosedXML.Report/Excel/XlExtensions.cs b/ClosedXML.Report/Excel/XlExtensions.cs index b6c6a2d..90e7115 100644 --- a/ClosedXML.Report/Excel/XlExtensions.cs +++ b/ClosedXML.Report/Excel/XlExtensions.cs @@ -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) {