diff --git a/_examples/document/simple/simple.docx b/_examples/document/simple/simple.docx index cb35f3fed6..3b4d75b385 100644 Binary files a/_examples/document/simple/simple.docx and b/_examples/document/simple/simple.docx differ diff --git a/common/appproperties.go b/common/appproperties.go index 120205a2c7..0610bf3657 100644 --- a/common/appproperties.go +++ b/common/appproperties.go @@ -8,6 +8,8 @@ package common import ( + "fmt" + "strconv" "strings" "baliance.com/gooxml" @@ -27,7 +29,10 @@ func NewAppProperties() AppProperties { p.SetApplication("baliance.com/gooxml") p.SetDocSecurity(0) p.SetLinksUpToDate(false) - p.SetApplicationVersion(strings.Replace(gooxml.ReleaseVersion, "v", "", -1)) + // trim the 'v' + ver := strings.Replace(gooxml.ReleaseVersion, "v", "", -1) + f, _ := strconv.ParseFloat(ver, 64) + p.SetApplicationVersion(fmt.Sprintf("%07.4f", f)) return p } @@ -64,7 +69,8 @@ func (a AppProperties) ApplicationVersion() string { return "" } -// SetApplicationVersion sets the version of the application that created the document. +// SetApplicationVersion sets the version of the application that created the +// document. Per MS, the verison string mut be in the form 'XX.YYYY'. func (a AppProperties) SetApplicationVersion(s string) { a.x.AppVersion = &s } diff --git a/common/appproperties_test.go b/common/appproperties_test.go index 6c81a11b85..dc4f84916f 100644 --- a/common/appproperties_test.go +++ b/common/appproperties_test.go @@ -8,6 +8,8 @@ package common_test import ( + "fmt" + "strconv" "strings" "testing" @@ -30,7 +32,8 @@ func TestNewAppDefaultProperties(t *testing.T) { t.Errorf("unexpected application: %s", got) } - if got := ap.ApplicationVersion(); got != strings.Replace(gooxml.ReleaseVersion, "v", "", -1) { + fv, _ := strconv.ParseFloat(strings.Replace(gooxml.ReleaseVersion, "v", "", -1), 64) + if got := ap.ApplicationVersion(); got != fmt.Sprintf("%07.4f", fv) { t.Errorf("unexpected application version: %s", got) } ap.X().AppVersion = nil diff --git a/document/testdata/header-footer-multiple.docx b/document/testdata/header-footer-multiple.docx index cfcc4f92ae..0918877006 100644 Binary files a/document/testdata/header-footer-multiple.docx and b/document/testdata/header-footer-multiple.docx differ diff --git a/document/testdata/simple-1.docx b/document/testdata/simple-1.docx index ad8d5855e6..a44ab11baf 100644 Binary files a/document/testdata/simple-1.docx and b/document/testdata/simple-1.docx differ diff --git a/spreadsheet/testdata/simple-1.xlsx b/spreadsheet/testdata/simple-1.xlsx index f13fa3e24a..3b9806e578 100644 Binary files a/spreadsheet/testdata/simple-1.xlsx and b/spreadsheet/testdata/simple-1.xlsx differ diff --git a/spreadsheet/testdata/simple-2.xlsx b/spreadsheet/testdata/simple-2.xlsx index 9d2ae04d15..87ef1ccefc 100644 Binary files a/spreadsheet/testdata/simple-2.xlsx and b/spreadsheet/testdata/simple-2.xlsx differ diff --git a/version.go b/version.go index 2d5de220d7..70529cf115 100644 --- a/version.go +++ b/version.go @@ -9,8 +9,9 @@ package gooxml import "time" -// Release is the last release version of the software. -var ReleaseVersion = "v0.4.0" +// ReleaseVersion is the last release version of the software and must be in the +// format x.y +var ReleaseVersion = "v0.5000" // ReleaseDate is the release date of the source code for licensing purposes. var ReleaseDate = time.Date(2018, 1, 4, 0, 0, 0, 0, time.UTC)