Skip to content

Commit 3bf1bf8

Browse files
committed
Rename SetLegacyDrawingHF to SetHeaderFooterImage
1 parent b7375bc commit 3bf1bf8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

sheet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ func attrValToBool(name string, attrs []xml.Attr) (val bool, err error) {
12391239
// |
12401240
// &F | Current workbook's file name
12411241
// |
1242-
// &G | Drawing object as background (Use SetLegacyDrawingHF)
1242+
// &G | Drawing object as background (Use SetHeaderFooterImage)
12431243
// |
12441244
// &H | Shadow text format
12451245
// |

vml.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,12 +1071,12 @@ func extractVMLFont(font []decodeVMLFont) []RichTextRun {
10711071
return runs
10721072
}
10731073

1074-
// SetLegacyDrawingHF provides a mechanism to set the graphics that
1074+
// SetHeaderFooterImage provides a mechanism to set the graphics that
10751075
// can be referenced in the Header/Footer defitions via &G.
10761076
//
10771077
// The extension should be provided with a "." in front, e.g. ".png".
10781078
// The width/height should have units in them, e.g. "100pt".
1079-
func (f *File) SetLegacyDrawingHF(sheet string, g *HeaderFooterGraphics) error {
1079+
func (f *File) SetHeaderFooterImage(sheet string, g *HeaderFooterGraphics) error {
10801080
vmlID := f.countVMLDrawing() + 1
10811081

10821082
vml := &vmlDrawing{

vml_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func TestExtractFormControl(t *testing.T) {
413413
assert.EqualError(t, err, "XML syntax error on line 1: invalid UTF-8")
414414
}
415415

416-
func TestSetLegacyDrawingHF(t *testing.T) {
416+
func TestSetHeaderFooterImage(t *testing.T) {
417417
f := NewFile()
418418
sheet := "Sheet1"
419419
headerFooterOptions := HeaderFooterOptions{
@@ -422,21 +422,21 @@ func TestSetLegacyDrawingHF(t *testing.T) {
422422
assert.NoError(t, f.SetHeaderFooter(sheet, &headerFooterOptions))
423423
file, err := os.ReadFile(filepath.Join("test", "images", "excel.png"))
424424
assert.NoError(t, err)
425-
assert.NoError(t, f.SetLegacyDrawingHF(sheet, &HeaderFooterGraphics{
425+
assert.NoError(t, f.SetHeaderFooterImage(sheet, &HeaderFooterGraphics{
426426
Extension: ".png",
427427
File: file,
428428
Width: "50pt",
429429
Height: "32pt",
430430
}))
431431
assert.NoError(t, f.SetCellValue(sheet, "A1", "Example"))
432-
assert.NoError(t, f.SaveAs(filepath.Join("test", "TestSetLegacyDrawingHF.xlsx")))
432+
assert.NoError(t, f.SaveAs(filepath.Join("test", "TestSetHeaderFooterImage.xlsx")))
433433
assert.NoError(t, f.Close())
434434

435435
// Test set legacy drawing header/footer with unsupported charset content types
436436
f = NewFile()
437437
f.ContentTypes = nil
438438
f.Pkg.Store(defaultXMLPathContentTypes, MacintoshCyrillicCharset)
439-
assert.EqualError(t, f.SetLegacyDrawingHF(sheet, &HeaderFooterGraphics{
439+
assert.EqualError(t, f.SetHeaderFooterImage(sheet, &HeaderFooterGraphics{
440440
Extension: ".png",
441441
File: file,
442442
Width: "50pt",

0 commit comments

Comments
 (0)