Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qax-os/excelize
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.1.0
Choose a base ref
...
head repository: qax-os/excelize
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.2.0
Choose a head ref

Commits on Feb 12, 2020

  1. 2
    Copy the full SHA
    023dba7 View commit details

Commits on Feb 15, 2020

  1. Copy the full SHA
    52f1eee View commit details

Commits on Feb 18, 2020

  1. Resolve #580, revert commit 5ca7231

    xuri committed Feb 18, 2020
    Copy the full SHA
    ad883ca View commit details

Commits on Feb 21, 2020

  1. Resolve #582, support to set date field subtotal and names for pivot …

    …table
    
    - typo fixed and update do.dev badge in the README.
    xuri committed Feb 21, 2020
    Copy the full SHA
    6dcb701 View commit details

Commits on Feb 24, 2020

  1. Copy the full SHA
    8b20ea1 View commit details

Commits on Feb 26, 2020

  1. AddPivotTable API changed: new structure PivotTableField to hold pivo…

    …t table fields for better scalability
    xuri committed Feb 26, 2020
    Copy the full SHA
    821a5d8 View commit details

Commits on Feb 28, 2020

  1. Update rows.go

    xxb-at-julichina authored Feb 28, 2020
    Copy the full SHA
    386a42d View commit details
  2. Merge pull request #589 from xxb-at-julichina/master

    Reduce redundant memory copy in getRowHeight
    xuri authored Feb 28, 2020
    Copy the full SHA
    0ac7e18 View commit details

Commits on Feb 29, 2020

  1. Copy the full SHA
    1d87da5 View commit details

Commits on Mar 2, 2020

  1. Copy the full SHA
    1e3c850 View commit details

Commits on Mar 3, 2020

  1. Export ExcelDateToTime function to convert excel date to time

    Signed-off-by: Vaibhav Nayak <vaibhav.nayak@gmail.com>
    hexbioc committed Mar 3, 2020
    Copy the full SHA
    83eedce View commit details
  2. Merge pull request #592 from hexbioc/master

    Exported function to convert excel date to time
    xuri authored Mar 3, 2020
    Copy the full SHA
    cb79754 View commit details

Commits on Mar 8, 2020

  1. Remove calculated properties to make recalculate formulas in some spr…

    …eadsheet applications, such as Kingsoft WPS
    xuri committed Mar 8, 2020
    Copy the full SHA
    2ccb8f6 View commit details

Commits on Mar 9, 2020

  1. Resolve #470, export Style structs to allow create the style for cell…

    …s by given JSON or structure
    xuri committed Mar 9, 2020
    Copy the full SHA
    9e2318c View commit details

Commits on Mar 12, 2020

  1. Copy the full SHA
    6ab5b99 View commit details

Commits on Mar 15, 2020

  1. Copy the full SHA
    cea3d80 View commit details

Commits on Mar 24, 2020

  1. Copy the full SHA
    a75c6f6 View commit details

Commits on Mar 28, 2020

  1. Copy the full SHA
    6afc468 View commit details

Commits on Mar 29, 2020

  1. Copy the full SHA
    3f89c6e View commit details

Commits on Mar 30, 2020

  1. Copy the full SHA
    3ce4b91 View commit details

Commits on Mar 31, 2020

  1. Add unit test case

    xuri committed Mar 31, 2020
    Copy the full SHA
    7363626 View commit details

Commits on Apr 1, 2020

  1. fix reading wrong string from xml such as below

    <sheetData><row r="1"><c r="A1" s="1" t="s"><v>0</v></c><c r="B1" s="1" t="s"></c></row></sheetData>
    foxmeder authored and xuri committed Apr 1, 2020
    Copy the full SHA
    59f6af2 View commit details

Commits on Apr 5, 2020

  1. Performance improvements

    xuri committed Apr 5, 2020
    4
    Copy the full SHA
    0f2a905 View commit details
  2. Copy the full SHA
    66d0272 View commit details

Commits on Apr 8, 2020

  1. Copy the full SHA
    6e90fa6 View commit details
  2. Fix for issue #608 (#609)

    echarlus authored Apr 8, 2020
    Copy the full SHA
    a2e1da8 View commit details
  3. Copy the full SHA
    e36650f View commit details

Commits on Apr 9, 2020

  1. - Resolve #611, fix failure BenchmarkSetCellValue

    - Allow empty filter, data, and rows in the pivot table
    - Add more test case for pivot table
    xuri committed Apr 9, 2020
    Copy the full SHA
    10115b5 View commit details

Commits on Apr 22, 2020

  1. - Resolve #485 use sheet index instead of ID

    -  added 3 internal function: getSheetID, getActiveSheetID, getSheetNameByID
    xuri committed Apr 22, 2020
    Copy the full SHA
    1fe660d View commit details

Commits on Apr 24, 2020

  1. Copy the full SHA
    2285d4d View commit details

Commits on May 3, 2020

  1. Copy the full SHA
    48fc4c0 View commit details

Commits on May 4, 2020

  1. Copy the full SHA
    bdf0538 View commit details
  2. Copy the full SHA
    789adf9 View commit details
  3. fn: CEILING, CEILING.MATH

    xuri committed May 4, 2020
    Copy the full SHA
    6f796b8 View commit details

Commits on May 5, 2020

  1. Copy the full SHA
    5c82f22 View commit details
  2. #65 fn: CSCH, DECIMAL, DEGREES, EVEN, EXP, FACT, FACTDOUBLE, FLOOR, F…

    …LOOR.MATH, FLOOR.PRECISE, INT, ISO.CEILING, LN, LOG, LOG10, MDETERM
    xuri committed May 5, 2020
    Copy the full SHA
    97e3f4c View commit details
  3. Copy the full SHA
    1f73a19 View commit details
  4. Merge branch 'formula'

    xuri committed May 5, 2020
    Copy the full SHA
    5f29af2 View commit details

Commits on May 6, 2020

  1. Copy the full SHA
    de34eca View commit details

Commits on May 7, 2020

  1. Copy the full SHA
    08185c3 View commit details

Commits on May 8, 2020

  1. - fn: SUMSQ

    - resolve ineffectual assignment
    - handle exception with invalid formula
    - update range resolver
    xuri committed May 8, 2020
    Copy the full SHA
    4188dc7 View commit details

Commits on May 10, 2020

  1. - formula engine: reduce cyclomatic complexity

    - styles: allow empty and default cell formats, #628
    xuri committed May 10, 2020
    Copy the full SHA
    882abb8 View commit details
  2. updated test and go.mod

    xuri committed May 10, 2020
    Copy the full SHA
    0feb819 View commit details
Showing with 5,492 additions and 657 deletions.
  1. +1 −1 .travis.yml
  2. +3 −3 CODE_OF_CONDUCT.md
  3. +1 −2 LICENSE
  4. +37 −19 README.md
  5. +37 −18 README_zh.md
  6. +3 −2 adjust.go
  7. +2,632 −0 calc.go
  8. +714 −0 calc_test.go
  9. +170 −3 cell.go
  10. +85 −3 cell_test.go
  11. +93 −23 chart.go
  12. +36 −3 chart_test.go
  13. +0 −3 codelingo.yaml
  14. +2 −2 col_test.go
  15. +12 −9 comment.go
  16. +8 −1 comment_test.go
  17. +29 −5 datavalidation.go
  18. +17 −0 datavalidation_test.go
  19. +8 −0 date.go
  20. +23 −9 date_test.go
  21. +54 −1 drawing.go
  22. +27 −0 drawing_test.go
  23. +4 −0 errors.go
  24. +4 −0 errors_test.go
  25. +25 −28 excelize.go
  26. +62 −13 excelize_test.go
  27. +1 −0 file.go
  28. +20 −0 file_test.go
  29. +8 −3 go.mod
  30. +25 −8 go.sum
  31. +86 −2 lib.go
  32. +5 −0 lib_test.go
  33. +2 −2 merge_test.go
  34. +29 −24 picture.go
  35. +182 −40 pivotTable.go
  36. +107 −48 pivotTable_test.go
  37. +75 −20 rows.go
  38. +79 −4 rows_test.go
  39. +1 −1 shape.go
  40. +230 −75 sheet.go
  41. +47 −10 sheet_test.go
  42. +4 −4 sheetpr_test.go
  43. +12 −12 sheetview_test.go
  44. +2 −3 sparkline.go
  45. +2 −2 sparkline_test.go
  46. +20 −25 stream.go
  47. +7 −0 stream_test.go
  48. +145 −105 styles.go
  49. +44 −3 styles_test.go
  50. BIN test/images/chart.png
  51. +1 −1 xmlChart.go
  52. +88 −0 xmlChartSheet.go
  53. +66 −42 xmlDrawing.go
  54. +3 −3 xmlPivotTable.go
  55. +45 −14 xmlSharedStrings.go
  56. +64 −52 xmlStyles.go
  57. +5 −6 xmlWorksheet.go
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@ install:
- go get -d -t -v ./... && go build -v ./...

go:
- 1.10.x
- 1.11.x
- 1.12.x
- 1.13.x
- 1.14.x

os:
- linux
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://www.contributor-covenant.org
[version]: https://www.contributor-covenant.org/version/2/0/code_of_conduct
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
BSD 3-Clause License

Copyright (c) 2016-2020, 360 Enterprise Security Group, Endpoint Security, Inc.
Copyright (c) 2011-2017, Geoffrey J. Teale
Copyright (c) 2016-2020 The excelize Authors.
All rights reserved.

Redistribution and use in source and binary forms, with or without
56 changes: 37 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<a href="https://travis-ci.org/360EntSecGroup-Skylar/excelize"><img src="https://travis-ci.org/360EntSecGroup-Skylar/excelize.svg?branch=master" alt="Build Status"></a>
<a href="https://codecov.io/gh/360EntSecGroup-Skylar/excelize"><img src="https://codecov.io/gh/360EntSecGroup-Skylar/excelize/branch/master/graph/badge.svg" alt="Code Coverage"></a>
<a href="https://goreportcard.com/report/github.com/360EntSecGroup-Skylar/excelize"><img src="https://goreportcard.com/badge/github.com/360EntSecGroup-Skylar/excelize" alt="Go Report Card"></a>
<a href="https://godoc.org/github.com/360EntSecGroup-Skylar/excelize"><img src="https://godoc.org/github.com/360EntSecGroup-Skylar/excelize?status.svg" alt="GoDoc"></a>
<a href="https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc"><img src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white" alt="go.dev"></a>
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-bsd-orange.svg" alt="Licenses"></a>
<a href="https://www.paypal.me/xuri"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"></a>
</p>
@@ -13,8 +13,7 @@

## Introduction

Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLSX files. Supports reading and writing XLSX file generated by Microsoft Excel&trade; 2007 and later.
Supports saving a file without losing original charts of XLSX. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) and [docs reference](https://xuri.me/excelize/).
Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLSX / XLSM / XLTM files. Supports reading and writing spreadsheet documents generated by Microsoft Excel&trade; 2007 and later. Supports complex components by high compatibility, and provided streaming API for generating or reading data from a worksheet with huge amounts of data. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) and [docs reference](https://xuri.me/excelize/).

## Basic Usage

@@ -24,14 +23,24 @@ Supports saving a file without losing original charts of XLSX. This library need
go get github.com/360EntSecGroup-Skylar/excelize
```

- If your package management with [Go Modules](https://blog.golang.org/using-go-modules), please install with following command.

```bash
go get github.com/360EntSecGroup-Skylar/excelize/v2
```

### Create XLSX file

Here is a minimal example usage that will create XLSX file.

```go
package main

import "github.com/360EntSecGroup-Skylar/excelize"
import (
"fmt"

"github.com/360EntSecGroup-Skylar/excelize"
)

func main() {
f := excelize.NewFile()
@@ -44,7 +53,7 @@ func main() {
f.SetActiveSheet(index)
// Save xlsx file by the given path.
if err := f.SaveAs("Book1.xlsx"); err != nil {
println(err.Error())
fmt.Println(err)
}
}
```
@@ -56,28 +65,32 @@ The following constitutes the bare to read a XLSX document.
```go
package main

import "github.com/360EntSecGroup-Skylar/excelize"
import (
"fmt"

"github.com/360EntSecGroup-Skylar/excelize"
)

func main() {
f, err := excelize.OpenFile("Book1.xlsx")
if err != nil {
println(err.Error())
fmt.Println(err)
return
}
// Get value from cell by given worksheet name and axis.
cell, err := f.GetCellValue("Sheet1", "B2")
if err != nil {
println(err.Error())
fmt.Println(err)
return
}
println(cell)
fmt.Println(cell)
// Get all the rows in the Sheet1.
rows, err := f.GetRows("Sheet1")
for _, row := range rows {
for _, colCell := range row {
print(colCell, "\t")
fmt.Print(colCell, "\t")
}
println()
fmt.Println()
}
}
```
@@ -91,7 +104,11 @@ With Excelize chart generation and management is as easy as a few lines of code.
```go
package main

import "github.com/360EntSecGroup-Skylar/excelize"
import (
"fmt"

"github.com/360EntSecGroup-Skylar/excelize"
)

func main() {
categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
@@ -104,12 +121,12 @@ func main() {
f.SetCellValue("Sheet1", k, v)
}
if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`); err != nil {
println(err.Error())
fmt.Println(err)
return
}
// Save xlsx file by the given path.
if err := f.SaveAs("Book1.xlsx"); err != nil {
println(err.Error())
fmt.Println(err)
}
}
```
@@ -120,6 +137,7 @@ func main() {
package main

import (
"fmt"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
@@ -130,24 +148,24 @@ import (
func main() {
f, err := excelize.OpenFile("Book1.xlsx")
if err != nil {
println(err.Error())
fmt.Println(err)
return
}
// Insert a picture.
if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil {
println(err.Error())
fmt.Println(err)
}
// Insert a picture to worksheet with scaling.
if err := f.AddPicture("Sheet1", "D2", "image.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`); err != nil {
println(err.Error())
fmt.Println(err)
}
// Insert a picture offset in the cell with printing support.
if err := f.AddPicture("Sheet1", "H2", "image.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`); err != nil {
println(err.Error())
fmt.Println(err)
}
// Save the xlsx file with the origin path.
if err = f.Save(); err != nil {
println(err.Error())
fmt.Println(err)
}
}
```
55 changes: 37 additions & 18 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<a href="https://travis-ci.org/360EntSecGroup-Skylar/excelize"><img src="https://travis-ci.org/360EntSecGroup-Skylar/excelize.svg?branch=master" alt="Build Status"></a>
<a href="https://codecov.io/gh/360EntSecGroup-Skylar/excelize"><img src="https://codecov.io/gh/360EntSecGroup-Skylar/excelize/branch/master/graph/badge.svg" alt="Code Coverage"></a>
<a href="https://goreportcard.com/report/github.com/360EntSecGroup-Skylar/excelize"><img src="https://goreportcard.com/badge/github.com/360EntSecGroup-Skylar/excelize" alt="Go Report Card"></a>
<a href="https://godoc.org/github.com/360EntSecGroup-Skylar/excelize"><img src="https://godoc.org/github.com/360EntSecGroup-Skylar/excelize?status.svg" alt="GoDoc"></a>
<a href="https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc"><img src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white" alt="go.dev"></a>
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-bsd-orange.svg" alt="Licenses"></a>
<a href="https://www.paypal.me/xuri"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"></a>
</p>
@@ -13,7 +13,7 @@

## 简介

Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel&trade; 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) 或查看 [参考文档](https://xuri.me/excelize/)
Excelize 是 Go 语言编写的用于操作 Office Excel 文档基础库,基于 ECMA-376,ISO/IEC 29500 国际标准。可以使用它来读取、写入由 Microsoft Excel&trade; 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM 等多种文档格式,高度兼容带有样式、图片(表)、透视表、切片器等复杂组件的文档,并提供流式读写 API,用于处理包含大规模数据的工作簿。可应用于各类报表平台、云计算、边缘计算等系统。使用本类库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) 或查看 [参考文档](https://xuri.me/excelize/)

## 快速上手

@@ -23,14 +23,24 @@ Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 E
go get github.com/360EntSecGroup-Skylar/excelize
```

- 如果您使用 [Go Modules](https://blog.golang.org/using-go-modules) 管理软件包,请使用下面的命令来安装最新版本。

```bash
go get github.com/360EntSecGroup-Skylar/excelize/v2
```

### 创建 Excel 文档

下面是一个创建 Excel 文档的简单例子:

```go
package main

import "github.com/360EntSecGroup-Skylar/excelize"
import (
"fmt"

"github.com/360EntSecGroup-Skylar/excelize"
)

func main() {
f := excelize.NewFile()
@@ -43,7 +53,7 @@ func main() {
f.SetActiveSheet(index)
// 根据指定路径保存文件
if err := f.SaveAs("Book1.xlsx"); err != nil {
println(err.Error())
fmt.Println(err)
}
}
```
@@ -55,28 +65,32 @@ func main() {
```go
package main

import "github.com/360EntSecGroup-Skylar/excelize"
import (
"fmt"

"github.com/360EntSecGroup-Skylar/excelize"
)

func main() {
f, err := excelize.OpenFile("Book1.xlsx")
if err != nil {
println(err.Error())
fmt.Println(err)
return
}
// 获取工作表中指定单元格的值
cell, err := f.GetCellValue("Sheet1", "B2")
if err != nil {
println(err.Error())
fmt.Println(err)
return
}
println(cell)
fmt.Println(cell)
// 获取 Sheet1 上所有单元格
rows, err := f.GetRows("Sheet1")
for _, row := range rows {
for _, colCell := range row {
print(colCell, "\t")
fmt.Print(colCell, "\t")
}
println()
fmt.Println()
}
}
```
@@ -90,7 +104,11 @@ func main() {
```go
package main

import "github.com/360EntSecGroup-Skylar/excelize"
import (
"fmt"

"github.com/360EntSecGroup-Skylar/excelize"
)

func main() {
categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
@@ -103,12 +121,12 @@ func main() {
f.SetCellValue("Sheet1", k, v)
}
if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`); err != nil {
println(err.Error())
fmt.Println(err)
return
}
// 根据指定路径保存文件
if err := f.SaveAs("Book1.xlsx"); err != nil {
println(err.Error())
fmt.Println(err)
}
}
```
@@ -119,6 +137,7 @@ func main() {
package main

import (
"fmt"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
@@ -129,24 +148,24 @@ import (
func main() {
f, err := excelize.OpenFile("Book1.xlsx")
if err != nil {
println(err.Error())
fmt.Println(err)
return
}
// 插入图片
if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil {
println(err.Error())
fmt.Println(err)
}
// 在工作表中插入图片,并设置图片的缩放比例
if err := f.AddPicture("Sheet1", "D2", "image.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`); err != nil {
println(err.Error())
fmt.Println(err)
}
// 在工作表中插入图片,并设置图片的打印属性
if err := f.AddPicture("Sheet1", "H2", "image.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`); err != nil {
println(err.Error())
fmt.Println(err)
}
// 保存文件
if err = f.Save(); err != nil {
println(err.Error())
fmt.Println(err)
}
}
```
5 changes: 3 additions & 2 deletions adjust.go
Original file line number Diff line number Diff line change
@@ -80,9 +80,10 @@ func (f *File) adjustColDimensions(xlsx *xlsxWorksheet, col, offset int) {
// adjustRowDimensions provides a function to update row dimensions when
// inserting or deleting rows or columns.
func (f *File) adjustRowDimensions(xlsx *xlsxWorksheet, row, offset int) {
for i, r := range xlsx.SheetData.Row {
for i := range xlsx.SheetData.Row {
r := &xlsx.SheetData.Row[i]
if newRow := r.R + offset; r.R >= row && newRow > 0 {
f.ajustSingleRowDimensions(&xlsx.SheetData.Row[i], newRow)
f.ajustSingleRowDimensions(r, newRow)
}
}
}
Loading