Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c56d90c
standalones inconclusive remote pass local
OssianEPPlus Sep 22, 2026
5ecece8
Fixed text centering and Pie shape being strange
OssianEPPlus Sep 23, 2026
823e2eb
Fixed Doubled Top Margin on shapes
OssianEPPlus Sep 23, 2026
3d10ad5
Added class names as identifiers
OssianEPPlus Sep 23, 2026
dd07c12
Grouped up TickMarks and GridLines
OssianEPPlus Sep 23, 2026
c5720be
Added organizational groups for multiple chart items
OssianEPPlus Sep 23, 2026
55e8f61
Removed unnecsary comments
OssianEPPlus Sep 23, 2026
2dfd327
Added settings for running Test Explorer in Docker Desktop
OssianEPPlus Sep 28, 2026
8aad8fc
Merge branch 'develop9' into fix/remote-docker-debugging
OssianEPPlus Sep 28, 2026
6ece25e
Merge branch 'bug/i2541' into fix/remote-docker-debugging
OssianEPPlus Sep 28, 2026
cb08ce3
Fixed Infinte Loop on linux in Resources.Designer
OssianEPPlus Sep 28, 2026
e9b48fc
Fixed more infinte loops
OssianEPPlus Sep 28, 2026
5cdcb42
More instances of path directory char
OssianEPPlus Sep 28, 2026
17f6dee
More of the same path issue
OssianEPPlus Sep 28, 2026
cb065d4
:Merge branch 'develop9' into fix/remote-docker-debugging
OssianEPPlus Sep 28, 2026
ef136f1
Merge with dev9
OssianEPPlus Sep 28, 2026
2a04bcd
Other area with path issue
OssianEPPlus Sep 28, 2026
b979581
Path issue CF_ColorScale
OssianEPPlus Sep 28, 2026
c2d69b5
Path issue databarTests
OssianEPPlus Sep 28, 2026
0c85f7a
path issue IconSetTests
OssianEPPlus Sep 28, 2026
8beac8c
More path issues + culture "us-en" to "en" issue
OssianEPPlus Sep 28, 2026
9bd2d96
File directory issue + extra
OssianEPPlus Sep 28, 2026
7f47c31
Fixed several NewLine diffs
OssianEPPlus Sep 28, 2026
70653e3
Fixed GetRelativeFile DirectorySeparator
OssianEPPlus Sep 28, 2026
032313a
Add path handlings
OssianEPPlus Sep 29, 2026
b10ef15
Solved copy picture links + newLines
OssianEPPlus Sep 29, 2026
500983f
Fixed HTML getsinglepage line endings
OssianEPPlus Sep 29, 2026
ae8513c
Ensured windows test not run on windows + dirChar
OssianEPPlus Sep 29, 2026
41be711
Fixed HTML formatting Oopsie
OssianEPPlus Sep 29, 2026
7ab9cd4
Merge branch 'develop9' into fix/remote-docker-debugging
OssianEPPlus Sep 29, 2026
8d13a6e
Removed merge mistake
OssianEPPlus Sep 30, 2026
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
2 changes: 1 addition & 1 deletion src/EPPlus.DrawingRenderer.Tests/Shape/ShapeToSvgTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void Rect()
d.TextAlignment = OfficeOpenXml.Drawing.eTextAlignment.Left;
d.TextAnchoring = OfficeOpenXml.Drawing.eTextAnchoringType.Bottom;
var svg = d.ToSvg();
SaveTextFileToWorkbook("svg\\rect.svg", svg);
SaveTextFileToWorkbook("svg/rect.svg", svg);
SaveAndCleanup(p);
}
}
Expand Down
13 changes: 9 additions & 4 deletions src/EPPlus/Drawing/ExcelPicture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,15 @@ internal ExcelPicture(ExcelDrawings drawings, XmlNode node, ExcelGroupShape shap
{
container.RelPic = LinkedImageRel;
Image = new ExcelImage(this);
//Path.Combine automatically fixes things like "\\" to linux appropriate paths if in linux
//var fixedPath = Path.Combine(new string[] { Path.GetFullPath(LinkedImageRel.TargetUri.GetComponents), "" });
var fullPath = Path.GetFullPath(LinkedImageRel.TargetUri.LocalPath);
FileInfo ImageFile = new FileInfo(fullPath);

var intendedPath = LinkedImageRel.TargetUri.OriginalString;
//var localPathOSAgnostic = LinkedImageRel.TargetUri.LocalPath.Replace(@"\\", @"/");
if (intendedPath.StartsWith("file:///"))
{
intendedPath = intendedPath.Substring("file:///".Length);
}
FileInfo ImageFile = new FileInfo(intendedPath);

LoadImageLinked(ImageFile);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Date Author Change
using System.IO;
using System.Linq;
using System.Runtime;
using System.Xml;
using static OfficeOpenXml.Export.HtmlExport.ColumnDataTypeManager;

namespace OfficeOpenXml.Export.HtmlExport.Exporters.Internal
Expand Down Expand Up @@ -868,5 +869,17 @@ public void AddTableDataFromCell(ExcelRangeBase cell, string dataType, HTMLEleme
contentElement.Content = ValueToTextHandler.GetFormattedText(cell.Value, cell.Worksheet.Workbook, cell.StyleID, false, settings.Culture);
}
}

internal string FormatHtmlCssLineEnding(string htmlDocument, string html, string css)
{
if (htmlDocument.Contains("{2}"))
{
return string.Format(htmlDocument, html, css, Environment.NewLine);
}
else
{
return string.Format(htmlDocument, html, css);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ public async Task RenderHtmlAsync(Stream stream, int rangeIndex, Action<ExcelHtm
public async Task<string> GetSinglePageAsync(string htmlDocument = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<style type=\"text/css\">\r\n{1}</style></head>\r\n<body>\r\n{0}\r\n</body>\r\n</html>")
{
if (Settings.Minify) htmlDocument = htmlDocument.Replace("\r\n", "");
if (Settings.Minify) htmlDocument = htmlDocument.Replace("{2}", "");
var html = await GetHtmlStringAsync();
var cssExporter = HtmlExporterFactory.CreateCssExporterAsync(_settings, _ranges, _exporterContext);
var css = await cssExporter.GetCssStringAsync();
return string.Format(htmlDocument, html, css);
return FormatHtmlCssLineEnding(htmlDocument, html, css);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ public void RenderHtml(Stream stream, int rangeIndex, Action<ExcelHtmlOverrideEx
public string GetSinglePage(string htmlDocument = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<style type=\"text/css\">\r\n{1}</style></head>\r\n<body>\r\n{0}\r\n</body>\r\n</html>")
{
if (Settings.Minify) htmlDocument = htmlDocument.Replace("\r\n", "");
if (Settings.Minify) htmlDocument = htmlDocument.Replace("{2}", "");
var html = GetHtmlString();
var exporter = HtmlExporterFactory.CreateCssExporterSync(_settings, _ranges, _exporterContext);
var css = exporter.GetCssString();
return string.Format(htmlDocument, html, css);
return FormatHtmlCssLineEnding(htmlDocument, html, css);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ public async Task RenderHtmlAsync(Stream stream)
public async Task<string> GetSinglePageAsync(string htmlDocument = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<style type=\"text/css\">\r\n{1}</style></head>\r\n<body>\r\n{0}</body>\r\n</html>")
{
if (Settings.Minify) htmlDocument = htmlDocument.Replace("\r\n", "");
if (Settings.Minify) htmlDocument = htmlDocument.Replace("{2}", "");
var html = await GetHtmlStringAsync();
var cssExporter = HtmlExporterFactory.CreateCssExporterTableAsync(_tableExportSettings, _table, _exporterContext);
var css = await cssExporter.GetCssStringAsync();
return string.Format(htmlDocument, html, css);
return FormatHtmlCssLineEnding(htmlDocument, html, css);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public void RenderHtml(Stream stream)
public string GetSinglePage(string htmlDocument = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<style type=\"text/css\">\r\n{1}</style></head>\r\n<body>\r\n{0}</body>\r\n</html>")
{
if (Settings.Minify) htmlDocument = htmlDocument.Replace("\r\n", "");
if (Settings.Minify) htmlDocument = htmlDocument.Replace("{2}", "");
var html = GetHtmlString();
var cssExporter = HtmlExporterFactory.CreateCssExporterTableSync(_tableExportSettings, _table, _exporterContext);
var css = cssExporter.GetCssString();
return string.Format(htmlDocument, html, css);

return FormatHtmlCssLineEnding(htmlDocument, html, css);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public interface IExcelHtmlRangeExporter
/// </summary>
/// <param name="htmlDocument">The html string where to insert the html and the css. The Html will be inserted in string parameter {0} and the Css will be inserted in parameter {1}.</param>
/// <returns>The html document</returns>
string GetSinglePage(string htmlDocument = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<style type=\"text/css\">\r\n{1}</style></head>\r\n<body>\r\n{0}\r\n</body>\r\n</html>");
string GetSinglePage(string htmlDocument = "<!DOCTYPE html>{2}<html>{2}<head>{2}<style type=\"text/css\">{2}{1}</style></head>{2}<body>{2}{0}{2}</body>{2}</html>");

/// <summary>
/// Exports an <see cref="ExcelTable"/> to a html string
Expand Down Expand Up @@ -163,7 +163,7 @@ public interface IExcelHtmlRangeExporter
/// </summary>
/// <param name="htmlDocument">The html string where to insert the html and the css. The Html will be inserted in string parameter {0} and the Css will be inserted in parameter {1}.</param>
/// <returns>The html document</returns>
Task<string> GetSinglePageAsync(string htmlDocument = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<style type=\"text/css\">\r\n{1}</style></head>\r\n<body>\r\n{0}\r\n</body>\r\n</html>");
Task<string> GetSinglePageAsync(string htmlDocument = "<!DOCTYPE html>{2}<html>{2}<head>{2}<style type=\"text/css\">{2}{1}</style></head>{2}<body>{2}{0}{2}</body>{2}</html>");

/// <summary>
/// Exports the css part of an <see cref="ExcelTable"/> to a html string
Expand Down
4 changes: 2 additions & 2 deletions src/EPPlusTest/Core/LoadSaveTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ public void SaveToText_VerifyWithApostrophes()
}

//Assert
var expectedText = "\"dog 1\"\"\"\"\"\"\",\"dog 2\"\"\"\"\"\"\",\"dog 3\"\"\"\"\"\"\"\r\n"
+ "\"cat 1\",\"cat 2\",\"cat 3\"\"\"\"\"\r\n"
var expectedText = $"\"dog 1\"\"\"\"\"\"\",\"dog 2\"\"\"\"\"\"\",\"dog 3\"\"\"\"\"\"\"{Environment.NewLine}"
+ $"\"cat 1\",\"cat 2\",\"cat 3\"\"\"\"\"{Environment.NewLine}"
+ "\"mouse 1\"\"\"\"\",\"mouse 2\"\"\"\"\",\"mouse 3\"\"\"\"\"";

Assert.AreEqual(expectedText, result);
Expand Down
2 changes: 1 addition & 1 deletion src/EPPlusTest/Core/Range/RangeToTextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ public void ToTextHandleRichTextCells()
var text = ws.Cells["A1:A2"].ToText();

//Assert
Assert.AreEqual("RichText 1\r\nRichText 2", text);
Assert.AreEqual($"RichText 1{Environment.NewLine}RichText 2", text);
Assert.AreEqual(3, ws.Cells["A2"].RichText.Count);
Assert.AreEqual(Color.Red.ToArgb(), ws.Cells["A2"].RichText[1].Color.ToArgb());
}
Expand Down
8 changes: 4 additions & 4 deletions src/EPPlusTest/Drawing/PictureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void AddPictureWithIllegalCharsShouldFail()
{
var sheet = package.Workbook.Worksheets.Add("emptyWS");

var pic = sheet.Drawings.AddPicture("ImageName", "testafhkai/[/\\|stuff", PictureLocation.Link);
var pic = sheet.Drawings.AddPicture("ImageName", "testafhkai/[/\\|stuff'\0'", PictureLocation.Link);

SaveAndCleanup(package);
}
Expand All @@ -200,7 +200,7 @@ public void AddPictureWithFaultyPathShouldFail()
{
var sheet = package.Workbook.Worksheets.Add("emptyWS");

var pic = sheet.Drawings.AddPicture("ImageName", "C:\\temp\\\test???", PictureLocation.Link);
var pic = sheet.Drawings.AddPicture("ImageName", "C:\\temp\\\test???'\0'", PictureLocation.Link);

SaveAndCleanup(package);
}
Expand All @@ -214,7 +214,7 @@ public void AddPictureWithFaultyPathShouldFail2()
{
var sheet = package.Workbook.Worksheets.Add("emptyWS");

var pic = sheet.Drawings.AddPicture("ImageName", "C:\\temp\\test???", PictureLocation.Link);
var pic = sheet.Drawings.AddPicture("ImageName", "C:\\temp\\test???'\0'", PictureLocation.Link);

SaveAndCleanup(package);
}
Expand All @@ -228,7 +228,7 @@ public void AddPictureWithIllegalCharsAndHyperlinkShouldFail()
{
var sheet = package.Workbook.Worksheets.Add("emptyWS");

var pic = sheet.Drawings.AddPicture("ImageName", "testafhkai/[/\\|stuff", new ExcelHyperLink("https://www.google.com/"), PictureLocation.Link);
var pic = sheet.Drawings.AddPicture("ImageName", "testafhkai/[/\\|stuff'\0'", new ExcelHyperLink("https://www.google.com/"), PictureLocation.Link);

SaveAndCleanup(package);
}
Expand Down
60 changes: 44 additions & 16 deletions src/EPPlusTest/Export/HtmlExport/HtmlConditionalFormattingTest.cs

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/EPPlusTest/Issues/WorksheetIssues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,14 @@ public void s843()
[TestMethod]
public void i1951()
{
var isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT &&
Environment.OSVersion.Version.Major >= 6 &&
Environment.OSVersion.Version.Minor >= 0;
if (isWindows == false)
{
Assert.Inconclusive("This test is only meant to be run on Windows OS");
}

using (var p = OpenPackage("I1951.xlsx", true))
{
var ws = p.Workbook.Worksheets.Add("GenericTM");
Expand Down
3 changes: 3 additions & 0 deletions src/EPPlusTest/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ protected static ExcelShape TryGetShape(ExcelPackage pck, string wsName)
protected static FileInfo GetResourceFile(string fileName)
{
string path = AppContext.BaseDirectory;
//Trim start and end separators so not double-added below (extra important on linux)
path = path.TrimEnd(new char[] { Path.DirectorySeparatorChar });

while (!Directory.Exists(path + $"{Path.DirectorySeparatorChar}Resources") && path.Length > 4)
{
path = new DirectoryInfo(path + $"{Path.DirectorySeparatorChar}..").FullName;
Expand Down
Loading