diff --git a/ClosedXML/Excel/Cells/XLCell.cs b/ClosedXML/Excel/Cells/XLCell.cs index cc1cb2f..4360176 100644 --- a/ClosedXML/Excel/Cells/XLCell.cs +++ b/ClosedXML/Excel/Cells/XLCell.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Globalization; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; + using System; + using System.Collections; + using System.Collections.Generic; + using System.Data; + using System.Globalization; + using System.Linq; + using System.Reflection; + using System.Text; + using System.Text.RegularExpressions; #if NET4 using System.ComponentModel.DataAnnotations; #else @@ -329,7 +329,7 @@ { cValue = GetString(); } - catch + catch { cValue = String.Empty; } @@ -850,7 +850,7 @@ else if (value == XLCellValues.Number) { double dTest; - if (Double.TryParse(_cellValue, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out dTest)) + if (Double.TryParse(_cellValue, XLHelper.NumberStyle, CultureInfo.InvariantCulture, out dTest)) _cellValue = dTest.ToInvariantString(); else { @@ -1671,7 +1671,7 @@ val = dtTest.ToOADate().ToInvariantString(); } } - + } else if (Boolean.TryParse(val, out bTest)) { @@ -1761,7 +1761,7 @@ if (value.Substring(0, matchIndex).CharCount('"') % 2 == 0 && value.Substring(0, matchIndex).CharCount('\'') % 2 == 0) { - // Check if the match is in between quotes +// Check if the match is in between quotes sb.Append(value.Substring(lastIndex, matchIndex - lastIndex)); sb.Append(conversionType == FormulaConversionType.A1ToR1C1 ? GetR1C1Address(matchString, rowsToShift, columnsToShift) diff --git a/ClosedXML/Excel/XLWorkbook_Save.cs b/ClosedXML/Excel/XLWorkbook_Save.cs index 5d9ac20..bc6df99 100644 --- a/ClosedXML/Excel/XLWorkbook_Save.cs +++ b/ClosedXML/Excel/XLWorkbook_Save.cs @@ -172,8 +172,8 @@ } } - // Get the CalculationChainPart - //Note: An instance of this part type contains an ordered set of references to all cells in all worksheets in the + // Get the CalculationChainPart + //Note: An instance of this part type contains an ordered set of references to all cells in all worksheets in the //workbook whose value is calculated from any formula CalculationChainPart calChainPart; @@ -207,7 +207,7 @@ var workbookPart = document.WorkbookPart ?? document.AddWorkbookPart(); var worksheets = WorksheetsInternal; - + var partsToRemove = workbookPart.Parts.Where(s => worksheets.Deleted.Contains(s.RelationshipId)).ToList(); @@ -555,7 +555,7 @@ { workbook.WorkbookProtection = null; } - + if (workbook.BookViews == null) workbook.BookViews = new BookViews(); @@ -585,11 +585,11 @@ { rId = context.RelIdGenerator.GetNext(RelType.Workbook); - while (WorksheetsInternal.Cast().Any(w => w.SheetId == Int32.Parse(rId.Substring(3)))) - rId = context.RelIdGenerator.GetNext(RelType.Workbook); + while (WorksheetsInternal.Cast().Any(w => w.SheetId == Int32.Parse(rId.Substring(3)))) + rId = context.RelIdGenerator.GetNext(RelType.Workbook); - xlSheet.SheetId = Int32.Parse(rId.Substring(3)); - xlSheet.RelId = rId; + xlSheet.SheetId = Int32.Parse(rId.Substring(3)); + xlSheet.RelId = rId; } else { @@ -599,15 +599,15 @@ if (!workbook.Sheets.Cast().Any(s => s.Id == rId)) { - var newSheet = new Sheet - { - Name = xlSheet.Name, - Id = rId, - SheetId = (UInt32)xlSheet.SheetId - }; + var newSheet = new Sheet + { + Name = xlSheet.Name, + Id = rId, + SheetId = (UInt32)xlSheet.SheetId + }; - workbook.Sheets.AppendChild(newSheet); - } + workbook.Sheets.AppendChild(newSheet); + } } var sheetElements = from sheet in workbook.Sheets.Elements() @@ -860,7 +860,7 @@ EndingBaseIndex = (UInt32)p.End }; - var text = new Text { Text = p.Text }; + var text = new Text {Text = p.Text}; if (p.Text.PreserveSpaces()) text.Space = SpaceProcessingModeValues.Preserve; @@ -2001,7 +2001,7 @@ var columnFields = new ColumnFields(); var rowItems = new RowItems(); var columnItems = new ColumnItems(); - var pageFields = new PageFields { Count = (uint)pt.ReportFilters.Count() }; + var pageFields = new PageFields {Count = (uint)pt.ReportFilters.Count()}; var pivotFields = new PivotFields {Count = Convert.ToUInt32(pt.SourceRange.ColumnCount())}; foreach (var xlpf in pt.Fields.OrderBy(f => pt.RowLabels.Any(p => p.SourceName == f.SourceName) ? pt.RowLabels.IndexOf(f) : Int32.MaxValue )) @@ -2024,7 +2024,7 @@ } else if (pt.ColumnLabels.Any(p => p.SourceName == xlpf.SourceName)) { - var f = new Field { Index = pt.Fields.IndexOf(xlpf) }; + var f = new Field {Index = pt.Fields.IndexOf(xlpf)}; columnFields.AppendChild(f); for (var i = 0; i < xlpf.SharedStrings.Count; i++) @@ -2175,7 +2175,7 @@ rowItem.Index = Convert.ToUInt32(i); rowItem.AppendChild(new MemberPropertyIndex() { Val = i }); columnItems.AppendChild(rowItem); - } + } } if (columnFields.Any()) @@ -2233,7 +2233,7 @@ if (items.Any(i => i.Equals(value.BaseItem))) df.BaseItem = Convert.ToUInt32(items.IndexOf(value.BaseItem)); - } + } } else { @@ -4183,7 +4183,7 @@ } worksheetPart.Worksheet.InsertAfter(conditionalFormatting, previousElement); previousElement = conditionalFormatting; - cm.SetElement(XLWSContentManager.XLWSContents.ConditionalFormatting, conditionalFormatting); + cm.SetElement(XLWSContentManager.XLWSContents.ConditionalFormatting, conditionalFormatting); } }