Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
excelize
提交
167554bf
excelize
项目概览
此号慢热型
/
excelize
与 Fork 源项目一致
Fork自
xuri / excelize
通知
2
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
已验证
提交
167554bf
编写于
5月 14, 2018
作者:
xurime
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve unit testing, remove redundant code.
上级
eb62256d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
7 deletion
+5
-7
excelize_test.go
excelize_test.go
+3
-1
sheet.go
sheet.go
+0
-6
templates.go
templates.go
+2
-0
未找到文件。
excelize_test.go
浏览文件 @
167554bf
...
...
@@ -82,6 +82,9 @@ func TestOpenFile(t *testing.T) {
xlsx
.
SetCellValue
(
"Sheet2"
,
"F14"
,
uint32
(
1
<<
32
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F15"
,
uint64
(
1
<<
32
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F16"
,
true
)
xlsx
.
SetCellValue
(
"Sheet2"
,
"F17"
,
complex64
(
5
+
10i
))
t
.
Log
(
letterOnlyMapF
(
'x'
))
t
.
Log
(
deepCopy
(
nil
,
nil
))
// Test boolean write
booltest
:=
[]
struct
{
value
bool
...
...
@@ -125,7 +128,6 @@ func TestOpenFile(t *testing.T) {
if
err
!=
nil
{
t
.
Log
(
err
)
}
}
func
TestAddPicture
(
t
*
testing
.
T
)
{
...
...
sheet.go
浏览文件 @
167554bf
...
...
@@ -193,12 +193,6 @@ func (f *File) setAppXML() {
// library doesn't multiple namespace declarations in a single element of a
// document. This function is a horrible hack to fix that after the XML
// marshalling is completed.
func
replaceRelationshipsNameSpace
(
workbookMarshal
string
)
string
{
oldXmlns
:=
`<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">`
newXmlns
:=
`<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main">`
return
strings
.
Replace
(
workbookMarshal
,
oldXmlns
,
newXmlns
,
-
1
)
}
func
replaceRelationshipsNameSpaceBytes
(
workbookMarshal
[]
byte
)
[]
byte
{
oldXmlns
:=
[]
byte
(
`<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">`
)
newXmlns
:=
[]
byte
(
`<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main">`
)
...
...
templates.go
浏览文件 @
167554bf
...
...
@@ -7,6 +7,8 @@ package excelize
const
XMLHeader
=
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>
\n
"
var
(
// XMLHeaderByte define an XML declaration can also contain a standalone
// declaration.
XMLHeaderByte
=
[]
byte
(
XMLHeader
)
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录