Commit Graph

206 Commits

Author SHA1 Message Date
xuri 9999221450
This closes #1865, unescape newline character in stream writer
- Update dependencies module
2024-04-01 08:49:21 +08:00
hu5ky 4eb088cf73
This fix performance impact introduced in #1692 (#1849)
Co-authored-by: chun.zhang2 <chun.zhang2@geely.com>

- This fix speed slowdown and memory usage increase base on the reverts commit 6220a798fd
- Fix panic on read workbook with internal row element without r attribute
- Update the unit tests
2024-03-15 11:36:34 +08:00
Paolo Barbolini 963a058535
Optimize getSharedFormula to avoid runtime.duffcopy (#1837) 2024-03-03 09:39:50 +08:00
Vivek Kairi ee2ef152d9
This closes #1815, cell value reading functions inherit the Options settings of the OpenReader (#1816)
Co-authored-by: Vivek Kairi <vivek@zerodhafundhouse.com>
2024-02-15 13:30:07 +08:00
3zmx 50e23df865
ref #65, support _xlfn.ANCHORARRAY formula function (#1784)
- Initial formula array calculation support
- Update unit test and documentation
2024-01-18 15:31:43 +08:00
xuri 792656552b
This closes #1777, fix the GetStyle or GetConditionalStyle function to returns incorrect DecimalPlaces field value
- Update documentation for the NewStyle function
- Update unit tests
- Update dependencies Go module
- Update GitHub workflow dependencies package version
- Update copyright agreement statement
2024-01-09 20:56:20 +08:00
cui fliter 77ece87e32
This fix some function names in comment (#1747)
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-12-07 15:22:26 +08:00
xuri 41259b474f
Recalculate and use the same shared string count and unique count to overwrite incorrect existing values 2023-11-23 00:03:10 +08:00
ZX 6251d493b3
Fixed invalid shared string table index on set cell value (#1725) 2023-11-21 11:23:54 +08:00
Tian 55e4d4b2c3
The GetCellRichText function support to return inline rich text (#1724)
Co-authored-by: jintian.wang <jintian.wang@mihoyo.com>
2023-11-20 23:57:45 +08:00
lujin 6220a798fd
This closes #1723, fix panic on read workbook in some cases (#1692)
- Fix panic on read workbook with internal row element without r attribute
- Check worksheet XML before get all cell value by column or row
- Update the unit tests
2023-11-18 16:44:45 +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 99df1a7343
This closes #1681, closes #1683
- Fix incorrect formula calculation result
- Introduce new exported function `SetCellUint`
- Updates unit test
- Typo fixed
2023-10-08 00:06:11 +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 9c079e5eec
This fix #1665, supports getting formula string cell value
- Improve compatibility for absolute path drawing part
- Fix incorrect table ID generated in the workbook which contains single table cells
- Fix missing relationship parts in the content types in some cases
- Upgrade number format parser to fix missing literal tokens in some cases
- Update built-in zh-cn and zh-tw language number format
- Ref #65, init new formula function: TEXT
- Remove duplicate style-related variables
- Update the unit tests
2023-09-21 00:06:31 +08:00
xuri ae64bcaabe
This fixes #1643, fixes #1647 and fixes #1653
- Correction cell type when formatting date type cell value
- Add check for MID and MIDB formula functions num_chars arguments, prevent panic on specifying a negative number
- Ref #65, add support for 2 formula functions: SEARCH and SEARCHB
- Fix a v2.8.0 regression bug, error on set print area and print titles with built-in special defined name
- Add new exported function `GetPivotTables` for get pivot tables
- Add a new `Name` field in the `PivotTableOptions` to support specify pivot table name
- Using relative cell reference in the pivot table docs and unit tests
- Support adding slicer content type part internally
- Add new exported source relationship and namespace `NameSpaceSpreadSheetXR10`, `ContentTypeSlicer`, `ContentTypeSlicerCache`, and `SourceRelationshipSlicer`
- Add new exported extended URI `ExtURIPivotCacheDefinition`
- Fix formula argument wildcard match issues
- Update GitHub Actions configuration, test on Go 1.21.x with 1.21.1 and later
- Avoid corrupted workbooks generated by improving compatibility with internally indexed color styles
2023-09-08 00:21:38 +08:00
xuri 1b63d098a7
This improves applying cell value with currency and accounting number format
- Update the unit test and dependencies modules
2023-08-21 00:11:55 +08:00
xuri 5fe30eb456
This closes #1590, add the Japanese calendar number format support
- The `GetFormControl` now support to get text, rich-text and font format of the form controls
- Update the unit tests and the documentation
2023-07-31 00:08:10 +08:00
xuri 49234fb95e
Ref #1199, this support applies partial built-in language number format code
- Remove the `Lang` field in the `Style` data type
- Rename field name `ShortDateFmtCode` to `ShortDatePattern` in the `Options` data type
- Rename field name `LongDateFmtCode` to `LongDatePattern` in the `Options` data type
- Rename field name `LongTimeFmtCode` to `LongTimePattern` in the `Options` data type
- Apply built-in language number format code number when creating a new style
- Checking and returning error if the date and time pattern was invalid
- Add new `Options` field `CultureInfo` and new exported data type `CultureName`
- Add new culture name types enumeration for country code
- Update unit tests
- Move built-in number format code and currency number format code definition source code
- Remove the built-in language number format code mapping with Unicode values
- Fix incorrect number formatted result for date and time with 12 hours at AM
2023-05-11 09:08:38 +08:00
fudali dfdd97c0a7
This closes #1199, support apply number format by system date and time options
- Add new options `ShortDateFmtCode`, `LongDateFmtCode` and `LongTimeFmtCode`
- Update unit tests
2023-05-06 20:34:18 +08:00
xuri 7c221cf295
Ref #660, support placeholder, padding and rounds numbers by specified number format code
- Remove built-in number formats functions
- Update unit tests
- Upgrade dependencies package
2023-04-30 11:10:51 +08:00
xuri 65fc25e7a6
Ref #1533, this made number format text handler just handle text tokens
- Fix race conditions for concurrency read and write shared string table
- Unit tests has been updated
2023-04-26 00:04:47 +08:00
xuri 612f6f104c
This closes #1528, closes #1533
- Avoid format text cell value as a numeric
- Fix race conditions for concurrency safety functions
2023-04-25 08:44:41 +08:00
xuri 93c72b4d55
This optimizes internal functions signature and mutex declarations 2023-04-24 00:02:13 +08:00
xuri fb6ce60bd5
This closes #1523, preventing format text cell value as a numeric
- Simplify variable declaration and error return statements
- Remove the internal `xlsxTabColor` data type
- Using the `xlsxColor` data type instead of `xlsxTabColor`
- Update unit test, improve code coverage
2023-04-19 00:05:59 +08:00
xuri d0ad0f39ec
This commit contains 5 changes:
- Fix incorrect comment box size for multi-line plain text comments
- Prevent create duplicate tables with the same name
- Add new exported error variable `ErrExistsTableName`
- Allocate buffer inside escape XML characters
- Update the unit tests
2023-04-17 08:48:30 +08:00
xuri 17c029494a
This closes #1519, escape XML characters after checking cell value length 2023-04-16 14:22:55 +08:00
Valery Ozarnichuk 635ec33576
Support checking cell value length with multi-bytes characters (#1517) 2023-04-12 08:17:10 +08:00
xuri 3b807c4bfe
This support get cell hyperlink for merged cells 2023-03-29 00:00:27 +08:00
xuri 9dbba9f34a
This closes #1508, support SST index which contains blank characters 2023-03-28 00:05:18 +08: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
ChantXu64 a34c81e1cc
This closes #1448, speed up for checking merged cells (#1500) 2023-03-20 09:17:28 +08:00
xuri 65a53b3ec6
Breaking changes: replace the type `ShapeParagraph` with `RichTextRun`
- This removes the `Color` field from the type `Shape`, and uses the `Fill` instead of it
- Remove sharp symbol from hex RGB color
- Update unit tests
2023-02-27 00:05:36 +08:00
xuri 3e2406096f
This closes #1462 and closes #1464
- Support creating a conditional format with a "stop if true" rule
- Support set border color and create solid color for the color data bar
- Fix incorrect cell type when modifying string cell with the time number
- Update unit test for the add pivot table to avoid pivot table range overlap
2023-02-07 00:08:11 +08:00
xuri 85e0b6c56e
Support to create of 17 kinds of fill variants styles
- Update the unit tests
- Update the `SetHeaderFooter` function parameters name
- Update document for the `SetDocProps` and `SetCellHyperLink` functions
2023-02-01 00:11:08 +08:00
xuri 917e6e19d6
This roundup time value when a millisecond great than 500 to fix the accuracy issue
- Correction example in the documentation of set cell formula
- Rename the internal function `parseOptions` to `getOptions`
- Update unit tests
2023-01-20 03:10:04 +00:00
xuri 5429f131f8
This closes #1438, fix cell data type issue for formula calculation engine
- Update dependencies module
- Update unit tests
2023-01-08 00:23:53 +08:00
xuri b39626fae9
This fixed worksheet protection issue
- Update example code in the documentation
- Update unit tests
- Rename `PictureOptions` to `GraphicOptions`
- Adjust partial options fields data types for the `PictureOptions` and `Shape` structure
- Update dependencies module
2023-01-02 11:47:31 +08:00
xuri f58dabd492
Breaking change: changed the function signature for 11 exported functions
* Change
    `func (f *File) NewConditionalStyle(style string) (int, error)`
    to
    `func (f *File) NewConditionalStyle(style *Style) (int, error)`
* Change
    `func (f *File) NewStyle(style interface{}) (int, error)`
     to
    `func (f *File) NewStyle(style *Style) (int, error)`
* Change
    `func (f *File) AddChart(sheet, cell, opts string, combo ...string) error`
     to
    `func (f *File) AddChart(sheet, cell string, chart *ChartOptions, combo ...*ChartOptions) error`
* Change
    `func (f *File) AddChartSheet(sheet, opts string, combo ...string) error`
     to
    `func (f *File) AddChartSheet(sheet string, chart *ChartOptions, combo ...*ChartOptions) error`
* Change
    `func (f *File) AddShape(sheet, cell, opts string) error`
     to
    `func (f *File) AddShape(sheet, cell string, opts *Shape) error`
* Change
    `func (f *File) AddPictureFromBytes(sheet, cell, opts, name, extension string, file []byte) error`
     to
    `func (f *File) AddPictureFromBytes(sheet, cell, name, extension string, file []byte, opts *PictureOptions) error`
* Change
    `func (f *File) AddTable(sheet, hCell, vCell, opts string) error`
     to
    `func (f *File) AddTable(sheet, reference string, opts *TableOptions) error`
* Change
    `func (sw *StreamWriter) AddTable(hCell, vCell, opts string) error`
     to
    `func (sw *StreamWriter) AddTable(reference string, opts *TableOptions) error`
* Change
    `func (f *File) AutoFilter(sheet, hCell, vCell, opts string) error`
     to
    `func (f *File) AutoFilter(sheet, reference string, opts *AutoFilterOptions) error`
* Change
    `func (f *File) SetPanes(sheet, panes string) error`
     to
    `func (f *File) SetPanes(sheet string, panes *Panes) error`
* Change
    `func (sw *StreamWriter) AddTable(hCell, vCell, opts string) error`
     to
    `func (sw *StreamWriter) AddTable(reference string, opts *TableOptions) error`
* Change
    `func (f *File) SetConditionalFormat(sheet, reference, opts string) error`
     to
    `func (f *File) SetConditionalFormat(sheet, reference string, opts []ConditionalFormatOptions) error`
* Add exported types:
  * AutoFilterListOptions
  * AutoFilterOptions
  * Chart
  * ChartAxis
  * ChartDimension
  * ChartLegend
  * ChartLine
  * ChartMarker
  * ChartPlotArea
  * ChartSeries
  * ChartTitle
  * ConditionalFormatOptions
  * PaneOptions
  * Panes
  * PictureOptions
  * Shape
  * ShapeColor
  * ShapeLine
  * ShapeParagraph
  * TableOptions
* This added support for set sheet visible as very hidden
* Return error when missing required parameters for set defined name
* Update unit test and comments
2022-12-30 00:50:08 +08:00
Liron Levin a57203a03a
This closes #1432, fix panic formattedValue when style is negative (#1433) 2022-12-29 00:37:37 +08:00
xuri 45d168c79d
This closes #1391, escape XML characters to avoid with corrupt file
- Update and improve unit test coverage
2022-11-15 22:08:37 +08:00
xuri ac564afa56
Remove internal error log print, throw XML deserialize error 2022-11-13 00:40:04 +08:00
xuri bd5dd17673
This is a breaking change, remove partial internal error log print, throw XML deserialize error
- Add error return value for the `GetComments`, `GetDefaultFont` and `SetDefaultFont` functions
- Update unit tests
2022-11-12 00:16:23 +08:00
March 8753950d62
Delete shared formula in calc chain when writing a formula cell (#1387) 2022-11-08 00:35:19 +08:00
Martin Martinez Rivera 75c912ca95
This closes #1384, fix segmentation fault in `formattedValue` (#1385)
- Add nil pointer guard in cell format
- Add tests to verify the nil checks in formattedValue

Co-authored-by: Zach Clark <zachmclark@gmail.com>
2022-11-05 12:41:07 +08:00
xuri db2d084ada
This closes #1204, breaking changes for add comments
- Allowing insert SVG format images
- Unit tests updated
2022-11-02 08:45:06 +08:00
xuri adf9d37d82
This closes #1379, cleanup stream writer temporary files by the `Close` function
- Fix error on inserting columns or rows on the worksheet which contains one cell merged cell range
- Fix getting incomplete rich text cell value in some cases
- Unit tests updated
2022-10-26 00:04:23 +08:00
xuri f44153ea46
This closes #1377, stream writer writes inline string type for string cell value
- Add `CellTypeFormula`, `CellTypeInlineString`, `CellTypeSharedString` and remove `CellTypeString` in `CellType` enumeration
- Unit tests updated
2022-10-25 10:24:45 +08:00
xuri 14c6a198ce
Support get cell value which contains a date in the ISO 8601 format
- Support set and get font color with indexed color
- New export variable `IndexedColorMapping`
- Fix getting incorrect page margin settings when the margin is 0
- Update unit tests and comments typo fixes
- ref #65, new formula functions: AGGREGATE and SUBTOTAL
2022-10-24 00:52:09 +08:00
GaoFei 3ece904b00
This closes #1369, support set, and get font color with theme and tint (#1370) 2022-10-15 00:03:49 +08:00