Skip to content

Commit

Permalink
Pipeline fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DraviaVemal committed Aug 25, 2024
1 parent f64742d commit 3228011
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
run: |
VERSION=$(xmlstarlet sel -t -v "/Project/PropertyGroup/Version" Directory.Build.props)
git tag "v${VERSION}"
git push origin "${VERSION}"
git push --tags
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<OutputPath>..\bin\</OutputPath>
<Authors>DraviaVemal</Authors>
<Version>2.9.0-Alpha.4</Version>
<Version>2.9.0-Alpha.5</Version>
<Company>DraviaVemal</Company>
<Copyright>Copyright (c) 2023 DraviaVemal
Permission is hereby granted, free of charge, to any person obtaining a copy of this
Expand Down
23 changes: 0 additions & 23 deletions Spreadsheet/Internal/Spreadsheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ internal Worksheet AddSheet(string sheetName)
worksheetPart.Worksheet = new DocumentFormat.OpenXml.Spreadsheet.Worksheet(new SheetData());
return new Worksheet(excel, worksheetPart.Worksheet, sheet);
}
internal string GetSheetId(string sheetName)
{
Sheet sheet = GetSheets().FirstOrDefault(tempSheet => (tempSheet as Sheet).Name == sheetName) as Sheet;
if (sheet != null)
{
return sheet.Id.Value;
}
return null;
}
internal uint GetStyleId(CellStyleSetting CellStyleSetting)
{
return GetStyleService().GetCellStyleId(CellStyleSetting);
Expand Down Expand Up @@ -93,20 +84,6 @@ internal bool RenameSheet(string oldSheetName, string newSheetName)
sheet.Name = newSheetName;
return true;
}
internal bool RenameSheetById(string sheetId, string newSheetName)
{
if (CheckIfSheetNameExist(newSheetName))
{
throw new ArgumentException(string.Format("New Sheet with name '{0}' already exist.", newSheetName));
}
Sheet sheet = GetSheets().FirstOrDefault(tempSheet => (tempSheet as Sheet).Id.Value == sheetId.ToString()) as Sheet;
if (sheet == null)
{
return false;
}
sheet.Name = newSheetName;
return true;
}
private void SaveAs()
{
UpdateStyle();
Expand Down
2 changes: 1 addition & 1 deletion Spreadsheet/Internal/SpreadsheetCore.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) DraviaVemal. Licensed under the MIT License. See License in the project root.

using System.Collections.Generic;
using System.IO;
using System.Linq;
using DocumentFormat.OpenXml;
using System.Collections.Generic;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using G = OpenXMLOffice.Global_2007;
Expand Down
24 changes: 10 additions & 14 deletions Spreadsheet/Public/Excel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public Excel(ExcelProperties spreadsheetProperties = null)
{
spreadsheet = new Spreadsheet(this, spreadsheetProperties);
}

/// <summary>
/// Works with in memory object can be saved to file at later point.
/// Source file will be cloned and released. hence can be replace by saveAs method if you want to update the same file.
Expand All @@ -37,6 +38,7 @@ public Excel(string filePath, bool isEditable, ExcelProperties spreadsheetProper
isFileEdited = true;
spreadsheet = new Spreadsheet(this, filePath, isEditable, spreadsheetProperties);
}

/// <summary>
/// Works with in memory object can be saved to file at later point.
/// Source stream is copied and closed.
Expand All @@ -48,6 +50,7 @@ public Excel(Stream Stream, bool IsEditable, ExcelProperties spreadsheetProperti
isFileEdited = true;
spreadsheet = new Spreadsheet(this, Stream, IsEditable, spreadsheetProperties);
}

/// <summary>
/// Adds a new sheet to the OpenXMLOffice with the specified name. Throws an exception if
/// SheetName already exist.
Expand All @@ -56,6 +59,7 @@ public Worksheet AddSheet(string sheetName = null)
{
return spreadsheet.AddSheet(sheetName);
}

/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -84,6 +88,7 @@ public void SetActiveSheet(string sheetName)
++sheetIndex;
}
}

/// <summary>
/// Use this method to create a new style and get the style id
/// Use of Style Id instead of Style Setting directly in Worksheet Cell is highly recommended for performance
Expand All @@ -104,27 +109,23 @@ internal StylesService GetStyleService()
{
return spreadsheet.GetStyleService();
}
/// <summary>
/// Return the Sheet Name for the given Sheet ID
/// </summary>
public string GetSheetName(string sheetId)
{
return spreadsheet.GetSheetName(sheetId);
}

/// <summary>
/// Retrieves a Worksheet object from an OpenXMLOffice, allowing manipulation of the worksheet.
/// </summary>
public Worksheet GetWorksheet(string sheetName)
{
return spreadsheet.GetWorksheet(sheetName);
}

/// <summary>
/// Removes a sheet with the specified name from the OpenXMLOffice
/// </summary>
public bool RemoveSheet(string sheetName)
{
return spreadsheet.RemoveSheet(sheetName);
}

/// <summary>
/// Creates a new sheet with the specified name and adds its relevant components to the
/// workbook. Throws an exception if the sheet name is already in use.
Expand All @@ -133,13 +134,7 @@ public bool RenameSheet(string oldSheetName, string newSheetName)
{
return spreadsheet.RenameSheet(oldSheetName, newSheetName);
}
/// <summary>
/// Renames an existing sheet in the OpenXMLOffice.
/// </summary>
public bool RenameSheetById(string sheetId, string newSheetName)
{
return spreadsheet.RenameSheetById(sheetId, newSheetName);
}

/// <summary>
/// Even on edit file OpenXML-Office Will clone the source and work on top of it to protect the integrity of source file.
/// You can save the document at the end of lifecycle targeting the edit file to update or new file.
Expand All @@ -150,6 +145,7 @@ public void SaveAs(string filePath)
SendAnonymousSaveStates(Assembly.GetExecutingAssembly().GetName());
spreadsheet.SaveAs(filePath);
}

/// <summary>
/// Even on edit file OpenXML-Office Will clone the source and work on top of it to protect the integrity of source file.
/// You can save the document at the end of lifecycle targeting the edit file to update or new file.
Expand Down

0 comments on commit 3228011

Please sign in to comment.