We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description
SetSheetName will delete the sheet if old name is equals to new name
the source code of excelize v2.3.1 is below:
func (f *File) SetSheetName(oldName, newName string) { oldName = trimSheetName(oldName) newName = trimSheetName(newName) content := f.workbookReader() for k, v := range content.Sheets.Sheet { if v.Name == oldName { content.Sheets.Sheet[k].Name = newName f.sheetMap[newName] = f.sheetMap[oldName] delete(f.sheetMap, oldName) // we may add a check if newName == oldName before } } }
Steps to reproduce the issue:
f
f, err := excelize.OpenFile(g.Opts.TmplConf.TemplateLocation)
Describe the results you received: step 3 got sheet not exist Describe the results you expected: step 3 setCellStr err is nil. Output of go version:
sheet not exist
go version
GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/Users/yubohe 1/Library/Caches/go-build" GOENV="/Users/yubohe 1/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/yubohe 1/go" GOPRIVATE="" GOPROXY="direct" GOROOT="/usr/local/go" GOSUMDB="off" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/y4/z855mpsx2bqb5n091wrg0zh00000gq/T/go-build327334959=/tmp/go-build -gno-record-gcc-switches -fno-common"
Excelize version or commit ID:
v2.3.1
Environment details (OS, Microsoft Excel™ version, physical, etc.):
The text was updated successfully, but these errors were encountered:
Fix #706, #713 improve AddPicture performance, fix missing worksheet …
520aa67
…when rename with same names
Thanks for your issue, I have fixed it, please try to use the master branch code.
Sorry, something went wrong.
@xuri Noted, thx , I'll upgrade when v2.3.2 release.
Fix qax-os#706, qax-os#713 improve AddPicture performance, fix missin…
37268e5
…g worksheet when rename with same names
8e12d5d
No branches or pull requests
Description
SetSheetName will delete the sheet if old name is equals to new name
the source code of excelize v2.3.1 is below:
Steps to reproduce the issue:
f
from Openf, err := excelize.OpenFile(g.Opts.TmplConf.TemplateLocation)
Describe the results you received:
step 3 got
sheet not exist
Describe the results you expected:
step 3 setCellStr err is nil.
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):
The text was updated successfully, but these errors were encountered: