Skip to content

Commit d84bd82

Browse files
Update v3.1.1
1 parent 2b44c2d commit d84bd82

File tree

13 files changed

+65
-60
lines changed

13 files changed

+65
-60
lines changed

Changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## v3.1.1
4+
5+
---
6+
Release Date: **10.08.2023**
7+
8+
- Adapted hex color validation (clarified number of necessary characters)
9+
- Code maintenance
10+
311
## v3.1.0
412

513
---

Demo .NET Standard/Demo .NET Standard.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<TargetFramework>net5.0</TargetFramework>
66
<RootNamespace>PicoXLSX</RootNamespace>
77
<AssemblyName>PicoXLSX.Demo</AssemblyName>
8-
<Copyright>Copyright Raphael Stoeckli © 2022</Copyright>
8+
<Copyright>Copyright Raphael Stoeckli © 2023</Copyright>
99
<RepositoryUrl>https://github.com/rabanti-github/PicoXLSX.git</RepositoryUrl>
1010
<PackageProjectUrl>https://github.com/rabanti-github/PicoXLSX</PackageProjectUrl>
11-
<AssemblyVersion>3.1.0.0</AssemblyVersion>
12-
<FileVersion>3.1.0.0</FileVersion>
13-
<Version>3.1.0</Version>
11+
<AssemblyVersion>3.1.1.0</AssemblyVersion>
12+
<FileVersion>3.1.1.0</FileVersion>
13+
<Version>3.1.1</Version>
1414
<Description>Demo Library showing the use of PicoXLSX, a library to generate Microsoft Excel files (XLSX) in an easy and native way</Description>
1515
<StartupObject>Demo.Program</StartupObject>
1616
<PackageLicenseExpression>MIT</PackageLicenseExpression>

Demo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Demo
1515
{
16-
class Program
16+
static class Program
1717
{
1818
/// <summary>
1919
/// Method to run all demos / testing scenarios (currently disabled)

Demo/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("3.1.0.0")]
36-
[assembly: AssemblyFileVersion("3.1.0.0")]
35+
[assembly: AssemblyVersion("3.1.1.0")]
36+
[assembly: AssemblyFileVersion("3.1.1.0")]

Demo/Testing/Performance.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ namespace Demo.Testing
1818
/// <summary>
1919
/// Class for performance tests
2020
/// </summary>
21-
public class Performance
21+
public static class Performance
2222
{
2323
/// <summary>
2424
/// Method to perform a stress test on PicoXLSX with a high amount of random data
2525
/// </summary>
2626
/// <param name="filename">filename of the output</param>
27-
/// <param name="sheetname">name of the worksheet</param>
27+
/// <param name="sheetName">name of the worksheet</param>
2828
/// <param name="rows">Number of rows</param>
2929
/// <param name="cols">Number of columns</param>
3030
/// <remarks>The data type is determined per column randomly. In case of strings, random ASCII characters from 1 to 256 characters are written into the cells</remarks>
31-
public static void StressTest(string filename, string sheetname, int rows, int cols)
31+
public static void StressTest(string filename, string sheetName, int rows, int cols)
3232
{
3333
System.Console.WriteLine("Starting performance test - Generating Array...");
3434
List<List<object>> field = new List<List<object>>();
3535
List<object> row;
3636
List<int> colTypes = new List<int>();
37-
DateTime min = new DateTime(1901, 01, 01);
38-
DateTime max = new DateTime(2100, 01, 01);
37+
DateTime min = new DateTime(1901, 1, 1, 0, 0, 0, DateTimeKind.Unspecified);
38+
DateTime max = new DateTime(2100, 1, 1, 0, 0, 0, DateTimeKind.Unspecified);
3939
int j;
4040
for (int i = 0; i < cols; i++)
4141
{
@@ -56,7 +56,7 @@ public static void StressTest(string filename, string sheetname, int rows, int c
5656
field.Add(row);
5757
}
5858
System.Console.WriteLine("Writing cells...");
59-
PicoXLSX.Workbook b = new PicoXLSX.Workbook(filename, sheetname);
59+
PicoXLSX.Workbook b = new PicoXLSX.Workbook(filename, sheetName);
6060
PicoXLSX.Worksheet s = b.CurrentWorksheet;
6161
s.CurrentCellDirection = PicoXLSX.Worksheet.CellDirection.ColumnToColumn;
6262
for (int i = 0; i < rows; i++)

Demo/Testing/TypeTesting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Demo.Testing
1717
/// <summary>
1818
/// Class for testing of several data types
1919
/// </summary>
20-
public class TypeTesting
20+
public static class TypeTesting
2121
{
2222

2323
public static void NumericTypeTesting(string fileName)

PicoXLSX .NET Standard/PicoXLSX .NET Standard.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
55
<RootNamespace>PicoXLSX</RootNamespace>
66
<PackageId>PicoXLSX</PackageId>
7-
<Version>3.1.0</Version>
7+
<Version>3.1.1</Version>
88
<Authors>Raphael Stoeckli</Authors>
99
<Company></Company>
1010
<Product>PicoXLSX</Product>
1111
<Description>PicoXLSX is a library to generate Microsoft Excel files (XLSX) in an easy and native way</Description>
12-
<Copyright>Copyright Raphael Stoeckli © 2022</Copyright>
12+
<Copyright>Copyright Raphael Stoeckli © 2023</Copyright>
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1414
<PackageProjectUrl>https://github.com/rabanti-github/PicoXLSX</PackageProjectUrl>
1515
<PackageIcon>PicoXLSX.png</PackageIcon>
1616
<RepositoryUrl>https://github.com/rabanti-github/PicoXLSX.git</RepositoryUrl>
1717
<PackageTags>Excel Office XLSX</PackageTags>
1818
<PackageReleaseNotes>Please see https://github.com/rabanti-github/PicoXLSX/blob/master/Changelog.md for the release notes</PackageReleaseNotes>
1919
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
20-
<AssemblyVersion>3.1.0.0</AssemblyVersion>
21-
<FileVersion>3.1.0.0</FileVersion>
20+
<AssemblyVersion>3.1.1.0</AssemblyVersion>
21+
<FileVersion>3.1.1.0</FileVersion>
2222
<AssemblyName>PicoXLSX</AssemblyName>
2323
<ApplicationIcon>favicon.ico</ApplicationIcon>
2424
</PropertyGroup>

PicoXLSX/Cell.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ public struct Address : IEquatable<Address>, IComparable<Address>
736736
public AddressType Type;
737737

738738
/// <summary>
739-
/// Initializes a new instance of the <see cref=""/> class
739+
/// Initializes a new instance of the <see cref="Address"/> class
740740
/// </summary>
741741
/// <param name="column">Column number (zero based).</param>
742742
/// <param name="row">Row number (zero based).</param>
@@ -749,7 +749,7 @@ public Address(int column, int row, AddressType type = AddressType.Default)
749749
}
750750

751751
/// <summary>
752-
/// Initializes a new instance of the <see cref=""/> class
752+
/// Initializes a new instance of the <see cref="Address"/> class
753753
/// </summary>
754754
/// <param name="address">Address string (e.g. 'A1:B12').</param>
755755
/// <param name="type">Optional referencing type of the address.</param>
@@ -869,7 +869,7 @@ public struct Range
869869
public Address StartAddress;
870870

871871
/// <summary>
872-
/// Initializes a new instance of the <see cref=""/> class
872+
/// Initializes a new instance of the <see cref="Range"/> class
873873
/// </summary>
874874
/// <param name="start">Start address of the range.</param>
875875
/// <param name="end">End address of the range.</param>
@@ -888,7 +888,7 @@ public Range(Address start, Address end)
888888
}
889889

890890
/// <summary>
891-
/// Initializes a new instance of the <see cref=""/> class
891+
/// Initializes a new instance of the <see cref="Range"/> class
892892
/// </summary>
893893
/// <param name="range">Address range (e.g. 'A1:B12').</param>
894894
public Range(string range)

PicoXLSX/LowLevel.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@ internal class LowLevel
6060
/// <summary>
6161
/// First date that can be displayed by Excel. Real values before this date cannot be processed.
6262
/// </summary>
63-
public static readonly DateTime FIRST_ALLOWED_EXCEL_DATE = new DateTime(1900, 1, 1, 0, 0, 0);
63+
public static readonly DateTime FIRST_ALLOWED_EXCEL_DATE = new DateTime(1900, 1, 1, 0, 0, 0, DateTimeKind.Unspecified);
6464

6565
/// <summary>
6666
/// All dates before this date are shifted in Excel by -1.0, since Excel assumes wrongly that the year 1900 is a leap year.<br/>
6767
/// See also: <a href="https://docs.microsoft.com/en-us/office/troubleshoot/excel/wrongly-assumes-1900-is-leap-year">
6868
/// https://docs.microsoft.com/en-us/office/troubleshoot/excel/wrongly-assumes-1900-is-leap-year</a>
6969
/// </summary>
70-
public static readonly DateTime FIRST_VALID_EXCEL_DATE = new DateTime(1900, 3, 1);
70+
public static readonly DateTime FIRST_VALID_EXCEL_DATE = new DateTime(1900, 3, 1, 0, 0, 0, DateTimeKind.Unspecified);
7171

7272
/// <summary>
7373
/// Last date that can be displayed by Excel. Real values after this date cannot be processed.
7474
/// </summary>
75-
public static readonly DateTime LAST_ALLOWED_EXCEL_DATE = new DateTime(9999, 12, 31, 23, 59, 59);
75+
public static readonly DateTime LAST_ALLOWED_EXCEL_DATE = new DateTime(9999, 12, 31, 23, 59, 59, DateTimeKind.Unspecified);
7676

7777
/// <summary>
7878
/// Constant for number conversion. The invariant culture (represents mostly the US numbering scheme) ensures that no culture-specific
@@ -125,7 +125,7 @@ internal class LowLevel
125125
/// <summary>
126126
/// Defines the ROOT_MILLIS
127127
/// </summary>
128-
private static readonly double ROOT_MILLIS = (double)new DateTime(1899, 12, 30, 0, 0, 0).Ticks / TimeSpan.TicksPerMillisecond;
128+
private static readonly double ROOT_MILLIS = (double)new DateTime(1899, 12, 30, 0, 0, 0, DateTimeKind.Unspecified).Ticks / TimeSpan.TicksPerMillisecond;
129129

130130
/// <summary>
131131
/// Defines the culture
@@ -733,7 +733,7 @@ public void SaveAsStream(Stream stream, bool leaveOpen = false)
733733
else
734734
{
735735
pp = p.CreatePart(sheetURIs[i], @"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml", CompressionOption.Normal);
736-
i++;
736+
737737
AppendXmlToPackagePart(CreateWorksheetPart(new Worksheet("sheet1")), pp);
738738
}
739739
pp = p.CreatePart(sharedStringsUri, @"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml", CompressionOption.Normal);
@@ -1003,15 +1003,12 @@ private string CreateRowString(DynamicRow dynamicRow, Worksheet worksheet)
10031003
// Date parsing
10041004
else if (item.DataType == Cell.CellType.DATE)
10051005
{
1006-
typeAttribute = "d";
10071006
DateTime date = (DateTime)item.Value;
10081007
valueDef = GetOADateTimeString(date);
10091008
}
10101009
// Time parsing
10111010
else if (item.DataType == Cell.CellType.TIME)
10121011
{
1013-
typeAttribute = "d";
1014-
// TODO: 'd' is probably an outdated attribute (to be checked for dates and times)
10151012
TimeSpan time = (TimeSpan)item.Value;
10161013
valueDef = GetOATimeString(time);
10171014
}
@@ -1791,12 +1788,12 @@ public static float GetInternalPaneSplitHeight(float height)
17911788
/// <summary>
17921789
/// Class representing a row that is either empty or containing cells. Empty rows can also carry information about height or visibility
17931790
/// </summary>
1794-
private class DynamicRow
1791+
private sealed class DynamicRow
17951792
{
17961793
/// <summary>
17971794
/// Defines the cellDefinitions
17981795
/// </summary>
1799-
private List<Cell> cellDefinitions;
1796+
private readonly List<Cell> cellDefinitions;
18001797

18011798
/// <summary>
18021799
/// Gets or sets the row number (zero-based)

PicoXLSX/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
// You can specify all the values or you can default the Build and Revision Numbers
3131
// by using the '*' as shown below:
3232
// [assembly: AssemblyVersion("1.0.*")]
33-
[assembly: AssemblyVersion("3.1.0")]
34-
[assembly: AssemblyFileVersion("3.1.0")]
33+
[assembly: AssemblyVersion("3.1.1")]
34+
[assembly: AssemblyFileVersion("3.1.1")]

0 commit comments

Comments
 (0)