Commit Graph

63 Commits

Author SHA1 Message Date
xuri c82a185af8
Compatibility improvement: parse document core part (workbook) dynamically 2020-11-04 00:28:20 +08:00
Ted fcca8a3838
optimize memory allocation (#722)
* optimize marshal

* optimize mem alloc

* add benchmark testing

* add NewSheetWithRowNum testing

* sync struct fields order

* add BenchmarkNewSheetWithStreamWriter

* delete NewSheetWithRowNum and benchmark test
2020-11-03 17:48:37 +08:00
xuri c3e92a51d7 Compatible with Go 1.15, fix unit test failed on Windows and fixed #689 potential race condition 2020-08-15 09:19:35 +00:00
xuri 843bd24e56 This closes #677 and closes #679, fix panic when enabling compiler inline flags 2020-08-06 05:58:40 +00:00
xuri 13e7bce6d2
improvement compatibility for the XML ignorable namespace 2020-07-20 00:05:37 +08:00
xuri ca43c65115
Update test for addTable 2020-07-19 00:10:42 +08:00
xuri c922c32fb7
support parse and generate XML element namespace dynamic, fix #651 2020-07-18 15:15:16 +08:00
xuri 49257c5918
support case-sensitive doc parts to improve compatibility 2020-07-09 01:24:11 +08:00
xuri 15fd56853f
Update docs and typo fixed 2020-06-22 00:14:56 +08:00
xuri 5221729bc3
make columns iterator read cell streamingly and add max column limit on ColumnNumberToName 2020-06-22 00:05:19 +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
sachin-puranik 82bb1153d7
Improved error handling and stoped the crash due to fatel error (#593) close #624 2020-05-23 12:51:46 +08:00
xuri 2efc7107ff
- transform the range to the matrix on the first arg of the formula
- typo fix
- reset cell with and height when insert picture into merged cell with autofit
2020-05-21 22:57:58 +08:00
xuri 48fc4c08a2
init formula calculation engine, ref #65 and #599 2020-05-03 18:44:43 +08:00
xuri 0f2a905324 Performance improvements 2020-04-05 13:51:00 +08:00
xuri 09485b3f9f
Improve code coverage unit tests 2019-12-29 16:02:31 +08:00
xuri 4e4a5b9b3e
Improve compatibility, fix workbook's rels ID calc error 2019-12-23 00:07:40 +08:00
Michael 9fe267ffcf Pre-allocate some memory when reading files (#510) 2019-10-24 22:14:33 +08:00
xuri 9c70d0ac86
Documentation updated, Go 1.10+ required 2019-08-11 00:36:14 +08:00
xuri 0660f30cdd
godoc update and typo fixed 2019-04-20 14:57:50 +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
xuri beff7b4f3c
Typo fixed and godoc updated 2019-03-20 15:13:41 +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
Olivier Mengué e780e41e02 Faster TitleToNumber (#343)
* TestTitleToNumber: more test cases

* TitleToNumber: drop use of math.Pow()

Compute using pure integers

* TitleToNumber: simplify

Remove unecessary casts to int
2019-02-02 11:05:01 +08:00
xuri fabd9d013f
README updated 2019-01-01 13:20:14 +08:00
HcySunYang 4dbc78ce0a resolve #273 new feature: protect sheet support
new feature: protect sheet support, relate issue #273
2018-11-02 23:08:31 +08:00
xuri 1c45425f12
resolve #276, add OfficeOpenXML-XMLSchema-Strict mode support 2018-10-17 00:28:31 +08:00
xuri 3e004d900b
Comments style changed. 2018-09-14 00:58:48 +08:00
xuri 13a9769cc5
Comments style changed. 2018-09-14 00:44:23 +08:00
xuri 2f146c923c
Comments style changed. 2018-09-14 00:35:47 +08:00
xuri b4a6e61ec3
Fix golint errors under confidence 0.1 2018-09-12 15:47:56 +08:00
xuri ec37b114c3
Fixes #256 and format document. 2018-08-06 10:21:24 +08:00
xuri 79dfe1c307
GoDoc updated. 2018-07-13 17:40:47 +08:00
Olivier Mengué 4a1b406456 CopySheet() using reflect instead of encoding/gob
Use github.com/mohae/deepcopy to deep copy worksheets instead of the
internal deepcopy function that was using encoding/gob serialization and
deserialization.

Rationale:
1/ using `encoding/gob` is much slower than
   [`mohae/deepcopy`](https://github.com/mohae/deepcopy/)
2/ When building an application this implementation of `deepcopy` drags
   the `encoding/gob` package into the binary. And this package is much
   bigger than `mohae/deepcopy` (which only depends on `time` and `reflect`).

```
$ LC_ALL=C stat -f "%6z %N" $(go env GOPATH)/pkg/$(go env GOOS)_$(go env GOARCH)/github.com/mohae/deepcopy.a $(go env GOROOT)/pkg/$(go env GOOS)_$(go env GOARCH)/encoding/gob.a
 10508 .../pkg/darwin_amd64/github.com/mohae/deepcopy.a
541818 .../pkg/darwin_amd64/encoding/gob.a
```
2018-06-14 17:54:31 +02:00
xuri 9e463b4614
- Add error return value for functions: `AddChart()`, `AddComment()`, `AddPicture()`, `AddShape()`, `AddTable()` and `SetConditionalFormat()`
- go test has been updated
2018-05-27 11:25:55 +08:00
Lunny Xiao 38ad20efc1
save bytes on memory instead of string 2018-05-07 16:12:51 +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
Olivier Mengué 88e48e079a Add SetSheetViewOptions and GetSheetViewOptions (#145)
Two new methods:
- SetSheetViewOptions(sheetName string, viewIndex int, opts ...SheetViewOption) error
- GetSheetViewOptions(sheetName string, viewIndex int, opts ...SheetViewOptionPtr) error

The option values are given by the user through types that have privates methods
that implement the private SheetViewOption and SheetViewOptionPtr interfaces:
- DefaultGridColor(bool)
- RightToLeft(bool)
- ShowFormulas(bool)
- ShowGridLines(bool)
- ShowRowColHeaders(bool)

Examples:
    err := xl.SetSheetViewOptions("Sheet1", -1, excelize.ShowGridLines(true))

    var showGridLines excelize.ShowGridLines
    err := xl.GetSheetViewOptions("Sheet1", -1, &showGridLines)

Fixes #145.
2017-11-16 12:00:36 +01:00
Ri Xu 1f93fc7bad Optimize code. 2017-09-06 12:16:39 +08:00
lichaofei 787495c503 Update lib.go 2017-09-05 18:26:47 +08:00
lichaofei 1169042f7d Update lib.go 2017-09-05 18:06:38 +08:00
Ri Xu 1ec2661dda
Bugfix: deep copy issue with function `CopySheet()`, relate PR #108. 2017-08-19 13:37:15 +08:00
Ri Xu 555e2ba9a8
- Make function `TitleToNumber()` exportable, note that function `ToAlphaString()` return value calculation changes, get more info from go doc. Relate issue #63;
- Readme and go doc updated
2017-06-27 17:53:06 +08:00
Ri Xu 35841caaf1
- Function `formattedValue()` performance improvement by avoid repeating deserialization, relate issue #64;
- Make function `ToAlphaString()` exportable, relate issue #63
2017-06-26 18:44:19 +08:00
Ri Xu 1f73f08185 - New feature: border setting support (Related issue #21);
- Function parameter code is simplified;
- Fix element `Tint` value parsing error in worksheet;
- Update go test
2017-03-06 12:05:41 +08:00
Josh Fyne d9f4a2f154 Standardize input and output 2017-02-16 13:25:55 -05:00
Ri Xu 0833a9d5da - Improved performance when reading large files, call Token to read tokens one by one instead Unmarshal. Related issue #20 ;
- Fix go test typo;
- Update README
2017-02-12 19:03:24 +08:00
Ri Xu bd5b033b02 Support set work sheet background image. 2017-01-24 18:29:02 +08:00
Ri Xu 9559f454a7 Fix issue #17, update README and fix typo. 2017-01-23 16:15:01 +08:00