// setSheet provides a function to update sheet property by given index.
181783
func (f *File) setSheet(index int, name string) {
	var xlsx xlsxWorksheet
	xlsx.Dimension.Ref = "A1"
	xlsx.SheetViews.SheetView = append(xlsx.SheetViews.SheetView, xlsxSheetView{
		WorkbookViewID: 0,
	})
	path := "xl/worksheets/sheet" + strconv.Itoa(index) + ".xml"
	f.sheetMap[trimSheetName(name)] = path
	f.Sheet[path] = &xlsx
}
864432
func (c *Cell) SetFormula(formula string) {
	c.formula = formula
	c.cellType = CellTypeFormula
}
502352
func (gr *GroupReader) SetIndex(index int) error {
	gr.mtx.Lock()
	defer gr.mtx.Unlock()
	return gr.openFile(index)
}
203709
func (s *DescribeScriptOutput) SetScript(v *Script) *DescribeScriptOutput {
	s.Script = v
	return s
}
688996
func SetCell(x, y int, ch rune, fg, bg Attribute) {
	st := mkStyle(fg, bg)
	screen.SetContent(x, y, ch, nil, st)
}
1047458
func (f *File) setWorkbook(name string, sheetID, rid int) {
	content := f.workbookReader()
	content.Sheets.Sheet = append(content.Sheets.Sheet, xlsxSheet{
		Name:    trimSheetName(name),
		SheetID: sheetID,
		ID:      "rId" + strconv.Itoa(rid),
	})
}
514126
func (s *BatchDetectEntitiesItemResult) SetIndex(v int64) *BatchDetectEntitiesItemResult {
	s.Index = &v
	return s
}
665541
func (s *BatchReadOperation) SetListIndex(v *BatchListIndex) *BatchReadOperation {
	s.ListIndex = v
	return s
}
724953
func (s *SearchInput) SetFacet(v string) *SearchInput {
	s.Facet = &v
	return s
}
1186394
func (dd *xlsxCellDataValidation) SetRange(f1, f2 int, t DataValidationType, o DataValidationOperator) error {
	formula1 := fmt.Sprintf("%d", f1)
	formula2 := fmt.Sprintf("%d", f2)

	switch o {
	case DataValidationOperatorBetween:
		if f1 > f2 {
			tmp := formula1
			formula1 = formula2
			formula2 = tmp
		}
	case DataValidationOperatorNotBetween:
		if f1 > f2 {
			tmp := formula1
			formula1 = formula2
			formula2 = tmp
		}
	}

	dd.Formula1 = formula1
	dd.Formula2 = formula2
	dd.Type = convDataValidationType(t)
	dd.Operator = convDataValidationOperatior(o)
	return nil
}
216890
func (f *Field) SetValue(value string) FieldInterface {
	f.value = value
	f.AddSelected(f.value)
	return f
}
1200009
func (s *ElasticsearchAction) SetIndex(v string) *ElasticsearchAction {
	s.Index = &v
	return s
}
1197646
func (f *File) copySheet(from, to int) error {
	sheet, err := f.workSheetReader("sheet" + strconv.Itoa(from))
	if err != nil {
		return err
	}
	worksheet := deepcopy.Copy(sheet).(*xlsxWorksheet)
	path := "xl/worksheets/sheet" + strconv.Itoa(to) + ".xml"
	if len(worksheet.SheetViews.SheetView) > 0 {
		worksheet.SheetViews.SheetView[0].TabSelected = false
	}
	worksheet.Drawing = nil
	worksheet.TableParts = nil
	worksheet.PageSetUp = nil
	f.Sheet[path] = worksheet
	toRels := "xl/worksheets/_rels/sheet" + strconv.Itoa(to) + ".xml.rels"
	fromRels := "xl/worksheets/_rels/sheet" + strconv.Itoa(from) + ".xml.rels"
	_, ok := f.XLSX[fromRels]
	if ok {
		f.XLSX[toRels] = f.XLSX[fromRels]
	}
	return err
}
1136249
func (s *GetFacetOutput) SetFacet(v *Facet) *GetFacetOutput {
	s.Facet = v
	return s
}
310502
func (s *ExportTask) SetTo(v int64) *ExportTask {
	s.To = &v
	return s
}
503858
func (s *DocumentDescription) SetSha1(v string) *DocumentDescription {
	s.Sha1 = &v
	return s
}
1082325
func (s *BatchReadSuccessfulResponse) SetListIndex(v *BatchListIndexResponse) *BatchReadSuccessfulResponse {
	s.ListIndex = v
	return s
}