Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions benchmarks/NPOI.Benchmarks/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Runtime.InteropServices;

// In SDK-style projects such as this one, several assembly attributes that were historically
// defined in this file are now automatically added during build and populated with
// values defined in project properties. For details of which attributes are included
// and how to customise this process see: https://aka.ms/assembly-info-properties


// Setting ComVisible to false makes the types in this assembly not visible to COM
// components. If you need to access a type in this assembly from COM, set the ComVisible
// attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM.

[assembly: Guid("e468bef5-fc11-425b-a4a3-0ee201802090")]
12 changes: 11 additions & 1 deletion benchmarks/NPOI.Benchmarks/LargeExcelFileBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,18 @@ public void GlobalSetup()
}

[Benchmark]
public void XSSFWorkbookLoad()
public void XSSFWorkbookLoad_DisableSheetLazyLoading()
{
XSSFSheet.EnableLazyLoading = false;
var workbook = new XSSFWorkbook(_filePath, true);
workbook.Dispose();
}


[Benchmark]
public void XSSFWorkbookLoad_EnableSheetLazyLoading()
{
XSSFSheet.EnableLazyLoading = true;
var workbook = new XSSFWorkbook(_filePath, true);
workbook.Dispose();
}
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/NPOI.Benchmarks/NPOI.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>$(NoWarn);SYSLIB0014</NoWarn>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\npoi.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions ooxml/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Runtime.CompilerServices;
using System.Security;

[assembly: InternalsVisibleTo("NPOI.Benchmarks, PublicKey=002400000480000094000000060200000024000052534131000400000100010095ccd95af3b39d8bc20544d3f47fd24b53ebc5ccb693eaed116290629f8cd882c827ebd511ad59449224f0718d3f9d03b64945a6c8b6644266001b8c8426185330e3d96da70ae16d4acc21b8d4d480f1385c7e924273179375aa88f81380a72fb115712a313379d16aed4aa36208ee3b4a5dd785b06a07b2d868e3227f4495b5", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("NPOI.OOXML.TestCases, PublicKey=002400000480000094000000060200000024000052534131000400000100010095ccd95af3b39d8bc20544d3f47fd24b53ebc5ccb693eaed116290629f8cd882c827ebd511ad59449224f0718d3f9d03b64945a6c8b6644266001b8c8426185330e3d96da70ae16d4acc21b8d4d480f1385c7e924273179375aa88f81380a72fb115712a313379d16aed4aa36208ee3b4a5dd785b06a07b2d868e3227f4495b5", AllInternalsVisible = true)]
#if NETSTANDARD2_1 || NET6_0_OR_GREATER || NETSTANDARD2_0 || NET40
[assembly: AllowPartiallyTrustedCallers]
Expand Down
11 changes: 6 additions & 5 deletions ooxml/XSSF/UserModel/XSSFChartSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ limitations under the License.
using NPOI.OpenXmlFormats.Spreadsheet;
using System.IO;
using System.Xml;
using System.Collections.Generic;
using System;
using NPOI.OpenXmlFormats;
using NPOI.Util;
using NPOI.OpenXml4Net.OPC;
using NPOI.OpenXmlFormats.Dml;

namespace NPOI.XSSF.UserModel
{
Expand Down Expand Up @@ -80,25 +77,29 @@ internal override void Read(Stream is1)
*/
public CT_Chartsheet GetCTChartsheet()
{
EnsureWorksheetLoaded();
return chartsheet;
}


protected override NPOI.OpenXmlFormats.Spreadsheet.CT_Drawing GetCTDrawing()
{
EnsureWorksheetLoaded();
return chartsheet.drawing;
}


protected override NPOI.OpenXmlFormats.Spreadsheet.CT_LegacyDrawing GetCTLegacyDrawing()
{
EnsureWorksheetLoaded();
return chartsheet.legacyDrawing;
}


internal override void Write(Stream out1, bool leaveOpen=false)
internal override void Write(Stream output, bool leaveOpen=false)
{
new ChartsheetDocument(this.chartsheet).Save(out1);
EnsureWorksheetLoaded();
new ChartsheetDocument(this.chartsheet).Save(output);
}

private static byte[] blankWorksheet()
Expand Down
Loading
Loading