Commit Graph

39 Commits

Author SHA1 Message Date
xuri 0d5d1c53b2
This closes #2015, fix a v2.9.0 regression bug introduced by commit 7715c1462a
- Fix corrupted workbook generated by open the workbook generated by stream writer
- Update unit tests
2024-10-25 08:52:59 +08:00
陈王 9d4c2e60f6
This closes #1825, made AddDataValidation and DeleteDataValidation functions concurrency safe (#1828)
- Remove the receiver of internal coordinatesToRangeRef, squashSqref and flatSqref functions
- Update unit tests

Co-authored-by: chenwang <chenwang@shinsson.com>
2024-03-01 10:12:17 +08:00
xuri d9a0da7b48
This closes #1687 and closes #1688
- Using sync map internally to get cell value concurrency safe
- Support set the height and width for the comment box
- Update the unit test
2023-10-11 00:04:38 +08:00
xuri 1c23dc3507
This sorted exported error constants by name and listed them in one place 2023-09-28 08:53:54 +08:00
xuri e3b7dad69a
Introduce the new exported function `AddSlicer` for adding table slicer
- Fix a v2.8.0 regression bug, generate workbook corruption caused by incorrect MRU colors style parts
- Fix corrupted workbooks generated when adding tables in some cases
- Added several exported extension list child element URI constants
- Move part of the internal constant and variables definition to the template source code file
- Updated unit tests
2023-09-16 12:21:11 +08:00
cnmlgbgithub db22452398
This closes #314, closes #1520 and closes #1521 (#1574)
- Add new function GetStyle support for get style definition
2023-08-24 23:51:07 +08:00
xuri dcb26b2cb8
Made unit tests compatibility with the next Go language version
- Fix documents issues for the `AddChart` function
- Update GitHub sponsor profile
2023-06-30 05:19:00 +00:00
xuri 60b9d029a6
Breaking changes: changed the function signature for 4 exported functions
- Change
    `func (f *File) AddVBAProject(bin string) error`
    to
    `func (f *File) AddVBAProject(file []byte) error`
- Change
    `func (f *File) GetComments() (map[string][]Comment, error)`
    to
    `func (f *File) GetComments(sheet string) ([]Comment, error)`
- Change
    `func (f *File) AddTable(sheet, rangeRef string, opts *TableOptions) error`
    to
    `func (f *File) AddTable(sheet string, table *Table) error`
- Change
    `func (sw *StreamWriter) AddTable(rangeRef string, opts *TableOptions) error`
    to
    `func (sw *StreamWriter) AddTable(table *Table) error`
- Rename exported data type `TableOptions` to `Table`
- Simplify the assert statements in the unit tests
- Update documents for the functions
- Update unit tests
2023-03-25 13:30:13 +08:00
xuri 12645e7116
This fixes #1461, supports 0 row height and column width
- Increase max cell styles to 65430
- Add new exported error variable `ErrCellStyles`
- Update unit tests, support test under Go 1.20.x
2023-02-03 00:08:46 +08:00
nesstord 61fda0b1ca
Fix binary string regex (#1415) 2022-12-07 00:45:27 +08:00
xuri efcf599dfe
This closes #1360, closes #1361
- Fix default number format parse issue with a long string of digits
- Fix creating a sheet with an empty name cause a corrupted file
- The `GetCellStyle` function no longer return master cell style of the merge cell range
- Using the specialized name in variables and functions
2022-09-28 00:04:17 +08:00
xuri 3f702999e6
Using the specialized name in a variable and making comments clear
- Add JSON tags for `AppProperties`, `PivotTableOption` and `PivotTableField` structure
2022-09-18 00:07:15 +08:00
xuri 8152bbb2ce
This closes #1312, #1313, fix number format issue
- Add supported options in the docs of the functions `SetSheetPrOptions` and `GetSheetPrOptions`
- Add go1.19 unit test settings, and made the test case compatible with go1.19
- Update dependencies module
2022-08-12 00:32:51 +08:00
MJacred 6429588e14
adjust `ErrColumnNumber`, rename `TotalColumns` to `MaxColumns` and add new constant `MinColumns` (#1272)
Signed-off-by: Benjamin Lösch <loesch.benny92@gmx.de>
2022-07-14 23:36:43 +08:00
xuri 94f197c4fe
This improved formula calculate precision and added zero placeholder number format support 2022-03-19 00:05:47 +08:00
xuri 4b64b26c52
Ref: #660, #764, #1093, #1112, #1133 This improve number format support
- Introduced NFP (number format parser) dependencies module
- Initialize custom dates and times number format support
- Dependencies module upgraded
2022-02-13 00:06:30 +08:00
xuri 3ee3c38f9c
Fix file corrupted in some cases, check file extension and format code
Fix file corrupted when save as in XLAM / XLSM / XLTM / XLTX extension in some case
New exported error ErrWorkbookExt has been added, and check file extension on save the workbook
Format source code with `gofumpt`
2022-01-23 00:48:26 +08:00
xuri 44a13aa402
Export 7 errors so users can act differently on different type of errors 2021-12-07 00:26:53 +08:00
xuri adecf447e1
This closes #1059, represent boolean in XML as 0/1 rather than true/false 2021-11-13 14:11:16 +08:00
xuri 790c363cce This closes #833, closes #845, and closes #1022, breaking changes
- Close spreadsheet and row's iterator required
- New options `WorksheetUnzipMemLimit` have been added
- Improve streaming reading performance, memory usage decrease about 93.7%
2021-09-19 11:06:54 +08:00
xuri c3d1d7dddd
Preserve XML control character in bstrUnmarshal result 2021-08-28 09:23:44 +08:00
xuri c49e7aab30
Reduce cyclomatic complexities for the formula calculate function and update documentation for the API: `MergeCell` and `GetCellValue` 2021-08-09 22:22:43 +08:00
xuri cf9fbafdd8
This closes #979, fix the data validation deletion issue and tidy the internal function in the source code 2021-08-06 22:44:43 +08:00
xuri 2cfcf9eb5f encode the escaped string literal which not permitted in an XML 1.0 document 2021-06-16 15:03:50 +00:00
xuri e354db69b0
string pattern match context check instead of regex lookahead assertion 2021-06-13 11:23:52 +08:00
xuri 5faa36430c
skip XML control character in the escape literal string, and update dependencies 2021-06-12 08:49:18 +08:00
xuri 83e12cc4e5
support escaped string literal basic string and use GitHub Action instead of TravisCI
- Note that: travis-ci.org will shutdown on June 15th, 2021, and I don't have enough permission to migrate this project to travis-ci.com currently
2021-06-11 22:48:37 +08:00
xuri be12cc27f1
This closes #652, new SetColWidth API, support set column width in stream writing mode, and export error message 2021-05-10 00:09:24 +08:00
xuri 7e429c5b46
Fixe issue generated file corrupted caused by incorrect default XML namespace attributes 2021-04-30 00:14:42 +08:00
xuri 13e7bce6d2
improvement compatibility for the XML ignorable namespace 2020-07-20 00:05:37 +08:00
xuri 0aa1510694
update docs and improve compatibility 2020-07-11 02:31:02 +08:00
xuri 2ae631376b
add limits for total columns, row and filename length 2020-05-29 00:26:40 +08:00
xuri 7f78464f7f
add test for ReadZipReader, close #642 2020-05-23 13:29:51 +08:00
xuri 0f2a905324 Performance improvements 2020-04-05 13:51:00 +08:00
xuri 40ff5dc1a7
refactor: handler error instead of panic,
Exported functions:

SetCellStyle
InsertCol
RemoveCol
RemoveRow
InsertRow
DuplicateRow
DuplicateRowTo
SetRowHeight
GetRowHeight
GetCellValue
GetCellFormula
GetCellHyperLink
SetCellHyperLink
SetCellInt
SetCellBool
SetCellFloat
SetCellStr
SetCellDefault
GetCellStyle
SetCellValue
MergeCell
SetSheetRow
SetRowVisible
GetRowVisible
SetRowOutlineLevel
GetRowOutlineLevel
GetRows
Columns
SearchSheet
AddTable
GetPicture
AutoFilter
GetColVisible
SetColVisible
GetColOutlineLevel
SetColOutlineLevel
SetColWidth
GetColWidth

inner functions:

adjustHelper
adjustMergeCells
adjustAutoFilter
prepareCell
setDefaultTimeStyle
timeToExcelTime
addDrawingChart
addDrawingVML
addDrawingPicture
getTotalRowsCols
checkRow
addDrawingShape
addTable
2019-03-23 20:08:06 +08:00
Veniamin Albaev dc01264562 Huge refactorig for consistent col/row numbering (#356)
* Huge refactorig for consistent col/row numbering

Started from simply changing ToALphaString()/TitleToNumber() logic and related fixes.
But have to go deeper, do fixes, after do related fixes and again and again.

Major improvements:

1. Tests made stronger again (But still be weak).
2. "Empty" returns for incorrect input replaces with panic.
3. Check for correct col/row/cell naming & addressing by default.
4. Removed huge amount of duplicated code.
5. Removed ToALphaString(), TitleToNumber() and it helpers functions at all,
and replaced with SplitCellName(), JoinCellName(), ColumnNameToNumber(), ColumnNumberToName(), CellNameToCoordinates(), CoordinatesToCellName().
6. Minor fixes for internal variable naming for code readability (ex. col, row for input params, colIdx, rowIdx for slice indexes etc).

* Formatting fixes
2019-03-20 00:14:41 +08:00
Veniamin Albaev 35426ed5dc Tests refactoring
Primary motivation: Avoid statefull tests with not ignorable git file tree changes.
Multiple tests reads and overwrites signle file for won needs.
Multiple tests reads and overwrites file under version control.

Secondary motivation: Minimal tests logic aligment, separate error expectation
and not error expectation tests. Introduce sub-test over test data sets and so far.

This commit is not ideal but necessary (IMHO)
2018-12-27 13:51:44 +03:00
Ri Xu 638bd44dd5
- gofmted with -s;
- Fix ineffectual assignments in Go code;
- Godoc has been updated
2018-01-31 11:12:43 +08:00
mbresson 317ef65381 make SetCellStyle quicker by skipping conversions in checkCellInArea, and skipping area checks when we are sure the cell can't be before or past the current row/col
Signed-off-by: Matthieu Bresson
2018-01-19 17:49:09 +08:00