Skip to content

Commit 3974fbc

Browse files
Release v3.0.0
2 parents ea523a5 + 241f7e7 commit 3974fbc

File tree

863 files changed

+2304
-1478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

863 files changed

+2304
-1478
lines changed

Changelog.md

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

3+
## v3.0.0
4+
5+
---
6+
Release Date: **03.09.2022 - Major Release**
7+
8+
Note: some of the mentioned changes may be already implemented in v2.x as preview functionality
9+
10+
### Workbook and Shortener
11+
12+
- Added a list of MRU colors that can be defined in the Workbook class (methods AddMruColor, ClearMruColors)
13+
- Added an exposed property for the workbook protection password hash (will be filled when loading a workbook)
14+
- Added the method SetSelectedWorksheet by name in the Workbook class
15+
- Added two methods GetWorksheet by name or index in the Workbook class
16+
- Added the methods CopyWorksheetIntoThis and CopyWorksheetTo with several overloads in the Workbook class
17+
- Added the function RemoveWorksheet by index with the option of resetting the current worksheet, in the Workbook class
18+
- Added the function SetCurrentWorksheet by index in the Workbook class
19+
- Added the function SetSelectedWorksheet by name in the Workbook class
20+
- Added a Shortener-Class constructor with a workbook reference
21+
- The shortener functions Down and Right have now an option to keep row and column positions
22+
- Added two shortener functions Up and Left
23+
- Made several style assigning methods deprecated in the Workbook class (will be removed in future versions)
24+
25+
### Worksheet
26+
27+
- Added an exposed property for the worksheet protection password hash (will be filled when loading a workbook)
28+
- Added the methods GetFirstDataColumnNumber, GetFirstDataColumnNumber, GetFirstDataRowNumber, GetFirstRowNumber, GetLastDataColumnNumber, GetFirstCellAddress, GetFirstDataCellAddress, GetLastDataColumnNumber, GetLastDataRowNumber, GetLastRowNumber, GetLastCellAddress, GetLastCellAddress and GetLastDataCellAddress
29+
- Added the methods GetRow and GetColumns by address string or index
30+
- Added the method Copy to copy a worksheet (deep copy)
31+
- Added a constructor with only the worksheet name as parameter
32+
- Added and option in GoToNextColumn and GoToNextRow to either keep the current row or column
33+
- Added the methods RemoveRowHeight and RemoveAllowedActionOnSheetProtection
34+
- Renamed columnAddress and rowAddress to columnNumber and rowNumber in the AddNextCell, AddCellFormula and RemoveCell methods
35+
- Added several validations for worksheet data
36+
37+
### Cells, Rows and Columns
38+
39+
- In Cell, the address can now have reference modifiers ($)
40+
- The worksheet reference in the Cell constructor was removed. Assigning to a worksheet is now managed automatically by the worksheet when adding a cell
41+
- Added a property CellAddressType in Cell
42+
- Cells can now have null as value, interpreted as empty
43+
- Added a new overloaded function ResolveCellCoordinate to resolve the address type as well
44+
- Added ValidateColumnNumber and ValidateRowNumber in Cell
45+
- In Address, the constructor with string and address type now only needs a string, since reference modifiers ($) are resolved automatically
46+
- Address objects are now comparable
47+
- Implemented better address validation
48+
- Range start and end addresses are swapped automatically, if reversed
49+
50+
### Styles
51+
52+
- Font has now an enum of possible underline values (e.g. instead of a bool)
53+
- CellXf supports now indentation
54+
- A new, internal style repository was introduced to streamline the style management
55+
- Color (RGB) values are now validated (Fill class has a function ValidateColor)
56+
- Style components have now more appropriate default values
57+
- MRU colors are now not collected from defined style colors but from the MRU list in the workbook object
58+
- The ToString function of Styles and all sub parts will now give a complete outline of all elements
59+
- Fixed several issues with style comparison
60+
- Several style default values were introduced as constants
61+
62+
### Formulas
63+
64+
- Added uint as possible formula value. Valid types are int, uint, long, ulong, float, double, byte, sbyte, decimal, short and ushort
65+
- Added several validity checks
66+
67+
68+
### Misc
69+
- Added several constants for boundary dates in the LowLevel class
70+
- Added several functions for pane splitting in the LowLevel class
71+
- Exposed the (legacy) password generation method in the LowLevel class
72+
- Updated documentation among the whole project
73+
- Exceptions have no sub-tiles anymore
74+
- Overhauled the whole writer
75+
- Removed lot of dead code for better maintenance
76+
377
## v2.11.5
478

579
---

Demo .NET Standard/Demo .NET Standard.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88
<Copyright>Copyright Raphael Stoeckli © 2022</Copyright>
99
<RepositoryUrl>https://github.com/rabanti-github/PicoXLSX.git</RepositoryUrl>
1010
<PackageProjectUrl>https://github.com/rabanti-github/PicoXLSX</PackageProjectUrl>
11-
<AssemblyVersion>2.11.5.0</AssemblyVersion>
12-
<FileVersion>2.11.5.0</FileVersion>
13-
<Version>2.11.5</Version>
11+
<AssemblyVersion>3.0.0.0</AssemblyVersion>
12+
<FileVersion>2.0.0.0</FileVersion>
13+
<Version>3.0.0</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>
1717
<PackageIcon>PicoXLSX.png</PackageIcon>
1818
<PackageIconUrl />
1919
<PackageTags>XLSX Excel ExcelWriter Office</PackageTags>
20+
<Company />
21+
<Product>PicoXLSX</Product>
22+
<Authors>Raphael Stoeckli</Authors>
2023
</PropertyGroup>
2124

2225
<ItemGroup>

Demo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ private static void Demo4()
233233

234234
Style s = new Style(); // Create new style
235235
s.CurrentFill.SetColor("FF22FF11", Style.Fill.FillType.fillColor); // Set fill color
236-
s.CurrentFont.DoubleUnderline = true; // Set double underline
236+
s.CurrentFont.Underline = Style.Font.UnderlineValue.u_double; // Set double underline
237237
s.CurrentCellXf.HorizontalAlign = Style.CellXf.HorizontalAlignValue.center; // Set alignment
238238

239239
Style s2 = s.CopyStyle(); // Copy the previously defined style

Demo/Properties/AssemblyInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
// General Information about an assembly is controlled through the following
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
8-
[assembly: AssemblyTitle("Demo")]
8+
[assembly: AssemblyTitle("PicoXLSX Demo")]
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("")]
12-
[assembly: AssemblyProduct("Demo")]
12+
[assembly: AssemblyProduct("PicoXLSX")]
1313
[assembly: AssemblyCopyright("Copyright Raphael Stoeckli © 2022")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
@@ -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("2.11.5.0")]
36-
[assembly: AssemblyFileVersion("2.11.5.0")]
35+
[assembly: AssemblyVersion("3.0.0.0")]
36+
[assembly: AssemblyFileVersion("3.0.0.0")]

PicoXLSX .NET Standard/PicoXLSX .NET Standard.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
55
<RootNamespace>PicoXLSX</RootNamespace>
66
<PackageId>PicoXLSX</PackageId>
7-
<Version>2.11.5</Version>
7+
<Version>3.0.0</Version>
88
<Authors>Raphael Stoeckli</Authors>
9-
<Company>Raphael Stoeckli</Company>
9+
<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>
1212
<Copyright>Copyright Raphael Stoeckli © 2022</Copyright>
@@ -17,8 +17,9 @@
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>2.11.5.0</AssemblyVersion>
21-
<FileVersion>2.11.5.0</FileVersion>
20+
<AssemblyVersion>3.0.0.0</AssemblyVersion>
21+
<FileVersion>3.0.0.0</FileVersion>
22+
<AssemblyName>PicoXLSX</AssemblyName>
2223
</PropertyGroup>
2324

2425
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

PicoXLSX/Cell.cs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,24 @@ public Style SetStyle(Style style, bool unmanaged = false)
300300
return cellStyle;
301301
}
302302

303+
/// <summary>
304+
/// Copies this cell into a new one. The style is considered if not null.
305+
/// </summary>
306+
/// <returns>Copy of this cell</returns>
307+
internal Cell Copy()
308+
{
309+
Cell copy = new Cell();
310+
copy.Value = this.Value;
311+
copy.DataType = this.DataType;
312+
copy.CellAddress = this.CellAddress;
313+
copy.CellAddressType = this.CellAddressType;
314+
if (this.cellStyle != null)
315+
{
316+
copy.SetStyle(this.cellStyle, true);
317+
}
318+
return copy;
319+
}
320+
303321
#endregion
304322

305323
#region staticMethods
@@ -634,7 +652,7 @@ public static string ResolveColumnAddress(int columnNumber)
634652
/// </summary>
635653
/// <param name="addressExpression">Address expression</param>
636654
/// <returns>Scope of the address expression</returns>
637-
public static AddressScope GetAddressScope(String addressExpression)
655+
public static AddressScope GetAddressScope(string addressExpression)
638656
{
639657
try
640658
{
@@ -780,6 +798,15 @@ public int CompareTo(Address other)
780798
return thisCoordinate.CompareTo(otherCoordinate);
781799
}
782800

801+
/// <summary>
802+
/// Creates a (dereferenced, if applicable) deep copy of this address
803+
/// </summary>
804+
/// <returns>Copy of this range</returns>
805+
internal Address Copy()
806+
{
807+
return new Address(this.Column, this.Row, this.Type);
808+
}
809+
783810
}
784811

785812
/// <summary>
@@ -813,6 +840,7 @@ public Range(Address start, Address end)
813840
StartAddress = end;
814841
EndAddress = start;
815842
}
843+
816844
}
817845

818846
/// <summary>
@@ -880,6 +908,15 @@ public override string ToString()
880908
{
881909
return StartAddress.ToString() + ":" + EndAddress.ToString();
882910
}
911+
912+
/// <summary>
913+
/// Creates a (dereferenced, if applicable) deep copy of this range
914+
/// </summary>
915+
/// <returns>Copy of this range</returns>
916+
internal Range Copy()
917+
{
918+
return new Range(this.StartAddress.Copy(), this.EndAddress.Copy());
919+
}
883920
}
884921

885922
/// <summary>

0 commit comments

Comments
 (0)