Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xuri
excelize
提交
efff54cc
excelize
项目概览
xuri
/
excelize
通知
13
Star
2
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
excelize
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
efff54cc
编写于
6月 12, 2017
作者:
xurime
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- Fixed coordinate parse error in function `SetCellStyle()`, relate issue #60;
- Simplified code
上级
c89d8423
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
6 addition
and
8 deletion
+6
-8
excelize.go
excelize.go
+1
-1
picture.go
picture.go
+3
-3
styles.go
styles.go
+2
-2
table.go
table.go
+0
-2
未找到文件。
excelize.go
浏览文件 @
efff54cc
...
...
@@ -210,7 +210,7 @@ func (f *File) SetCellDefault(sheet, axis, value string) {
}
// Completion column element tags of XML in a sheet.
func
completeCol
(
xlsx
*
xlsxWorksheet
,
row
int
,
cell
int
)
{
func
completeCol
(
xlsx
*
xlsxWorksheet
,
row
,
cell
int
)
{
if
len
(
xlsx
.
SheetData
.
Row
)
<
cell
{
for
i
:=
len
(
xlsx
.
SheetData
.
Row
);
i
<
cell
;
i
++
{
xlsx
.
SheetData
.
Row
=
append
(
xlsx
.
SheetData
.
Row
,
xlsxRow
{
...
...
picture.go
浏览文件 @
efff54cc
...
...
@@ -218,7 +218,7 @@ func (f *File) addDrawingPicture(sheet, drawingXML, cell, file string, width, he
// addDrawingRelationships provides function to add image part relationships in
// the file xl/drawings/_rels/drawing%d.xml.rels by given drawing index,
// relationship type and target.
func
(
f
*
File
)
addDrawingRelationships
(
index
int
,
relType
string
,
target
string
)
int
{
func
(
f
*
File
)
addDrawingRelationships
(
index
int
,
relType
,
target
string
)
int
{
var
rels
=
"xl/drawings/_rels/drawing"
+
strconv
.
Itoa
(
index
)
+
".xml.rels"
var
drawingRels
xlsxWorkbookRels
var
rID
=
1
...
...
@@ -257,7 +257,7 @@ func (f *File) countMedia() int {
// addMedia provides function to add picture into folder xl/media/image by given
// file name and extension name.
func
(
f
*
File
)
addMedia
(
file
string
,
ext
string
)
{
func
(
f
*
File
)
addMedia
(
file
,
ext
string
)
{
count
:=
f
.
countMedia
()
dat
,
_
:=
ioutil
.
ReadFile
(
file
)
media
:=
"xl/media/image"
+
strconv
.
Itoa
(
count
+
1
)
+
ext
...
...
@@ -341,7 +341,7 @@ func (f *File) addContentTypePart(index int, contentType string) {
// getSheetRelationshipsTargetByID provides function to get Target attribute
// value in xl/worksheets/_rels/sheet%d.xml.rels by given sheet name and
// relationship index.
func
(
f
*
File
)
getSheetRelationshipsTargetByID
(
sheet
string
,
rID
string
)
string
{
func
(
f
*
File
)
getSheetRelationshipsTargetByID
(
sheet
,
rID
string
)
string
{
var
rels
=
"xl/worksheets/_rels/"
+
strings
.
ToLower
(
sheet
)
+
".xml.rels"
var
sheetRels
xlsxWorkbookRels
xml
.
Unmarshal
([]
byte
(
f
.
readXML
(
rels
)),
&
sheetRels
)
...
...
styles.go
浏览文件 @
efff54cc
...
...
@@ -776,8 +776,8 @@ func (f *File) setCellStyle(sheet, hcell, vcell string, styleID int) {
xlsx
:=
f
.
workSheetReader
(
sheet
)
completeRow
(
xlsx
,
v
xAxis
+
1
,
vy
Axis
+
1
)
completeCol
(
xlsx
,
v
xAxis
+
1
,
vy
Axis
+
1
)
completeRow
(
xlsx
,
v
yAxis
+
1
,
vx
Axis
+
1
)
completeCol
(
xlsx
,
v
yAxis
+
1
,
vx
Axis
+
1
)
for
r
,
row
:=
range
xlsx
.
SheetData
.
Row
{
for
k
,
c
:=
range
row
.
C
{
...
...
table.go
浏览文件 @
efff54cc
...
...
@@ -236,12 +236,10 @@ func (f *File) AutoFilter(sheet, hcell, vcell, format string) error {
vxAxis
:=
titleToNumber
(
vcol
)
if
vxAxis
<
hxAxis
{
hcell
,
vcell
=
vcell
,
hcell
vxAxis
,
hxAxis
=
hxAxis
,
vxAxis
}
if
vyAxis
<
hyAxis
{
hcell
,
vcell
=
vcell
,
hcell
vyAxis
,
hyAxis
=
hyAxis
,
vyAxis
}
ref
:=
toAlphaString
(
hxAxis
+
1
)
+
strconv
.
Itoa
(
hyAxis
+
1
)
+
":"
+
toAlphaString
(
vxAxis
+
1
)
+
strconv
.
Itoa
(
vyAxis
+
1
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录