diff --git a/ClosedXML/ClosedXML/ClosedXML.sln b/ClosedXML/ClosedXML/ClosedXML.sln index 00bd435..9a36446 100644 --- a/ClosedXML/ClosedXML/ClosedXML.sln +++ b/ClosedXML/ClosedXML/ClosedXML.sln @@ -57,8 +57,8 @@ {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Any CPU.Build.0 = Release|Any CPU {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|x86.ActiveCfg = Release|x64 - {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|x86.Build.0 = Release|x64 + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|x86.ActiveCfg = Release|Any CPU + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|x86.Build.0 = Release|Any CPU {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Debug|Any CPU.ActiveCfg = Debug|x86 {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Debug|Mixed Platforms.Build.0 = Debug|x86 @@ -89,8 +89,8 @@ {5F43B12B-A900-40C6-9924-A0C0B032F791}.Release|Any CPU.Build.0 = Release|Any CPU {5F43B12B-A900-40C6-9924-A0C0B032F791}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {5F43B12B-A900-40C6-9924-A0C0B032F791}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5F43B12B-A900-40C6-9924-A0C0B032F791}.Release|x86.ActiveCfg = Release|x64 - {5F43B12B-A900-40C6-9924-A0C0B032F791}.Release|x86.Build.0 = Release|x64 + {5F43B12B-A900-40C6-9924-A0C0B032F791}.Release|x86.ActiveCfg = Release|Any CPU + {5F43B12B-A900-40C6-9924-A0C0B032F791}.Release|x86.Build.0 = Release|Any CPU {E005997D-B192-461F-AA3E-44007A33A3DF}.Debug|Any CPU.ActiveCfg = Debug|x86 {E005997D-B192-461F-AA3E-44007A33A3DF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {E005997D-B192-461F-AA3E-44007A33A3DF}.Debug|Mixed Platforms.Build.0 = Debug|x86 diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/IXLPageSetup.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/IXLPageSetup.cs index 3ad8f3f..955d5fc 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/IXLPageSetup.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/IXLPageSetup.cs @@ -151,11 +151,11 @@ /// /// Gets or sets the horizontal dpi for printing the worksheet. /// - Int32 HorizontalDpi { get; set; } + UInt32 HorizontalDpi { get; set; } /// /// Gets or sets the vertical dpi for printing the worksheet. /// - Int32 VerticalDpi { get; set; } + UInt32 VerticalDpi { get; set; } /// /// Gets or sets the page number that will begin the printout. /// For example, the first page of your printout could be numbered page 5. diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/XLPageSetup.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/XLPageSetup.cs index 4c8df9a..c5a9761 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/XLPageSetup.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/XLPageSetup.cs @@ -95,8 +95,8 @@ public XLPageOrientation PageOrientation { get; set; } public XLPaperSize PaperSize { get; set; } - public Int32 HorizontalDpi { get; set; } - public Int32 VerticalDpi { get; set; } + public UInt32 HorizontalDpi { get; set; } + public UInt32 VerticalDpi { get; set; } public Int32 FirstPageNumber { get; set; } public Boolean CenterHorizontally { get; set; } public Boolean CenterVertically { get; set; } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs index 37dc69f..854efb9 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs @@ -186,7 +186,7 @@ if (row.Collapsed != null && row.Collapsed) xlRow.Collapse(); - if (row.OutlineLevel != null) + if (row.OutlineLevel != null && row.OutlineLevel > 0) xlRow.OutlineLevel = row.OutlineLevel; if (row.CustomFormat != null) @@ -559,8 +559,8 @@ ws.PageSetup.ShowComments = showCommentsValues.Single(sc => sc.Value == pageSetup.CellComments).Key; if (pageSetup.Errors != null) ws.PageSetup.PrintErrorValue = printErrorValues.Single(p => p.Value == pageSetup.Errors).Key; - if (pageSetup.HorizontalDpi != null) ws.PageSetup.HorizontalDpi = Int32.Parse(pageSetup.HorizontalDpi.InnerText); - if (pageSetup.VerticalDpi != null) ws.PageSetup.VerticalDpi = Int32.Parse(pageSetup.VerticalDpi.InnerText); + if (pageSetup.HorizontalDpi != null) ws.PageSetup.HorizontalDpi = pageSetup.HorizontalDpi.Value; + if (pageSetup.VerticalDpi != null) ws.PageSetup.VerticalDpi = pageSetup.VerticalDpi.Value; if (pageSetup.FirstPageNumber != null) ws.PageSetup.FirstPageNumber = Int32.Parse(pageSetup.FirstPageNumber.InnerText); } } diff --git a/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs b/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs index 81d2ee6..2b1d0a9 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs +++ b/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs @@ -15,14 +15,10 @@ static void Main(string[] args) { - var wb = new XLWorkbook(); - var ws = wb.Worksheets.Add("New"); - var dataValidation = ws.Range("A1:B2").DataValidation; - dataValidation.WholeNumber.Between(1, 5); - dataValidation.ErrorStyle = XLErrorStyle.Warning; - dataValidation.ErrorTitle = "Number out of range"; - dataValidation.ErrorMessage = "Please enter a number between 1 and 5"; - wb.SaveAs(@"C:\Excel Files\ForTesting\Sandbox.xlsx"); + var wb = new XLWorkbook(@"c:\Excel Files\ForTesting\Issue_6237.xlsx"); + + + wb.SaveAs(@"C:\Excel Files\ForTesting\Issue_6237_Saved.xlsx"); }