Skip to content

Commit

Permalink
Update xml comments and removed some unused imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKallman committed Oct 25, 2023
1 parent 730d13d commit c4e3258
Show file tree
Hide file tree
Showing 26 changed files with 95 additions and 35 deletions.
1 change: 1 addition & 0 deletions src/EPPlus/Core/CellStore/RangeDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace OfficeOpenXml.Core.CellStore
/// <summary>
/// This class stores ranges to keep track if they have been accessed before and adds a reference to <see cref="T"/>.

Check warning on line 18 in src/EPPlus/Core/CellStore/RangeDictionary.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

XML comment has cref attribute 'T' that refers to a type parameter
/// </summary>
/// <typeparam name="T">Type type used in the RangeDictionary</typeparam>
internal class RangeDictionary<T>
{
internal struct RangeItem : IComparable<RangeItem>
Expand Down
15 changes: 9 additions & 6 deletions src/EPPlus/DataValidation/ExcelDataValidation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ namespace OfficeOpenXml.DataValidation
/// </summary>
public abstract class ExcelDataValidation : IExcelDataValidation
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="uid">Id for validation</param>
/// <param name="address">adress validation is applied to</param>
protected ExcelDataValidation(string uid, string address, ExcelWorksheet ws)
/// <summary>
/// Constructor
/// </summary>
/// <param name="uid">Id for validation</param>
/// <param name="address">adress validation is applied to</param>
/// <param name="ws">The worksheet</param>
protected ExcelDataValidation(string uid, string address, ExcelWorksheet ws)
{
Require.Argument(uid).IsNotNullOrEmpty("uid");
Require.Argument(address).IsNotNullOrEmpty("address");
Expand All @@ -47,6 +48,7 @@ protected ExcelDataValidation(string uid, string address, ExcelWorksheet ws)
/// Read-File Constructor
/// </summary>
/// <param name="xr"></param>
/// <param name="ws">The worksheet</param>
protected ExcelDataValidation(XmlReader xr, ExcelWorksheet ws)
{
LoadXML(xr);
Expand All @@ -57,6 +59,7 @@ protected ExcelDataValidation(XmlReader xr, ExcelWorksheet ws)
/// Copy-Constructor
/// </summary>
/// <param name="validation">Validation to copy from</param>
/// <param name="ws">The worksheet</param>
protected ExcelDataValidation(ExcelDataValidation validation,ExcelWorksheet ws)
{
Uid = validation.Uid;
Expand Down
3 changes: 3 additions & 0 deletions src/EPPlus/DataValidation/ExcelDataValidationAny.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class ExcelDataValidationAny : ExcelDataValidation, IExcelDataValidationA
/// </summary>
/// <param name="uid">Uid of the data validation, format should be a Guid surrounded by curly braces.</param>
/// <param name="address"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationAny(string uid, string address, ExcelWorksheet ws) : base(uid, address, ws)
{
}
Expand All @@ -33,6 +34,7 @@ internal ExcelDataValidationAny(string uid, string address, ExcelWorksheet ws) :
/// Constructor for reading data
/// </summary>
/// <param name="xr">The XmlReader to read from</param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationAny(XmlReader xr, ExcelWorksheet ws) : base(xr, ws)
{
}
Expand All @@ -41,6 +43,7 @@ internal ExcelDataValidationAny(XmlReader xr, ExcelWorksheet ws) : base(xr, ws)
/// Copy constructor
/// </summary>
/// <param name="copy"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationAny(ExcelDataValidationAny copy, ExcelWorksheet ws) : base(copy, ws)
{
}
Expand Down
1 change: 1 addition & 0 deletions src/EPPlus/DataValidation/ExcelDataValidationCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ internal void ValidateAll()
/// Optionally add address at end for new copy with address in range
/// </summary>
/// <param name="dv"></param>
/// <param name="added">The worksheet</param>
/// <param name="address"></param>
internal void AddCopyOfDataValidation(ExcelDataValidation dv, ExcelWorksheet added, string address = null)
{
Expand Down
3 changes: 2 additions & 1 deletion src/EPPlus/DataValidation/ExcelDataValidationCustom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class ExcelDataValidationCustom : ExcelDataValidationWithFormula<IExcelDa
/// <summary>
/// Constructor
/// </summary>
/// <param name="worksheetName"></param>
/// <param name="uid">Uid of the data validation, format should be a Guid surrounded by curly braces.</param>
/// <param name="address"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationCustom(string uid, string address, ExcelWorksheet ws)
: base(uid, address, ws)
{
Expand All @@ -47,6 +47,7 @@ internal ExcelDataValidationCustom(XmlReader xr, ExcelWorksheet ws)
/// Copy constructor
/// </summary>
/// <param name="copy"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationCustom(ExcelDataValidationCustom copy, ExcelWorksheet ws) : base(copy, ws)
{
Formula = copy.Formula;
Expand Down
3 changes: 2 additions & 1 deletion src/EPPlus/DataValidation/ExcelDataValidationDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class ExcelDataValidationDateTime : ExcelDataValidationWithFormula2<IExce
/// <summary>
/// Constructor
/// </summary>
/// <param name="worksheetName"></param>
/// <param name="uid">Uid of the data validation, format should be a Guid surrounded by curly braces.</param>
/// <param name="address"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationDateTime(string uid, string address, ExcelWorksheet ws)
: base(uid, address, ws)
{
Expand All @@ -49,6 +49,7 @@ internal ExcelDataValidationDateTime(XmlReader xr, ExcelWorksheet ws)
/// Copy constructor
/// </summary>
/// <param name="copy"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationDateTime(ExcelDataValidationDateTime copy, ExcelWorksheet ws) : base(copy, ws)
{
Formula = copy.Formula;
Expand Down
4 changes: 3 additions & 1 deletion src/EPPlus/DataValidation/ExcelDataValidationDecimal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class ExcelDataValidationDecimal : ExcelDataValidationWithFormula2<IExcel
/// <summary>
/// Constructor
/// </summary>
/// <param name="worksheetName"></param>
/// <param name="uid">Uid of the data validation, format should be a Guid surrounded by curly braces.</param>
/// <param name="address"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationDecimal(string uid, string address, ExcelWorksheet ws)
: base(uid, address, ws)
{
Expand All @@ -39,6 +39,7 @@ internal ExcelDataValidationDecimal(string uid, string address, ExcelWorksheet w
/// Constructor for reading data
/// </summary>
/// <param name="xr">The XmlReader to read from</param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationDecimal(XmlReader xr, ExcelWorksheet ws)
: base(xr, ws)
{
Expand All @@ -48,6 +49,7 @@ internal ExcelDataValidationDecimal(XmlReader xr, ExcelWorksheet ws)
/// Copy constructor
/// </summary>
/// <param name="copy"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationDecimal(ExcelDataValidationDecimal copy, ExcelWorksheet ws) : base(copy, ws)
{
Formula = copy.Formula;
Expand Down
4 changes: 3 additions & 1 deletion src/EPPlus/DataValidation/ExcelDataValidationInt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class ExcelDataValidationInt : ExcelDataValidationWithFormula2<IExcelData
/// Constructor for reading data
/// </summary>
/// <param name="xr">The XmlReader to read from</param>
/// <param name="ws">Worksheet</param>
/// <param name="isTextLength">Bool to define type of int validation</param>
internal ExcelDataValidationInt(XmlReader xr, ExcelWorksheet ws, bool isTextLength = false)
: base(xr, ws)
Expand All @@ -37,9 +38,9 @@ internal ExcelDataValidationInt(XmlReader xr, ExcelWorksheet ws, bool isTextLeng
/// <summary>
/// Constructor
/// </summary>
/// <param name="worksheetName"></param>
/// <param name="uid">Uid of the data validation, format should be a Guid surrounded by curly braces.</param>
/// <param name="address"></param>
/// <param name="ws">The worksheet</param>
/// <param name="isTextLength">Bool to define type of int validation</param>
internal ExcelDataValidationInt(string uid, string address, ExcelWorksheet ws, bool isTextLength = false)
: base(uid, address, ws)
Expand All @@ -54,6 +55,7 @@ internal ExcelDataValidationInt(string uid, string address, ExcelWorksheet ws, b
/// Copy constructor
/// </summary>
/// <param name="copy"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationInt(ExcelDataValidationInt copy, ExcelWorksheet ws)
: base(copy, ws)
{
Expand Down
3 changes: 1 addition & 2 deletions src/EPPlus/DataValidation/ExcelDataValidationList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ public class ExcelDataValidationList : ExcelDataValidationWithFormula<IExcelData
/// <summary>
/// Constructor
/// </summary>
/// <param name="worksheet"></param>
/// <param name="uid">Uid of the data validation, format should be a Guid surrounded by curly braces.</param>
/// <param name="address"></param>
/// <param name="validationType"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationList(string uid, string address, ExcelWorksheet ws)
: base(uid, address, ws)
{
Expand Down
5 changes: 3 additions & 2 deletions src/EPPlus/DataValidation/ExcelDataValidationTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public class ExcelDataValidationTime : ExcelDataValidationWithFormula2<IExcelDat
/// <summary>
/// Constructor
/// </summary>
/// <param name="worksheet"></param>
/// <param name="uid">Uid of the data validation, format should be a Guid surrounded by curly braces.</param>
/// <param name="address"></param>
/// <param name="validationType"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationTime(string uid, string address, ExcelWorksheet ws)
: base(uid, address, ws)
{
Expand All @@ -40,6 +39,7 @@ internal ExcelDataValidationTime(string uid, string address, ExcelWorksheet ws)
/// Constructor for reading data
/// </summary>
/// <param name="xr">The XmlReader to read from</param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationTime(XmlReader xr, ExcelWorksheet ws)
: base(xr, ws)
{
Expand All @@ -49,6 +49,7 @@ internal ExcelDataValidationTime(XmlReader xr, ExcelWorksheet ws)
/// Copy constructor
/// </summary>
/// <param name="copy"></param>
/// <param name="ws"></param>
internal ExcelDataValidationTime(ExcelDataValidationTime copy, ExcelWorksheet ws)
: base(copy, ws)
{
Expand Down
3 changes: 1 addition & 2 deletions src/EPPlus/DataValidation/ExcelDataValidationType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ public class ExcelDataValidationType
/// <summary>
/// Returns a validation type by <see cref="eDataValidationType"/>
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
/// <returns>The string output</returns>
internal string TypeToXmlString()
{
switch (Type)
Expand Down
6 changes: 4 additions & 2 deletions src/EPPlus/DataValidation/ExcelDataValidationWithFormula.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public abstract class ExcelDataValidationWithFormula<T> : ExcelDataValidation
/// <summary>
/// Constructor
/// </summary>
/// <param name="workSheetName"></param>
/// <param name="uid">Uid of the data validation, format should be a Guid surrounded by curly braces.</param>
/// <param name="address"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationWithFormula(string uid, string address, ExcelWorksheet ws)
: base(uid, address, ws)
{
Expand All @@ -45,6 +45,7 @@ internal ExcelDataValidationWithFormula(string uid, string address, ExcelWorkshe
/// Constructor for reading data
/// </summary>
/// <param name="xr">The XmlReader to read from</param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationWithFormula(XmlReader xr, ExcelWorksheet ws)
: base(xr, ws)
{
Expand All @@ -54,6 +55,7 @@ internal ExcelDataValidationWithFormula(XmlReader xr, ExcelWorksheet ws)
/// Copy Constructor
/// </summary>
/// <param name="copy"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationWithFormula(ExcelDataValidation copy, ExcelWorksheet ws)
: base(copy, ws)
{
Expand All @@ -62,7 +64,7 @@ internal ExcelDataValidationWithFormula(ExcelDataValidation copy, ExcelWorksheet
internal override void ReadClassSpecificXmlNodes(XmlReader xr)
{
base.ReadClassSpecificXmlNodes(xr);
Formula = ReadFormula(xr, "formula1");
Formula = ReadFormula(xr, "formula");
}

internal T ReadFormula(XmlReader xr, string formulaIdentifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public abstract class ExcelDataValidationWithFormula2<T> : ExcelDataValidationWi
/// <summary>
/// Constructor
/// </summary>
/// <param name="workSheetName"></param>
/// <param name="uid">Uid of the data validation, format should be a Guid surrounded by curly braces.</param>
/// <param name="address"></param>
/// <param name="ws">The worksheet</param>
internal ExcelDataValidationWithFormula2(string uid, string address, ExcelWorksheet ws)
: base(uid, address, ws)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ internal enum FormulaState
/// </summary>
internal abstract class ExcelDataValidationFormula :IExcelDataValidationFormula
{

internal event System.EventHandler BecomesExt;

private readonly Action<OnFormulaChangedEventArgs> _handler;

/// <summary>
/// Constructor
/// </summary>
/// <param name="validationUid">id of the data validation containing this formula</param>
/// <param name="workSheetName">The worksheet name</param>
/// <param name="extListHandler">A callback when the formula is changed.</param>
public ExcelDataValidationFormula(string validationUid, string workSheetName, Action<OnFormulaChangedEventArgs> extListHandler)
{
Require.Argument(validationUid).IsNotNullOrEmpty("validationUid");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ internal abstract class ExcelDataValidationFormulaValue<T> : ExcelDataValidation
/// Constructor
/// </summary>
/// <param name="validationUid">Uid for the data validation</param>
/// <param name="worksheetName">The worksheet name</param>
/// <param name="extListHandler">Callback for updateing formulas</param>
public ExcelDataValidationFormulaValue(string validationUid, string worksheetName, Action<OnFormulaChangedEventArgs> extListHandler)
: base(validationUid, worksheetName, extListHandler)
{
Expand Down
2 changes: 1 addition & 1 deletion src/EPPlus/Drawing/Chart/ExcelChartAxisStandard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ internal override eAxisType AxisType
/// <summary>
/// Adds the axis title and styles it according to the style selected in the StyleManager
/// </summary>
/// <param name="title"></param>
/// <param name="linkedCell">A cell range to link the title to.</param>
public void AddTitle(ExcelRangeBase linkedCell)
{
Title.LinkedCell = linkedCell;
Expand Down
8 changes: 4 additions & 4 deletions src/EPPlus/ExcelPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,10 @@ private void ConstructNewFile(string password)
}
catch (Exception ex)
{
if (ms != null)
{
ms.Dispose();
}
if (password == null && CompoundDocument.IsCompoundDocument(File))
{
throw new Exception("Cannot open the package. The package is an OLE compound document. If this is an encrypted package, please supply the password", ex);
Expand All @@ -539,10 +543,6 @@ private void ConstructNewFile(string password)
{
throw;
}
if(ms!=null)
{
ms.Dispose();
}
}
}
else
Expand Down
1 change: 0 additions & 1 deletion src/EPPlus/ExcelRangeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Date Author Change
using OfficeOpenXml.ConditionalFormatting;
using OfficeOpenXml.ConditionalFormatting.Contracts;
using OfficeOpenXml.FormulaParsing.LexicalAnalysis;
using w = System.Windows;
using OfficeOpenXml.Utils;
using OfficeOpenXml.Compatibility;
using OfficeOpenXml.Core;
Expand Down
2 changes: 0 additions & 2 deletions src/EPPlus/ExcelStyles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Date Author Change
using System.Xml;
using System.Linq;
using System.Collections.Generic;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
using draw=System.Drawing;
using OfficeOpenXml.Style;
using OfficeOpenXml.Style.XmlAccess;
using OfficeOpenXml.Style.Dxf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Date Author Change
using OfficeOpenXml.FormulaParsing;
using OfficeOpenXml.FormulaParsing.Utilities;
using OfficeOpenXml.FormulaParsing.Exceptions;
using util=OfficeOpenXml.Utils;
using Util=OfficeOpenXml.Utils;

namespace OfficeOpenXml.FormulaParsing.Excel.Functions
{
Expand All @@ -33,7 +33,7 @@ public override object Parse(object obj)
return r == null ? 0 : r.ValueDouble;
}
if (obj is double) return obj;
if (obj.IsNumeric()) return util.ConvertUtil.GetValueDouble(obj);
if (obj.IsNumeric()) return Util.ConvertUtil.GetValueDouble(obj);
var str = obj != null ? obj.ToString() : string.Empty;
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Date Author Change

namespace OfficeOpenXml.FormulaParsing.Excel.Functions.Finance.Implementations
{
public static class XirrImpl
internal static class XirrImpl
{

public static FinanceCalcResult<double> GetXirr(IEnumerable<double> aValues, IEnumerable<System.DateTime> aDates, double rGuessRate = 0.1)
internal static FinanceCalcResult<double> GetXirr(IEnumerable<double> aValues, IEnumerable<System.DateTime> aDates, double rGuessRate = 0.1)
{
if (aValues.Count() != aDates.Count()) return new FinanceCalcResult<double>(eErrorType.Value);

Expand Down
Loading

0 comments on commit c4e3258

Please sign in to comment.