Commit Graph

158 Commits

Author SHA1 Message Date
xuri 5ca7231ed4
optimize code and comments: use println errors instead of panic 2020-01-03 23:57:25 +08:00
xuri 09485b3f9f
Improve code coverage unit tests 2019-12-29 16:02:31 +08:00
xuri 1666d04559
optimization: checking error in unit tests 2019-12-24 01:09:28 +08:00
xuri 4e4a5b9b3e
Improve compatibility, fix workbook's rels ID calc error 2019-12-23 00:07:40 +08:00
xuri ae2865d923
Improve code coverage unit tests 2019-12-22 00:02:09 +08:00
xuri da0d2ffbb6 Fix #533, add support overlapped mergecells 2019-12-14 19:57:37 +08:00
xuri 5e418ebd66
Resolve #507, add the new function `DeleteDefinedName` 2019-10-26 20:55:24 +08:00
Michael 9fe267ffcf Pre-allocate some memory when reading files (#510) 2019-10-24 22:14:33 +08:00
xuri 75d66a03f3
Fix #482, font strike style support 2019-09-23 21:50:03 +08:00
Christian Fiedler 3280e1b686 Allow access to more formula attributes in SetCellFormula (#484)
* Allow access to more formula attributes in SetCellFormula

Make SetCellFormula variadic to not break API.
The new arguments are option arguments in which the type of
the formula and the ref attribute may be set.
These need to be set for an array formula to work.

* Add TestWriteArrayFormula to test optional parameters of SetCellFormula

TestWriteArrayFormula writes a document to the test directory that
contains array formulas that are used to calculate standard deviations.
The file also contains values calculated by the Go testcase, so the
results can be verified. It should be tested, if the array formula
works (i.e. shows a number, not an error) and that the values calculated
by the formula and those calculated by Go are the same.
2019-09-22 20:52:01 +08:00
xuri 407fb55c20
Update the Godoc 2019-08-21 23:03:34 +08:00
Harris acd76425c2
Handle multi row inline strings
The inline string struct is actually the same
as the shared strings struct, reuse it.

Note that Go version 1.10 is required.

Fixes #462
2019-08-09 08:12:08 -05:00
Harris e07581e980
Further improve read performance
Instead of re-encoding the full sheet to change the namespaces
in the encoded bytes, read the sheet again and do the byte
replacements there.

In this case, file access ends up being more performant than
marshaling the sheet back to XML.

In the SharedStrings test, ensure the strings are actually read.

Fix #439
2019-08-07 08:06:40 -05:00
xuri 35e485756f
Resolve #217, new function add VBA project supported. 2019-07-21 12:56:36 +08:00
xuri 54def7eaad
Add TIF, TIFF format images and more detailed error information when open the encrypted file 2019-06-27 21:58:14 +08:00
xuri a335be7e4e
New functions: SetDefinedName and GetDefinedName added 2019-06-18 23:07:44 +08:00
xuri 46a3632ee0
Fix #422, avoid accent theme color index overflow 2019-06-09 09:53:02 +08:00
xuri cff16fa811
- Supplemental worksheet struct fields and field order adjustment
- Testing case for set and get doc properties
- Update charts struct XML tags
2019-06-05 22:06:15 +08:00
xuri 7e77e14814
Resolve #397, support set style by columns 2019-05-16 13:36:50 +08:00
xuri 69b38ddcd6
Resolve #394, init set header and footer support 2019-05-05 16:25:57 +08:00
xuri b1f632d408 Resolve #393, upgrade Go module to v2 2019-05-02 15:57:47 +08:00
xuri b45c4b094c Add a check for maximum limit hyperlinks in a worksheet
typo fixed
2019-04-21 00:20:19 +08:00
xuri a88459d5f1
add unit tests to functions 2019-04-16 10:57:21 +08:00
xuri f2df344739
Resolve #369,#370
add error return value

exported functions:

GetMergeCells
ProtectSheet
UnprotectSheet
UpdateLinkedValue
GetMergeCells
SetSheetVisible

inner functions:

workSheetReader
copySheet
2019-04-15 11:22:57 +08:00
xuri f0244c0016
Add unit test to improve testing coverage 2019-03-24 13:08:32 +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 40ea8eb014
resolve #360, fix axis parse issue when add / get pictures;
typo fixed and go test updated
2019-03-20 16:52:33 +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
caozhiyi b974df402a update go test and function docs 2019-03-07 16:03:31 +08:00
Veniamin Albaev 12c1e2481e Implement consistent row addressing by Excel row number starting with 1 (#350)
* Implement consistent row addressing by Excel row number starting with 1

1. Added second versions for all row manipulation methods with zero-based row addressing.
2. Fixed methods documentation to explicitly describe which row addressing used in method.
3. Added WARNING to README.md.
4. Cosmetic change: All row test moved to file `rows_test.go`.

* TravisCI: go1.12 added to tests matrix

* BACKWARD INCOMPARTIBLE: Use only Excel numbering logic from 1 row

* README updated
2019-03-06 21:40:45 +08:00
xuri 1aed1d744b
Resolve #274, performance optimization for add images, charts and shapes 2019-02-25 22:14:34 +08:00
xuri 0072bb7310
resolve the issue corrupted xlsx after deleting formula of cell, reference #346 2019-02-22 22:17:38 +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
Veniamin Albaev 725c1a0c40 New feature: File.DuplicateRowTo() duplicate row to specified row position.
DuplicateRowTo() is similar to DuplicateRow() but copies specified row not just after specified source row
but to any other specified position below or above source row.

Also I made minor modifications of tests: using filepath.Join() instead of direct unix-way paths strings
to avoid possible tests fails on other OS.
2019-01-10 14:29:19 +03:00
xuri fabd9d013f
README updated 2019-01-01 13:20:14 +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
xuri 9a6f66a996
New feature: the function `SearchSheet` now support regular expression, relate pull request #316 2018-12-26 14:48:14 +08:00
Veniamin Albaev 7b7ca99f5d Duplicate row (#317)
* go mod tidy applied

* File.DuplicateRow() method added
2018-12-26 13:33:40 +08:00
r-uchino 9b8baf75ad Add RegSearchSheet (#316) 2018-12-26 13:30:59 +08:00
xuri b04107c4a3
Resolve #311, create 2D/3D area, stacked area, 100% stacked area chart support 2018-12-23 00:07:47 +08:00
xuri 3ca3156d45
Merge pull request #313 from sairoutine/feature/get_merge_cells
Add GetMergeCells
2018-12-19 23:32:12 +08:00
sairoutine 3012df08eb Add GetMergeCells 2018-12-19 20:54:38 +09:00
xuri b89f75c896
Add new logo for excelize 2018-12-05 00:27:19 +08:00
q523591 51857a217d New function `UnprotectSheet()` has been added 2018-11-04 23:14:43 +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
covv 75edf1ac7d Add testing case for the function `SearchSheet()`. 2018-10-27 22:54:17 +08:00
xuri 90bdd3632f
Fix the issue caused by missing tradition to strict conversion for `sharedStringsReader()`, relate issue #276 2018-10-18 10:23:08 +08:00
lizheao 2be4d45c62 feat: add new function and refactor writeto action
* add new exported function to get Excel file content buffer

* refactor the WriteTo function
2018-10-12 10:25:10 +08:00
xuri 6ced438f39
New function `AddPictureFromBytes()` has been added, this resolve #259 and close #271. 2018-09-14 00:24:49 +08:00
xuri a3571ee39b
Bugfix: create worksheet cause file issue. Relate issue #249. 2018-07-17 15:28:22 +08:00