Skip to content

Commit 43a057b

Browse files
committed
This closes qax-os#986, fix set data validation drop list failed in some cases
Update documentation for `GetCellValue` and simplify code
1 parent c49e7aa commit 43a057b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cell.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ const (
3434
// GetCellValue provides a function to get formatted value from cell by given
3535
// worksheet name and axis in spreadsheet file. If it is possible to apply a
3636
// format to the cell value, it will do so, if not then an error will be
37-
// returned, along with the raw value of the cell. All cells value will be
38-
// same in a merged range.
37+
// returned, along with the raw value of the cell. All cells' values will be
38+
// the same in a merged range.
3939
func (f *File) GetCellValue(sheet, axis string) (string, error) {
4040
return f.getCellStringFunc(sheet, axis, func(x *xlsxWorksheet, c *xlsxC) (string, bool, error) {
4141
val, err := c.getValueFrom(f, f.sharedStringsReader())

datavalidation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (dd *DataValidation) SetRange(f1, f2 float64, t DataValidationType, o DataV
154154
//
155155
func (dd *DataValidation) SetSqrefDropList(sqref string, isCurrentSheet bool) error {
156156
if isCurrentSheet {
157-
dd.Formula1 = sqref
157+
dd.Formula1 = fmt.Sprintf("<formula1>%s</formula1>", sqref)
158158
dd.Type = convDataValidationType(typeList)
159159
return nil
160160
}

picture.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ func (f *File) drawingsWriter() {
622622
}
623623

624624
// drawingResize calculate the height and width after resizing.
625-
func (f *File) drawingResize(sheet string, cell string, width, height float64, formatSet *formatPicture) (w, h, c, r int, err error) {
625+
func (f *File) drawingResize(sheet, cell string, width, height float64, formatSet *formatPicture) (w, h, c, r int, err error) {
626626
var mergeCells []MergeCell
627627
mergeCells, err = f.GetMergeCells(sheet)
628628
if err != nil {

0 commit comments

Comments
 (0)