Skip to content

Commit

Permalink
Fixed issue JanKallman#176 Tint problem with small values. JanKallman…
Browse files Browse the repository at this point in the history
…#178 LoadFromText, JanKallman#181 Custom properties causes corrupt workbook and JanKallman#10 Optimized adding of images in the Drawings collection. JanKallman#196 Text format with d does not match the Excel behavior. And some documentation of Sparklines
  • Loading branch information
JanKallman committed Apr 25, 2018
1 parent 8ab7d73 commit cdfc51d
Show file tree
Hide file tree
Showing 22 changed files with 216 additions and 218 deletions.
12 changes: 0 additions & 12 deletions EPPlus/Compatibility/CompatibilitySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,5 @@ public bool IsWorksheets1Based
}
}
}
//TODO: Add this in a future version
//public bool IsRowColumnCell1Based
//{
// get
// {
// return excelPackage._rowColumnCellAdd == 1;
// }
// set
// {
// excelPackage._rowColumnCellAdd = value ? 1 : 0;
// }
//}
}
}
115 changes: 0 additions & 115 deletions EPPlus/Compatibility/DateTimeExtensions.cs

This file was deleted.

4 changes: 2 additions & 2 deletions EPPlus/Compatibility/ImageCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

namespace OfficeOpenXml.Compatibility
{
public class ImageCompat
internal class ImageCompat
{
public static byte[] GetImageAsByteArray(Image image)
internal static byte[] GetImageAsByteArray(Image image)
{
var ms = new MemoryStream();
if (image.RawFormat.Guid == ImageFormat.Gif.Guid)
Expand Down
58 changes: 0 additions & 58 deletions EPPlus/Compatibility/SecurityElement.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ExcelDataValidationFormulaDateTime(XmlNamespaceManager namespaceManager,
if (!string.IsNullOrEmpty(value))
{
double oADate = default(double);
if (double.TryParse(value, NumberStyles.Number, CultureInfo.InvariantCulture, out oADate))
if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out oADate))
{
Value = DateTime.FromOADate(oADate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ExcelDataValidationFormulaDecimal(XmlNamespaceManager namespaceManager, X
if (!string.IsNullOrEmpty(value))
{
double dValue = default(double);
if (double.TryParse(value, NumberStyles.Number, CultureInfo.InvariantCulture, out dValue))
if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out dValue))
{
Value = dValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ExcelDataValidationFormulaTime(XmlNamespaceManager namespaceManager, XmlN
if (!string.IsNullOrEmpty(value))
{
decimal time = default(decimal);
if (decimal.TryParse(value, NumberStyles.Number, CultureInfo.InvariantCulture, out time))
if (decimal.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out time))
{
Value = new ExcelTime(time);
}
Expand Down
2 changes: 1 addition & 1 deletion EPPlus/Drawing/ExcelDrawings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ public ExcelShape AddShape(string Name, ExcelShape Source)
}
private XmlElement CreateDrawingXml()
{
if (DrawingXml.OuterXml == "")
if (DrawingXml.DocumentElement == null)
{
DrawingXml.LoadXml(string.Format("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><xdr:wsDr xmlns:xdr=\"{0}\" xmlns:a=\"{1}\" />", ExcelPackage.schemaSheetDrawings, ExcelPackage.schemaDrawings));
Packaging.ZipPackage package = Worksheet._package.Package;
Expand Down
4 changes: 4 additions & 0 deletions EPPlus/EPPlus.MultiTarget.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ Release Candidate changes
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\EPPlus.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
<NoWarn>1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Compatibility\DateTimeExtensions.cs" />
<Compile Remove="Compatibility\SecurityElement.cs" />
Expand Down
16 changes: 12 additions & 4 deletions EPPlus/ExcelPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,13 @@ internal ImageInfo GetImageInfo(byte[] image)
return null;
}
}
internal static int _id = 1;
private Uri GetNewUri(Packaging.ZipPackage package, string sUri)
{
int id = 1;
Uri uri;
do
{
uri = new Uri(string.Format(sUri, id++), UriKind.Relative);
uri = new Uri(string.Format(sUri, _id++), UriKind.Relative);
}
while (package.PartExists(uri));
return uri;
Expand Down Expand Up @@ -748,7 +748,11 @@ private XmlNamespaceManager CreateDefaultNSM()
internal void SavePart(Uri uri, XmlDocument xmlDoc)
{
Packaging.ZipPackagePart part = _package.GetPart(uri);
xmlDoc.Save(part.GetStream(FileMode.Create, FileAccess.Write));
var stream = part.GetStream(FileMode.Create, FileAccess.Write);
var xr = new XmlTextWriter(stream, Encoding.UTF8);
xr.Formatting = Formatting.None;

xmlDoc.Save(xr);
}
/// <summary>
/// Saves the XmlDocument into the package at the specified Uri.
Expand Down Expand Up @@ -779,7 +783,11 @@ internal void SaveWorkbook(Uri uri, XmlDocument xmlDoc)
}
}
}
xmlDoc.Save(part.GetStream(FileMode.Create, FileAccess.Write));
var stream = part.GetStream(FileMode.Create, FileAccess.Write);
var xr = new XmlTextWriter(stream, Encoding.UTF8);
xr.Formatting = Formatting.None;

xmlDoc.Save(xr);
}

#endregion
Expand Down
Loading

0 comments on commit cdfc51d

Please sign in to comment.