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
5 changes: 0 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
<Project>
<PropertyGroup>
<NuGetAuditMode>All</NuGetAuditMode>
<!-- This repository is a fork of a large third-party codebase (EPPlus). Nullable annotations
and warnings-as-errors were switched on across it by an automated governance commit
(1a8baa10), which left the branch unbuildable with 5,618 errors, almost all nullability.
Annotating the vendored source is a deliberate project of its own, not a precondition for
shipping a fix, so warnings stay warnings here. -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageVersion Include="System.Xml.XPath.XmlDocument" Version="4.7.0" />
<!-- Sample projects -->
<PackageVersion Include="Microsoft.AspNetCore.App" Version="2.2.8" />
<PackageVersion Include="System.Data.SqlClient" Version="4.9.1" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="7.1.1" />
<!-- Not referenced by any project here. Retained rather than removed, so that restoring the
build is not conflated with pruning it. -->
<PackageVersion Include="xunit.v3" Version="4.0.1" />
Expand Down
2 changes: 2 additions & 0 deletions PanoramicData.EPPlus.Test/CompoundDoc.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
锘縰sing Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Runtime.Versioning;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using OfficeOpenXml.Utils.CompundDocument;
Expand Down Expand Up @@ -163,6 +164,7 @@ public void Issue131()

package.Save();
}
[SupportedOSPlatform("windows")]
[TestMethod, Ignore]
public void Sample7EncrLargeTest()
{
Expand Down
3 changes: 3 additions & 0 deletions PanoramicData.EPPlus.Test/DTS_FailingTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
锘縰sing Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Runtime.Versioning;
using OfficeOpenXml;
using System.IO;

Expand All @@ -8,6 +9,7 @@ namespace PanoramicData.EPPlus.Test;
public class DTS_FailingTests
{

[SupportedOSPlatform("windows")]
[TestMethod]
public void DeleteWorksheetWithReferencedImage()
{
Expand All @@ -30,6 +32,7 @@ public void DeleteWorksheetWithReferencedImage()
}
}

[SupportedOSPlatform("windows")]
[TestMethod]
public void CopyAndDeleteWorksheetWithImage()
{
Expand Down
8 changes: 8 additions & 0 deletions PanoramicData.EPPlus.Test/DrawingTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
锘縰sing EPPlusTest.Properties;
using System.Runtime.Versioning;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OfficeOpenXml;
using OfficeOpenXml.Drawing;
Expand All @@ -15,6 +16,7 @@ namespace PanoramicData.EPPlus.Test;
[TestClass]
public class DrawingTest : TestBase
{
[SupportedOSPlatform("windows")]
[TestMethod]
public void RunDrawingTests()
{
Expand Down Expand Up @@ -59,6 +61,7 @@ public void ReadDrawing()
Assert.AreEqual(cht.Title.Text, "Test");
}

[SupportedOSPlatform("windows")]
public void Picture()
{
var ws = _pck.Workbook.Worksheets.Add("Picture");
Expand Down Expand Up @@ -109,6 +112,7 @@ public void Picture()
}
//[TestMethod]
//[Ignore]
[SupportedOSPlatform("windows")]
public void DrawingSizingAndPositioning()
{
var ws = _pck.Workbook.Worksheets.Add("DrawingPosSize");
Expand Down Expand Up @@ -251,6 +255,7 @@ public void PieChart3D()
}
//[TestMethod]
//[Ignore]
[SupportedOSPlatform("windows")]
public void Scatter()
{
var ws = _pck.Workbook.Worksheets.Add("Scatter");
Expand Down Expand Up @@ -570,6 +575,7 @@ public void LineMarker()
}
//[TestMethod]
//[Ignore]
[SupportedOSPlatform("windows")]
public void Drawings()
{
var ws = _pck.Workbook.Worksheets.Add("Shapes");
Expand Down Expand Up @@ -755,6 +761,7 @@ public void MultiChartSeries()
}
//[TestMethod]
//[Ignore]
[SupportedOSPlatform("windows")]
public void DeleteDrawing()
{
var ws = _pck.Workbook.Worksheets.Add("DeleteDrawing1");
Expand Down Expand Up @@ -952,6 +959,7 @@ public void AllDrawingsInsideMarkupCompatibility()
// Cleanup:
File.Delete(savedPath);
}
[SupportedOSPlatform("windows")]
public void DrawingRowheightDynamic()
{
var ws = _pck.Workbook.Worksheets.Add("PicResize");
Expand Down
10 changes: 10 additions & 0 deletions PanoramicData.EPPlus.Test/Issues.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
锘縰sing Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Runtime.Versioning;
using OfficeOpenXml;
using OfficeOpenXml.Drawing;
using OfficeOpenXml.Drawing.Chart;
Expand Down Expand Up @@ -72,6 +73,7 @@ public void Issue15031()
ws.Cells["A1"].Style.Numberformat.Format = "[t]:mm:ss";
ws.Dispose();
}
[SupportedOSPlatform("windows")]
[TestMethod]
public void Issue15022()
{
Expand Down Expand Up @@ -433,6 +435,7 @@ public void Issue15174()

package.SaveAs(new FileInfo(@"C:\temp\bug\MyTemplate2.xlsx"));
}
[SupportedOSPlatform("windows")]
[Ignore]
[TestMethod]
public void PictureIssue()
Expand Down Expand Up @@ -690,6 +693,7 @@ public void Issue15234()
}
[TestMethod]
/**** Pivottable issue ****/
[SupportedOSPlatform("windows")]
public void Issue()
{
DirectoryInfo outputDir = new(@"c:\ExcelPivotTest");
Expand All @@ -699,6 +703,7 @@ public void Issue()
BuildPivotTable2(MyFile);
}

[SupportedOSPlatform("windows")]
private static void LoadData(FileInfo MyFile)
{
if (MyFile.Exists)
Expand Down Expand Up @@ -1474,6 +1479,7 @@ public void Issue_8()


}
[SupportedOSPlatform("windows")]
[TestMethod, Ignore]
public void Issuer27()
{
Expand Down Expand Up @@ -1739,6 +1745,7 @@ public void Issue70()
workbook.SaveAs(new FileInfo(outputPath));
}

[SupportedOSPlatform("windows")]
[TestMethod, Ignore]
public void Issue100()
{
Expand Down Expand Up @@ -1852,6 +1859,7 @@ public void Issue181()
var a = pck.Workbook.Properties.Author;
pck.SaveAs(new FileInfo($@"C:\temp\bug\issue181-saved.xlsx"));
}
[SupportedOSPlatform("windows")]
[TestMethod, Ignore]
public void Issue10()
{
Expand Down Expand Up @@ -2042,6 +2050,7 @@ public void Issue236()
_pck.Workbook.Worksheets["Sheet1"].Cells[7, 10].AddComment("test", "Author");
SaveWorksheet("Issue236-Saved.xlsx");
}
[SupportedOSPlatform("windows")]
[TestMethod]
public void Issue228()
{
Expand Down Expand Up @@ -2199,6 +2208,7 @@ public void Issue333()

Assert.AreEqual("2019-03-07", ws.Cells["A1"].Text);
}
[SupportedOSPlatform("windows")]
[TestMethod]
public void Issue445()
{
Expand Down
4 changes: 3 additions & 1 deletion PanoramicData.EPPlus.Test/PanoramicData.EPPlus.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<SignAssembly>False</SignAssembly>
<AssemblyOriginatorKeyFile></AssemblyOriginatorKeyFile>
<Description>Package Description</Description>
<Nullable>enable</Nullable>
<!-- Vendored EPPlus code, never fully annotated: keep the annotations, drop the nullable warnings. -->
<Nullable>annotations</Nullable>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
10 changes: 10 additions & 0 deletions PanoramicData.EPPlus.Test/WorkSheetTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
锘縰sing Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Runtime.Versioning;
using OfficeOpenXml;
using OfficeOpenXml.Drawing;
using OfficeOpenXml.Drawing.Chart;
Expand Down Expand Up @@ -34,6 +35,7 @@ internal class InhItem : BaseItem
[TestClass]
public class WorkSheetTest : TestBase
{
[SupportedOSPlatform("windows")]
[TestMethod]
public void RunWorksheetTests()
{
Expand Down Expand Up @@ -402,6 +404,7 @@ public void ReadStreamSaveAsStream()
// Use ClassCleanup to run code after all tests in a class have run
//[Ignore]
//[TestMethod]
[SupportedOSPlatform("windows")]
public void LoadData()
{
var ws = _pck.Workbook.Worksheets.Add("newsheet");
Expand Down Expand Up @@ -1137,6 +1140,7 @@ public void FormulaArray()
}
//[Ignore]
//[TestMethod]
[SupportedOSPlatform("windows")]
public void PictureURL()
{
var ws = _pck.Workbook.Worksheets.Add("Pic URL");
Expand Down Expand Up @@ -1875,6 +1879,7 @@ public void DefColWidthBug()
// return pkg

}
[SupportedOSPlatform("windows")]
[Ignore]
[TestMethod]
public void CloseProblem()
Expand Down Expand Up @@ -2250,6 +2255,7 @@ public void CreatePivotMultData()
pck.Save();
}
//[Ignore]
[SupportedOSPlatform("windows")]
[TestMethod]
public void SetBackground()
{
Expand All @@ -2260,6 +2266,7 @@ public void SetBackground()
ws.BackgroundImage.SetFromFile(new FileInfo(Path.Combine(_clipartPath, "Vector Drawing.wmf")));
}
//[Ignore]
[SupportedOSPlatform("windows")]
[TestMethod]
public void SetHeaderFooterImage()
{
Expand Down Expand Up @@ -2293,6 +2300,7 @@ public void SetHeaderFooterImage()
}
//[Ignore]
//[TestMethod]
[SupportedOSPlatform("windows")]
public void NamedStyles()
{
var wsSheet = _pck.Workbook.Worksheets.Add("NamedStyles");
Expand Down Expand Up @@ -2413,6 +2421,7 @@ public void BuildInStyles()
}
//[Ignore]
//[TestMethod]
[SupportedOSPlatform("windows")]
public void AutoFitColumns()
{
var ws = _pck.Workbook.Worksheets.Add("Autofit");
Expand Down Expand Up @@ -2868,6 +2877,7 @@ public void SaveToStream()
excelPackage.Save();
var s = stream.ToArray();
}
[SupportedOSPlatform("windows")]
[TestMethod, Ignore]
public void ColumnsTest()
{
Expand Down
2 changes: 2 additions & 0 deletions PanoramicData.EPPlus/Compatibility/ImageCompat.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
锘縰sing System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.Versioning;

namespace OfficeOpenXml.Compatibility;

[SupportedOSPlatform("windows")]
internal class ImageCompat
{
internal static byte[] GetImageAsByteArray(Image image)
Expand Down
5 changes: 5 additions & 0 deletions PanoramicData.EPPlus/Drawing/ExcelDrawings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
using System.Drawing;
using System.IO;
using System.Xml;
using System.Runtime.Versioning;

namespace OfficeOpenXml.Drawing;

Expand Down Expand Up @@ -247,6 +248,7 @@ eChartType.StockOHLC or
/// <param name="Name"></param>
/// <param name="image">An image. Always saved in then JPeg format</param>
/// <returns></returns>
[SupportedOSPlatform("windows")]
public ExcelPicture AddPicture(string Name, Image image) => AddPicture(Name, image, null);
/// <summary>
/// Add a picture to the worksheet
Expand All @@ -255,6 +257,7 @@ eChartType.StockOHLC or
/// <param name="image">An image. Always saved in then JPeg format</param>
/// <param name="Hyperlink">Picture hyperlink</param>
/// <returns></returns>
[SupportedOSPlatform("windows")]
public ExcelPicture AddPicture(string Name, Image image, Uri Hyperlink)
{
if (image != null)
Expand Down Expand Up @@ -283,6 +286,7 @@ public ExcelPicture AddPicture(string Name, Image image, Uri Hyperlink)
/// <param name="Name"></param>
/// <param name="ImageFile">The image file</param>
/// <returns></returns>
[SupportedOSPlatform("windows")]
public ExcelPicture AddPicture(string Name, FileInfo ImageFile) => AddPicture(Name, ImageFile, null);
/// <summary>
/// Add a picure to the worksheet
Expand All @@ -291,6 +295,7 @@ public ExcelPicture AddPicture(string Name, Image image, Uri Hyperlink)
/// <param name="ImageFile">The image file</param>
/// <param name="Hyperlink">Picture Hyperlink</param>
/// <returns></returns>
[SupportedOSPlatform("windows")]
public ExcelPicture AddPicture(string Name, FileInfo ImageFile, Uri Hyperlink)
{
if (Worksheet is ExcelChartsheet && _drawings.Count > 0)
Expand Down
Loading