Commit Graph

187 Commits

Author SHA1 Message Date
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
charles.deng 2f5704b114
Stream writer support to set inline rich text cell (#1121)
Co-authored-by: zhengchao.deng <zhengchao.deng@meican.com>
2022-10-10 00:11:18 +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 b6cc43d824
This makes 6 functions concurrency safety
- These 6 functions now support concurrency safe: SetColWidth, GetColWidth, SetColVisible, GetColVisible, SetColStyle and GetColStyle
2022-09-11 00:04:04 +08:00
Cooper de Nicola 0e9378fec2
This closes #1247, add new function `SetSheetCol` for set worksheet column values (#1320)
Signed-off-by: cdenicola <cooper.denicola@instabase.com>
Co-authored-by: cdenicola <cooper.denicola@instabase.com>
2022-08-25 09:34:29 +08:00
xuri 551fb8a9e4
This closes #1244 and closes #1314, improving the compatibility with Google Sheet
- Format code with `gofmt`
2022-08-13 11:21:59 +08:00
xuri ebea684ae5
Fix potential file corrupted and change worksheet name case-insensitive
- Using sheet ID instead of sheet index when delete the cell in calculation chain
- Update documentation for exported functions
- Using `sheet` represent the sheet name in the function parameters
2022-07-18 00:21:34 +08:00
xuri 40ed1d1b81
Fix potential file corrupted when changing cell value or the col/row
- Remove shared formula subsequent cell when setting the cell values
- Support adjust table range when removing and inserting column/row
2022-07-16 12:50:40 +08:00
yeshu 18afc88759
This closes #1264, fix can't modify cell content issue in some cases
Remove inline rich text when setting cell value and cell formulas
2022-07-01 00:46:23 +08:00
jialei d490a0f86f
RichTextRun support set superscript and subscript by vertAlign attribute (#1252)
check vertical align enumeration, update set rich text docs and test
2022-06-13 23:38:59 +08:00
xuri 8f16a76781
This fixes a part of staticcheck issues and updates the code of conduct
Update example for set cell hyperlinks with `HyperlinkOpts`
2022-05-18 23:15:24 +08:00
xuri 19a0cf3cec
This closed #1163, fix set cell value with column and row style inherit issue 2022-05-15 15:38:40 +08:00
xuri eed431e0fc
This closes #1219, fixes cell value reading issue, improves performance, and 1904 date system support
- Fix incorrect cell data types casting results when number formatting
- Support set cell value on 1904 date system enabled, ref #1212
- Improve performance for set sheet row and the merging cells, fix performance impact when resolving #1129
2022-05-02 12:30:18 +08:00
xuri 773d4afa32
This closes #1217, support update cell hyperlink
Ref #1129, make `SetRowStyle` overwrite style of the cells
2022-05-01 12:28:36 +08:00
xuri 856ee57c40
This closes #1212, init support for 1900 or 1904 date system 2022-04-30 09:54:11 +08:00
xuri 0f93bd23c9
This closes #1213, fix get incorrect rich text value caused by missing cell type checking 2022-04-29 13:53:09 +08:00
xuri 29d63f6ae0
ref #65, new formula functions: HYPGEOM.DIST and HYPGEOMDIST 2022-03-30 00:01:38 +08:00
xuri 8a335225c7
Format code, update documentation and remove exported variable `XMLHeaderByte` 2022-03-24 00:19:30 +08:00
xuri 94f197c4fe
This improved formula calculate precision and added zero placeholder number format support 2022-03-19 00:05:47 +08:00